KiCad PCB EDA Suite
Go to the documentation of this file.
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
5  * Copyright (C) 2004-2018 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
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  *
20  * or you may search the 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  */
30 #ifndef TYPE_SCH_MARKER_H_
31 #define TYPE_SCH_MARKER_H_
33 #include <sch_item_struct.h>
34 #include <marker_base.h>
37 class SCH_MARKER : public SCH_ITEM, public MARKER_BASE
38 {
39 public:
42  SCH_MARKER( const wxPoint& aPos, const wxString& aText );
44  // Do not create a copy constructor. The one generated by the compiler is adequate.
46  wxString GetClass() const override
47  {
48  return wxT( "SCH_MARKER" );
49  }
51  void ViewGetLayers( int aLayers[], int& aCount ) const override;
53  void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
54  GR_DRAWMODE aDraw_mode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
56  void Plot( PLOTTER* aPlotter ) override
57  {
58  // SCH_MARKERs should not be plotted. However, SCH_ITEM will fail an
59  // assertion if we do not confirm this by locally implementing a no-op
60  // Plot().
61  (void) aPlotter;
62  }
64  EDA_RECT const GetBoundingBox() const override;
66  // Geometric transforms (used in block operations):
68  void Move( const wxPoint& aMoveVector ) override
69  {
70  m_Pos += aMoveVector;
71  }
74  void MirrorY( int aYaxis_position ) override;
76  void MirrorX( int aXaxis_position ) override;
78  void Rotate( wxPoint aPosition ) override;
89  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ) override;
91  void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList ) override;
93  bool IsSelectStateChanged( const wxRect& aRect ) override;
95  wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override
96  {
97  return wxString( _( "ERC Marker" ) );
98  }
100  BITMAP_DEF GetMenuImage() const override;
102  wxPoint GetPosition() const override { return m_Pos; }
104  void SetPosition( const wxPoint& aPosition ) override { m_Pos = aPosition; }
106  bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
108  EDA_ITEM* Clone() const override;
110 #if defined(DEBUG)
111  void Show( int nestLevel, std::ostream& os ) const override;
112 #endif
113 };
115 #endif // TYPE_SCH_MARKER_H_
void MirrorX(int aXaxis_position) override
Function MirrorX mirrors item relative to the X axis about aXaxis_position.
Definition: sch_marker.cpp:145
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_marker.cpp:120
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, GR_DRAWMODE aDraw_mode, COLOR4D aColor=COLOR4D::UNSPECIFIED) override
Function Draw Draw a schematic item.
Definition: sch_marker.cpp:74
Base schematic object class definition.
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: sch_marker.cpp:174
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_marker.h:102
void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
Definition: sch_marker.cpp:126
wxPoint m_Pos
position of the marker
Definition: marker_base.h:54
void MirrorY(int aYaxis_position) override
Function MirrorY mirrors item relative to the Y axis about aYaxis_position.
Definition: sch_marker.cpp:153
void Move(const wxPoint &aMoveVector) override
Function Move moves the item by aMoveVector to a new position.
Definition: sch_marker.h:68
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_marker.cpp:133
void Plot(PLOTTER *aPlotter) override
Function Plot plots the schematic item to aPlotter.
Definition: sch_marker.h:56
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_marker.h:95
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers returns the layers the item is drawn on (which may be more than its "home" lay...
Definition: sch_marker.cpp:113
void SetPosition(const wxPoint &aPosition) override
Function SetPosition set the schematic item position to aPosition.
Definition: sch_marker.h:104
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation) override
Compare DRC marker main and auxiliary text against search string.
Definition: sch_marker.cpp:96
Base plotter engine class.
Definition: plotter.h:97
void Rotate(wxPoint aPosition) override
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_marker.cpp:139
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_marker.cpp:56
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_marker.h:46
bool IsSelectStateChanged(const wxRect &aRect) override
Function IsSelectStateChanged checks if the selection state of an item inside aRect has changed.
Definition: sch_marker.cpp:161
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: common.h:160
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39