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 GetPenWidth() const override;
196 
197  // Geometric transforms (used in block operations):
198 
199  void Move( const wxPoint& aMoveVector ) override
200  {
201  EDA_TEXT::Offset( aMoveVector );
202  }
203 
204  void MirrorHorizontally( int aCenter ) override;
205  void MirrorVertically( int aCenter ) override;
206  void Rotate( const wxPoint& aCenter ) override;
207 
208  virtual void Rotate90( bool aClockwise );
209  virtual void MirrorSpinStyle( bool aLeftRight );
210 
211  bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
212  {
213  return SCH_ITEM::Matches( GetText(), aSearchData );
214  }
215 
216  bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData ) override
217  {
218  return EDA_TEXT::Replace( aSearchData );
219  }
220 
221  virtual bool IsReplaceable() const override { return true; }
222 
223  void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
224 
225  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
226  const SCH_SHEET_PATH* aPath = nullptr ) override;
227 
228  bool IsDangling() const override { return m_isDangling; }
229  void SetIsDangling( bool aIsDangling ) { m_isDangling = aIsDangling; }
230 
231  std::vector<wxPoint> GetConnectionPoints() const override;
232 
233  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
234 
235  BITMAPS GetMenuImage() const override;
236 
237  wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
238  void SetPosition( const wxPoint& aPosition ) override { EDA_TEXT::SetTextPos( aPosition ); }
239 
240  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
241  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
242 
243  void Plot( PLOTTER* aPlotter ) const override;
244 
245  EDA_ITEM* Clone() const override;
246 
247  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
248 
249 #if defined(DEBUG)
250  void Show( int nestLevel, std::ostream& os ) const override;
251 #endif
252 
253  static HTML_MESSAGE_BOX* ShowSyntaxHelp( wxWindow* aParentWindow );
254 
255 protected:
257 
261 
263 
275 };
276 
277 
278 class SCH_LABEL : public SCH_TEXT
279 {
280 public:
281  SCH_LABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
282 
283  // Do not create a copy constructor. The one generated by the compiler is adequate.
284 
286 
287  static inline bool ClassOf( const EDA_ITEM* aItem )
288  {
289  return aItem && SCH_LABEL_T == aItem->Type();
290  }
291 
292  wxString GetClass() const override
293  {
294  return wxT( "SCH_LABEL" );
295  }
296 
297  bool IsType( const KICAD_T aScanTypes[] ) const override;
298 
299  const EDA_RECT GetBoundingBox() const override;
300 
301  bool IsConnectable() const override { return true; }
302 
303  bool CanConnect( const SCH_ITEM* aItem ) const override
304  {
305  return aItem->Type() == SCH_LINE_T &&
306  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
307  }
308 
309  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
310 
311  BITMAPS GetMenuImage() const override;
312 
313  bool IsReplaceable() const override { return true; }
314 
315  EDA_ITEM* Clone() const override;
316 
317  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
318  {
319  return m_isDangling && GetPosition() == aPos;
320  }
321 
322 private:
323  bool doIsConnected( const wxPoint& aPosition ) const override
324  {
325  return EDA_TEXT::GetTextPos() == aPosition;
326  }
327 };
328 
329 
330 class SCH_GLOBALLABEL : public SCH_TEXT
331 {
332 public:
333  SCH_GLOBALLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
334 
335  SCH_GLOBALLABEL( const SCH_GLOBALLABEL& aGlobalLabel );
336 
338 
339  static inline bool ClassOf( const EDA_ITEM* aItem )
340  {
341  return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
342  }
343 
344  wxString GetClass() const override
345  {
346  return wxT( "SCH_GLOBALLABEL" );
347  }
348 
349  EDA_ITEM* Clone() const override;
350 
351  void SwapData( SCH_ITEM* aItem ) override;
352 
353  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
354 
355  void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
356 
357  void Rotate( const wxPoint& aCenter ) override;
358  void Rotate90( bool aClockwise ) override;
359  void MirrorSpinStyle( bool aLeftRight ) override;
360 
361  void MirrorHorizontally( int aCenter ) override;
362  void MirrorVertically( int aCenter ) override;
363 
364  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
365 
366  wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
367 
372  const EDA_RECT GetBoundingBoxBase() const;
373 
377  const EDA_RECT GetBoundingBox() const override;
378 
379  void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings,
380  std::vector<wxPoint>& aPoints, const wxPoint& aPos ) const override;
381 
383  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
384 
385  bool ResolveTextVar( wxString* token, int aDepth ) const;
386 
387  bool IsConnectable() const override { return true; }
388 
389  bool CanConnect( const SCH_ITEM* aItem ) const override
390  {
391  return aItem->Type() == SCH_LINE_T &&
392  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
393  }
394 
395  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
396 
397  BITMAPS GetMenuImage() const override;
398 
399  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
400 
401  void Plot( PLOTTER* aPlotter ) const override;
402 
404  void SetIntersheetRefs( const SCH_FIELD& aField ) { m_intersheetRefsField = aField; }
405 
406  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
407  {
408  return m_isDangling && GetPosition() == aPos;
409  }
410 
411  void Move( const wxPoint& aMoveVector ) override
412  {
413  SCH_TEXT::Move( aMoveVector );
414  m_intersheetRefsField.Move( aMoveVector );
415  }
416 
417 private:
418  bool doIsConnected( const wxPoint& aPosition ) const override
419  {
420  return EDA_TEXT::GetTextPos() == aPosition;
421  }
422 
424 };
425 
426 
427 class SCH_HIERLABEL : public SCH_TEXT
428 {
429 public:
430  SCH_HIERLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
431  KICAD_T aType = SCH_HIER_LABEL_T );
432 
433  // Do not create a copy constructor. The one generated by the compiler is adequate.
434 
436 
437  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& offset ) override;
438 
439  static inline bool ClassOf( const EDA_ITEM* aItem )
440  {
441  return aItem && SCH_HIER_LABEL_T == aItem->Type();
442  }
443 
444  wxString GetClass() const override
445  {
446  return wxT( "SCH_HIERLABEL" );
447  }
448 
449  void SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) override;
450 
451  wxPoint GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
452 
453  void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
454  const wxPoint& aPos ) const override;
455  void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<wxPoint>& aPoints,
456  const wxPoint& aPos, PINSHEETLABEL_SHAPE aShape ) const;
457 
458  const EDA_RECT GetBoundingBox() const override;
459 
460  bool IsConnectable() const override { return true; }
461 
462  bool CanConnect( const SCH_ITEM* aItem ) const override
463  {
464  return aItem->Type() == SCH_LINE_T &&
465  ( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
466  }
467 
468  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
469 
470  BITMAPS GetMenuImage() const override;
471 
472  EDA_ITEM* Clone() const override;
473 
474  bool IsPointClickableAnchor( const wxPoint& aPos ) const override
475  {
476  return m_isDangling && GetPosition() == aPos;
477  }
478 
479 private:
480  bool doIsConnected( const wxPoint& aPosition ) const override
481  {
482  return EDA_TEXT::GetTextPos() == aPosition;
483  }
484 };
485 
486 #endif /* CLASS_TEXT_LABEL_H */
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_text.cpp:279
bool IsDangling() const override
Definition: sch_text.h:228
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:1382
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:989
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:252
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:313
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_text.cpp:1061
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:303
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:411
virtual bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_text.h:221
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1278
LABEL_SPIN_STYLE m_spin_style
The orientation of text and any associated drawing elements of derived objects.
Definition: sch_text.h:274
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:995
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:260
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:1450
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:660
bool Replace(const wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:170
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_text.h:211
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:246
void Plot(PLOTTER *aPlotter) const override
Plot the schematic item to aPlotter.
Definition: sch_text.cpp:1299
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:648
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:900
CONNECTION_TYPE
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:1519
void SetIsDangling(bool aIsDangling)
Definition: sch_text.h:229
SCH_GLOBALLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:912
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:216
CONNECTION_TYPE m_connectionType
Definition: sch_text.h:262
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:246
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:1117
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:1649
constexpr LABEL_SPIN_STYLE(SPIN aSpin)
Definition: sch_text.h:55
int GetPenWidth() const override
Definition: sch_text.cpp:411
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:119
void GetContextualTextVars(wxArrayString *aVars) const
Return the set of contextual text variable tokens for this text item.
Definition: sch_text.cpp:567
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:826
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:199
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: sch_text.cpp:1227
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_text.cpp:288
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:444
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:228
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:1472
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:323
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:1623
const char * SheetLabelType[]
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_text.cpp:234
LABEL_SPIN_STYLE()=default
void SetIntersheetRefs(const SCH_FIELD &aField)
Definition: sch_text.h:404
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_text.cpp:270
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:1478
const EDA_RECT GetBoundingBox() const override
Return the bounding box on the global label only, including the intersheet references.
Definition: sch_text.cpp:1432
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:426
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:1539
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:1571
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:159
int GetTextOffset(const RENDER_SETTINGS *aSettings=nullptr) const
Definition: sch_text.cpp:394
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:964
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:532
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:1172
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_text.cpp:577
wxPoint GetPosition() const override
Definition: sch_text.h:237
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
Definition: sch_text.cpp:417
LABEL_SPIN_STYLE MirrorY()
Mirror the label spin style across the Y axis or simply swaps left and right.
Definition: sch_text.cpp:186
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:292
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_text.cpp:1160
bool IsConnectable() const override
Definition: sch_text.h:301
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:439
LABEL_SPIN_STYLE RotateCCW()
Definition: sch_text.cpp:152
virtual void Rotate90(bool aClockwise)
Definition: sch_text.cpp:300
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:1142
EDA_UNITS
Definition: eda_units.h:38
~SCH_LABEL()
Definition: sch_text.h:285
SCH_FIELD * GetIntersheetRefs()
Definition: sch_text.h:403
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:906
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:462
Base plotter engine class.
Definition: plotter.h:121
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_text.cpp:374
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Definition: sch_text.cpp:1655
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:339
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:169
wxString GetClass() const override
Return the class name.
Definition: sch_text.h:344
LABEL_SPIN_STYLE RotateCW()
Definition: sch_text.cpp:135
SCH_FIELD m_intersheetRefsField
Definition: sch_text.h:423
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:1310
bool IsConnectable() const override
Definition: sch_text.h:387
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_text.cpp:522
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:317
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_text.h:406
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_text.cpp:359
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:474
Handle the component boundary box.
Definition: eda_rect.h:42
~SCH_TEXT()
Definition: sch_text.h:123
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_text.h:389
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:1184
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:437
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_text.cpp:872
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:1456
const wxPoint & GetTextPos() const
Definition: eda_text.h:247
void Plot(PLOTTER *aPlotter) const override
Plot the schematic item to aPlotter.
Definition: sch_text.cpp:680
PINSHEETLABEL_SHAPE m_shape
Definition: sch_text.h:256
virtual void MirrorSpinStyle(bool aLeftRight)
Definition: sch_text.cpp:309
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:1027
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
Definition: sch_text.cpp:832
SCH_HIERLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_text.cpp:1462
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_text.cpp:943
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:318
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:1643
void SetPosition(const wxPoint &aPosition) override
Definition: sch_text.h:238
void Rotate90(bool aClockwise) override
Definition: sch_text.cpp:1074
SCH_TEXT(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXT_T)
Definition: sch_text.cpp:203
bool IsConnectable() const override
Definition: sch_text.h:460
SCH_LABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_text.cpp:816
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:949
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_text.cpp:654
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_text.h:287
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:726
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_text.h:418
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:480
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113