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.

85 lines
2.3 KiB

14 years ago
  1. /**
  2. * @file class_marker_pcb.h
  3. * @brief Markers used to show a drc problem on boards.
  4. */
  5. #ifndef CLASS_MARKER_PCB_H
  6. #define CLASS_MARKER_PCB_H
  7. #include <class_board_item.h>
  8. #include <class_marker_base.h>
  9. class MSG_PANEL_ITEM;
  10. class MARKER_PCB : public BOARD_ITEM, public MARKER_BASE
  11. {
  12. public:
  13. MARKER_PCB( BOARD_ITEM* aParent );
  14. /**
  15. * Constructor
  16. * @param aErrorCode The categorizing identifier for an error
  17. * @param aMarkerPos The position of the MARKER_PCB on the BOARD
  18. * @param aText Text describing the first of two objects
  19. * @param aPos The position of the first of two objects
  20. * @param bText Text describing the second of the two conflicting objects
  21. * @param bPos The position of the second of two objects
  22. */
  23. MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
  24. const wxString& aText, const wxPoint& aPos,
  25. const wxString& bText, const wxPoint& bPos );
  26. /**
  27. * Constructor
  28. * @param aErrorCode The categorizing identifier for an error
  29. * @param aMarkerPos The position of the MARKER_PCB on the BOARD
  30. * @param aText Text describing the object
  31. * @param aPos The position of the object
  32. */
  33. MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
  34. const wxString& aText, const wxPoint& aPos );
  35. ~MARKER_PCB();
  36. void Move(const wxPoint& aMoveVector)
  37. {
  38. m_Pos += aMoveVector;
  39. }
  40. void Rotate( const wxPoint& aRotCentre, double aAngle );
  41. void Flip( const wxPoint& aCentre );
  42. void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
  43. GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset )
  44. {
  45. DrawMarker( aPanel, aDC, aDrawMode, aOffset );
  46. }
  47. const wxPoint& GetPosition() const { return m_Pos; }
  48. void SetPosition( const wxPoint& aPos ) { m_Pos = aPos; }
  49. bool HitTest( const wxPoint& aPosition )
  50. {
  51. return HitTestMarker( aPosition );
  52. }
  53. bool IsOnLayer( LAYER_NUM aLayer ) const;
  54. void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );
  55. wxString GetSelectMenuText() const;
  56. BITMAP_DEF GetMenuImage() const { return drc_xpm; }
  57. #if defined(DEBUG)
  58. void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
  59. #endif
  60. };
  61. #endif // CLASS_MARKER_PCB_H