KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_field.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) 2022 CERN
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24
25#include <eda_text.h>
26#include <sch_item.h>
27#include <template_fieldnames.h>
28#include <general.h>
29#include <string_utils.h>
30#include "scintilla_tricks.h"
31#include <algorithm>
32
33class SCH_EDIT_FRAME;
34class SCH_TEXT;
35
37{
38 class SchematicField;
39}
40
41
43{
45 std::vector<std::unique_ptr<KIFONT::GLYPH>> glyphs;
46};
47
48
49class SCH_FIELD : public SCH_ITEM, public EDA_TEXT
50{
51public:
52 SCH_FIELD(); // For std::map::operator[]
53
54 explicit SCH_FIELD( SCH_ITEM* aParent, FIELD_T aFieldId = FIELD_T::USER, const wxString& aName = wxEmptyString );
55
56 explicit SCH_FIELD( SCH_ITEM* aParent, SCH_TEXT* aText );
57
58 SCH_FIELD( const SCH_FIELD& aText );
59
60 void Serialize( google::protobuf::Any& aContainer ) const override;
61 bool Deserialize( const google::protobuf::Any& aContainer ) override;
62
63 void Serialize( kiapi::schematic::types::SchematicField& aOutput,
64 const EDA_IU_SCALE& aScale ) const;
65 bool Deserialize( const kiapi::schematic::types::SchematicField& aInput,
66 const EDA_IU_SCALE& aScale );
67
68 ~SCH_FIELD() override
69 { }
70
71 SCH_FIELD& operator=( const SCH_FIELD& aField );
72
73 static bool ClassOf( const EDA_ITEM* aItem )
74 {
75 return aItem && SCH_FIELD_T == aItem->Type();
76 }
77
78 wxString GetClass() const override
79 {
80 return wxT( "SCH_FIELD" );
81 }
82
83 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
84 {
85 if( SCH_ITEM::IsType( aScanTypes ) )
86 return true;
87
88 for( KICAD_T scanType : aScanTypes )
89 {
91 return true;
92 else if ( scanType == SCH_FIELD_LOCATE_VALUE_T && m_id == FIELD_T::VALUE )
93 return true;
94 else if ( scanType == SCH_FIELD_LOCATE_FOOTPRINT_T && m_id == FIELD_T::FOOTPRINT )
95 return true;
96 else if ( scanType == SCH_FIELD_LOCATE_DATASHEET_T && m_id == FIELD_T::DATASHEET )
97 return true;
98 }
99
100 return false;
101 }
102
103 wxString GetFriendlyName() const override
104 {
105 return _( "Field" );
106 }
107
108 bool HasHypertext() const override;
109
110 void DoHypertextAction( EDA_DRAW_FRAME* aFrame, const VECTOR2I& aMousePos ) const override;
111
118 wxString GetName( bool aUseDefaultName = true ) const;
119
123 wxString GetUntranslatedName() const;
124
130 static bool IsNetclassLabelFieldName( const wxString& aName );
131
132 void SetName( const wxString& aName );
133
134 void SetText( const wxString& aText ) override;
135
136 void SetText( const wxString& aText, const SCH_SHEET_PATH* aPath, const wxString& aVariantName = wxEmptyString );
137
138 virtual const wxString& GetText() const override { return EDA_TEXT::GetText(); }
139
140 wxString GetText( const SCH_SHEET_PATH* aPath, const wxString& aVariantName = wxEmptyString ) const;
141
142 FIELD_T GetId() const { return m_id; }
143
144 int GetOrdinal() const
145 {
146 return IsMandatory() ? (int) m_id : m_ordinal;
147 }
148 void SetOrdinal( int aOrdinal, FIELD_T aType )
149 {
150 m_id = aType;
151 m_ordinal = aOrdinal;
152 }
153
159 wxString GetShownName() const;
160 wxString GetShownText( const SCH_SHEET_PATH* aPath, RESOLUTION_CONTEXT aContext,
161 const wxString& aVariantName = wxEmptyString, int aDepth = 0 ) const;
162
163 wxString GetShownText( RESOLUTION_CONTEXT aContextx, int aDepth = 0 ) const override;
164
174 wxString GetFullText( int unit = 1 ) const;
175
181 bool IsEmpty()
182 {
183 wxString name( m_name );
184 wxString value( GetText() );
185
186 return name.Trim().empty() && value.Trim().empty();
187 }
188
189 int GetSchTextSize() const { return GetTextWidth(); }
190 void SetSchTextSize( int aSize ) { SetTextSize( VECTOR2I( aSize, aSize ) ); }
191
192 COLOR4D GetFieldColor() const;
193
194 void SetLastResolvedState( const SCH_ITEM* aItem ) override
195 {
196 const SCH_FIELD* aField = dynamic_cast<const SCH_FIELD*>( aItem );
197
198 if( aField )
200 }
201
202 std::vector<int> ViewGetLayers() const override;
203
205
209 EDA_ANGLE GetDrawRotation() const override;
210
211 KIFONT::FONT* GetDrawFont( const RENDER_SETTINGS* aSettings ) const override;
212
213 const BOX2I GetBoundingBox() const override;
214
219 bool IsHorizJustifyFlipped() const;
220 bool IsVertJustifyFlipped() const;
221
224
227
228 bool IsNameShown() const { return m_showName; }
229 void SetNameShown( bool aShown = true ) { m_showName = aShown; }
230
237 bool IsGeneratedField() const { return m_isGeneratedField; }
238
239 bool CanAutoplace() const { return m_allowAutoPlace; }
240 void SetCanAutoplace( bool aCanPlace ) { m_allowAutoPlace = aCanPlace; }
241
242 void swapData( SCH_ITEM* aItem ) override;
243
244 int GetPenWidth() const override;
245
246 bool IsAutoAdded() const { return m_autoAdded; }
247 void SetAutoAdded( bool aAutoAdded ) { m_autoAdded = aAutoAdded; }
248
249 bool ShowInChooser() const { return m_showInChooser; }
250 void SetShowInChooser( bool aShow = true ) { m_showInChooser = aShow; }
251
252 void ClearCaches() override;
253 void ClearRenderCache() override;
254
255 std::vector<std::unique_ptr<KIFONT::GLYPH>>*
256 GetRenderCache( const wxString& forResolvedText, const VECTOR2I& forPosition, TEXT_ATTRIBUTES& aAttrs ) const;
257
258 void Move( const VECTOR2I& aMoveVector ) override
259 {
260 Offset( aMoveVector );
261 }
262
263 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) override;
264
265 void MirrorVertically( int aCenter ) override;
266 void MirrorHorizontally( int aCenter ) override;
267
268 void BeginEdit( const VECTOR2I& aStartPoint ) override;
269 void CalcEdit( const VECTOR2I& aPosition ) override;
270
271 void OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks, wxStyledTextEvent &aEvent ) const;
272
273 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
274
275 bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData = nullptr ) override;
276
277 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
278 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
279
280 BITMAPS GetMenuImage() const override;
281
282 bool IsReplaceable() const override;
283
284 bool IsLocked() const override;
285
287
288 VECTOR2I GetPosition() const override;
289 void SetPosition( const VECTOR2I& aPosition ) override;
290
292
293 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
294 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
295 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
296
297 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
298 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
299
300 EDA_ITEM* Clone() const override;
301
309 void ImportValues( const SCH_FIELD& aSource );
310
318 void Copy( SCH_FIELD* aTarget ) const;
319
320 bool IsMandatory() const;
321
322 bool operator <( const SCH_ITEM& aItem ) const override;
323
324 double Similarity( const SCH_ITEM& aItem ) const override;
325
326 bool operator==( const SCH_ITEM& aItem ) const override;
327 bool operator==( const SCH_FIELD& aItem ) const;
328
333 bool HasSameContent( const SCH_FIELD& aOther ) const;
334
335#if defined(DEBUG)
336 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
337#endif
338
339protected:
341
342 const KIFONT::METRICS& getFontMetrics() const override { return GetFontMetrics(); }
343
356 int compare( const SCH_ITEM& aOther, int aCompareFlags = 0 ) const override;
357
358 void setId( FIELD_T aId );
359
360 wxString getUnescapedText( const SCH_SHEET_PATH* aPath = nullptr,
361 const wxString& aVariantName = wxEmptyString ) const;
362
363private:
366 wxString m_name;
367
372
375
376 mutable std::unique_ptr<SCH_FIELD_RENDER_CACHE_DATA> m_renderCache;
377
379};
380
381
382inline int NextFieldOrdinal( const std::vector<SCH_FIELD>& aFields )
383{
384 int ordinal = 42; // Arbitrarily larger than any mandatory FIELD_T id
385
386 for( const SCH_FIELD& field : aFields )
387 ordinal = std::max( ordinal, field.GetOrdinal() + 1 );
388
389 return ordinal;
390}
391
392
393inline const SCH_FIELD* FindField( const std::vector<SCH_FIELD>& aFields, FIELD_T aFieldId )
394{
395 for( const SCH_FIELD& field : aFields )
396 {
397 if( field.GetId() == aFieldId )
398 return &field;
399 }
400
401 return nullptr;
402}
403
404
405inline SCH_FIELD* FindField( std::vector<SCH_FIELD>& aFields, FIELD_T aFieldId )
406{
407 const std::vector<SCH_FIELD>& constFields = const_cast<const std::vector<SCH_FIELD>&>( aFields );
408 return const_cast<SCH_FIELD*>( FindField( constFields, aFieldId ) );
409}
410
411
412inline const SCH_FIELD* FindField( const std::vector<SCH_FIELD>& aFields, const wxString& aFieldName )
413{
414 for( const SCH_FIELD& field : aFields )
415 {
416 if( field.GetName() == aFieldName )
417 return &field;
418 }
419
420 return nullptr;
421}
422
423
424inline SCH_FIELD* FindField( std::vector<SCH_FIELD>& aFields, const wxString& aFieldName )
425{
426 const std::vector<SCH_FIELD>& constFields = const_cast<const std::vector<SCH_FIELD>&>( aFields );
427 return const_cast<SCH_FIELD*>( FindField( constFields, aFieldName ) );
428}
429
430
431inline wxString GetFieldValue( const std::vector<SCH_FIELD>* aFields, FIELD_T aFieldType )
432{
433 if( !aFields )
434 return wxEmptyString;
435
436 if( const SCH_FIELD* field = FindField( *aFields, aFieldType ) )
437 return field->GetText();
438
439 return wxEmptyString;
440}
441
442
443inline std::string GetFieldValue( const std::vector<SCH_FIELD>* aFields, const wxString& aFieldName,
444 bool aResolve, int aDepth )
445{
446 if( !aFields )
447 return "";
448
449 if( const SCH_FIELD* field = FindField( *aFields, aFieldName ) )
450 return ( aResolve ? field->GetShownText( INTERNAL, aDepth ) : field->GetText() ).ToStdString();
451
452 return "";
453}
454
455
456inline void SetFieldValue( std::vector<SCH_FIELD>& aFields, const wxString& aFieldName,
457 const std::string& aValue, bool aIsVisible = true,
458 const SCH_SHEET_PATH* aSheetPath = nullptr, const wxString& aVariantName = wxEmptyString )
459{
460 if( !aSheetPath || aVariantName.empty() )
461 {
462 // Without a sheet path this is a local write (usually to the Symbol Properties dialog's copy of the
463 // fields). Variant handling will apply only when the local fields are written back to the symbol.
464
465 if( aValue == "" )
466 {
467 std::erase_if( aFields, [&]( const SCH_FIELD& field )
468 {
469 return field.GetName() == aFieldName;
470 } );
471 return;
472 }
473
474 if( SCH_FIELD* field = FindField( aFields, aFieldName ) )
475 {
476 field->SetText( aValue );
477 return;
478 }
479
480 SCH_ITEM* parent = static_cast<SCH_ITEM*>( aFields.at( 0 ).GetParent() );
481 aFields.emplace_back( parent, FIELD_T::USER, aFieldName );
482
483 aFields.back().SetText( aValue );
484 aFields.back().SetVisible( aIsVisible );
485 return;
486 }
487
488 if( SCH_FIELD* field = FindField( aFields, aFieldName ) )
489 {
490 field->SetText( aValue, aSheetPath, aVariantName );
491 return;
492 }
493
494 SCH_ITEM* parent = static_cast<SCH_ITEM*>( aFields.at( 0 ).GetParent() );
495 aFields.emplace_back( parent, FIELD_T::USER, aFieldName );
496
497 // Since the default variant doesn't have this field at all, we're going to set it to the same value
498 // and visibility as specified for the variant. We therefore don't really have a variant at all, so we
499 // can ignore variant processing here.
500 aFields.back().SetText( aValue );
501 aFields.back().SetVisible( aIsVisible );
502}
const char * name
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:927
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:98
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:84
virtual VECTOR2I GetTextPos() const
Definition eda_text.h:313
virtual void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
Definition eda_text.cpp:495
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:118
virtual void Offset(const VECTOR2I &aOffset)
Definition eda_text.cpp:558
virtual int GetTextWidth() const
Definition eda_text.h:304
EDA_TEXT(const EDA_IU_SCALE &aIuScale, const wxString &aText=wxEmptyString)
Definition eda_text.cpp:98
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:94
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Base plotter engine class.
Definition plotter.h:136
Schematic editor (Eeschema) main window.
friend class SCH_IO_KICAD_SEXPR_PARSER
Definition sch_field.h:340
void ClearRenderCache() override
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
wxString GetClass() const override
Return the class name.
Definition sch_field.h:78
COLOR4D m_lastResolvedColor
Definition sch_field.h:378
bool IsAutoAdded() const
Definition sch_field.h:246
GR_TEXT_V_ALIGN_T GetEffectiveVertJustify() const
bool IsMandatory() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool HasSameContent(const SCH_FIELD &aOther) const
Test if this field has the same name, content and presentation as another field, ignoring the owning ...
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
wxString GetFullText(int unit=1) const
Return the text of a field.
~SCH_FIELD() override
Definition sch_field.h:68
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool IsLocked() const override
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
VECTOR2I GetPosition() const override
void SetEffectiveHorizJustify(GR_TEXT_H_ALIGN_T)
int GetSchTextSize() const
Definition sch_field.h:189
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData=nullptr) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
void SetLastResolvedState(const SCH_ITEM *aItem) override
Definition sch_field.h:194
bool m_showName
Render the field name in addition to its value.
Definition sch_field.h:368
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition sch_field.h:83
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
static bool ClassOf(const EDA_ITEM *aItem)
Definition sch_field.h:73
bool IsNameShown() const
Definition sch_field.h:228
bool m_autoAdded
Was this field automatically added to a LIB_SYMBOL?
Definition sch_field.h:373
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
std::unique_ptr< SCH_FIELD_RENDER_CACHE_DATA > m_renderCache
Definition sch_field.h:376
bool IsGeneratedField() const
Generated fields are fields whose names are variables like ${VAR}.
Definition sch_field.h:237
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
SCH_LAYER_ID GetDefaultLayer() const
bool HasHypertext() const override
Indicates that the item has at least one hypertext action.
bool IsHorizJustifyFlipped() const
Return whether the field will be rendered with the horizontal justification inverted due to rotation ...
bool IsVertJustifyFlipped() const
EDA_ANGLE GetDrawRotation() const override
Adjusters to allow EDA_TEXT to draw/print/etc.
void SetEffectiveVertJustify(GR_TEXT_V_ALIGN_T)
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
void SetOrdinal(int aOrdinal, FIELD_T aType)
Definition sch_field.h:148
virtual const wxString & GetText() const override
Return the string associated with the text object.
Definition sch_field.h:138
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
FIELD_T GetId() const
Definition sch_field.h:142
void SetCanAutoplace(bool aCanPlace)
Definition sch_field.h:240
int GetPenWidth() const override
bool m_isGeneratedField
If the field name is a variable name (e.g.
Definition sch_field.h:370
int m_ordinal
Sort order for non-mandatory fields.
Definition sch_field.h:365
COLOR4D GetFieldColor() const
wxString getUnescapedText(const SCH_SHEET_PATH *aPath=nullptr, const wxString &aVariantName=wxEmptyString) const
wxString GetFriendlyName() const override
Definition sch_field.h:103
bool operator==(const SCH_ITEM &aItem) const override
SCH_FIELD & operator=(const SCH_FIELD &aField)
void ImportValues(const SCH_FIELD &aSource)
Copy parameters from a SCH_FIELD source.
void SetAutoAdded(bool aAutoAdded)
Definition sch_field.h:247
wxString GetUntranslatedName() const
Get the untranslated field name for storage, variable look-up, etc.
bool operator<(const SCH_ITEM &aItem) const override
FIELD_T m_id
Field id,.
Definition sch_field.h:364
void DoHypertextAction(EDA_DRAW_FRAME *aFrame, const VECTOR2I &aMousePos) const override
wxString GetShownName() const
Get the field's name as displayed on the schematic or in the symbol fields table.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
VECTOR2I GetLibPosition() const
Definition sch_field.h:286
void setId(FIELD_T aId)
int GetOrdinal() const
Definition sch_field.h:144
bool IsEmpty()
Return true if both the name and value of the field are empty.
Definition sch_field.h:181
KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const override
void BeginEdit(const VECTOR2I &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
void SetShowInChooser(bool aShow=true)
Definition sch_field.h:250
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
void SetSchTextSize(int aSize)
Definition sch_field.h:190
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, const wxString &aVariantName=wxEmptyString, int aDepth=0) const
GR_TEXT_H_ALIGN_T GetEffectiveHorizJustify() const
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
void SetPosition(const VECTOR2I &aPosition) override
void SetName(const wxString &aName)
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition sch_field.h:258
bool CanAutoplace() const
Definition sch_field.h:239
std::vector< std::unique_ptr< KIFONT::GLYPH > > * GetRenderCache(const wxString &forResolvedText, const VECTOR2I &forPosition, TEXT_ATTRIBUTES &aAttrs) const
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.
bool ShowInChooser() const
Definition sch_field.h:249
void ClearCaches() override
void SetText(const wxString &aText) override
VECTOR2I GetParentPosition() const
const KIFONT::METRICS & getFontMetrics() const override
Definition sch_field.h:342
bool m_showInChooser
This field is available as a data column for the chooser.
Definition sch_field.h:374
void OnScintillaCharAdded(SCINTILLA_TRICKS *aScintillaTricks, wxStyledTextEvent &aEvent) const
wxString m_name
Definition sch_field.h:366
void SetNameShown(bool aShown=true)
Definition sch_field.h:229
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
static bool IsNetclassLabelFieldName(const wxString &aName)
Test whether aName is one of the known translations of the directive-label net class field name (used...
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void Copy(SCH_FIELD *aTarget) const
Copy parameters of this field to another field.
bool m_allowAutoPlace
This field can be autoplaced.
Definition sch_field.h:369
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:52
const KIFONT::METRICS & GetFontMetrics() const
Definition sch_item.cpp:815
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition sch_item.h:180
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
RESOLUTION_CONTEXT
Definition common.h:87
@ INTERNAL
Definition common.h:92
#define _(s)
SCH_LAYER_ID
Eeschema drawing layers.
Definition layer_ids.h:471
void SetFieldValue(std::vector< SCH_FIELD > &aFields, const wxString &aFieldName, const std::string &aValue, bool aIsVisible=true, const SCH_SHEET_PATH *aSheetPath=nullptr, const wxString &aVariantName=wxEmptyString)
Definition sch_field.h:456
wxString GetFieldValue(const std::vector< SCH_FIELD > *aFields, FIELD_T aFieldType)
Definition sch_field.h:431
const SCH_FIELD * FindField(const std::vector< SCH_FIELD > &aFields, FIELD_T aFieldId)
Definition sch_field.h:393
int NextFieldOrdinal(const std::vector< SCH_FIELD > &aFields)
Definition sch_field.h:382
std::vector< std::unique_ptr< KIFONT::GLYPH > > glyphs
Definition sch_field.h:45
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ USER
The field ID hasn't been set yet; field is invalid.
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70
@ SCH_FIELD_LOCATE_REFERENCE_T
Definition typeinfo.h:176
@ SCH_FIELD_LOCATE_FOOTPRINT_T
Definition typeinfo.h:178
@ SCH_FIELD_T
Definition typeinfo.h:146
@ SCH_FIELD_LOCATE_VALUE_T
Definition typeinfo.h:177
@ SCH_FIELD_LOCATE_DATASHEET_T
Definition typeinfo.h:179
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683