KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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
34/*
35 * Spin style for labels of all kinds on schematics
36 * Basically a higher level abstraction of rotation and justification of text
37 */
39{
40public:
41 enum SPIN : int
42 {
43 LEFT = 0,
44 UP = 1,
45 RIGHT = 2,
46 BOTTOM = 3
47 };
48
49
50 SPIN_STYLE() = default;
51 constexpr SPIN_STYLE( SPIN aSpin ) : m_spin( aSpin )
52 {
53 }
54
55 constexpr bool operator==( SPIN a ) const
56 {
57 return m_spin == a;
58 }
59
60 constexpr bool operator!=( SPIN a ) const
61 {
62 return m_spin != a;
63 }
64
65 operator int() const
66 {
67 return static_cast<int>( m_spin );
68 }
69
71
76
81
82private:
84};
85
86
87/*
88 * Label and flag shapes used with text objects.
89 */
91{
97
104
105/*
106 * Specific enums for property manager (not used elsewhere)
107 */
109{
116
118{
124
125
127{
128public:
129 SCH_LABEL_BASE( const VECTOR2I& aPos, const wxString& aText, KICAD_T aType );
130
131 SCH_LABEL_BASE( const SCH_LABEL_BASE& aLabel );
132
133 SCH_LABEL_BASE& operator=( const SCH_LABEL_BASE& aLabel );
134
135 // Abstract class
136 virtual wxString GetClass() const override = 0;
137
138 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override;
139
140 void SwapData( SCH_ITEM* aItem ) override;
141
142 bool CanConnect( const SCH_ITEM* aItem ) const override
143 {
144 switch( aItem->Type() )
145 {
146 case SCH_LINE_T:
147 return aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS;
148
150 return true;
151
152 case SCH_SYMBOL_T:
153 return true;
154
155 case SCH_LABEL_T:
157 case SCH_HIER_LABEL_T:
159 case SCH_SHEET_PIN_T:
160 return true;
161
162 default:
163 return false;
164 }
165 }
166
168 void SetShape( LABEL_FLAG_SHAPE aShape ) { m_shape = aShape; }
169
170 // Type-specific versions for property manager
172 void SetLabelShape( LABEL_SHAPE aShape ) { m_shape = (LABEL_FLAG_SHAPE) aShape; }
173
174 COLOR4D GetLabelColor() const;
175
176 virtual void SetSpinStyle( SPIN_STYLE aSpinStyle );
177 SPIN_STYLE GetSpinStyle() const;
178
179 void SetLastResolvedState( const SCH_ITEM* aItem ) override
180 {
181 const SCH_LABEL_BASE* aLabel = dynamic_cast<const SCH_LABEL_BASE*>( aItem );
182
183 if( aLabel )
185 }
186
187 static const wxString GetDefaultFieldName( const wxString& aName, bool aUseDefaultName );
188
189 virtual int GetMandatoryFieldCount() { return 0; }
190
191 std::vector<SCH_FIELD>& GetFields() { return m_fields; }
192 const std::vector<SCH_FIELD>& GetFields() const { return m_fields; }
193
199 void SetFields( const std::vector<SCH_FIELD>& aFields )
200 {
201 m_fields = aFields; // vector copying, length is changed possibly
202 }
203
204 void AddFields( const std::vector<SCH_FIELD>& aFields )
205 {
206 m_fields.insert( m_fields.end(), aFields.begin(), aFields.end() );
207 }
208
209 void AddField( const SCH_FIELD& aField )
210 {
211 m_fields.push_back( aField );
212 }
213
219 bool IncrementLabel( int aIncrement );
220
221 void Move( const VECTOR2I& aMoveVector ) override;
222 void Rotate( const VECTOR2I& aCenter ) override;
223 void Rotate90( bool aClockwise ) override;
224
225 void MirrorSpinStyle( bool aLeftRight ) override;
226
227 void MirrorHorizontally( int aCenter ) override;
228 void MirrorVertically( int aCenter ) override;
229
230 void SetPosition( const VECTOR2I& aPosition ) override;
231
232 void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
233
238 void GetIntersheetRefs( std::vector<std::pair<wxString, wxString>>* pages );
239
243 void GetContextualTextVars( wxArrayString* aVars ) const;
244
250 virtual bool ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, int aDepth ) const;
251
252 wxString GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraText,
253 int aDepth = 0 ) const override;
254
255 wxString GetShownText( bool aAllowExtraText, int aDepth = 0 ) const override
256 {
257 SCHEMATIC* schematic = Schematic();
258
259 if( schematic )
260 return GetShownText( &schematic->CurrentSheet(), aAllowExtraText, aDepth );
261 else
262 return GetText();
263 }
264
265 bool HasCachedDriverName() const override;
266 const wxString& GetCachedDriverName() const override;
267
268 void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
269
270 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
271 const std::vector<KICAD_T>& scanTypes ) override;
272
273 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
274 bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) override;
275
276 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
277
284 virtual void CreateGraphicShape( const RENDER_SETTINGS* aSettings,
285 std::vector<VECTOR2I>& aPoints, const VECTOR2I& Pos ) const
286 {
287 aPoints.clear();
288 }
289
290 int GetLabelBoxExpansion( const RENDER_SETTINGS* aSettings = nullptr ) const;
291
295 virtual const BOX2I GetBodyBoundingBox() const;
296
300 const BOX2I GetBoundingBox() const override;
301
302 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
303 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
304
305 std::vector<VECTOR2I> GetConnectionPoints() const override;
306
307 void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
308
309 bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemListByType,
310 std::vector<DANGLING_END_ITEM>& aItemListByPos,
311 const SCH_SHEET_PATH* aPath = nullptr ) override;
312
313 bool IsDangling() const override { return m_isDangling; }
314 void SetIsDangling( bool aIsDangling ) { m_isDangling = aIsDangling; }
315
316 void ViewGetLayers( int aLayers[], int& aCount ) const override;
317
318 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
319
320 void Plot( PLOTTER* aPlotter, bool aBackground,
321 const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
322
323 void Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
324
329 bool AutoRotateOnPlacement() const;
330
336 void SetAutoRotateOnPlacement( bool autoRotate = true );
337
343 virtual bool AutoRotateOnPlacementSupported() const = 0;
344
345 double Similarity( const SCH_ITEM& aItem ) const override;
346
347 bool operator==( const SCH_ITEM& aItem ) const override;
348
349protected:
350 void cacheShownText() override;
351
352protected:
353 std::vector<SCH_FIELD> m_fields;
354
356
360
362
364};
365
366
368{
369public:
370 SCH_LABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString );
371
372 // Do not create a copy constructor. The one generated by the compiler is adequate.
373
375
376 static inline bool ClassOf( const EDA_ITEM* aItem )
377 {
378 return aItem && SCH_LABEL_T == aItem->Type();
379 }
380
381 wxString GetClass() const override
382 {
383 return wxT( "SCH_LABEL" );
384 }
385
386 const BOX2I GetBodyBoundingBox() const override;
387
388 bool IsConnectable() const override { return true; }
389
390 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
391
392 BITMAPS GetMenuImage() const override;
393
394 bool IsReplaceable() const override { return true; }
395
396 EDA_ITEM* Clone() const override
397 {
398 return new SCH_LABEL( *this );
399 }
400
401 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
402 {
403 return m_isDangling && GetPosition() == aPos;
404 }
405
406 bool AutoRotateOnPlacementSupported() const override { return false; }
407
408private:
409 bool doIsConnected( const VECTOR2I& aPosition ) const override
410 {
411 return EDA_TEXT::GetTextPos() == aPosition;
412 }
413};
414
415
417{
418public:
419 SCH_DIRECTIVE_LABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ) );
420
421 SCH_DIRECTIVE_LABEL( const SCH_DIRECTIVE_LABEL& aClassLabel );
422
424
425 static inline bool ClassOf( const EDA_ITEM* aItem )
426 {
427 return aItem && SCH_DIRECTIVE_LABEL_T == aItem->Type();
428 }
429
430 wxString GetClass() const override
431 {
432 return wxT( "SCH_DIRECTIVE_LABEL" );
433 }
434
435 EDA_ITEM* Clone() const override
436 {
437 return new SCH_DIRECTIVE_LABEL( *this );
438 }
439
440 void SwapData( SCH_ITEM* aItem ) override;
441
443 void SetFlagShape( FLAG_SHAPE aShape ) { m_shape = (LABEL_FLAG_SHAPE) aShape; }
444
445 int GetPinLength() const { return m_pinLength; }
446 void SetPinLength( int aLength ) { m_pinLength = aLength; }
447
448 int GetPenWidth() const override;
449
450 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
451 const VECTOR2I& aPos ) const override;
452
453 void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
454
455 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
456
457 bool IsConnectable() const override { return true; }
458
459 bool AutoRotateOnPlacementSupported() const override { return false; }
460
461 void MirrorSpinStyle( bool aLeftRight ) override;
462
463 void MirrorHorizontally( int aCenter ) override;
464 void MirrorVertically( int aCenter ) override;
465
466private:
469};
470
471
473{
474public:
475 SCH_GLOBALLABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString );
476
477 SCH_GLOBALLABEL( const SCH_GLOBALLABEL& aGlobalLabel );
478
480
481 static inline bool ClassOf( const EDA_ITEM* aItem )
482 {
483 return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
484 }
485
486 wxString GetClass() const override
487 {
488 return wxT( "SCH_GLOBALLABEL" );
489 }
490
491 EDA_ITEM* Clone() const override
492 {
493 return new SCH_GLOBALLABEL( *this );
494 }
495
496 int GetMandatoryFieldCount() override { return 1; }
497
498 void SetSpinStyle( SPIN_STYLE aSpinStyle ) override;
499
500 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
501
502 void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings, std::vector<VECTOR2I>& aPoints,
503 const VECTOR2I& aPos ) const override;
504
505 bool ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, int aDepth ) const override;
506
507 bool IsConnectable() const override { return true; }
508
509 void ViewGetLayers( int aLayers[], int& aCount ) const override;
510
511 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
512
513 BITMAPS GetMenuImage() const override;
514
515 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
516 {
517 return m_isDangling && GetPosition() == aPos;
518 }
519
520 bool AutoRotateOnPlacementSupported() const override { return true; }
521
522private:
523 bool doIsConnected( const VECTOR2I& aPosition ) const override
524 {
525 return EDA_TEXT::GetTextPos() == aPosition;
526 }
527};
528
529
531{
532public:
533 SCH_HIERLABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString,
534 KICAD_T aType = SCH_HIER_LABEL_T );
535
536 // Do not create a copy constructor. The one generated by the compiler is adequate.
537
539
540 static inline bool ClassOf( const EDA_ITEM* aItem )
541 {
542 return aItem && SCH_HIER_LABEL_T == aItem->Type();
543 }
544
545 wxString GetClass() const override
546 {
547 return wxT( "SCH_HIERLABEL" );
548 }
549
550 void SetSpinStyle( SPIN_STYLE aSpinStyle ) override;
551
552 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
553
554 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
555 const VECTOR2I& aPos ) const override;
556 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
557 const VECTOR2I& aPos, LABEL_FLAG_SHAPE aShape ) const;
558
559 const BOX2I GetBodyBoundingBox() const override;
560
561 bool IsConnectable() const override { return true; }
562
563 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
564
565 BITMAPS GetMenuImage() const override;
566
567 EDA_ITEM* Clone() const override
568 {
569 return new SCH_HIERLABEL( *this );
570 }
571
572 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
573 {
574 return m_isDangling && GetPosition() == aPos;
575 }
576
577 bool AutoRotateOnPlacementSupported() const override { return true; }
578
579private:
580 bool doIsConnected( const VECTOR2I& aPosition ) const override
581 {
582 return EDA_TEXT::GetTextPos() == aPosition;
583 }
584};
585
586#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:230
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:95
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Base plotter engine class.
Definition: plotter.h:104
Holds all the data relating to one schematic.
Definition: schematic.h:75
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:136
void MirrorSpinStyle(bool aLeftRight) override
Definition: sch_label.cpp:1510
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_label.cpp:1480
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_label.cpp:1568
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_label.cpp:1541
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_label.cpp:1659
bool IsConnectable() const override
Definition: sch_label.h:457
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:425
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:1590
FLAG_SHAPE GetFlagShape() const
Definition: sch_label.h:442
int GetPenWidth() const override
Definition: sch_label.cpp:1499
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:459
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:430
void SetPinLength(int aLength)
Definition: sch_label.h:446
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:435
void SetFlagShape(FLAG_SHAPE aShape)
Definition: sch_label.h:443
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_label.cpp:1709
int GetPinLength() const
Definition: sch_label.h:445
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:52
bool IsConnectable() const override
Definition: sch_label.h:507
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:1845
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:1857
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth) const override
Resolve any references to system tokens supported by the label.
Definition: sch_label.cpp:1786
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:481
int GetMandatoryFieldCount() override
Definition: sch_label.h:496
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:523
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:1747
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
Definition: sch_label.cpp:1779
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_label.cpp:1925
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:520
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:491
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:515
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:486
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:1932
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:580
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:540
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:545
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:1986
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
Definition: sch_label.cpp:1947
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:1954
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:567
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:2066
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:572
bool IsConnectable() const override
Definition: sch_label.h:561
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:2039
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_label.cpp:2059
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:577
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:165
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:113
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
bool operator==(const SCH_ITEM &aItem) const override
Definition: sch_label.cpp:574
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_SETTINGS &aPlotSettings) const override
Plot the schematic item to aPlotter.
Definition: sch_label.cpp:1268
void SetLastResolvedState(const SCH_ITEM *aItem) override
Definition: sch_label.h:179
const wxString & GetCachedDriverName() const override
Definition: sch_label.cpp:873
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:974
COLOR4D m_lastResolvedColor
Definition: sch_label.h:361
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const override
Definition: sch_label.cpp:888
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_label.cpp:417
void AddFields(const std::vector< SCH_FIELD > &aFields)
Definition: sch_label.h:204
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
Definition: sch_label.h:199
void SetIsDangling(bool aIsDangling)
Definition: sch_label.h:314
bool m_isDangling
Definition: sch_label.h:358
void AddField(const SCH_FIELD &aField)
Definition: sch_label.h:209
bool IsDangling() const override
Definition: sch_label.h:313
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:936
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_label.cpp:920
bool HasCachedDriverName() const override
Definition: sch_label.cpp:867
const std::vector< SCH_FIELD > & GetFields() const
Definition: sch_label.h:192
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:1043
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:961
bool AutoRotateOnPlacement() const
autoRotateOnPlacement
Definition: sch_label.cpp:1408
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_label.cpp:426
SCH_LABEL_BASE & operator=(const SCH_LABEL_BASE &aLabel)
Definition: sch_label.cpp:236
std::vector< SCH_FIELD > m_fields
Definition: sch_label.h:353
CONNECTION_TYPE m_connectionType
Definition: sch_label.h:357
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_label.cpp:522
void SetLabelShape(LABEL_SHAPE aShape)
Definition: sch_label.h:172
wxString GetShownText(bool aAllowExtraText, int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_label.h:255
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_label.cpp:304
SPIN_STYLE GetSpinStyle() const
Definition: sch_label.cpp:372
void GetIntersheetRefs(std::vector< std::pair< wxString, wxString > > *pages)
Builds an array of { pageNumber, pageName } pairs.
Definition: sch_label.cpp:708
void MirrorSpinStyle(bool aLeftRight) override
Definition: sch_label.cpp:494
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_label.cpp:968
COLOR4D GetLabelColor() const
Definition: sch_label.cpp:326
void SetShape(LABEL_FLAG_SHAPE aShape)
Definition: sch_label.h:168
LABEL_FLAG_SHAPE GetShape() const
Definition: sch_label.h:167
const BOX2I GetBoundingBox() const override
Return the bounding box of the label including its fields.
Definition: sch_label.cpp:1018
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: sch_label.cpp:259
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_label.cpp:541
virtual bool AutoRotateOnPlacementSupported() const =0
AutoRotateOnPlacementSupported.
void SetPosition(const VECTOR2I &aPosition) override
Definition: sch_label.cpp:410
virtual bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth) const
Resolve any references to system tokens supported by the label.
Definition: sch_label.cpp:756
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_label.h:142
LABEL_SHAPE GetLabelShape() const
Definition: sch_label.h:171
bool m_autoRotateOnPlacement
Definition: sch_label.h:359
wxString m_cached_driver_name
Definition: sch_label.h:363
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &offset) override
Print a schematic item.
Definition: sch_label.cpp:1365
int GetLabelBoxExpansion(const RENDER_SETTINGS *aSettings=nullptr) const
Definition: sch_label.cpp:985
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
Definition: sch_label.cpp:560
void SetAutoRotateOnPlacement(bool autoRotate=true)
setAutoRotateOnPlacement
Definition: sch_label.cpp:1413
void cacheShownText() override
Definition: sch_label.cpp:879
void Rotate90(bool aClockwise) override
Definition: sch_label.cpp:441
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:1210
static const wxString GetDefaultFieldName(const wxString &aName, bool aUseDefaultName)
Definition: sch_label.cpp:246
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_label.cpp:637
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
Definition: sch_label.cpp:913
virtual int GetMandatoryFieldCount()
Definition: sch_label.h:189
LABEL_FLAG_SHAPE m_shape
Definition: sch_label.h:355
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this label.
Definition: sch_label.cpp:743
virtual const BOX2I GetBodyBoundingBox() const
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:1000
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:284
std::vector< SCH_FIELD > & GetFields()
Definition: sch_label.h:191
virtual wxString GetClass() const override=0
Return the class name.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, 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:1104
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:391
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
Definition: sch_label.cpp:337
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:926
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
Definition: sch_label.cpp:600
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:406
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_label.cpp:1456
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:381
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:409
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:396
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:401
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:1427
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:1463
~SCH_LABEL()
Definition: sch_label.h:374
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_label.h:394
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:376
bool IsConnectable() const override
Definition: sch_label.h:388
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
VECTOR2I GetPosition() const override
Definition: sch_text.h:134
constexpr SPIN_STYLE(SPIN aSpin)
Definition: sch_label.h:51
SPIN_STYLE MirrorX()
Mirror the label spin style across the X axis or simply swaps up and bottom.
Definition: sch_label.cpp:172
SPIN m_spin
Definition: sch_label.h:83
SPIN_STYLE()=default
constexpr bool operator!=(SPIN a) const
Definition: sch_label.h:60
constexpr bool operator==(SPIN a) const
Definition: sch_label.h:55
SPIN_STYLE MirrorY()
Mirror the label spin style across the Y axis or simply swaps left and right.
Definition: sch_label.cpp:188
SPIN_STYLE RotateCCW()
Definition: sch_label.cpp:156
INSPECT_RESULT
Definition: eda_item.h:42
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:78
@ LAYER_WIRE
Definition: layer_ids.h:355
@ LAYER_BUS
Definition: layer_ids.h:356
CONNECTION_TYPE
FLAG_SHAPE
Definition: sch_label.h:118
@ FLAG_CIRCLE
Definition: sch_label.h:120
@ FLAG_RECTANGLE
Definition: sch_label.h:122
@ FLAG_DOT
Definition: sch_label.h:119
@ FLAG_DIAMOND
Definition: sch_label.h:121
LABEL_FLAG_SHAPE
Definition: sch_label.h:91
@ L_BIDI
Definition: sch_label.h:94
@ L_TRISTATE
Definition: sch_label.h:95
@ L_UNSPECIFIED
Definition: sch_label.h:96
@ F_DOT
Definition: sch_label.h:99
@ F_ROUND
Definition: sch_label.h:100
@ F_FIRST
Definition: sch_label.h:98
@ L_OUTPUT
Definition: sch_label.h:93
@ F_DIAMOND
Definition: sch_label.h:101
@ L_INPUT
Definition: sch_label.h:92
@ F_RECTANGLE
Definition: sch_label.h:102
LABEL_SHAPE
Definition: sch_label.h:109
@ LABEL_BIDI
Definition: sch_label.h:112
@ LABEL_INPUT
Definition: sch_label.h:110
@ LABEL_OUTPUT
Definition: sch_label.h:111
@ LABEL_PASSIVE
Definition: sch_label.h:114
@ LABEL_TRISTATE
Definition: sch_label.h:113
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_LINE_T
Definition: typeinfo.h:148
@ SCH_SYMBOL_T
Definition: typeinfo.h:160
@ SCH_DIRECTIVE_LABEL_T
Definition: typeinfo.h:158
@ SCH_LABEL_T
Definition: typeinfo.h:155
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:157
@ SCH_SHEET_PIN_T
Definition: typeinfo.h:161
@ SCH_BUS_WIRE_ENTRY_T
Definition: typeinfo.h:146
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:156
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588