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 <eda_text.h>
30 #include <sch_item.h>
31 #include <sch_connection.h> // for CONNECTION_TYPE
32 
33 
34 class NETLIST_OBJECT_LIST;
35 class HTML_MESSAGE_BOX;
36 class SCH_IREF;
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  constexpr bool operator==( SPIN a ) const
60  {
61  return m_spin == a;
62  }
63 
64  constexpr bool operator!=( SPIN a ) const
65  {
66  return m_spin != a;
67  }
68 
69  operator int() const
70  {
71  return static_cast<int>( m_spin );
72  }
73 
75  {
76  SPIN newSpin = m_spin;
77 
78  switch( m_spin )
79  {
80  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::UP; break;
81  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
83  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::LEFT; break;
84  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
85  }
86 
87  return LABEL_SPIN_STYLE( newSpin );
88  }
89 
91  {
92  SPIN newSpin = m_spin;
93 
94  switch( m_spin )
95  {
96  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
98  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::UP; break;
99  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::LEFT; break;
100  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
101  }
102 
103  return LABEL_SPIN_STYLE( newSpin );
104  }
105 
106  /*
107  * Mirrors the label spin style across the X axis or simply swaps up and bottom
108  */
110  {
111  SPIN newSpin = m_spin;
112 
113  switch( m_spin )
114  {
115  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
116  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::UP; break;
117  case LABEL_SPIN_STYLE::LEFT: break;
118  case LABEL_SPIN_STYLE::RIGHT: break;
119  default: wxLogWarning( "MirrorX encountered unknown current spin style" ); break;
120  }
121 
122  return LABEL_SPIN_STYLE( newSpin );
123  }
124 
125  /*
126  * Mirrors the label spin style across the Y axis or simply swaps left and right
127  */
129  {
130  SPIN newSpin = m_spin;
131 
132  switch( m_spin )
133  {
134  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
135  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::LEFT; break;
136  case LABEL_SPIN_STYLE::UP: break;
137  case LABEL_SPIN_STYLE::BOTTOM: break;
138  default: wxLogWarning( "MirrorY encountered unknown current spin style" ); break;
139  }
140 
141  return LABEL_SPIN_STYLE( newSpin );
142  }
143 
144 private:
146 };
147 
148 /* Shape/Type of SCH_HIERLABEL and SCH_GLOBALLABEL
149  * mainly used to handle the graphic associated shape
150  */
152 {
153  PS_INPUT, // use "PS_INPUT" instead of "INPUT" to avoid colliding
154  // with a Windows header on msys2
155  PS_OUTPUT,
156  PS_BIDI,
157  PS_TRISTATE,
159 };
160 
161 
162 extern const char* SheetLabelType[]; /* names of types of labels */
163 
164 
165 class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
166 {
167 protected:
169 
173 
175 
186 
187 public:
188  SCH_TEXT( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
189  KICAD_T aType = SCH_TEXT_T );
190 
197  SCH_TEXT( const SCH_TEXT& aText );
198 
199  ~SCH_TEXT() { }
200 
201  static inline bool ClassOf( const EDA_ITEM* aItem )
202  {
203  return aItem && SCH_TEXT_T == aItem->Type();
204  }
205 
206  virtual wxString GetClass() const override
207  {
208  return wxT( "SCH_TEXT" );
209  }
210 
215  void GetContextualTextVars( wxArrayString* aVars ) const;
216 
217  wxString GetShownText( int aDepth = 0 ) const override;
218 
224  void IncrementLabel( int aIncrement );
225 
232  virtual void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle );
234  {
235  return m_spin_style;
236  }
237 
239 
240  void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; }
241 
248  virtual wxPoint GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const;
249 
250  void Print( RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
251 
259  virtual void CreateGraphicShape( RENDER_SETTINGS* aSettings,
260  std::vector <wxPoint>& aPoints, const wxPoint& Pos )
261  {
262  aPoints.clear();
263  }
264 
265  void SwapData( SCH_ITEM* aItem ) override;
266 
267  const EDA_RECT GetBoundingBox() const override;
268 
269  bool operator<( const SCH_ITEM& aItem ) const override;
270 
271  int GetTextOffset( RENDER_SETTINGS* aSettings ) const;
272 
273  int GetPenWidth() 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,
301  const SCH_SHEET_PATH* aPath = nullptr ) override;
302 
303  bool IsDangling() const override { return m_isDangling; }
304  void SetIsDangling( bool aIsDangling ) { m_isDangling = aIsDangling; }
305 
306  std::vector<wxPoint> GetConnectionPoints() const override;
307 
308  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
309 
310  BITMAP_DEF GetMenuImage() const override;
311 
312  wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
313  void SetPosition( const wxPoint& aPosition ) override { EDA_TEXT::SetTextPos( aPosition ); }
314 
315  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
316  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
317 
318  void Plot( PLOTTER* aPlotter ) override;
319 
320  EDA_ITEM* Clone() const override;
321 
322  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
323 
324 #if defined(DEBUG)
325  void Show( int nestLevel, std::ostream& os ) const override;
326 #endif
327 
328  static HTML_MESSAGE_BOX* ShowSyntaxHelp( wxWindow* aParentWindow );
329 };
330 
331 
332 class SCH_LABEL : public SCH_TEXT
333 {
334 public:
335  SCH_LABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
336 
337  // Do not create a copy constructor. The one generated by the compiler is adequate.
338 
340 
341  static inline bool ClassOf( const EDA_ITEM* aItem )
342  {
343  return aItem && SCH_LABEL_T == aItem->Type();
344  }
345 
346  wxString GetClass() const override
347  {
348  return wxT( "SCH_LABEL" );
349  }
350 
351  bool IsType( const KICAD_T aScanTypes[] ) const override;
352 
353  const EDA_RECT GetBoundingBox() const override;
354 
355  bool IsConnectable() const override { return true; }
356 
357  bool CanConnect( const SCH_ITEM* aItem ) const override
358  {
359  return aItem->Type() == SCH_LINE_T &&
360  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
361  }
362 
363  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
364 
365  BITMAP_DEF GetMenuImage() const override;
366 
367  bool IsReplaceable() const override { return true; }
368 
369  EDA_ITEM* Clone() const override;
370 
371  bool IsPointClickableAnchor( const wxPoint& aPos ) const override { return m_isDangling && GetPosition() == aPos; }
372 
373 private:
374  bool doIsConnected( const wxPoint& aPosition ) const override { return EDA_TEXT::GetTextPos() == aPosition; }
375 };
376 
377 
378 class SCH_GLOBALLABEL : public SCH_TEXT
379 {
380 public:
381  SCH_GLOBALLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
382 
383  // Do not create a copy constructor. The one generated by the compiler is adequate.
384 
386 
387  void Print( RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
388 
389  static inline bool ClassOf( const EDA_ITEM* aItem )
390  {
391  return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
392  }
393 
394  wxString GetClass() const override
395  {
396  return wxT( "SCH_GLOBALLABEL" );
397  }
398 
399  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
400 
401  wxPoint GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const override;
402 
403  const EDA_RECT GetBoundingBox() const override;
404 
405  void CreateGraphicShape( RENDER_SETTINGS* aRenderSettings,
406  std::vector<wxPoint>& aPoints, const wxPoint& aPos ) override;
407 
408  bool IsConnectable() const override { return true; }
409 
410  bool CanConnect( const SCH_ITEM* aItem ) const override
411  {
412  return aItem->Type() == SCH_LINE_T &&
413  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
414  }
415 
416  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
417 
418  BITMAP_DEF GetMenuImage() const override;
419 
420  EDA_ITEM* Clone() const override;
421 
422  SCH_IREF* GetIref() { return m_iref; }
423  void SetIref( SCH_IREF* iref ) { m_iref = iref; }
424 
425  wxPoint GetIrefSavedPosition() { return m_savedIrefPos; }
426  void SetIrefSavedPosition( wxPoint pos ) { m_savedIrefPos = pos; }
427 
428  bool IsPointClickableAnchor( const wxPoint& aPos ) const override { return m_isDangling && GetPosition() == aPos; }
429 
430 private:
431  bool doIsConnected( const wxPoint& aPosition ) const override { return EDA_TEXT::GetTextPos() == aPosition; }
433  wxPoint m_savedIrefPos;
434 };
435 
436 
437 class SCH_HIERLABEL : public SCH_TEXT
438 {
439 public:
440  SCH_HIERLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
441  KICAD_T aType = SCH_HIER_LABEL_T );
442 
443  // Do not create a copy constructor. The one generated by the compiler is adequate.
444 
446 
447  void Print( RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
448 
449  static inline bool ClassOf( const EDA_ITEM* aItem )
450  {
451  return aItem && SCH_HIER_LABEL_T == aItem->Type();
452  }
453 
454  wxString GetClass() const override
455  {
456  return wxT( "SCH_HIERLABEL" );
457  }
458 
459  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
460 
461  wxPoint GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const override;
462 
463  void CreateGraphicShape( RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
464  const wxPoint& Pos ) override;
465 
466  const EDA_RECT GetBoundingBox() const override;
467 
468  bool IsConnectable() const override { return true; }
469 
470  bool CanConnect( const SCH_ITEM* aItem ) const override
471  {
472  return aItem->Type() == SCH_LINE_T &&
473  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
474  }
475 
476  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
477 
478  BITMAP_DEF GetMenuImage() const override;
479 
480  EDA_ITEM* Clone() const override;
481 
482  bool IsPointClickableAnchor( const wxPoint& aPos ) const override { return m_isDangling && GetPosition() == aPos; }
483 
484 private:
485  bool doIsConnected( const wxPoint& aPosition ) const override { return EDA_TEXT::GetTextPos() == aPosition; }
486 };
487 
488 #endif /* CLASS_TEXT_LABEL_H */
bool IsDangling() const override
Definition: sch_text.h:303
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:259
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:802
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:240
bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_text.h:367
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:357
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:185
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:172
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:1040
virtual wxPoint GetSchematicTextOffset(RENDER_SETTINGS *aSettings) const
Definition: sch_text.cpp:160
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:561
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:253
SCH_IREF * m_iref
Definition: sch_text.h:432
void Print(RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1109
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:549
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:796
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Matches compares the item against the search criteria in aSearchData.
Definition: sch_text.h:286
CONNECTION_TYPE
void SetIsDangling(bool aIsDangling)
Definition: sch_text.h:304
SCH_GLOBALLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:808
The base class for create windows for drawing purpose.
CONNECTION_TYPE m_connectionType
Definition: sch_text.h:174
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:193
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:1046
constexpr bool operator==(SPIN a) const
Definition: sch_text.h:59
constexpr LABEL_SPIN_STYLE(SPIN aSpin)
Definition: sch_text.h:55
int GetPenWidth() const override
Definition: sch_text.cpp:319
wxPoint GetSchematicTextOffset(RENDER_SETTINGS *aSettings) const override
Definition: sch_text.cpp:1209
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:119
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:259
void GetContextualTextVars(wxArrayString *aVars) const
Returns the set of contextual text variable tokens for this text item.
Definition: sch_text.cpp:476
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:721
void Move(const wxPoint &aMoveVector) override
Move 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:454
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:146
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:1062
constexpr bool operator!=(SPIN a) const
Definition: sch_text.h:64
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:374
const char * SheetLabelType[]
LABEL_SPIN_STYLE()=default
void SetIref(SCH_IREF *iref)
Definition: sch_text.h:423
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:1068
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:985
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:334
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:1153
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:233
int GetTextOffset(RENDER_SETTINGS *aSettings) const
Definition: sch_text.cpp:308
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:441
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
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:913
HTML_MESSAGE_BOX.
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:201
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_text.cpp:486
wxPoint GetPosition() const override
Definition: sch_text.h:312
LABEL_SPIN_STYLE MirrorY()
Definition: sch_text.h:128
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:346
bool IsConnectable() const override
Definition: sch_text.h:355
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:449
LABEL_SPIN_STYLE RotateCCW()
Definition: sch_text.h:90
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:279
EDA_UNITS
Definition: eda_units.h:38
wxPoint m_savedIrefPos
Definition: sch_text.h:433
~SCH_LABEL()
Definition: sch_text.h:339
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:470
Base plotter engine class.
Definition: plotter.h:131
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_text.cpp:288
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Definition: sch_text.cpp:1241
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:389
PINSHEETLABEL_SHAPE
Definition: sch_text.h:151
void SetIrefSavedPosition(wxPoint pos)
Definition: sch_text.h:426
LABEL_SPIN_STYLE MirrorX()
Definition: sch_text.h:109
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:394
LABEL_SPIN_STYLE RotateCW()
Definition: sch_text.h:74
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
Definition: sch_text.cpp:581
bool IsConnectable() const override
Definition: sch_text.h:408
SCH_IREF * GetIref()
Definition: sch_text.h:422
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_text.cpp:431
void Print(RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:897
bool Replace(wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:177
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:371
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:428
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:273
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_text.cpp:202
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_text.h:206
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:482
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:555
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
~SCH_TEXT()
Definition: sch_text.h:199
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:410
void Print(RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:325
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
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:345
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_text.cpp:767
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
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:1129
PINSHEETLABEL_SHAPE m_shape
Definition: sch_text.h:168
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:858
bool IsType(const KICAD_T aScanTypes[]) const override
Function IsType Checks whether the item is one of the listed types.
Definition: sch_text.cpp:727
SCH_HIERLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_text.cpp:1052
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:820
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:232
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:1229
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
Definition: sch_text.cpp:184
void SetPosition(const wxPoint &aPosition) override
Definition: sch_text.h:313
wxPoint GetIrefSavedPosition()
Definition: sch_text.h:425
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_text.cpp:1235
SCH_TEXT(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXT_T)
Definition: sch_text.cpp:121
bool IsConnectable() const override
Definition: sch_text.h:468
SCH_LABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:711
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: eda_item.h:447
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:341
wxPoint GetSchematicTextOffset(RENDER_SETTINGS *aSettings) const override
Definition: sch_text.cpp:826
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:623
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:431
PINSHEETLABEL_SHAPE GetShape() const
Definition: sch_text.h:238
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:485
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182
void IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_text.cpp:152