KiCad PCB EDA Suite
sch_label.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-2023 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 SCH_LABEL_H
26#define SCH_LABEL_H
27
28#include <sch_text.h>
29#include <sch_item.h>
30#include <sch_field.h>
31#include <sch_connection.h> // for CONNECTION_TYPE
32
33
35{
36public:
37 SCH_LABEL_BASE( const VECTOR2I& aPos, const wxString& aText, KICAD_T aType );
38
39 SCH_LABEL_BASE( const SCH_LABEL_BASE& aLabel );
40
41 // Abstract class
42 virtual wxString GetClass() const override = 0;
43
44 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override;
45
46 void SwapData( SCH_ITEM* aItem ) override;
47
48 bool CanConnect( const SCH_ITEM* aItem ) const override
49 {
50 switch( aItem->Type() )
51 {
52 case SCH_LINE_T:
53 return aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS;
54
56 return true;
57
58 case SCH_SYMBOL_T:
59 return true;
60
61 case SCH_LABEL_T:
65 case SCH_SHEET_PIN_T:
66 return true;
67
68 default:
69 return false;
70 }
71 }
72
73 LABEL_FLAG_SHAPE GetShape() const override { return m_shape; }
74 void SetShape( LABEL_FLAG_SHAPE aShape ) override { m_shape = aShape; }
75
76 COLOR4D GetLabelColor() const;
77
78 void SetLastResolvedState( const SCH_ITEM* aItem ) override
79 {
80 const SCH_LABEL_BASE* aLabel = dynamic_cast<const SCH_LABEL_BASE*>( aItem );
81
82 if( aLabel )
84 }
85
86 static const wxString GetDefaultFieldName( const wxString& aName, bool aUseDefaultName );
87
88 virtual int GetMandatoryFieldCount() { return 0; }
89
90 std::vector<SCH_FIELD>& GetFields() { return m_fields; }
91 const std::vector<SCH_FIELD>& GetFields() const { return m_fields; }
92
98 void SetFields( const std::vector<SCH_FIELD>& aFields )
99 {
100 m_fields = aFields; // vector copying, length is changed possibly
101 }
102
108 bool IncrementLabel( int aIncrement );
109
110 void Move( const VECTOR2I& aMoveVector ) override
111 {
112 SCH_TEXT::Move( aMoveVector );
113
114 for( SCH_FIELD& field : m_fields )
115 field.Offset( aMoveVector );
116 }
117
118 void Rotate( const VECTOR2I& aCenter ) override;
119 void Rotate90( bool aClockwise ) override;
120
121 void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
122
127 void GetIntersheetRefs( std::vector<std::pair<wxString, wxString>>* pages );
128
132 void GetContextualTextVars( wxArrayString* aVars ) const;
133
139 virtual bool ResolveTextVar( wxString* token, int aDepth ) const;
140
141 wxString GetShownText( int aDepth = 0, bool aAllowExtraText = true ) const override;
142
143 void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
144
145 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
146 const std::vector<KICAD_T>& scanTypes ) override;
147
148 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
149 bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) override;
150
151 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
152
159 virtual void CreateGraphicShape( const RENDER_SETTINGS* aSettings,
160 std::vector<VECTOR2I>& aPoints, const VECTOR2I& Pos ) const
161 {
162 aPoints.clear();
163 }
164
165 int GetLabelBoxExpansion( const RENDER_SETTINGS* aSettings = nullptr ) const;
166
170 virtual const BOX2I GetBodyBoundingBox() const;
171
175 const BOX2I GetBoundingBox() const override;
176
177 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
178 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
179
180 std::vector<VECTOR2I> GetConnectionPoints() const override;
181
182 void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
183
184 bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
185 const SCH_SHEET_PATH* aPath = nullptr ) override;
186
187 bool IsDangling() const override { return m_isDangling; }
188 void SetIsDangling( bool aIsDangling ) { m_isDangling = aIsDangling; }
189
190 void ViewGetLayers( int aLayers[], int& aCount ) const override;
191
192 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
193
194 void Plot( PLOTTER* aPlotter, bool aBackground ) const override;
195
196 void Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
197
202 bool AutoRotateOnPlacement() const;
203
209 void SetAutoRotateOnPlacement( bool autoRotate = true );
210
216 virtual bool AutoRotateOnPlacementSupported() const = 0;
217
218protected:
219 std::vector<SCH_FIELD> m_fields;
220
222
226
228};
229
230
232{
233public:
234 SCH_LABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString );
235
236 // Do not create a copy constructor. The one generated by the compiler is adequate.
237
239
240 static inline bool ClassOf( const EDA_ITEM* aItem )
241 {
242 return aItem && SCH_LABEL_T == aItem->Type();
243 }
244
245 wxString GetClass() const override
246 {
247 return wxT( "SCH_LABEL" );
248 }
249
250 const BOX2I GetBodyBoundingBox() const override;
251
252 bool IsConnectable() const override { return true; }
253
254 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
255
256 BITMAPS GetMenuImage() const override;
257
258 bool IsReplaceable() const override { return true; }
259
260 EDA_ITEM* Clone() const override
261 {
262 return new SCH_LABEL( *this );
263 }
264
265 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
266 {
267 return m_isDangling && GetPosition() == aPos;
268 }
269
270 bool AutoRotateOnPlacementSupported() const override { return false; }
271
272private:
273 bool doIsConnected( const VECTOR2I& aPosition ) const override
274 {
275 return EDA_TEXT::GetTextPos() == aPosition;
276 }
277};
278
279
281{
282public:
283 SCH_DIRECTIVE_LABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ) );
284
285 SCH_DIRECTIVE_LABEL( const SCH_DIRECTIVE_LABEL& aClassLabel );
286
288
289 static inline bool ClassOf( const EDA_ITEM* aItem )
290 {
291 return aItem && SCH_DIRECTIVE_LABEL_T == aItem->Type();
292 }
293
294 wxString GetClass() const override
295 {
296 return wxT( "SCH_DIRECTIVE_LABEL" );
297 }
298
299 EDA_ITEM* Clone() const override
300 {
301 return new SCH_DIRECTIVE_LABEL( *this );
302 }
303
304 void SwapData( SCH_ITEM* aItem ) override;
305
306 int GetPinLength() const { return m_pinLength; }
307 void SetPinLength( int aLength ) { m_pinLength = aLength; }
308
309 int GetPenWidth() const override;
310
311 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
312 const VECTOR2I& aPos ) const override;
313
314 void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
315
316 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
317
318 bool IsConnectable() const override { return true; }
319
320 bool AutoRotateOnPlacementSupported() const override { return false; }
321
322private:
325};
326
327
329{
330public:
331 SCH_GLOBALLABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString );
332
333 SCH_GLOBALLABEL( const SCH_GLOBALLABEL& aGlobalLabel );
334
336
337 static inline bool ClassOf( const EDA_ITEM* aItem )
338 {
339 return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
340 }
341
342 wxString GetClass() const override
343 {
344 return wxT( "SCH_GLOBALLABEL" );
345 }
346
347 EDA_ITEM* Clone() const override
348 {
349 return new SCH_GLOBALLABEL( *this );
350 }
351
352 int GetMandatoryFieldCount() override { return 1; }
353
354 void MirrorSpinStyle( bool aLeftRight ) override;
355
356 void MirrorHorizontally( int aCenter ) override;
357 void MirrorVertically( int aCenter ) override;
358
359 void SetTextSpinStyle( TEXT_SPIN_STYLE aSpinStyle ) override;
360
361 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
362
363 void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings, std::vector<VECTOR2I>& aPoints,
364 const VECTOR2I& aPos ) const override;
365
366 bool ResolveTextVar( wxString* token, int aDepth ) const override;
367
368 bool IsConnectable() const override { return true; }
369
370 void ViewGetLayers( int aLayers[], int& aCount ) const override;
371
372 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
373
374 BITMAPS GetMenuImage() const override;
375
376 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
377 {
378 return m_isDangling && GetPosition() == aPos;
379 }
380
381 bool AutoRotateOnPlacementSupported() const override { return true; }
382
383private:
384 bool doIsConnected( const VECTOR2I& aPosition ) const override
385 {
386 return EDA_TEXT::GetTextPos() == aPosition;
387 }
388};
389
390
392{
393public:
394 SCH_HIERLABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString,
395 KICAD_T aType = SCH_HIER_LABEL_T );
396
397 // Do not create a copy constructor. The one generated by the compiler is adequate.
398
400
401 static inline bool ClassOf( const EDA_ITEM* aItem )
402 {
403 return aItem && SCH_HIER_LABEL_T == aItem->Type();
404 }
405
406 wxString GetClass() const override
407 {
408 return wxT( "SCH_HIERLABEL" );
409 }
410
411 void SetTextSpinStyle( TEXT_SPIN_STYLE aSpinStyle ) override;
412
413 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
414
415 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
416 const VECTOR2I& aPos ) const override;
417 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
418 const VECTOR2I& aPos, LABEL_FLAG_SHAPE aShape ) const;
419
420 const BOX2I GetBodyBoundingBox() const override;
421
422 bool IsConnectable() const override { return true; }
423
424 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
425
426 BITMAPS GetMenuImage() const override;
427
428 EDA_ITEM* Clone() const override
429 {
430 return new SCH_HIERLABEL( *this );
431 }
432
433 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
434 {
435 return m_isDangling && GetPosition() == aPos;
436 }
437
438 bool AutoRotateOnPlacementSupported() const override { return true; }
439
440private:
441 bool doIsConnected( const VECTOR2I& aPosition ) const override
442 {
443 return EDA_TEXT::GetTextPos() == aPosition;
444 }
445};
446
447#endif /* SCH_LABEL_H */
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
const VECTOR2I & GetTextPos() const
Definition: eda_text.h:208
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:102
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Base plotter engine class.
Definition: plotter.h:110
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_label.cpp:1114
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_label.cpp:1212
SCH_DIRECTIVE_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0))
Definition: sch_label.cpp:1103
bool IsConnectable() const override
Definition: sch_label.h:318
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:289
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_label.cpp:1143
int GetPenWidth() const override
Definition: sch_label.cpp:1132
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:320
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:294
void SetPinLength(int aLength)
Definition: sch_label.h:307
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:299
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_label.cpp:1262
int GetPinLength() const
Definition: sch_label.h:306
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:51
bool IsConnectable() const override
Definition: sch_label.h:368
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_label.cpp:1464
void CreateGraphicShape(const RENDER_SETTINGS *aRenderSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_label.cpp:1476
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:337
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_label.cpp:1397
bool ResolveTextVar(wxString *token, int aDepth) const override
Resolve any references to system tokens supported by the label.
Definition: sch_label.cpp:1413
int GetMandatoryFieldCount() override
Definition: sch_label.h:352
void MirrorSpinStyle(bool aLeftRight) override
Definition: sch_label.cpp:1339
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:384
VECTOR2I 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_label.cpp:1300
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_label.cpp:1544
SCH_GLOBALLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_label.cpp:1277
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:381
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:347
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:376
void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_label.cpp:1332
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:342
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:1550
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_label.cpp:1367
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:441
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:401
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:406
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:1604
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_label.cpp:1572
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:428
SCH_HIERLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_label.cpp:1556
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:1684
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:433
bool IsConnectable() const override
Definition: sch_label.h:422
VECTOR2I 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_label.cpp:1657
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_label.cpp:1677
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:438
void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_label.cpp:1565
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:246
void SetLastResolvedState(const SCH_ITEM *aItem) override
Definition: sch_label.h:78
SCH_LABEL_BASE(const VECTOR2I &aPos, const wxString &aText, KICAD_T aType)
Definition: sch_label.cpp:155
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_label.cpp:683
COLOR4D m_lastResolvedColor
Definition: sch_label.h:227
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_label.h:110
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
Definition: sch_label.h:98
void SetIsDangling(bool aIsDangling)
Definition: sch_label.h:188
bool m_isDangling
Definition: sch_label.h:224
bool IsDangling() const override
Definition: sch_label.h:187
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< 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_label.cpp:645
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_label.cpp:629
const std::vector< SCH_FIELD > & GetFields() const
Definition: sch_label.h:91
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: sch_label.cpp:752
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_label.cpp:670
bool AutoRotateOnPlacement() const
autoRotateOnPlacement
Definition: sch_label.cpp:1043
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_label.cpp:294
wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const override
Return the string actually shown after processing of the base text.
Definition: sch_label.cpp:598
std::vector< SCH_FIELD > m_fields
Definition: sch_label.h:219
CONNECTION_TYPE m_connectionType
Definition: sch_label.h:223
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_label.cpp:241
void GetIntersheetRefs(std::vector< std::pair< wxString, wxString > > *pages)
Builds an array of { pageNumber, pageName } pairs.
Definition: sch_label.cpp:447
virtual bool ResolveTextVar(wxString *token, int aDepth) const
Resolve any references to system tokens supported by the label.
Definition: sch_label.cpp:495
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_label.cpp:677
COLOR4D GetLabelColor() const
Definition: sch_label.cpp:263
const BOX2I GetBoundingBox() const override
Return the bounding box of the label including its fields.
Definition: sch_label.cpp:727
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: sch_label.cpp:196
virtual bool AutoRotateOnPlacementSupported() const =0
AutoRotateOnPlacementSupported.
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_label.h:48
bool m_autoRotateOnPlacement
Definition: sch_label.h:225
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &offset) override
Print a schematic item.
Definition: sch_label.cpp:1017
int GetLabelBoxExpansion(const RENDER_SETTINGS *aSettings=nullptr) const
Definition: sch_label.cpp:694
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_label.cpp:362
void SetAutoRotateOnPlacement(bool autoRotate=true)
setAutoRotateOnPlacement
Definition: sch_label.cpp:1048
void Rotate90(bool aClockwise) override
Definition: sch_label.cpp:309
void SetShape(LABEL_FLAG_SHAPE aShape) override
Definition: sch_label.h:74
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_label.cpp:813
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_label.cpp:888
static const wxString GetDefaultFieldName(const wxString &aName, bool aUseDefaultName)
Definition: sch_label.cpp:183
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_label.cpp:376
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
Definition: sch_label.cpp:622
LABEL_FLAG_SHAPE GetShape() const override
Definition: sch_label.h:73
virtual int GetMandatoryFieldCount()
Definition: sch_label.h:88
LABEL_FLAG_SHAPE m_shape
Definition: sch_label.h:221
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this label.
Definition: sch_label.cpp:482
virtual const BOX2I GetBodyBoundingBox() const
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:709
virtual void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &Pos) const
Calculate the graphic shape (a polygon) associated to the text.
Definition: sch_label.h:159
std::vector< SCH_FIELD > & GetFields()
Definition: sch_label.h:90
virtual wxString GetClass() const override=0
Return the class name.
VECTOR2I 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_label.cpp:274
void Plot(PLOTTER *aPlotter, bool aBackground) const override
Plot the schematic item to aPlotter.
Definition: sch_label.cpp:946
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
Definition: sch_label.cpp:635
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:270
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_label.cpp:1091
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:245
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:273
SCH_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_label.cpp:1053
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:260
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:265
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:1062
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:1097
~SCH_LABEL()
Definition: sch_label.h:238
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_label.h:258
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:240
bool IsConnectable() const override
Definition: sch_label.h:252
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_text.h:173
VECTOR2I GetPosition() const override
Definition: sch_text.h:203
INSPECT_RESULT
Definition: eda_item.h:42
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:78
@ LAYER_WIRE
Definition: layer_ids.h:344
@ LAYER_BUS
Definition: layer_ids.h:345
CONNECTION_TYPE
LABEL_FLAG_SHAPE
Definition: sch_text.h:96
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_LINE_T
Definition: typeinfo.h:146
@ SCH_SYMBOL_T
Definition: typeinfo.h:156
@ SCH_DIRECTIVE_LABEL_T
Definition: typeinfo.h:154
@ SCH_LABEL_T
Definition: typeinfo.h:151
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:153
@ SCH_SHEET_PIN_T
Definition: typeinfo.h:157
@ SCH_BUS_WIRE_ENTRY_T
Definition: typeinfo.h:144
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:152
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590