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-2022 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
129 virtual bool ResolveTextVar( wxString* token, int aDepth ) const;
130
131 wxString GetShownText( int aDepth = 0, bool aAllowExtraText = true ) const override;
132
133 void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
134
135 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
136 const std::vector<KICAD_T>& scanTypes ) override;
137
138 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
139 bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) override;
140
141 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
142
149 virtual void CreateGraphicShape( const RENDER_SETTINGS* aSettings,
150 std::vector<VECTOR2I>& aPoints, const VECTOR2I& Pos ) const
151 {
152 aPoints.clear();
153 }
154
155 int GetLabelBoxExpansion( const RENDER_SETTINGS* aSettings = nullptr ) const;
156
160 virtual const BOX2I GetBodyBoundingBox() const;
161
165 const BOX2I GetBoundingBox() const override;
166
167 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
168 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
169
170 std::vector<VECTOR2I> GetConnectionPoints() const override;
171
172 void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
173
174 bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
175 const SCH_SHEET_PATH* aPath = nullptr ) override;
176
177 bool IsDangling() const override { return m_isDangling; }
178 void SetIsDangling( bool aIsDangling ) { m_isDangling = aIsDangling; }
179
180 void ViewGetLayers( int aLayers[], int& aCount ) const override;
181
182 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
183
184 void Plot( PLOTTER* aPlotter, bool aBackground ) const override;
185
186 void Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
187
192 bool AutoRotateOnPlacement() const;
193
199 void SetAutoRotateOnPlacement( bool autoRotate = true );
200
206 virtual bool AutoRotateOnPlacementSupported() const = 0;
207
208protected:
209 std::vector<SCH_FIELD> m_fields;
210
212
216
218};
219
220
222{
223public:
224 SCH_LABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString );
225
226 // Do not create a copy constructor. The one generated by the compiler is adequate.
227
229
230 static inline bool ClassOf( const EDA_ITEM* aItem )
231 {
232 return aItem && SCH_LABEL_T == aItem->Type();
233 }
234
235 wxString GetClass() const override
236 {
237 return wxT( "SCH_LABEL" );
238 }
239
240 const BOX2I GetBodyBoundingBox() const override;
241
242 bool IsConnectable() const override { return true; }
243
244 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
245
246 BITMAPS GetMenuImage() const override;
247
248 bool IsReplaceable() const override { return true; }
249
250 EDA_ITEM* Clone() const override
251 {
252 return new SCH_LABEL( *this );
253 }
254
255 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
256 {
257 return m_isDangling && GetPosition() == aPos;
258 }
259
260 bool AutoRotateOnPlacementSupported() const override { return false; }
261
262private:
263 bool doIsConnected( const VECTOR2I& aPosition ) const override
264 {
265 return EDA_TEXT::GetTextPos() == aPosition;
266 }
267};
268
269
271{
272public:
273 SCH_DIRECTIVE_LABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ) );
274
275 SCH_DIRECTIVE_LABEL( const SCH_DIRECTIVE_LABEL& aClassLabel );
276
278
279 static inline bool ClassOf( const EDA_ITEM* aItem )
280 {
281 return aItem && SCH_DIRECTIVE_LABEL_T == aItem->Type();
282 }
283
284 wxString GetClass() const override
285 {
286 return wxT( "SCH_DIRECTIVE_LABEL" );
287 }
288
289 EDA_ITEM* Clone() const override
290 {
291 return new SCH_DIRECTIVE_LABEL( *this );
292 }
293
294 void SwapData( SCH_ITEM* aItem ) override;
295
296 int GetPinLength() const { return m_pinLength; }
297 void SetPinLength( int aLength ) { m_pinLength = aLength; }
298
299 int GetPenWidth() const override;
300
301 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
302 const VECTOR2I& aPos ) const override;
303
304 void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
305
306 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
307
308 bool IsConnectable() const override { return true; }
309
310 bool AutoRotateOnPlacementSupported() const override { return false; }
311
312private:
315};
316
317
319{
320public:
321 SCH_GLOBALLABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString );
322
323 SCH_GLOBALLABEL( const SCH_GLOBALLABEL& aGlobalLabel );
324
326
327 static inline bool ClassOf( const EDA_ITEM* aItem )
328 {
329 return aItem && SCH_GLOBAL_LABEL_T == aItem->Type();
330 }
331
332 wxString GetClass() const override
333 {
334 return wxT( "SCH_GLOBALLABEL" );
335 }
336
337 EDA_ITEM* Clone() const override
338 {
339 return new SCH_GLOBALLABEL( *this );
340 }
341
342 int GetMandatoryFieldCount() override { return 1; }
343
344 void MirrorSpinStyle( bool aLeftRight ) override;
345
346 void MirrorHorizontally( int aCenter ) override;
347 void MirrorVertically( int aCenter ) override;
348
349 void SetTextSpinStyle( TEXT_SPIN_STYLE aSpinStyle ) override;
350
351 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
352
353 void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings, std::vector<VECTOR2I>& aPoints,
354 const VECTOR2I& aPos ) const override;
355
356 bool ResolveTextVar( wxString* token, int aDepth ) const override;
357
358 bool IsConnectable() const override { return true; }
359
360 void ViewGetLayers( int aLayers[], int& aCount ) const override;
361
362 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
363
364 BITMAPS GetMenuImage() const override;
365
366 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
367 {
368 return m_isDangling && GetPosition() == aPos;
369 }
370
371 bool AutoRotateOnPlacementSupported() const override { return true; }
372
373private:
374 bool doIsConnected( const VECTOR2I& aPosition ) const override
375 {
376 return EDA_TEXT::GetTextPos() == aPosition;
377 }
378};
379
380
382{
383public:
384 SCH_HIERLABEL( const VECTOR2I& aPos = VECTOR2I( 0, 0 ), const wxString& aText = wxEmptyString,
385 KICAD_T aType = SCH_HIER_LABEL_T );
386
387 // Do not create a copy constructor. The one generated by the compiler is adequate.
388
390
391 static inline bool ClassOf( const EDA_ITEM* aItem )
392 {
393 return aItem && SCH_HIER_LABEL_T == aItem->Type();
394 }
395
396 wxString GetClass() const override
397 {
398 return wxT( "SCH_HIERLABEL" );
399 }
400
401 void SetTextSpinStyle( TEXT_SPIN_STYLE aSpinStyle ) override;
402
403 VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
404
405 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
406 const VECTOR2I& aPos ) const override;
407 void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
408 const VECTOR2I& aPos, LABEL_FLAG_SHAPE aShape ) const;
409
410 const BOX2I GetBodyBoundingBox() const override;
411
412 bool IsConnectable() const override { return true; }
413
414 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
415
416 BITMAPS GetMenuImage() const override;
417
418 EDA_ITEM* Clone() const override
419 {
420 return new SCH_HIERLABEL( *this );
421 }
422
423 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
424 {
425 return m_isDangling && GetPosition() == aPos;
426 }
427
428 bool AutoRotateOnPlacementSupported() const override { return true; }
429
430private:
431 bool doIsConnected( const VECTOR2I& aPosition ) const override
432 {
433 return EDA_TEXT::GetTextPos() == aPosition;
434 }
435};
436
437#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:104
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:1085
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_label.cpp:1183
SCH_DIRECTIVE_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0))
Definition: sch_label.cpp:1074
bool IsConnectable() const override
Definition: sch_label.h:308
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:279
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:1114
int GetPenWidth() const override
Definition: sch_label.cpp:1103
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_label.cpp:1233
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:310
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:284
void SetPinLength(int aLength)
Definition: sch_label.h:297
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:289
int GetPinLength() const
Definition: sch_label.h:296
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:50
bool IsConnectable() const override
Definition: sch_label.h:358
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:1435
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:1447
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:327
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_label.cpp:1368
bool ResolveTextVar(wxString *token, int aDepth) const override
Definition: sch_label.cpp:1384
int GetMandatoryFieldCount() override
Definition: sch_label.h:342
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_label.cpp:1515
void MirrorSpinStyle(bool aLeftRight) override
Definition: sch_label.cpp:1310
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:374
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:1271
SCH_GLOBALLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_label.cpp:1248
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:371
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:337
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:366
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:1303
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:332
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:1521
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_label.cpp:1338
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:431
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:391
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:396
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:1575
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:1543
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:418
SCH_HIERLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
Definition: sch_label.cpp:1527
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_label.cpp:1648
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:1655
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:423
bool IsConnectable() const override
Definition: sch_label.h:412
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:1628
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:428
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:1536
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:656
COLOR4D m_lastResolvedColor
Definition: sch_label.h:217
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:178
bool m_isDangling
Definition: sch_label.h:214
bool IsDangling() const override
Definition: sch_label.h:177
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:618
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_label.cpp:602
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:725
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:643
bool AutoRotateOnPlacement() const
autoRotateOnPlacement
Definition: sch_label.cpp:1014
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:560
std::vector< SCH_FIELD > m_fields
Definition: sch_label.h:209
CONNECTION_TYPE m_connectionType
Definition: sch_label.h:213
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
Definition: sch_label.cpp:482
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_label.cpp:650
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:700
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:215
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &offset) override
Print a schematic item.
Definition: sch_label.cpp:988
int GetLabelBoxExpansion(const RENDER_SETTINGS *aSettings=nullptr) const
Definition: sch_label.cpp:667
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:1019
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:786
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:861
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:595
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:211
virtual const BOX2I GetBodyBoundingBox() const
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:682
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:149
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:919
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:608
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
Definition: sch_label.h:260
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_label.cpp:1062
wxString GetClass() const override
Return the class name.
Definition: sch_label.h:235
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_label.h:263
SCH_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
Definition: sch_label.cpp:1024
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_label.h:250
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition: sch_label.h:255
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
Definition: sch_label.cpp:1033
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_label.cpp:1068
~SCH_LABEL()
Definition: sch_label.h:228
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_label.h:248
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_label.h:230
bool IsConnectable() const override
Definition: sch_label.h:242
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:618