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-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 #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 
35 class LINE_READER;
37 
38 /*
39  * Spin style for text items of all kinds on schematics
40  * Basically a higher level abstraction of rotation and justification of text
41  */
43 {
44 public:
45  enum SPIN : int
46  {
47  LEFT = 0,
48  UP = 1,
49  RIGHT = 2,
50  BOTTOM = 3
51  };
52 
53 
54  LABEL_SPIN_STYLE() = default;
55  constexpr LABEL_SPIN_STYLE( SPIN aSpin ) : m_spin( aSpin )
56  {
57  }
58 
59 
60  LABEL_SPIN_STYLE( int aSpin )
61  {
62  m_spin = static_cast<SPIN>( aSpin );
63  }
64 
65 
66  constexpr bool operator==( SPIN a ) const
67  {
68  return m_spin == a;
69  }
70 
71 
72  constexpr bool operator!=( SPIN a ) const
73  {
74  return m_spin != a;
75  }
76 
77 
78  operator int() const
79  {
80  return static_cast<int>( m_spin );
81  }
82 
83 
85  {
86  SPIN newSpin = m_spin;
87 
88  switch( m_spin )
89  {
90  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::UP; break;
91  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
93  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::LEFT; break;
94  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
95  }
96 
97  return LABEL_SPIN_STYLE( newSpin );
98  }
99 
100 
102  {
103  SPIN newSpin = m_spin;
104 
105  switch( m_spin )
106  {
107  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
108  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
109  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::UP; break;
110  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::LEFT; break;
111  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
112  }
113 
114  return LABEL_SPIN_STYLE( newSpin );
115  }
116 
117 
118  /*
119  * Mirrors the label spin style across the X axis or simply swaps up and bottom
120  */
122  {
123  SPIN newSpin = m_spin;
124 
125  switch( m_spin )
126  {
127  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
128  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::UP; break;
129  case LABEL_SPIN_STYLE::LEFT: break;
130  case LABEL_SPIN_STYLE::RIGHT: break;
131  default: wxLogWarning( "MirrorX encountered unknown current spin style" ); break;
132  }
133 
134  return LABEL_SPIN_STYLE( newSpin );
135  }
136 
137 
138  /*
139  * Mirrors the label spin style across the Y axis or simply swaps left and right
140  */
142  {
143  SPIN newSpin = m_spin;
144 
145  switch( m_spin )
146  {
147  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
148  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::LEFT; break;
149  case LABEL_SPIN_STYLE::UP: break;
150  case LABEL_SPIN_STYLE::BOTTOM: break;
151  default: wxLogWarning( "MirrorY encountered unknown current spin style" ); break;
152  }
153 
154  return LABEL_SPIN_STYLE( newSpin );
155  }
156 
157 private:
159 };
160 
161 /* Shape/Type of SCH_HIERLABEL and SCH_GLOBALLABEL
162  * mainly used to handle the graphic associated shape
163  */
165 {
166  PS_INPUT, // use "PS_INPUT" instead of "INPUT" to avoid colliding
167  // with a Windows header on msys2
168  PS_OUTPUT,
169  PS_BIDI,
170  PS_TRISTATE,
172 };
173 
174 
175 extern const char* SheetLabelType[]; /* names of types of labels */
176 
177 
178 class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
179 {
180 protected:
182 
186 
188 
199 
200 public:
201  SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
202  KICAD_T aType = SCH_TEXT_T );
203 
210  SCH_TEXT( const SCH_TEXT& aText );
211 
212  ~SCH_TEXT() { }
213 
214  static inline bool ClassOf( const EDA_ITEM* aItem )
215  {
216  return aItem && SCH_TEXT_T == aItem->Type();
217  }
218 
219  virtual wxString GetClass() const override
220  {
221  return wxT( "SCH_TEXT" );
222  }
223 
229  void IncrementLabel( int aIncrement );
230 
237  virtual void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle );
239  {
240  return m_spin_style;
241  }
242 
244 
245  void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; }
246 
253  virtual wxPoint GetSchematicTextOffset() const;
254 
255  void Print( wxDC* DC, const wxPoint& offset ) override;
256 
264  virtual void CreateGraphicShape( std::vector <wxPoint>& aPoints, const wxPoint& Pos )
265  {
266  aPoints.clear();
267  }
268 
269  void SwapData( SCH_ITEM* aItem ) override;
270 
271  const EDA_RECT GetBoundingBox() const override;
272 
273  int GetPenSize() const override;
274 
275  // Geometric transforms (used in block operations):
276 
277  void Move( const wxPoint& aMoveVector ) override
278  {
279  EDA_TEXT::Offset( aMoveVector );
280  }
281 
282  void MirrorY( int aYaxis_position ) override;
283  void MirrorX( int aXaxis_position ) override;
284  void Rotate( wxPoint aPosition ) override;
285 
286  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
287  {
288  return SCH_ITEM::Matches( GetText(), aSearchData );
289  }
290 
291  bool Replace( wxFindReplaceData& aSearchData, void* aAuxData ) override
292  {
293  return EDA_TEXT::Replace( aSearchData );
294  }
295 
296  virtual bool IsReplaceable() const override { return true; }
297 
298  void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
299 
300  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList ) 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  bool CanIncrementLabel() const override { return true; }
308 
309  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
310 
311  BITMAP_DEF GetMenuImage() const override;
312 
313  void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems, SCH_SHEET_PATH* aSheetPath ) override;
314 
315  wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
316  void SetPosition( const wxPoint& aPosition ) override { EDA_TEXT::SetTextPos( aPosition ); }
317 
318  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
319  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
320 
321  void Plot( PLOTTER* aPlotter ) override;
322 
323  EDA_ITEM* Clone() const override;
324 
325  void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
326 
327 #if defined(DEBUG)
328  void Show( int nestLevel, std::ostream& os ) const override;
329 #endif
330 };
331 
332 
333 class SCH_LABEL : public SCH_TEXT
334 {
335 public:
336  SCH_LABEL( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = 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& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
381 
382  // Do not create a copy constructor. The one generated by the compiler is adequate.
383 
385 
386  void Print( wxDC* DC, 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() const override;
401 
402  const EDA_RECT GetBoundingBox() const override;
403 
404  void CreateGraphicShape( std::vector <wxPoint>& aPoints, const wxPoint& aPos ) override;
405 
406  bool IsConnectable() const override { return true; }
407 
408  bool CanConnect( const SCH_ITEM* aItem ) const override
409  {
410  return aItem->Type() == SCH_LINE_T &&
411  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
412  }
413 
414  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
415 
416  BITMAP_DEF GetMenuImage() const override;
417 
418  EDA_ITEM* Clone() const override;
419 
420 private:
421  bool doIsConnected( const wxPoint& aPosition ) const override { return EDA_TEXT::GetTextPos() == aPosition; }
422 };
423 
424 
425 class SCH_HIERLABEL : public SCH_TEXT
426 {
427 public:
428  SCH_HIERLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
429  const wxString& text = 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( wxDC* DC, 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() const override;
451 
452  void CreateGraphicShape( std::vector <wxPoint>& aPoints, const wxPoint& Pos ) override;
453 
454  const EDA_RECT GetBoundingBox() const override;
455 
456  bool IsConnectable() const override { return true; }
457 
458  bool CanConnect( const SCH_ITEM* aItem ) const override
459  {
460  return aItem->Type() == SCH_LINE_T &&
461  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
462  }
463 
464  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
465 
466  BITMAP_DEF GetMenuImage() const override;
467 
468  EDA_ITEM* Clone() const override;
469 
470 private:
471  bool doIsConnected( const wxPoint& aPosition ) const override { return EDA_TEXT::GetTextPos() == aPosition; }
472 };
473 
474 #endif /* CLASS_TEXT_LABEL_H */
bool IsDangling() const override
Definition: sch_text.h:302
SCH_HIERLABEL(const wxPoint &pos=wxPoint(0, 0), const wxString &text=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_text.cpp:1000
EDA_UNITS
Definition: common.h:72
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:237
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:704
void Print(wxDC *DC, const wxPoint &offset) override
Function Print Print a schematic item.
Definition: sch_text.cpp:284
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:245
LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived to re...
Definition: richio.h:81
bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_text.h:368
PNG memory record (file in memory).
Definition: bitmap_def.h:29
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:358
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_text.cpp:266
SCH_GLOBALLABEL(const wxPoint &pos=wxPoint(0, 0), const wxString &text=wxEmptyString)
Definition: sch_text.cpp:710
virtual bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_text.h:296
LABEL_SPIN_STYLE m_spin_style
The orientation of text and any associated drawing elements of derived objects.
Definition: sch_text.h:198
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:185
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:988
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:469
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:231
virtual wxPoint GetSchematicTextOffset() const
Definition: sch_text.cpp:137
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:429
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:698
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList) override
Function IsDanglingStateChanged tests the schematic item to aItemList to check if it's dangling state...
Definition: sch_text.cpp:313
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Matches compares the item against the search criteria in aSearchData.
Definition: sch_text.h:286
bool CanIncrementLabel() const override
Definition: sch_text.h:307
CONNECTION_TYPE
void SetIsDangling(bool aIsDangling)
Definition: sch_text.h:303
CONNECTION_TYPE m_connectionType
Definition: sch_text.h:187
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
Function MirrorX mirrors item relative to the X axis about aXaxis_position.
Definition: sch_text.cpp:170
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:994
constexpr bool operator==(SPIN a) const
Definition: sch_text.h:66
This file contains miscellaneous commonly used macros and functions.
constexpr LABEL_SPIN_STYLE(SPIN aSpin)
Definition: sch_text.h:55
NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected items in a...
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:109
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:636
void Move(const wxPoint &aMoveVector) override
Function Move moves the item by aMoveVector to a new position.
Definition: sch_text.h:277
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:123
void GetConnectionPoints(std::vector< wxPoint > &aPoints) const override
Function GetConnectionPoints add all the connection points for this item to aPoints.
Definition: sch_text.cpp:392
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:1010
constexpr bool operator!=(SPIN a) const
Definition: sch_text.h:72
bool doIsConnected(const wxPoint &aPosition) const override
Function doIsConnected provides the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:373
wxPoint GetSchematicTextOffset() const override
Definition: sch_text.cpp:726
const char * SheetLabelType[]
LABEL_SPIN_STYLE()=default
void CreateGraphicShape(std::vector< wxPoint > &aPoints, const wxPoint &aPos) override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.cpp:834
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:1016
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:934
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Function GetEndPoints adds the schematic item end points to aItemList if the item has end points.
Definition: sch_text.cpp:302
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:1102
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:238
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:402
SCH_SHEET_PATH.
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:214
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_text.h:315
LABEL_SPIN_STYLE MirrorY()
Definition: sch_text.h:141
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:347
bool IsConnectable() const override
Function IsConnectable returns true if the schematic item can connect to another schematic item.
Definition: sch_text.h:356
void Print(wxDC *DC, const wxPoint &offset) override
Function Print Print a schematic item.
Definition: sch_text.cpp:1057
LABEL_SPIN_STYLE(int aSpin)
Definition: sch_text.h:60
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:438
LABEL_SPIN_STYLE RotateCCW()
Definition: sch_text.h:101
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:212
~SCH_LABEL()
Definition: sch_text.h:340
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:458
void CreateGraphicShape(std::vector< wxPoint > &aPoints, const wxPoint &Pos) override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.cpp:1080
Base plotter engine class.
Definition: plotter.h:103
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:388
PINSHEETLABEL_SHAPE
Definition: sch_text.h:164
virtual void CreateGraphicShape(std::vector< wxPoint > &aPoints, const wxPoint &Pos)
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.h:264
LABEL_SPIN_STYLE MirrorX()
Definition: sch_text.h:121
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:393
void GetMsgPanelInfo(EDA_UNITS 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_text.cpp:539
LABEL_SPIN_STYLE RotateCW()
Definition: sch_text.h:84
void Plot(PLOTTER *aPlotter) override
Function Plot plots the schematic item to aPlotter.
Definition: sch_text.cpp:489
bool IsConnectable() const override
Function IsConnectable returns true if the schematic item can connect to another schematic item.
Definition: sch_text.h:406
bool Replace(wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:144
void SwapData(SCH_ITEM *aItem) override
Function SwapData swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:251
void Rotate(wxPoint aPosition) override
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_text.cpp:179
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:219
SCH_TEXT(const wxPoint &pos=wxPoint(0, 0), const wxString &text=wxEmptyString, KICAD_T aType=SCH_TEXT_T)
Definition: sch_text.cpp:99
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:435
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
~SCH_TEXT()
Definition: sch_text.h:212
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:408
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:163
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:674
const wxPoint & GetTextPos() const
Definition: eda_text.h:232
PINSHEETLABEL_SHAPE m_shape
Definition: sch_text.h:181
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:291
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:773
bool IsType(const KICAD_T aScanTypes[]) const override
Function IsType Checks whether the item is one of the listed types.
Definition: sch_text.cpp:642
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:720
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:210
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:1182
void MirrorY(int aYaxis_position) override
Function MirrorY mirrors item relative to the Y axis about aYaxis_position.
Definition: sch_text.cpp:161
void SetPosition(const wxPoint &aPosition) override
Function SetPosition set the schematic item position to aPosition.
Definition: sch_text.h:316
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:1188
bool IsConnectable() const override
Function IsConnectable returns true if the schematic item can connect to another schematic item.
Definition: sch_text.h:456
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:471
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:136
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123
SCH_LABEL(const wxPoint &pos=wxPoint(0, 0), const wxString &text=wxEmptyString)
Definition: sch_text.cpp:626
wxPoint GetSchematicTextOffset() const override
Definition: sch_text.cpp:1155
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:342
bool doIsConnected(const wxPoint &aPosition) const override
Function doIsConnected provides the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:421
void GetNetListItem(NETLIST_OBJECT_LIST &aNetListItems, SCH_SHEET_PATH *aSheetPath) override
Function GetNetListItem creates a new NETLIST_OBJECT for the schematic object and adds it to aNetList...
Definition: sch_text.cpp:441
void Print(wxDC *DC, const wxPoint &offset) override
Function Print Print a schematic item.
Definition: sch_text.cpp:812
PINSHEETLABEL_SHAPE GetShape() const
Definition: sch_text.h:243
bool doIsConnected(const wxPoint &aPosition) const override
Function doIsConnected provides the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:471
KICAD_T Type() const
Function Type()
Definition: base_struct.h:207
void IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_text.cpp:129