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  {
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( "MirrorVertically 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( "MirrorHorizontally encountered unknown current spin style" ); break;
139  }
140 
141  return LABEL_SPIN_STYLE( newSpin );
142  }
143 
144 private:
146 };
147 
148 /*
149  * Shape/Type of #SCH_HIERLABEL and #SCH_GLOBALLABEL.
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 public:
168  SCH_TEXT( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
169  KICAD_T aType = SCH_TEXT_T );
170 
177  SCH_TEXT( const SCH_TEXT& aText );
178 
179  ~SCH_TEXT() { }
180 
181  static inline bool ClassOf( const EDA_ITEM* aItem )
182  {
183  return aItem && SCH_TEXT_T == aItem->Type();
184  }
185 
186  virtual wxString GetClass() const override
187  {
188  return wxT( "SCH_TEXT" );
189  }
190 
196  void GetContextualTextVars( wxArrayString* aVars ) const;
197 
198  wxString GetShownText( int aDepth = 0 ) const override;
199 
205  bool IncrementLabel( int aIncrement );
206 
214  virtual void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle );
216 
218 
219  void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; }
220 
227  virtual wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const;
228 
229  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
230 
237  virtual void CreateGraphicShape( const RENDER_SETTINGS* aSettings,
238  std::vector<wxPoint>& aPoints, const wxPoint& Pos ) const
239  {
240  aPoints.clear();
241  }
242 
243  void SwapData( SCH_ITEM* aItem ) override;
244 
245  const EDA_RECT GetBoundingBox() const override;
246 
247  bool operator<( const SCH_ITEM& aItem ) const override;
248 
249  int GetTextOffset( const RENDER_SETTINGS* aSettings = nullptr ) const;
250 
251  int GetPenWidth() const override;
252 
253  // Geometric transforms (used in block operations):
254 
255  void Move( const wxPoint& aMoveVector ) override
256  {
257  EDA_TEXT::Offset( aMoveVector );
258  }
259 
260  void MirrorHorizontally( int aCenter ) override;
261  void MirrorVertically( int aCenter ) override;
262  void Rotate( wxPoint aCenter ) override;
263 
264  virtual void Rotate90( bool aClockwise );
265  virtual void MirrorSpinStyle( bool aLeftRight );
266 
267  bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
268  {
269  return SCH_ITEM::Matches( GetText(), aSearchData );
270  }
271 
272  bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData ) override
273  {
274  return EDA_TEXT::Replace( aSearchData );
275  }
276 
277  virtual bool IsReplaceable() const override { return true; }
278 
279  void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
280 
281  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
282  const SCH_SHEET_PATH* aPath = nullptr ) override;
283 
284  bool IsDangling() const override { return m_isDangling; }
285  void SetIsDangling( bool aIsDangling ) { m_isDangling = aIsDangling; }
286 
287  std::vector<wxPoint> GetConnectionPoints() const override;
288 
289  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
290 
291  BITMAPS GetMenuImage() const override;
292 
293  wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
294  void SetPosition( const wxPoint& aPosition ) override { EDA_TEXT::SetTextPos( aPosition ); }
295 
296  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
297  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
298 
299  void Plot( PLOTTER* aPlotter ) const override;
300 
301  EDA_ITEM* Clone() const override;
302 
303  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
304 
305 #if defined(DEBUG)
306  void Show( int nestLevel, std::ostream& os ) const override;
307 #endif
308 
309  static HTML_MESSAGE_BOX* ShowSyntaxHelp( wxWindow* aParentWindow );
310 
311 protected:
313 
317 
319 
331 };
332 
333 
334 class SCH_LABEL : public SCH_TEXT
335 {
336 public:
337  SCH_LABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
338 
339  // Do not create a copy constructor. The one generated by the compiler is adequate.
340 
342 
343  static inline bool ClassOf( const EDA_ITEM* aItem )
344  {
345  return aItem && SCH_LABEL_T == aItem->Type();
346  }
347 
348  wxString GetClass() const override
349  {
350  return wxT( "SCH_LABEL" );
351  }
352 
353  bool IsType( const KICAD_T aScanTypes[] ) const override;
354 
355  const EDA_RECT GetBoundingBox() const override;
356 
357  bool IsConnectable() const override { return true; }
358 
359  bool CanConnect( const SCH_ITEM* aItem ) const override
360  {
361  return aItem->Type() == SCH_LINE_T &&
362  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
363  }
364 
365  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
366 
367  BITMAPS GetMenuImage() const override;
368 
369  bool IsReplaceable() const override { return true; }
370 
371  EDA_ITEM* Clone() const override;
372 
373  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
374  {
375  return m_isDangling && GetPosition() == aPos;
376  }
377 
378 private:
379  bool doIsConnected( const wxPoint& aPosition ) const override
380  {
381  return EDA_TEXT::GetTextPos() == aPosition;
382  }
383 };
384 
385 
386 class SCH_GLOBALLABEL : public SCH_TEXT
387 {
388 public:
389  SCH_GLOBALLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
390 
391  SCH_GLOBALLABEL( const SCH_GLOBALLABEL& aGlobalLabel );
392 
394 
395  static inline bool ClassOf( const EDA_ITEM* aItem )
396  {
397  return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
398  }
399 
400  wxString GetClass() const override
401  {
402  return wxT( "SCH_GLOBALLABEL" );
403  }
404 
405  EDA_ITEM* Clone() const override;
406 
407  void SwapData( SCH_ITEM* aItem ) override;
408 
409  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
410 
411  void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
412 
413  void Rotate( wxPoint aCenter ) override;
414  void Rotate90( bool aClockwise ) override;
415  void MirrorSpinStyle( bool aLeftRight ) override;
416 
417  void MirrorHorizontally( int aCenter ) override;
418  void MirrorVertically( int aCenter ) override;
419 
420  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
421 
422  wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
423 
428  const EDA_RECT GetBoundingBoxBase() const;
429 
433  const EDA_RECT GetBoundingBox() const override;
434 
435  void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings,
436  std::vector<wxPoint>& aPoints, const wxPoint& aPos ) const override;
437 
439  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
440 
441  bool ResolveTextVar( wxString* token, int aDepth ) const;
442 
443  bool IsConnectable() const override { return true; }
444 
445  bool CanConnect( const SCH_ITEM* aItem ) const override
446  {
447  return aItem->Type() == SCH_LINE_T &&
448  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
449  }
450 
451  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
452 
453  BITMAPS GetMenuImage() const override;
454 
455  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
456 
457  void Plot( PLOTTER* aPlotter ) const override;
458 
460  void SetIntersheetRefs( const SCH_FIELD& aField ) { m_intersheetRefsField = aField; }
461 
462  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
463  {
464  return m_isDangling && GetPosition() == aPos;
465  }
466 
467  void Move( const wxPoint& aMoveVector ) override
468  {
469  SCH_TEXT::Move( aMoveVector );
470  m_intersheetRefsField.Move( aMoveVector );
471  }
472 
473 private:
474  bool doIsConnected( const wxPoint& aPosition ) const override
475  {
476  return EDA_TEXT::GetTextPos() == aPosition;
477  }
478 
480 };
481 
482 
483 class SCH_HIERLABEL : public SCH_TEXT
484 {
485 public:
486  SCH_HIERLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
487  KICAD_T aType = SCH_HIER_LABEL_T );
488 
489  // Do not create a copy constructor. The one generated by the compiler is adequate.
490 
492 
493  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
494 
495  static inline bool ClassOf( const EDA_ITEM* aItem )
496  {
497  return aItem && SCH_HIER_LABEL_T == aItem->Type();
498  }
499 
500  wxString GetClass() const override
501  {
502  return wxT( "SCH_HIERLABEL" );
503  }
504 
505  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
506 
507  wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
508 
509  void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
510  const wxPoint& aPos ) const override;
511  void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
512  const wxPoint& aPos, PINSHEETLABEL_SHAPE aShape ) const;
513 
514  const EDA_RECT GetBoundingBox() const override;
515 
516  bool IsConnectable() const override { return true; }
517 
518  bool CanConnect( const SCH_ITEM* aItem ) const override
519  {
520  return aItem->Type() == SCH_LINE_T &&
521  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
522  }
523 
524  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
525 
526  BITMAPS GetMenuImage() const override;
527 
528  EDA_ITEM* Clone() const override;
529 
530  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
531  {
532  return m_isDangling && GetPosition() == aPos;
533  }
534 
535 private:
536  bool doIsConnected( const wxPoint& aPosition ) const override
537  {
538  return EDA_TEXT::GetTextPos() == aPosition;
539  }
540 };
541 
542 #endif /* CLASS_TEXT_LABEL_H */
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_text.cpp:209
bool IsDangling() const override
Definition: sch_text.h:284
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:1301
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_field.h:148
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
Definition: sch_text.cpp:910
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:50
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:259
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:219
virtual bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition: eda_item.h:415
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_text.h:369
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:359
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:467
virtual bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_text.h:277
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1199
LABEL_SPIN_STYLE m_spin_style
The orientation of text and any associated drawing elements of derived objects.
Definition: sch_text.h:330
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:916
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:316
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:1369
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: sch_text.cpp:582
bool Replace(const wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:178
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_text.h:267
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:253
void Plot(PLOTTER *aPlotter) const override
Plot the schematic item to aPlotter.
Definition: sch_text.cpp:1219
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:570
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:821
CONNECTION_TYPE
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1438
void SetIsDangling(bool aIsDangling)
Definition: sch_text.h:285
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.
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:272
CONNECTION_TYPE m_connectionType
Definition: sch_text.h:318
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:176
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:95
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:1038
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:1567
constexpr LABEL_SPIN_STYLE(SPIN aSpin)
Definition: sch_text.h:55
int GetPenWidth() const override
Definition: sch_text.cpp:341
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:119
void GetContextualTextVars(wxArrayString *aVars) const
Returns the set of contextual text variable tokens for this text item.
Definition: sch_text.cpp:498
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:747
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:255
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: sch_text.cpp:1148
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:500
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:158
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:1391
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:379
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:1541
const char * SheetLabelType[]
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_text.cpp:164
LABEL_SPIN_STYLE()=default
void SetIntersheetRefs(const SCH_FIELD &aField)
Definition: sch_text.h:460
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_text.cpp:200
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:1397
const EDA_RECT GetBoundingBox() const override
Return the bounding box on the global label only, including the intersheet references.
Definition: sch_text.cpp:1351
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:356
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:1458
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:1489
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:215
int GetTextOffset(const RENDER_SETTINGS *aSettings=nullptr) const
Definition: sch_text.cpp:324
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:885
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:463
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
HTML_MESSAGE_BOX.
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:181
void UpdateIntersheetRefProps()
Definition: sch_text.cpp:1093
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_text.cpp:508
wxPoint GetPosition() const override
Definition: sch_text.h:293
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:347
LABEL_SPIN_STYLE MirrorY()
Definition: sch_text.h:128
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:348
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_text.cpp:1081
bool IsConnectable() const override
Definition: sch_text.h:357
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:495
LABEL_SPIN_STYLE RotateCCW()
Definition: sch_text.h:90
virtual void Rotate90(bool aClockwise)
Definition: sch_text.cpp:230
void Rotate(wxPoint aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_text.cpp:218
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_text.cpp:1063
EDA_UNITS
Definition: eda_units.h:38
~SCH_LABEL()
Definition: sch_text.h:341
SCH_FIELD * GetIntersheetRefs()
Definition: sch_text.h:459
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:827
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:237
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:518
void Rotate(wxPoint aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_text.cpp:982
Base plotter engine class.
Definition: plotter.h:121
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_text.cpp:304
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Definition: sch_text.cpp:1573
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:395
PINSHEETLABEL_SHAPE
Definition: sch_text.h:151
LABEL_SPIN_STYLE MirrorX()
Definition: sch_text.h:109
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:400
LABEL_SPIN_STYLE RotateCW()
Definition: sch_text.h:74
SCH_FIELD m_intersheetRefsField
Definition: sch_text.h:479
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:1229
bool IsConnectable() const override
Definition: sch_text.h:443
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_text.cpp:453
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:373
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:462
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:289
virtual wxString GetClass() const override
Return the class name.
Definition: sch_text.h:186
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:530
Handle the component boundary box.
Definition: eda_rect.h:42
~SCH_TEXT()
Definition: sch_text.h:179
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:445
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_text.cpp:1105
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:367
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:793
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:1375
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
void Plot(PLOTTER *aPlotter) const override
Plot the schematic item to aPlotter.
Definition: sch_text.cpp:602
PINSHEETLABEL_SHAPE m_shape
Definition: sch_text.h:312
virtual void MirrorSpinStyle(bool aLeftRight)
Definition: sch_text.cpp:239
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:948
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
Definition: sch_text.cpp:753
SCH_HIERLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_text.cpp:1381
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:864
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:248
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:1561
void SetPosition(const wxPoint &aPosition) override
Definition: sch_text.h:294
void Rotate90(bool aClockwise) override
Definition: sch_text.cpp:995
SCH_TEXT(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXT_T)
Definition: sch_text.cpp:133
bool IsConnectable() const override
Definition: sch_text.h:516
SCH_LABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:737
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:870
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:576
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:343
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: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:474
PINSHEETLABEL_SHAPE GetShape() const
Definition: sch_text.h:217
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:536
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163