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.

114 lines
3.6 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.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 <marker_base.h>
  32. class SCH_MARKER : public SCH_ITEM, public MARKER_BASE
  33. {
  34. public:
  35. SCH_MARKER();
  36. SCH_MARKER( const wxPoint& aPos, const wxString& aText );
  37. // Do not create a copy constructor. The one generated by the compiler is adequate.
  38. wxString GetClass() const override
  39. {
  40. return wxT( "SCH_MARKER" );
  41. }
  42. void ViewGetLayers( int aLayers[], int& aCount ) const override;
  43. void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset ) override;
  44. void Plot( PLOTTER* aPlotter ) override
  45. {
  46. // SCH_MARKERs should not be plotted. However, SCH_ITEM will fail an
  47. // assertion if we do not confirm this by locally implementing a no-op
  48. // Plot().
  49. (void) aPlotter;
  50. }
  51. EDA_RECT const GetBoundingBox() const override;
  52. // Geometric transforms (used in block operations):
  53. void Move( const wxPoint& aMoveVector ) override
  54. {
  55. m_Pos += aMoveVector;
  56. }
  57. void MirrorY( int aYaxis_position ) override;
  58. void MirrorX( int aXaxis_position ) override;
  59. void Rotate( wxPoint aPosition ) override;
  60. /**
  61. * Compare DRC marker main and auxiliary text against search string.
  62. *
  63. * @param aSearchData - Criteria to search against.
  64. * @param aAuxData A pointer to optional data required for the search or NULL
  65. * if not used.
  66. * @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
  67. * @return True if the DRC main or auxiliary text matches the search criteria.
  68. */
  69. bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ) override;
  70. void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList ) override;
  71. bool IsSelectStateChanged( const wxRect& aRect ) override;
  72. wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override
  73. {
  74. return wxString( _( "ERC Marker" ) );
  75. }
  76. BITMAP_DEF GetMenuImage() const override;
  77. wxPoint GetPosition() const override { return m_Pos; }
  78. void SetPosition( const wxPoint& aPosition ) override { m_Pos = aPosition; }
  79. bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
  80. EDA_ITEM* Clone() const override;
  81. #if defined(DEBUG)
  82. void Show( int nestLevel, std::ostream& os ) const override;
  83. #endif
  84. };
  85. #endif // TYPE_SCH_MARKER_H_