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) 2015 Jean-Pierre Charras, jp.charras at
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
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  */
25 /*
26  * @file sch_marker.h
27  * @brief SCH_MARKER class definition.
28  */
30 #ifndef TYPE_SCH_MARKER_H_
31 #define TYPE_SCH_MARKER_H_
33 #include <sch_item_struct.h>
34 #include <class_marker_base.h>
37 /* Names for corresponding types of markers: */
38 extern const wxChar* NameMarqueurType[];
41 class SCH_MARKER : public SCH_ITEM, public MARKER_BASE
42 {
43 public:
46  SCH_MARKER( const wxPoint& aPos, const wxString& aText );
48  // Do not create a copy constructor. The one generated by the compiler is adequate.
50  wxString GetClass() const override
51  {
52  return wxT( "SCH_MARKER" );
53  }
55  void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
56  GR_DRAWMODE aDraw_mode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
58  void Plot( PLOTTER* aPlotter ) override
59  {
60  // SCH_MARKERs should not be plotted. However, SCH_ITEM will fail an
61  // assertion if we do not confirm this by locally implementing a no-op
62  // Plot().
63  (void) aPlotter;
64  }
66  bool Save( FILE* aFile ) const override;
68  EDA_RECT const GetBoundingBox() const override;
70  // Geometric transforms (used in block operations):
72  void Move( const wxPoint& aMoveVector ) override
73  {
74  m_Pos += aMoveVector;
75  }
78  void MirrorY( int aYaxis_position ) override;
80  void MirrorX( int aXaxis_position ) override;
82  void Rotate( wxPoint aPosition ) override;
94  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ) override;
96  void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
98  bool IsSelectStateChanged( const wxRect& aRect ) override;
100  wxString GetSelectMenuText() const override { return wxString( _( "ERC Marker" ) ); }
102  BITMAP_DEF GetMenuImage() const override;
104  wxPoint GetPosition() const override { return m_Pos; }
106  void SetPosition( const wxPoint& aPosition ) override { m_Pos = aPosition; }
108  bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
110  EDA_ITEM* Clone() const override;
112 #if defined(DEBUG)
113  void Show( int nestLevel, std::ostream& os ) const override;
114 #endif
115 };
117 #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:160
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: sch_marker.cpp:133
PNG memory record (file in memory).
Definition: bitmap_types.h:38
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:87
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:189
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_marker.h:104
wxPoint m_Pos
position of the marker
void GetMsgPanelInfo(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:139
void MirrorY(int aYaxis_position) override
Function MirrorY mirrors item relative to the Y axis about aYaxis_position.
Definition: sch_marker.cpp:168
void Move(const wxPoint &aMoveVector) override
Function Move moves the item by aMoveVector to a new position.
Definition: sch_marker.h:72
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_marker.cpp:148
void Plot(PLOTTER *aPlotter) override
Function Plot plots the schematic item to aPlotter.
Definition: sch_marker.h:58
const wxChar * NameMarqueurType[]
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:41
void SetPosition(const wxPoint &aPosition) override
Function SetPosition set the schematic item position to aPosition.
Definition: sch_marker.h:106
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation) override
Function Matches, virtual from the base class EDA_ITEM Compare DRC marker main and auxiliary text aga...
Definition: sch_marker.cpp:109
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_marker.h:100
Base plotter engine class.
Definition: plot_common.h:86
void Rotate(wxPoint aPosition) override
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_marker.cpp:154
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_marker.cpp:58
Class EDA_RECT handles the component boundary box.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:165
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_marker.h:50
bool IsSelectStateChanged(const wxRect &aRect) override
Function IsSelectStateChanged checks if the selection state of an item inside aRect has changed...
Definition: sch_marker.cpp:176
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
bool Save(FILE *aFile) const override
Function Save (do nothing : markers are no more saved in files ) writes the data structures for this ...
Definition: sch_marker.cpp:81
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39