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.

117 lines
3.7 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /*
  25. * @file sch_marker.h
  26. * @brief SCH_MARKER class definition.
  27. */
  28. #ifndef TYPE_SCH_MARKER_H_
  29. #define TYPE_SCH_MARKER_H_
  30. #include <sch_item_struct.h>
  31. #include <class_marker_base.h>
  32. /* Names for corresponding types of markers: */
  33. extern const wxChar* NameMarqueurType[];
  34. class SCH_MARKER : public SCH_ITEM, public MARKER_BASE
  35. {
  36. public:
  37. SCH_MARKER();
  38. SCH_MARKER( const wxPoint& aPos, const wxString& aText );
  39. // Do not create a copy constructor. The one generated by the compiler is adequate.
  40. wxString GetClass() const override
  41. {
  42. return wxT( "SCH_MARKER" );
  43. }
  44. void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
  45. GR_DRAWMODE aDraw_mode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
  46. void Plot( PLOTTER* aPlotter ) override
  47. {
  48. // SCH_MARKERs should not be plotted. However, SCH_ITEM will fail an
  49. // assertion if we do not confirm this by locally implementing a no-op
  50. // Plot().
  51. (void) aPlotter;
  52. }
  53. bool Save( FILE* aFile ) const override;
  54. EDA_RECT const GetBoundingBox() const override;
  55. // Geometric transforms (used in block operations):
  56. void Move( const wxPoint& aMoveVector ) override
  57. {
  58. m_Pos += aMoveVector;
  59. }
  60. void MirrorY( int aYaxis_position ) override;
  61. void MirrorX( int aXaxis_position ) override;
  62. void Rotate( wxPoint aPosition ) override;
  63. /**
  64. * Function Matches, virtual from the base class EDA_ITEM
  65. * Compare DRC marker main and auxiliary text against search string.
  66. *
  67. * @param aSearchData - Criteria to search against.
  68. * @param aAuxData A pointer to optional data required for the search or NULL
  69. * if not used.
  70. * @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
  71. * @return True if the DRC main or auxiliary text matches the search criteria.
  72. */
  73. bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ) override;
  74. void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
  75. bool IsSelectStateChanged( const wxRect& aRect ) override;
  76. wxString GetSelectMenuText() const override { return wxString( _( "ERC Marker" ) ); }
  77. BITMAP_DEF GetMenuImage() const override;
  78. wxPoint GetPosition() const override { return m_Pos; }
  79. void SetPosition( const wxPoint& aPosition ) override { m_Pos = aPosition; }
  80. bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
  81. EDA_ITEM* Clone() const override;
  82. #if defined(DEBUG)
  83. void Show( int nestLevel, std::ostream& os ) const override;
  84. #endif
  85. };
  86. #endif // TYPE_SCH_MARKER_H_