You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.3 KiB

18 years ago
  1. /****************************************************/
  2. /* MIREPCB class definition. (targets for photos) */
  3. /****************************************************/
  4. #ifndef MIRE_H
  5. #define MIRE_H
  6. #include "base_struct.h"
  7. class MIREPCB : public BOARD_ITEM
  8. {
  9. public:
  10. int m_Width;
  11. wxPoint m_Pos;
  12. int m_Shape; // bit 0 : 0 = draw +, 1 = draw X
  13. int m_Size;
  14. public:
  15. MIREPCB( BOARD_ITEM* aParent );
  16. ~MIREPCB();
  17. MIREPCB* Next() const { return (MIREPCB*) Pnext; }
  18. MIREPCB* Back() const { return (MIREPCB*) Pnext; }
  19. wxPoint& GetPosition()
  20. {
  21. return m_Pos;
  22. }
  23. /**
  24. * Function Move
  25. * move this object.
  26. * @param const wxPoint& aMoveVector - the move vector for this object.
  27. */
  28. virtual void Move(const wxPoint& aMoveVector)
  29. {
  30. m_Pos += aMoveVector;
  31. }
  32. /**
  33. * Function Rotate
  34. * Rotate this object.
  35. * @param const wxPoint& aRotCentre - the rotation point.
  36. * @param aAngle - the rotation angle in 0.1 degree.
  37. */
  38. virtual void Rotate(const wxPoint& aRotCentre, int aAngle);
  39. /**
  40. * Function Flip
  41. * Flip this object, i.e. change the board side for this object
  42. * @param const wxPoint& aCentre - the rotation point.
  43. */
  44. virtual void Flip(const wxPoint& aCentre );
  45. /**
  46. * Function Save
  47. * writes the data structures for this object out to a FILE in "*.brd" format.
  48. * @param aFile The FILE to write to.
  49. * @return bool - true if success writing else false.
  50. */
  51. bool Save( FILE* aFile ) const;
  52. bool ReadMirePcbDescr( FILE* File, int* LineNum );
  53. void Copy( MIREPCB* source );
  54. void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
  55. /**
  56. * Function HitTest
  57. * tests if the given wxPoint is within the bounds of this object.
  58. * @param refPos A wxPoint to test
  59. * @return bool - true if a hit, else false
  60. */
  61. bool HitTest( const wxPoint& refPos );
  62. /**
  63. * Function HitTest (overlaid)
  64. * tests if the given EDA_Rect intersect this object.
  65. * For now, the anchor must be inside this rect.
  66. * @param refArea : the given EDA_Rect
  67. * @return bool - true if a hit, else false
  68. */
  69. bool HitTest( EDA_Rect& refArea );
  70. };
  71. #endif // #define MIRE_H