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  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
236 
237  BITMAPS GetMenuImage() const override;
238 
239  wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
240  void SetPosition( const wxPoint& aPosition ) override { EDA_TEXT::SetTextPos( aPosition ); }
241 
242  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
243  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
244 
245  void Plot( PLOTTER* aPlotter ) const override;
246 
247  EDA_ITEM* Clone() const override;
248 
249  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
250 
251 #if defined(DEBUG)
252  void Show( int nestLevel, std::ostream& os ) const override;
253 #endif
254 
255  static HTML_MESSAGE_BOX* ShowSyntaxHelp( wxWindow* aParentWindow );
256 
257 protected:
259 
263 
265 
277 };
278 
279 
280 class SCH_LABEL : public SCH_TEXT
281 {
282 public:
283  SCH_LABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
284 
285  // Do not create a copy constructor. The one generated by the compiler is adequate.
286 
288 
289  static inline bool ClassOf( const EDA_ITEM* aItem )
290  {
291  return aItem && SCH_LABEL_T == aItem->Type();
292  }
293 
294  wxString GetClass() const override
295  {
296  return wxT( "SCH_LABEL" );
297  }
298 
299  bool IsType( const KICAD_T aScanTypes[] ) const override;
300 
301  const EDA_RECT GetBoundingBox() const override;
302 
303  bool IsConnectable() const override { return true; }
304 
305  bool CanConnect( const SCH_ITEM* aItem ) const override
306  {
307  return aItem->Type() == SCH_LINE_T &&
308  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
309  }
310 
311  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
312 
313  BITMAPS GetMenuImage() const override;
314 
315  bool IsReplaceable() const override { return true; }
316 
317  EDA_ITEM* Clone() const override;
318 
319  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
320  {
321  return m_isDangling && GetPosition() == aPos;
322  }
323 
324 private:
325  bool doIsConnected( const wxPoint& aPosition ) const override
326  {
327  return EDA_TEXT::GetTextPos() == aPosition;
328  }
329 };
330 
331 
332 class SCH_GLOBALLABEL : public SCH_TEXT
333 {
334 public:
335  SCH_GLOBALLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
336 
337  SCH_GLOBALLABEL( const SCH_GLOBALLABEL& aGlobalLabel );
338 
340 
341  static inline bool ClassOf( const EDA_ITEM* aItem )
342  {
343  return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
344  }
345 
346  wxString GetClass() const override
347  {
348  return wxT( "SCH_GLOBALLABEL" );
349  }
350 
351  EDA_ITEM* Clone() const override;
352 
353  void SwapData( SCH_ITEM* aItem ) override;
354 
355  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
356 
357  void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
358 
359  void Rotate( const wxPoint& aCenter ) override;
360  void Rotate90( bool aClockwise ) override;
361  void MirrorSpinStyle( bool aLeftRight ) override;
362 
363  void MirrorHorizontally( int aCenter ) override;
364  void MirrorVertically( int aCenter ) override;
365 
366  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
367 
368  wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
369 
374  const EDA_RECT GetBoundingBoxBase() const;
375 
379  const EDA_RECT GetBoundingBox() const override;
380 
386  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
387  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
388 
389  void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings,
390  std::vector<wxPoint>& aPoints, const wxPoint& aPos ) const override;
391 
393  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
394 
395  bool ResolveTextVar( wxString* token, int aDepth ) const;
396 
397  bool IsConnectable() const override { return true; }
398 
399  bool CanConnect( const SCH_ITEM* aItem ) const override
400  {
401  return aItem->Type() == SCH_LINE_T &&
402  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
403  }
404 
405  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
406 
407  BITMAPS GetMenuImage() const override;
408 
409  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
410 
411  void Plot( PLOTTER* aPlotter ) const override;
412 
414  void SetIntersheetRefs( const SCH_FIELD& aField ) { m_intersheetRefsField = aField; }
415 
416  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
417  {
418  return m_isDangling && GetPosition() == aPos;
419  }
420 
421  void Move( const wxPoint& aMoveVector ) override
422  {
423  SCH_TEXT::Move( aMoveVector );
424  m_intersheetRefsField.Move( aMoveVector );
425  }
426 
427 private:
428  bool doIsConnected( const wxPoint& aPosition ) const override
429  {
430  return EDA_TEXT::GetTextPos() == aPosition;
431  }
432 
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( const 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( const RENDER_SETTINGS* aSettings ) const override;
462 
463  void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
464  const wxPoint& aPos ) const override;
465  void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
466  const wxPoint& aPos, PINSHEETLABEL_SHAPE aShape ) const;
467 
468  const EDA_RECT GetBoundingBox() const override;
469 
470  bool IsConnectable() const override { return true; }
471 
472  bool CanConnect( const SCH_ITEM* aItem ) const override
473  {
474  return aItem->Type() == SCH_LINE_T &&
475  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
476  }
477 
478  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
479 
480  BITMAPS GetMenuImage() const override;
481 
482  EDA_ITEM* Clone() const override;
483 
484  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
485  {
486  return m_isDangling && GetPosition() == aPos;
487  }
488 
489 private:
490  bool doIsConnected( const wxPoint& aPosition ) const override
491  {
492  return EDA_TEXT::GetTextPos() == aPosition;
493  }
494 };
495 
496 #endif /* CLASS_TEXT_LABEL_H */
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_text.cpp:281
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:1393
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_field.h:147
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
Definition: sch_text.cpp:998
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:365
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_text.h:315
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_text.cpp:1070
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:305
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:421
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:1289
LABEL_SPIN_STYLE m_spin_style
The orientation of text and any associated drawing elements of derived objects.
Definition: sch_text.h:276
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:1004
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:262
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:1461
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:673
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:1310
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:661
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:909
CONNECTION_TYPE
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1582
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:921
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:264
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:1473
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:248
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:94
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:1126
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:1712
constexpr LABEL_SPIN_STYLE(SPIN aSpin)
Definition: sch_text.h:55
int GetPenWidth() const override
Definition: sch_text.cpp:430
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:580
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:835
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:1236
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_text.cpp:290
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:454
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:230
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:1535
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:325
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:1686
const char * SheetLabelType[]
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_text.cpp:236
LABEL_SPIN_STYLE()=default
void SetIntersheetRefs(const SCH_FIELD &aField)
Definition: sch_text.h:414
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_text.cpp:272
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:1541
const EDA_RECT GetBoundingBox() const override
Return the bounding box on the global label only, including the intersheet references.
Definition: sch_text.cpp:1443
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:445
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:1602
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:1634
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:159
int GetTextOffset(const RENDER_SETTINGS *aSettings=nullptr) const
Definition: sch_text.cpp:396
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:973
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:545
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:1181
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_text.cpp:590
wxPoint GetPosition() const override
Definition: sch_text.h:239
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:436
LABEL_SPIN_STYLE MirrorY()
Mirror the label spin style across the Y axis or simply swaps left and right.
Definition: sch_text.cpp:188
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:294
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_text.cpp:1169
bool IsConnectable() const override
Definition: sch_text.h:303
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:449
LABEL_SPIN_STYLE RotateCCW()
Definition: sch_text.cpp:154
virtual void Rotate90(bool aClockwise)
Definition: sch_text.cpp:302
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:257
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_text.cpp:1151
EDA_UNITS
Definition: eda_units.h:38
~SCH_LABEL()
Definition: sch_text.h:287
SCH_FIELD * GetIntersheetRefs()
Definition: sch_text.h:413
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:915
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:472
Base plotter engine class.
Definition: plotter.h:121
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_text.cpp:376
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Definition: sch_text.cpp:1718
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:341
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:171
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:346
LABEL_SPIN_STYLE RotateCW()
Definition: sch_text.cpp:137
SCH_FIELD m_intersheetRefsField
Definition: sch_text.h:433
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:1321
bool IsConnectable() const override
Definition: sch_text.h:397
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_text.cpp:535
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:319
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:416
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:361
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:484
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:413
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:399
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_text.cpp:1193
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:456
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:881
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:1467
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:693
PINSHEETLABEL_SHAPE m_shape
Definition: sch_text.h:258
virtual void MirrorSpinStyle(bool aLeftRight)
Definition: sch_text.cpp:311
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:1036
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
Definition: sch_text.cpp:841
SCH_HIERLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_text.cpp:1525
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:952
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:320
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:1706
void SetPosition(const wxPoint &aPosition) override
Definition: sch_text.h:240
void Rotate90(bool aClockwise) override
Definition: sch_text.cpp:1083
SCH_TEXT(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXT_T)
Definition: sch_text.cpp:205
bool IsConnectable() const override
Definition: sch_text.h:470
SCH_LABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:825
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:958
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:667
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:289
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:739
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:428
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:490
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113