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.

118 lines
3.3 KiB

18 years ago
  1. /***************************************/
  2. /* Markers: used to show a drc problem */
  3. /***************************************/
  4. #ifndef CLASS_MARKER_PCB_H
  5. #define CLASS_MARKER_PCB_H
  6. #include "base_struct.h"
  7. #include "drc_stuff.h"
  8. class MARKER_PCB : public BOARD_ITEM, public MARKER_BASE
  9. {
  10. public:
  11. MARKER_PCB( BOARD_ITEM* aParent );
  12. /**
  13. * Constructor
  14. * @param aErrorCode The categorizing identifier for an error
  15. * @param aMarkerPos The position of the MARKER_PCB on the BOARD
  16. * @param aText Text describing the first of two objects
  17. * @param aPos The position of the first of two objects
  18. * @param bText Text describing the second of the two conflicting objects
  19. * @param bPos The position of the second of two objects
  20. */
  21. MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
  22. const wxString& aText, const wxPoint& aPos,
  23. const wxString& bText, const wxPoint& bPos );
  24. /**
  25. * Constructor
  26. * @param aErrorCode The categorizing identifier for an error
  27. * @param aMarkerPos The position of the MARKER_PCB on the BOARD
  28. * @param aText Text describing the object
  29. * @param aPos The position of the object
  30. */
  31. MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
  32. const wxString& aText, const wxPoint& aPos );
  33. ~MARKER_PCB();
  34. /**
  35. * Function Move
  36. * move this object.
  37. * @param const wxPoint& aMoveVector - the move vector for this object.
  38. */
  39. virtual void Move(const wxPoint& aMoveVector)
  40. {
  41. m_Pos += aMoveVector;
  42. }
  43. /**
  44. * Function Rotate
  45. * Rotate this object.
  46. * @param const wxPoint& aRotCentre - the rotation point.
  47. * @param aAngle - the rotation angle in 0.1 degree.
  48. */
  49. virtual void Rotate(const wxPoint& aRotCentre, int aAngle);
  50. /**
  51. * Function Flip
  52. * Flip this object, i.e. change the board side for this object
  53. * @param const wxPoint& aCentre - the rotation point.
  54. */
  55. virtual void Flip(const wxPoint& aCentre );
  56. /** Function Draw
  57. */
  58. void Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode, const wxPoint& aOffset = ZeroOffset )
  59. {
  60. DrawMarker( aPanel, aDC, aDrawMode, aOffset );
  61. }
  62. /**
  63. * Function GetPosition
  64. * returns the position of this MARKER_PCB.
  65. */
  66. wxPoint& GetPosition()
  67. {
  68. return (wxPoint&) m_Pos;
  69. }
  70. /** Function HitTest
  71. * @return true if the point aPosRef is within item area
  72. * @param aPosRef = a wxPoint to test
  73. */
  74. bool HitTest( const wxPoint& aPosRef )
  75. {
  76. return HitTestMarker( aPosRef );
  77. }
  78. /**
  79. * Function DisplayInfo
  80. * has knowledge about the frame and how and where to put status information
  81. * about this object into the frame's message panel.
  82. * @param frame A WinEDA_DrawFrame in which to print status information.
  83. */
  84. void DisplayInfo( WinEDA_DrawFrame* frame );
  85. /**
  86. * Function Save
  87. * writes the data structures for this object out to a FILE in "*.brd" format.
  88. * @param aFile The FILE to write to.
  89. * @return bool - true if success writing else false.
  90. */
  91. bool Save( FILE* aFile ) const
  92. {
  93. // not implemented, this is here to satisfy BOARD_ITEM::Save()
  94. // "pure" virtual-ness
  95. return true;
  96. }
  97. };
  98. #endif // CLASS_MARKER_PCB_H