KiCad PCB EDA Suite
sch_text.h
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 wanadoo.fr
5  * Copyright (C) 1992-2020 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 #ifndef CLASS_TEXT_LABEL_H
26 #define CLASS_TEXT_LABEL_H
27 
28 
29 #include <macros.h>
30 #include <eda_text.h>
31 #include <sch_item.h>
32 #include <sch_connection.h> // for CONNECTION_TYPE
33 
34 
36 
37 /*
38  * Spin style for text items of all kinds on schematics
39  * Basically a higher level abstraction of rotation and justification of text
40  */
42 {
43 public:
44  enum SPIN : int
45  {
46  LEFT = 0,
47  UP = 1,
48  RIGHT = 2,
49  BOTTOM = 3
50  };
51 
52 
53  LABEL_SPIN_STYLE() = default;
54  constexpr LABEL_SPIN_STYLE( SPIN aSpin ) : m_spin( aSpin )
55  {
56  }
57 
58  constexpr bool operator==( SPIN a ) const
59  {
60  return m_spin == a;
61  }
62 
63  constexpr bool operator!=( SPIN a ) const
64  {
65  return m_spin != a;
66  }
67 
68  operator int() const
69  {
70  return static_cast<int>( m_spin );
71  }
72 
74  {
75  SPIN newSpin = m_spin;
76 
77  switch( m_spin )
78  {
79  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::UP; break;
80  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
82  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::LEFT; break;
83  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
84  }
85 
86  return LABEL_SPIN_STYLE( newSpin );
87  }
88 
90  {
91  SPIN newSpin = m_spin;
92 
93  switch( m_spin )
94  {
95  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
97  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::UP; break;
98  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::LEFT; break;
99  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
100  }
101 
102  return LABEL_SPIN_STYLE( newSpin );
103  }
104 
105  /*
106  * Mirrors the label spin style across the X axis or simply swaps up and bottom
107  */
109  {
110  SPIN newSpin = m_spin;
111 
112  switch( m_spin )
113  {
114  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
115  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::UP; break;
116  case LABEL_SPIN_STYLE::LEFT: break;
117  case LABEL_SPIN_STYLE::RIGHT: break;
118  default: wxLogWarning( "MirrorX encountered unknown current spin style" ); break;
119  }
120 
121  return LABEL_SPIN_STYLE( newSpin );
122  }
123 
124  /*
125  * Mirrors the label spin style across the Y axis or simply swaps left and right
126  */
128  {
129  SPIN newSpin = m_spin;
130 
131  switch( m_spin )
132  {
133  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
134  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::LEFT; break;
135  case LABEL_SPIN_STYLE::UP: break;
136  case LABEL_SPIN_STYLE::BOTTOM: break;
137  default: wxLogWarning( "MirrorY encountered unknown current spin style" ); break;
138  }
139 
140  return LABEL_SPIN_STYLE( newSpin );
141  }
142 
143 private:
145 };
146 
147 /* Shape/Type of SCH_HIERLABEL and SCH_GLOBALLABEL
148  * mainly used to handle the graphic associated shape
149  */
151 {
152  PS_INPUT, // use "PS_INPUT" instead of "INPUT" to avoid colliding
153  // with a Windows header on msys2
154  PS_OUTPUT,
155  PS_BIDI,
156  PS_TRISTATE,
158 };
159 
160 
161 extern const char* SheetLabelType[]; /* names of types of labels */
162 
163 
164 class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
165 {
166 protected:
168 
172 
174 
185 
186 public:
187  SCH_TEXT( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
188  KICAD_T aType = SCH_TEXT_T );
189 
196  SCH_TEXT( const SCH_TEXT& aText );
197 
198  ~SCH_TEXT() { }
199 
200  static inline bool ClassOf( const EDA_ITEM* aItem )
201  {
202  return aItem && SCH_TEXT_T == aItem->Type();
203  }
204 
205  virtual wxString GetClass() const override
206  {
207  return wxT( "SCH_TEXT" );
208  }
209 
214  void GetContextualTextVars( wxArrayString* aVars ) const;
215 
216  wxString GetShownText( int aDepth = 0 ) const override;
217 
223  void IncrementLabel( int aIncrement );
224 
231  virtual void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle );
233  {
234  return m_spin_style;
235  }
236 
238 
239  void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; }
240 
247  virtual wxPoint GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const;
248 
249  void Print( RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
250 
258  virtual void CreateGraphicShape( RENDER_SETTINGS* aSettings,
259  std::vector <wxPoint>& aPoints, const wxPoint& Pos )
260  {
261  aPoints.clear();
262  }
263 
264  void SwapData( SCH_ITEM* aItem ) override;
265 
266  const EDA_RECT GetBoundingBox() const override;
267 
268  bool operator<( const SCH_ITEM& aItem ) const override;
269 
270  int GetTextOffset( RENDER_SETTINGS* aSettings ) const;
271 
272  int GetPenWidth() const override;
273 
274  // Geometric transforms (used in block operations):
275 
276  void Move( const wxPoint& aMoveVector ) override
277  {
278  EDA_TEXT::Offset( aMoveVector );
279  }
280 
281  void MirrorY( int aYaxis_position ) override;
282  void MirrorX( int aXaxis_position ) override;
283  void Rotate( wxPoint aPosition ) override;
284 
285  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
286  {
287  return SCH_ITEM::Matches( GetText(), aSearchData );
288  }
289 
290  bool Replace( wxFindReplaceData& aSearchData, void* aAuxData ) override
291  {
292  return EDA_TEXT::Replace( aSearchData );
293  }
294 
295  virtual bool IsReplaceable() const override { return true; }
296 
297  void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
298 
299  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
300  const SCH_SHEET_PATH* aPath = nullptr ) override;
301 
302  bool IsDangling() const override { return m_isDangling; }
303  void SetIsDangling( bool aIsDangling ) { m_isDangling = aIsDangling; }
304 
305  void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const override;
306 
307  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
308 
309  BITMAP_DEF GetMenuImage() const override;
310 
311  void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems, SCH_SHEET_PATH* aSheetPath ) override;
312 
313  wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
314  void SetPosition( const wxPoint& aPosition ) override { EDA_TEXT::SetTextPos( aPosition ); }
315 
316  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
317  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
318 
319  void Plot( PLOTTER* aPlotter ) override;
320 
321  EDA_ITEM* Clone() const override;
322 
323  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
324 
325 #if defined(DEBUG)
326  void Show( int nestLevel, std::ostream& os ) const override;
327 #endif
328 
329  static void ShowSyntaxHelp( wxWindow* aParentWindow );
330 };
331 
332 
333 class SCH_LABEL : public SCH_TEXT
334 {
335 public:
336  SCH_LABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
337 
338  // Do not create a copy constructor. The one generated by the compiler is adequate.
339 
341 
342  static inline bool ClassOf( const EDA_ITEM* aItem )
343  {
344  return aItem && SCH_LABEL_T == aItem->Type();
345  }
346 
347  wxString GetClass() const override
348  {
349  return wxT( "SCH_LABEL" );
350  }
351 
352  bool IsType( const KICAD_T aScanTypes[] ) const override;
353 
354  const EDA_RECT GetBoundingBox() const override;
355 
356  bool IsConnectable() const override { return true; }
357 
358  bool CanConnect( const SCH_ITEM* aItem ) const override
359  {
360  return aItem->Type() == SCH_LINE_T &&
361  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
362  }
363 
364  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
365 
366  BITMAP_DEF GetMenuImage() const override;
367 
368  bool IsReplaceable() const override { return true; }
369 
370  EDA_ITEM* Clone() const override;
371 
372 private:
373  bool doIsConnected( const wxPoint& aPosition ) const override { return EDA_TEXT::GetTextPos() == aPosition; }
374 };
375 
376 
377 class SCH_GLOBALLABEL : public SCH_TEXT
378 {
379 public:
380  SCH_GLOBALLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
381 
382  // Do not create a copy constructor. The one generated by the compiler is adequate.
383 
385 
386  void Print( RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
387 
388  static inline bool ClassOf( const EDA_ITEM* aItem )
389  {
390  return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
391  }
392 
393  wxString GetClass() const override
394  {
395  return wxT( "SCH_GLOBALLABEL" );
396  }
397 
398  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
399 
400  wxPoint GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const override;
401 
402  const EDA_RECT GetBoundingBox() const override;
403 
404  void CreateGraphicShape( RENDER_SETTINGS* aRenderSettings,
405  std::vector<wxPoint>& aPoints, const wxPoint& aPos ) override;
406 
407  bool IsConnectable() const override { return true; }
408 
409  bool CanConnect( const SCH_ITEM* aItem ) const override
410  {
411  return aItem->Type() == SCH_LINE_T &&
412  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
413  }
414 
415  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
416 
417  BITMAP_DEF GetMenuImage() const override;
418 
419  EDA_ITEM* Clone() const override;
420 
421 private:
422  bool doIsConnected( const wxPoint& aPosition ) const override { return EDA_TEXT::GetTextPos() == aPosition; }
423 };
424 
425 
426 class SCH_HIERLABEL : public SCH_TEXT
427 {
428 public:
429  SCH_HIERLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
430  KICAD_T aType = SCH_HIER_LABEL_T );
431 
432  // Do not create a copy constructor. The one generated by the compiler is adequate.
433 
435 
436  void Print( RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
437 
438  static inline bool ClassOf( const EDA_ITEM* aItem )
439  {
440  return aItem && SCH_HIER_LABEL_T == aItem->Type();
441  }
442 
443  wxString GetClass() const override
444  {
445  return wxT( "SCH_HIERLABEL" );
446  }
447 
448  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
449 
450  wxPoint GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const override;
451 
452  void CreateGraphicShape( RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
453  const wxPoint& Pos ) override;
454 
455  const EDA_RECT GetBoundingBox() const override;
456 
457  bool IsConnectable() const override { return true; }
458 
459  bool CanConnect( const SCH_ITEM* aItem ) const override
460  {
461  return aItem->Type() == SCH_LINE_T &&
462  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
463  }
464 
465  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
466 
467  BITMAP_DEF GetMenuImage() const override;
468 
469  EDA_ITEM* Clone() const override;
470 
471 private:
472  bool doIsConnected( const wxPoint& aPosition ) const override { return EDA_TEXT::GetTextPos() == aPosition; }
473 };
474 
475 #endif /* CLASS_TEXT_LABEL_H */
bool IsDangling() const override
Definition: sch_text.h:302
EDA_UNITS
Definition: common.h:198
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:253
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:827
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:239
bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_text.h:368
PNG memory record (file in memory).
Definition: bitmap_def.h:29
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:358
virtual bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_text.h:295
LABEL_SPIN_STYLE m_spin_style
The orientation of text and any associated drawing elements of derived objects.
Definition: sch_text.h:184
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:171
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_text.cpp:1063
virtual wxPoint GetSchematicTextOffset(RENDER_SETTINGS *aSettings) const
Definition: sch_text.cpp:158
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: sch_text.cpp:587
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:247
void Print(RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1132
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_text.cpp:547
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_text.cpp:821
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Matches compares the item against the search criteria in aSearchData.
Definition: sch_text.h:285
static void ShowSyntaxHelp(wxWindow *aParentWindow)
Definition: sch_text.cpp:1264
CONNECTION_TYPE
void SetIsDangling(bool aIsDangling)
Definition: sch_text.h:303
SCH_GLOBALLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:833
The base class for create windows for drawing purpose.
CONNECTION_TYPE m_connectionType
Definition: sch_text.h:173
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
void MirrorX(int aXaxis_position) override
Mirror item relative to the X axis about aXaxis_position.
Definition: sch_text.cpp:191
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:1069
constexpr bool operator==(SPIN a) const
Definition: sch_text.h:58
This file contains miscellaneous commonly used macros and functions.
constexpr LABEL_SPIN_STYLE(SPIN aSpin)
Definition: sch_text.h:54
NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected items in a...
int GetPenWidth() const override
Definition: sch_text.cpp:317
wxPoint GetSchematicTextOffset(RENDER_SETTINGS *aSettings) const override
Definition: sch_text.cpp:1232
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:113
virtual void CreateGraphicShape(RENDER_SETTINGS *aSettings, std::vector< wxPoint > &aPoints, const wxPoint &Pos)
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.h:258
void GetContextualTextVars(wxArrayString *aVars) const
Returns the set of contextual text variable tokens for this text item.
Definition: sch_text.cpp:474
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:746
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:276
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:443
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:144
void GetConnectionPoints(std::vector< wxPoint > &aPoints) const override
Add all the connection points for this item to aPoints.
Definition: sch_text.cpp:429
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:1085
constexpr bool operator!=(SPIN a) const
Definition: sch_text.h:63
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:373
const char * SheetLabelType[]
LABEL_SPIN_STYLE()=default
void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:1091
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:1008
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
Definition: sch_text.cpp:332
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:1176
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:232
int GetTextOffset(RENDER_SETTINGS *aSettings) const
Definition: sch_text.cpp:306
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:439
SCH_SHEET_PATH.
void CreateGraphicShape(RENDER_SETTINGS *aRenderSettings, std::vector< wxPoint > &aPoints, const wxPoint &aPos) override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.cpp:936
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:200
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_text.cpp:484
wxPoint GetPosition() const override
Definition: sch_text.h:313
LABEL_SPIN_STYLE MirrorY()
Definition: sch_text.h:127
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:347
bool IsConnectable() const override
Definition: sch_text.h:356
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:438
LABEL_SPIN_STYLE RotateCCW()
Definition: sch_text.h:89
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
~SCH_LABEL()
Definition: sch_text.h:340
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:459
Base plotter engine class.
Definition: plotter.h:114
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_text.cpp:286
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:388
PINSHEETLABEL_SHAPE
Definition: sch_text.h:150
LABEL_SPIN_STYLE MirrorX()
Definition: sch_text.h:108
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:393
LABEL_SPIN_STYLE RotateCW()
Definition: sch_text.h:73
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
Definition: sch_text.cpp:607
bool IsConnectable() const override
Definition: sch_text.h:407
void Print(RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:920
bool Replace(wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:178
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:271
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_text.cpp:200
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:205
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:553
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
~SCH_TEXT()
Definition: sch_text.h:198
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:409
void Print(RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:323
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
Definition: sch_text.cpp:343
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:792
const wxPoint & GetTextPos() const
Definition: eda_text.h:248
void CreateGraphicShape(RENDER_SETTINGS *aSettings, std::vector< wxPoint > &aPoints, const wxPoint &Pos) override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.cpp:1152
PINSHEETLABEL_SHAPE m_shape
Definition: sch_text.h:167
bool Replace(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Replace performs a text replace using the find and replace criteria in aSearchData on items ...
Definition: sch_text.h:290
void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:881
bool IsType(const KICAD_T aScanTypes[]) const override
Function IsType Checks whether the item is one of the listed types.
Definition: sch_text.cpp:752
SCH_HIERLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_text.cpp:1075
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:843
virtual void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:230
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_text.cpp:1252
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
Definition: sch_text.cpp:182
void SetPosition(const wxPoint &aPosition) override
Set the schematic item position to aPosition.
Definition: sch_text.h:314
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:1258
SCH_TEXT(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXT_T)
Definition: sch_text.cpp:119
bool IsConnectable() const override
Definition: sch_text.h:457
SCH_LABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:736
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:457
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:187
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:127
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:342
wxPoint GetSchematicTextOffset(RENDER_SETTINGS *aSettings) const override
Definition: sch_text.cpp:849
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, 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_text.cpp:648
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:422
void GetNetListItem(NETLIST_OBJECT_LIST &aNetListItems, SCH_SHEET_PATH *aSheetPath) override
Create a new NETLIST_OBJECT for the schematic object and adds it to aNetListItems.
Definition: sch_text.cpp:559
PINSHEETLABEL_SHAPE GetShape() const
Definition: sch_text.h:237
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:472
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
void IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_text.cpp:150