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-2021 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_field.h>
32 #include <sch_connection.h> // for CONNECTION_TYPE
33 
34 
35 class NETLIST_OBJECT_LIST;
36 class HTML_MESSAGE_BOX;
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 
77 
82 
87 
88 private:
90 };
91 
92 /*
93  * Shape/Type of #SCH_HIERLABEL and #SCH_GLOBALLABEL.
94  */
96 {
97  PS_INPUT, // use "PS_INPUT" instead of "INPUT" to avoid colliding
98  // with a Windows header on msys2
99  PS_OUTPUT,
100  PS_BIDI,
101  PS_TRISTATE,
103 };
104 
105 
106 extern const char* SheetLabelType[]; /* names of types of labels */
107 
108 
109 class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
110 {
111 public:
112  SCH_TEXT( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
113  KICAD_T aType = SCH_TEXT_T );
114 
121  SCH_TEXT( const SCH_TEXT& aText );
122 
123  ~SCH_TEXT() { }
124 
125  static inline bool ClassOf( const EDA_ITEM* aItem )
126  {
127  return aItem && SCH_TEXT_T == aItem->Type();
128  }
129 
130  virtual wxString GetClass() const override
131  {
132  return wxT( "SCH_TEXT" );
133  }
134 
140  void GetContextualTextVars( wxArrayString* aVars ) const;
141 
142  wxString GetShownText( int aDepth = 0 ) const override;
143 
149  bool IncrementLabel( int aIncrement );
150 
158  virtual void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle );
160 
162 
163  void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; }
164 
171  virtual wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const;
172 
173  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
174 
181  virtual void CreateGraphicShape( const RENDER_SETTINGS* aSettings,
182  std::vector<wxPoint>& aPoints, const wxPoint& Pos ) const
183  {
184  aPoints.clear();
185  }
186 
187  void SwapData( SCH_ITEM* aItem ) override;
188 
189  const EDA_RECT GetBoundingBox() const override;
190 
191  bool operator<( const SCH_ITEM& aItem ) const override;
192 
193  int GetTextOffset( const RENDER_SETTINGS* aSettings = nullptr ) const;
194 
195  int GetLabelBoxExpansion( const RENDER_SETTINGS* aSettings = nullptr ) const;
196 
197  int GetPenWidth() const override;
198 
199  // Geometric transforms (used in block operations):
200 
201  void Move( const wxPoint& aMoveVector ) override
202  {
203  EDA_TEXT::Offset( aMoveVector );
204  }
205 
206  void MirrorHorizontally( int aCenter ) override;
207  void MirrorVertically( int aCenter ) override;
208  void Rotate( const wxPoint& aCenter ) override;
209 
210  virtual void Rotate90( bool aClockwise );
211  virtual void MirrorSpinStyle( bool aLeftRight );
212 
213  bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
214  {
215  return SCH_ITEM::Matches( GetText(), aSearchData );
216  }
217 
218  bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData ) override
219  {
220  return EDA_TEXT::Replace( aSearchData );
221  }
222 
223  virtual bool IsReplaceable() const override { return true; }
224 
225  void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
226 
227  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
228  const SCH_SHEET_PATH* aPath = nullptr ) override;
229 
230  bool IsDangling() const override { return m_isDangling; }
231  void SetIsDangling( bool aIsDangling ) { m_isDangling = aIsDangling; }
232 
233  std::vector<wxPoint> GetConnectionPoints() const override;
234 
235  void ViewGetLayers( int aLayers[], int& aCount ) const override;
236 
237  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
238 
239  BITMAPS GetMenuImage() const override;
240 
241  wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
242  void SetPosition( const wxPoint& aPosition ) override { EDA_TEXT::SetTextPos( aPosition ); }
243 
244  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
245  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
246 
247  void Plot( PLOTTER* aPlotter ) const override;
248 
249  EDA_ITEM* Clone() const override;
250 
251  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
252 
253 #if defined(DEBUG)
254  void Show( int nestLevel, std::ostream& os ) const override;
255 #endif
256 
257  static HTML_MESSAGE_BOX* ShowSyntaxHelp( wxWindow* aParentWindow );
258 
259 protected:
261 
265 
267 
279 };
280 
281 
282 class SCH_LABEL : public SCH_TEXT
283 {
284 public:
285  SCH_LABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
286 
287  // Do not create a copy constructor. The one generated by the compiler is adequate.
288 
290 
291  static inline bool ClassOf( const EDA_ITEM* aItem )
292  {
293  return aItem && SCH_LABEL_T == aItem->Type();
294  }
295 
296  wxString GetClass() const override
297  {
298  return wxT( "SCH_LABEL" );
299  }
300 
301  bool IsType( const KICAD_T aScanTypes[] ) const override;
302 
303  const EDA_RECT GetBoundingBox() const override;
304 
305  bool IsConnectable() const override { return true; }
306 
307  bool CanConnect( const SCH_ITEM* aItem ) const override
308  {
309  return aItem->Type() == SCH_LINE_T &&
310  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
311  }
312 
313  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
314 
315  BITMAPS GetMenuImage() const override;
316 
317  bool IsReplaceable() const override { return true; }
318 
319  EDA_ITEM* Clone() const override;
320 
321  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
322  {
323  return m_isDangling && GetPosition() == aPos;
324  }
325 
326 private:
327  bool doIsConnected( const wxPoint& aPosition ) const override
328  {
329  return EDA_TEXT::GetTextPos() == aPosition;
330  }
331 };
332 
333 
334 class SCH_GLOBALLABEL : public SCH_TEXT
335 {
336 public:
337  SCH_GLOBALLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
338 
339  SCH_GLOBALLABEL( const SCH_GLOBALLABEL& aGlobalLabel );
340 
342 
343  static inline bool ClassOf( const EDA_ITEM* aItem )
344  {
345  return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
346  }
347 
348  wxString GetClass() const override
349  {
350  return wxT( "SCH_GLOBALLABEL" );
351  }
352 
353  EDA_ITEM* Clone() const override;
354 
355  void SwapData( SCH_ITEM* aItem ) override;
356 
357  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
358 
359  void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
360 
361  void Rotate( const wxPoint& aCenter ) override;
362  void Rotate90( bool aClockwise ) override;
363  void MirrorSpinStyle( bool aLeftRight ) override;
364 
365  void MirrorHorizontally( int aCenter ) override;
366  void MirrorVertically( int aCenter ) override;
367 
368  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
369 
370  wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
371 
376  const EDA_RECT GetBoundingBoxBase() const;
377 
381  const EDA_RECT GetBoundingBox() const override;
382 
388  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
389  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
390 
391  void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings,
392  std::vector<wxPoint>& aPoints, const wxPoint& aPos ) const override;
393 
395  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
396 
397  bool ResolveTextVar( wxString* token, int aDepth ) const;
398 
399  bool IsConnectable() const override { return true; }
400 
401  bool CanConnect( const SCH_ITEM* aItem ) const override
402  {
403  return aItem->Type() == SCH_LINE_T &&
404  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
405  }
406 
407  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
408 
409  BITMAPS GetMenuImage() const override;
410 
411  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
412 
413  void Plot( PLOTTER* aPlotter ) const override;
414 
416  void SetIntersheetRefs( const SCH_FIELD& aField ) { m_intersheetRefsField = aField; }
417 
418  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
419  {
420  return m_isDangling && GetPosition() == aPos;
421  }
422 
423  void Move( const wxPoint& aMoveVector ) override
424  {
425  SCH_TEXT::Move( aMoveVector );
426  m_intersheetRefsField.Move( aMoveVector );
427  }
428 
429 private:
430  bool doIsConnected( const wxPoint& aPosition ) const override
431  {
432  return EDA_TEXT::GetTextPos() == aPosition;
433  }
434 
436 };
437 
438 
439 class SCH_HIERLABEL : public SCH_TEXT
440 {
441 public:
442  SCH_HIERLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
443  KICAD_T aType = SCH_HIER_LABEL_T );
444 
445  // Do not create a copy constructor. The one generated by the compiler is adequate.
446 
448 
449  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
450 
451  static inline bool ClassOf( const EDA_ITEM* aItem )
452  {
453  return aItem && SCH_HIER_LABEL_T == aItem->Type();
454  }
455 
456  wxString GetClass() const override
457  {
458  return wxT( "SCH_HIERLABEL" );
459  }
460 
461  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
462 
463  wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
464 
465  void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
466  const wxPoint& aPos ) const override;
467  void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
468  const wxPoint& aPos, PINSHEETLABEL_SHAPE aShape ) const;
469 
470  const EDA_RECT GetBoundingBox() const override;
471 
472  bool IsConnectable() const override { return true; }
473 
474  bool CanConnect( const SCH_ITEM* aItem ) const override
475  {
476  return aItem->Type() == SCH_LINE_T &&
477  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
478  }
479 
480  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
481 
482  BITMAPS GetMenuImage() const override;
483 
484  EDA_ITEM* Clone() const override;
485 
486  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
487  {
488  return m_isDangling && GetPosition() == aPos;
489  }
490 
491 private:
492  bool doIsConnected( const wxPoint& aPosition ) const override
493  {
494  return EDA_TEXT::GetTextPos() == aPosition;
495  }
496 };
497 
498 #endif /* CLASS_TEXT_LABEL_H */
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_text.cpp:291
bool IsDangling() const override
Definition: sch_text.h:230
const EDA_RECT GetBoundingBoxBase() const
Return the bounding box on the global label only, without taking in account the intersheet references...
Definition: sch_text.cpp:1416
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_field.h:159
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
Definition: sch_text.cpp:1021
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:49
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:273
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:163
virtual bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition: eda_item.h:364
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_text.h:317
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_text.cpp:1093
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:307
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:423
virtual bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_text.h:223
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1312
LABEL_SPIN_STYLE m_spin_style
The orientation of text and any associated drawing elements of derived objects.
Definition: sch_text.h:278
wxPoint GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
Definition: sch_text.cpp:1027
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:264
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_text.cpp:1484
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: sch_text.cpp:680
bool Replace(const wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:180
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_text.h:213
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:267
void Plot(PLOTTER *aPlotter) const override
Plot the schematic item to aPlotter.
Definition: sch_text.cpp:1333
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_text.cpp:668
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_text.cpp:932
CONNECTION_TYPE
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1605
void SetIsDangling(bool aIsDangling)
Definition: sch_text.h:231
SCH_GLOBALLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:944
The base class for create windows for drawing purpose.
bool Replace(const wxFindReplaceData &aSearchData, void *aAuxData) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
Definition: sch_text.h:218
CONNECTION_TYPE m_connectionType
Definition: sch_text.h:266
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Override basic hit test to allow testing separately for label and intersheet refs which can move inde...
Definition: sch_text.cpp:1496
virtual wxPoint GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const
This offset depends on the orientation, the type of text, and the area required to draw the associate...
Definition: sch_text.cpp:258
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:93
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
void MirrorSpinStyle(bool aLeftRight) override
Definition: sch_text.cpp:1149
constexpr bool operator==(SPIN a) const
Definition: sch_text.h:59
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:1735
constexpr LABEL_SPIN_STYLE(SPIN aSpin)
Definition: sch_text.h:55
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition: sch_text.cpp:920
int GetPenWidth() const override
Definition: sch_text.cpp:440
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:140
void GetContextualTextVars(wxArrayString *aVars) const
Return the set of contextual text variable tokens for this text item.
Definition: sch_text.cpp:590
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:845
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:201
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: sch_text.cpp:1259
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_text.cpp:300
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:456
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:240
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:1558
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:327
wxPoint GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
Definition: sch_text.cpp:1709
const char * SheetLabelType[]
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_text.cpp:246
LABEL_SPIN_STYLE()=default
void SetIntersheetRefs(const SCH_FIELD &aField)
Definition: sch_text.h:416
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_text.cpp:282
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:1564
const EDA_RECT GetBoundingBox() const override
Return the bounding box on the global label only, including the intersheet references.
Definition: sch_text.cpp:1466
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:455
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< wxPoint > &aPoints, const wxPoint &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.cpp:1625
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:1657
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:159
int GetTextOffset(const RENDER_SETTINGS *aSettings=nullptr) const
Definition: sch_text.cpp:406
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: sch_text.cpp:996
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:555
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:125
void UpdateIntersheetRefProps()
Definition: sch_text.cpp:1204
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_text.cpp:600
wxPoint GetPosition() const override
Definition: sch_text.h:241
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:446
LABEL_SPIN_STYLE MirrorY()
Mirror the label spin style across the Y axis or simply swaps left and right.
Definition: sch_text.cpp:198
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:296
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_text.cpp:1192
bool IsConnectable() const override
Definition: sch_text.h:305
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:451
LABEL_SPIN_STYLE RotateCCW()
Definition: sch_text.cpp:164
virtual void Rotate90(bool aClockwise)
Definition: sch_text.cpp:312
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:259
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_text.cpp:1174
EDA_UNITS
Definition: eda_units.h:38
~SCH_LABEL()
Definition: sch_text.h:289
SCH_FIELD * GetIntersheetRefs()
Definition: sch_text.h:415
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:938
virtual void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< wxPoint > &aPoints, const wxPoint &Pos) const
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.h:181
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:474
Base plotter engine class.
Definition: plotter.h:121
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_text.cpp:386
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Definition: sch_text.cpp:1741
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:343
PINSHEETLABEL_SHAPE
Definition: sch_text.h:95
LABEL_SPIN_STYLE MirrorX()
Mirror the label spin style across the X axis or simply swaps up and bottom.
Definition: sch_text.cpp:181
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:348
LABEL_SPIN_STYLE RotateCW()
Definition: sch_text.cpp:147
SCH_FIELD m_intersheetRefsField
Definition: sch_text.h:435
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
void CreateGraphicShape(const RENDER_SETTINGS *aRenderSettings, std::vector< wxPoint > &aPoints, const wxPoint &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_text.cpp:1344
bool IsConnectable() const override
Definition: sch_text.h:399
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_text.cpp:545
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:321
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:418
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:371
virtual wxString GetClass() const override
Return the class name.
Definition: sch_text.h:130
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:486
Handle the component boundary box.
Definition: eda_rect.h:42
~SCH_TEXT()
Definition: sch_text.h:123
int GetLabelBoxExpansion(const RENDER_SETTINGS *aSettings=nullptr) const
Definition: sch_text.cpp:423
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:401
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:99
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_text.cpp:1216
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:466
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:892
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:1490
const wxPoint & GetTextPos() const
Definition: eda_text.h:268
void Plot(PLOTTER *aPlotter) const override
Plot the schematic item to aPlotter.
Definition: sch_text.cpp:700
PINSHEETLABEL_SHAPE m_shape
Definition: sch_text.h:260
virtual void MirrorSpinStyle(bool aLeftRight)
Definition: sch_text.cpp:321
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:1059
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
Definition: sch_text.cpp:851
SCH_HIERLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_text.cpp:1548
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:975
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:330
SEARCH_RESULT
Definition: eda_item.h:41
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_text.cpp:1729
void SetPosition(const wxPoint &aPosition) override
Definition: sch_text.h:242
void Rotate90(bool aClockwise) override
Definition: sch_text.cpp:1106
SCH_TEXT(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXT_T)
Definition: sch_text.cpp:215
bool IsConnectable() const override
Definition: sch_text.h:472
SCH_LABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:835
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:154
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:981
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:674
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:291
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: sch_text.cpp:746
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:430
PINSHEETLABEL_SHAPE GetShape() const
Definition: sch_text.h:161
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:492
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112