KiCad PCB EDA Suite
Loading...
Searching...
No Matches
lib_symbol.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) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
6 * Copyright (C) 2022 CERN
7 * Copyright (C) 2004-2024 KiCad Developers, see change_log.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef LIB_SYMBOL_H
28#define LIB_SYMBOL_H
29
30#include <symbol.h>
31#include <sch_field.h>
32#include <sch_pin.h>
33#include <lib_tree_item.h>
34#include <vector>
35#include <core/multivector.h>
36
37class LINE_READER;
38class OUTPUTFORMATTER;
39class REPORTER;
40class SYMBOL_LIB;
41class LIB_SYMBOL;
43
44
45typedef std::shared_ptr<LIB_SYMBOL> LIB_SYMBOL_SPTR;
46typedef std::weak_ptr<LIB_SYMBOL> LIB_SYMBOL_REF;
49
50
51/* values for member .m_options */
53{
54 ENTRY_NORMAL, // Libentry is a standard symbol (real or alias)
55 ENTRY_POWER // Libentry is a power symbol
56};
57
58
59extern bool operator<( const LIB_SYMBOL& aItem1, const LIB_SYMBOL& aItem2 );
60
61
63{
64 int m_unit;
66 std::vector<SCH_ITEM*> m_items;
67};
68
69
76class LIB_SYMBOL : public SYMBOL, public LIB_TREE_ITEM
77{
78public:
79 LIB_SYMBOL( const wxString& aName, LIB_SYMBOL* aParent = nullptr,
80 SYMBOL_LIB* aLibrary = nullptr );
81
82 LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary = nullptr );
83
84 virtual ~LIB_SYMBOL()
85 {}
86
88 LIB_SYMBOL_SPTR SharedPtr() const { return m_me; }
89
93 virtual LIB_SYMBOL* Duplicate() const
94 {
95 LIB_SYMBOL* dupe = new LIB_SYMBOL( *this, m_library );
96 const_cast<KIID&>( dupe->m_Uuid ) = KIID();
97
98 for( SCH_ITEM& item : dupe->m_drawings )
99 const_cast<KIID&>( item.m_Uuid ) = KIID();
100
101 return dupe;
102 }
103
104 void SetParent( LIB_SYMBOL* aParent = nullptr );
106 const LIB_SYMBOL_REF& GetParent() const { return m_parent; }
107
113 unsigned GetInheritanceDepth() const;
114
124
125 virtual wxString GetClass() const override
126 {
127 return wxT( "LIB_SYMBOL" );
128 }
129
130 static inline bool ClassOf( const EDA_ITEM* aItem )
131 {
132 return aItem && aItem->Type() == LIB_SYMBOL_T;
133 }
134
135 virtual void SetName( const wxString& aName );
136 wxString GetName() const override { return m_name; }
137
138 LIB_ID GetLIB_ID() const override { return m_libId; }
139 wxString GetDesc() override { return GetDescription(); }
140 int GetSubUnitCount() const override { return GetUnitCount(); }
141
142 const LIB_ID& GetLibId() const override { return m_libId; }
143 void SetLibId( const LIB_ID& aLibId ) { m_libId = aLibId; }
144
146 void SetSourceLibId( const LIB_ID& aLibId ) { m_sourceLibId = aLibId; }
147
148 wxString GetLibNickname() const override { return GetLibraryName(); }
149
151 void SetDescription( const wxString& aDescription )
152 {
153 GetDescriptionField().SetText( aDescription );
154 }
155
157 wxString GetDescription() const override
158 {
159 if( GetDescriptionField().GetText().IsEmpty() && IsAlias() )
160 {
161 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
162 return parent->GetDescription();
163 }
164
165 return GetDescriptionField().GetText();
166 }
167
168 void SetKeyWords( const wxString& aKeyWords ) { m_keyWords = aKeyWords; }
169
170 wxString GetKeyWords() const override
171 {
172 if( m_keyWords.IsEmpty() && IsAlias() )
173 {
174 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
175 return parent->GetKeyWords();
176 }
177
178 return m_keyWords;
179 }
180
181 std::vector<SEARCH_TERM> GetSearchTerms() override;
182
183 wxString GetFootprint() override
184 {
185 return GetFootprintField().GetText();
186 }
187
188 void GetChooserFields( std::map<wxString , wxString>& aColumnMap ) override;
189
193 bool IsRoot() const override { return m_parent.use_count() == 0; }
194 bool IsAlias() const { return !m_parent.expired() && m_parent.use_count() > 0; }
195
196 const wxString GetLibraryName() const;
197
198 SYMBOL_LIB* GetLib() const { return m_library; }
199 void SetLib( SYMBOL_LIB* aLibrary ) { m_library = aLibrary; }
200
202
203 void SetFPFilters( const wxArrayString& aFilters ) { m_fpFilters = aFilters; }
204
205 wxArrayString GetFPFilters() const
206 {
207 if( m_fpFilters.IsEmpty() && IsAlias() )
208 {
209 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
210 return parent->GetFPFilters();
211 }
212
213 return m_fpFilters;
214 }
215
226 const BOX2I GetUnitBoundingBox( int aUnit, int aBodyStyle,
227 bool aIgnoreHiddenFields = true ) const;
228
239 const BOX2I GetBodyBoundingBox( int aUnit, int aBodyStyle, bool aIncludePins,
240 bool aIncludePrivateItems ) const;
241
242 const BOX2I GetBoundingBox() const override
243 {
244 return GetUnitBoundingBox( 0, 0 );
245 }
246
247 bool IsPower() const override;
248 bool IsNormal() const override;
249
250 void SetPower();
251 void SetNormal();
252
257 void LockUnits( bool aLockUnits ) { m_unitsLocked = aLockUnits; }
258
263 bool UnitsLocked() const { return m_unitsLocked; }
264
270 void SetFields( const std::vector<SCH_FIELD>& aFieldsList );
271
277 void GetFields( std::vector<SCH_FIELD*>& aList );
278 void GetFields( std::vector<SCH_FIELD>& aList );
279
283 void AddField( SCH_FIELD* aField );
284
285 void AddField( SCH_FIELD& aField ) { AddField( new SCH_FIELD( aField ) ); }
286
295 SCH_FIELD* FindField( const wxString& aFieldName, bool aCaseInsensitive = false );
296
297 const SCH_FIELD* FindField( const wxString& aFieldName,
298 bool aCaseInsensitive = false ) const;
299
306 SCH_FIELD* GetFieldById( int aId ) const;
307
309 SCH_FIELD& GetValueField() const;
310
313
316
319
322
323 wxString GetPrefix();
324
325 const wxString GetRef( const SCH_SHEET_PATH* aSheet, bool aIncludeUnit = false ) const override
326 {
327 return GetReferenceField().GetText();
328 }
329
330 const wxString GetValue( bool aResolve, const SCH_SHEET_PATH* aPath,
331 bool aAllowExtraText ) const override
332 {
333 return GetValueField().GetText();
334 }
335
336 void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
337
346
347 int GetNextAvailableFieldId() const;
348
349 void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
350 const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
351
352 void PrintBackground( const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle,
353 const VECTOR2I& aOffset, bool aDimmed ) override;
354
355 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
356 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
357
361 void PlotFields( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
362 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed );
363
370 void AddDrawItem( SCH_ITEM* aItem, bool aSort = true );
371
377 void RemoveDrawItem( SCH_ITEM* aItem );
378
379 void RemoveField( SCH_FIELD* aField ) { RemoveDrawItem( aField ); }
380
381 size_t GetFieldCount() const { return m_drawings.size( SCH_FIELD_T ); }
382
393 std::vector<SCH_PIN*> GetPins( int aUnit = 0, int aBodyStyle = 0 ) const;
394
399 std::vector<SCH_PIN*> GetAllLibPins() const;
400
404 int GetPinCount() override;
405
415 SCH_PIN* GetPin( const wxString& aNumber, int aUnit = 0, int aBodyStyle = 0 ) const;
416
428 bool PinsConflictWith( const LIB_SYMBOL& aOtherSymbol, bool aTestNums, bool aTestNames,
429 bool aTestType, bool aTestOrientation, bool aTestLength ) const;
430
436 void Move( const VECTOR2I& aOffset ) override;
437
443 bool HasAlternateBodyStyle() const override;
444
449 int GetMaxPinNumber() const;
450
454 void ClearTempFlags() override;
455 void ClearEditFlags() override;
456
466 SCH_ITEM* LocateDrawItem( int aUnit, int aBodyStyle, KICAD_T aType, const VECTOR2I& aPoint );
467
478 SCH_ITEM* LocateDrawItem( int aUnit, int aBodyStyle, KICAD_T aType, const VECTOR2I& aPoint,
479 const TRANSFORM& aTransform );
480
487 const LIB_ITEMS_CONTAINER& GetDrawItems() const { return m_drawings; }
488
493 void FixupDrawItems();
494
495 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
496 const std::vector<KICAD_T>& aScanTypes ) override;
497
509 void SetUnitCount( int aCount, bool aDuplicateDrawItems = true );
510 int GetUnitCount() const override;
511
515 wxString GetUnitReference( int aUnit ) override;
516
520 bool HasUnitDisplayName( int aUnit ) override;
521
525 wxString GetUnitDisplayName( int aUnit ) override;
526
530 void CopyUnitDisplayNames( std::map<int, wxString>& aTarget ) const;
531
535 void SetUnitDisplayName( int aUnit, const wxString& aName );
536
541 bool IsMulti() const override { return m_unitCount > 1; }
542
543 static wxString LetterSubReference( int aUnit, int aFirstId );
544
556 void SetHasAlternateBodyStyle( bool aHasAlternate, bool aDuplicatePins = true );
557
567 int Compare( const LIB_SYMBOL& aRhs, int aCompareFlags = 0,
568 REPORTER* aReporter = nullptr ) const;
569
570 bool operator==( const LIB_SYMBOL* aSymbol ) const { return this == aSymbol; }
571 bool operator==( const LIB_SYMBOL& aSymbol ) const;
572 bool operator!=( const LIB_SYMBOL& aSymbol ) const
573 {
574 return Compare( aSymbol, SCH_ITEM::COMPARE_FLAGS::EQUALITY ) != 0;
575 }
576
577 const LIB_SYMBOL& operator=( const LIB_SYMBOL& aSymbol );
578
586 std::unique_ptr< LIB_SYMBOL > Flatten() const;
587
594 std::vector<struct LIB_SYMBOL_UNIT> GetUnitDrawItems();
595
606 std::vector<SCH_ITEM*> GetUnitDrawItems( int aUnit, int aBodyStyle );
607
614 double Similarity( const SCH_ITEM& aSymbol ) const override;
615#if defined(DEBUG)
616 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
617#endif
618
619private:
620 // We create a different set parent function for this class, so we hide the inherited one.
622
623 void deleteAllFields();
624
625private:
631
635
637
639
641 wxString m_name;
642 wxString m_keyWords;
643 wxArrayString m_fpFilters;
645
646 std::map<int, wxString> m_unitDisplayNames;
647};
648
649#endif // CLASS_LIBENTRY_H
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:88
const KIID m_Uuid
Definition: eda_item.h:485
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:100
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:103
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:98
Definition: kiid.h:49
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
Define a library symbol object.
Definition: lib_symbol.h:77
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:638
wxString GetDescription() const override
Definition: lib_symbol.h:157
const LIB_ID & GetLibId() const override
Definition: lib_symbol.h:142
wxString GetKeyWords() const override
Definition: lib_symbol.h:170
bool IsMulti() const override
Definition: lib_symbol.h:541
bool operator!=(const LIB_SYMBOL &aSymbol) const
Definition: lib_symbol.h:572
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.)
Definition: lib_symbol.h:636
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
Definition: lib_symbol.cpp:740
bool PinsConflictWith(const LIB_SYMBOL &aOtherSymbol, bool aTestNums, bool aTestNames, bool aTestType, bool aTestOrientation, bool aTestLength) const
Return true if this symbol's pins do not match another symbol's pins.
bool IsPower() const override
Definition: lib_symbol.cpp:663
wxString GetPrefix()
void SetSourceLibId(const LIB_ID &aLibId)
Definition: lib_symbol.h:146
void SetUnitCount(int aCount, bool aDuplicateDrawItems=true)
Set the units per symbol count.
std::vector< SCH_PIN * > GetPins(int aUnit=0, int aBodyStyle=0) const
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:982
bool UnitsLocked() const
Check whether symbol units are interchangeable.
Definition: lib_symbol.h:263
const BOX2I GetUnitBoundingBox(int aUnit, int aBodyStyle, bool aIgnoreHiddenFields=true) const
Get the bounding box for the symbol.
int GetNextAvailableFieldId() const
void GetFields(std::vector< SCH_FIELD * > &aList)
Return a list of fields within this symbol.
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
Definition: lib_symbol.h:193
bool operator==(const LIB_SYMBOL *aSymbol) const
Definition: lib_symbol.h:570
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of SCH_ITEM objects separated by unit and convert number.
void RemoveField(SCH_FIELD *aField)
Definition: lib_symbol.h:379
std::map< int, wxString > m_unitDisplayNames
Definition: lib_symbol.h:646
void ClearTempFlags() override
Clears the status flag all draw objects in this symbol.
SYMBOL_LIB * m_library
Definition: lib_symbol.h:640
wxString GetFootprint() override
For items with footprint fields.
Definition: lib_symbol.h:183
wxString GetUnitDisplayName(int aUnit) override
Return the user-defined display name for aUnit for symbols with units.
Definition: lib_symbol.cpp:535
const wxString GetLibraryName() const
Definition: lib_symbol.cpp:654
void SetFields(const std::vector< SCH_FIELD > &aFieldsList)
Overwrite all the existing fields in this symbol with fields supplied in aFieldsList.
SCH_FIELD & GetValueField() const
Return reference to the value field.
std::vector< SEARCH_TERM > GetSearchTerms() override
Definition: lib_symbol.cpp:39
timestamp_t GetLastModDate() const
Definition: lib_symbol.h:201
LIB_ID GetSourceLibId() const
Definition: lib_symbol.h:145
bool IsAlias() const
Definition: lib_symbol.h:194
int GetMaxPinNumber() const
virtual LIB_SYMBOL * Duplicate() const
Create a copy of a LIB_SYMBOL and assigns unique KIIDs to the copy and its children.
Definition: lib_symbol.h:93
LIB_SYMBOL_SPTR m_me
Definition: lib_symbol.h:626
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.
Definition: lib_symbol.cpp:821
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: lib_symbol.h:242
int Compare(const LIB_SYMBOL &aRhs, int aCompareFlags=0, REPORTER *aReporter=nullptr) const
Comparison test that can be used for operators.
Definition: lib_symbol.cpp:240
void FixupDrawItems()
This function finds the filled draw items that are covering up smaller draw items and replaces their ...
Definition: lib_symbol.cpp:902
static wxString LetterSubReference(int aUnit, int aFirstId)
Definition: lib_symbol.cpp:721
SCH_PIN * GetPin(const wxString &aNumber, int aUnit=0, int aBodyStyle=0) const
Return pin object with the requested pin aNumber.
bool IsNormal() const override
Definition: lib_symbol.cpp:693
wxString m_name
Definition: lib_symbol.h:641
std::vector< SCH_PIN * > GetAllLibPins() const
Return a list of pin pointers for all units / converts.
void SetPower()
Definition: lib_symbol.cpp:679
bool HasAlternateBodyStyle() const override
Test if symbol has more than one body conversion type (DeMorgan).
static bool ClassOf(const EDA_ITEM *aItem)
Definition: lib_symbol.h:130
SCH_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:642
SCH_ITEM * LocateDrawItem(int aUnit, int aBodyStyle, KICAD_T aType, const VECTOR2I &aPoint)
Locate a draw object.
double Similarity(const SCH_ITEM &aSymbol) const override
Return a measure of similarity between this symbol and aSymbol.
void PlotFields(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed)
Plot symbol fields.
Definition: lib_symbol.cpp:863
SCH_FIELD & GetDatasheetField() const
Return reference to the datasheet field.
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
Definition: lib_symbol.h:257
SCH_FIELD & GetFootprintField() const
Return reference to the footprint field.
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Definition: lib_symbol.h:486
void SetParent(LIB_SYMBOL *aParent=nullptr)
Definition: lib_symbol.cpp:570
wxString GetName() const override
Definition: lib_symbol.h:136
void SetDescription(const wxString &aDescription)
Gets the Description field text value *‍/.
Definition: lib_symbol.h:151
const LIB_SYMBOL_REF & GetParent() const
Definition: lib_symbol.h:106
void SetKeyWords(const wxString &aKeyWords)
Definition: lib_symbol.h:168
SCH_FIELD & GetReferenceField() const
Return reference to the reference designator field.
void PrintBackground(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Print just the background fills.
Definition: lib_symbol.cpp:787
wxArrayString GetFPFilters() const
Definition: lib_symbol.h:205
void RemoveDrawItem(SCH_ITEM *aItem)
Remove draw aItem from list.
Definition: lib_symbol.cpp:944
void GetChooserFields(std::map< wxString, wxString > &aColumnMap) override
Retrieves a key/value map of the fields on this item that should be exposed to the library browser/ch...
Definition: lib_symbol.cpp:70
timestamp_t m_lastModDate
Definition: lib_symbol.h:630
LIB_ID m_libId
Definition: lib_symbol.h:628
void SetLib(SYMBOL_LIB *aLibrary)
Definition: lib_symbol.h:199
SCH_FIELD & GetDescriptionField() const
Return reference to the description field.
int GetSubUnitCount() const override
For items with units, return the number of units.
Definition: lib_symbol.h:140
wxString GetLibNickname() const override
Sets the Description field text value.
Definition: lib_symbol.h:148
virtual ~LIB_SYMBOL()
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Definition: lib_symbol.h:84
const LIB_SYMBOL & operator=(const LIB_SYMBOL &aSymbol)
Definition: lib_symbol.cpp:178
bool m_unitsLocked
True if symbol has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:633
wxArrayString m_fpFilters
List of suitable footprint names for the symbol (wild card names accepted).
Definition: lib_symbol.h:643
void Move(const VECTOR2I &aOffset) override
Move the symbol aOffset.
void SetFPFilters(const wxArrayString &aFilters)
Definition: lib_symbol.h:203
bool HasUnitDisplayName(int aUnit) override
Return true if the given unit aUnit has a display name defined.
Definition: lib_symbol.cpp:529
size_t GetFieldCount() const
Definition: lib_symbol.h:381
const BOX2I GetBodyBoundingBox(int aUnit, int aBodyStyle, bool aIncludePins, bool aIncludePrivateItems) const
Get the symbol bounding box excluding fields.
LIB_SYMBOL_SPTR SharedPtr() const
Definition: lib_symbol.h:88
const wxString GetValue(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const override
Definition: lib_symbol.h:330
wxString GetDesc() override
Definition: lib_symbol.h:139
SCH_FIELD * FindField(const wxString &aFieldName, bool aCaseInsensitive=false)
Find a field within this symbol matching aFieldName and returns it or NULL if not found.
int UpdateFieldOrdinals()
Order optional field indices.
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
Definition: lib_symbol.h:325
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
Definition: lib_symbol.cpp:523
void AddField(SCH_FIELD &aField)
Definition: lib_symbol.h:285
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:632
void SetHasAlternateBodyStyle(bool aHasAlternate, bool aDuplicatePins=true)
Set or clear the alternate body style (DeMorgan) for the symbol.
virtual wxString GetClass() const override
Return the class name.
Definition: lib_symbol.h:125
LIB_ID m_sourceLibId
For database library symbols; the original symbol.
Definition: lib_symbol.h:629
unsigned GetInheritanceDepth() const
Get the number of parents for this symbol.
Definition: lib_symbol.cpp:221
int GetUnitCount() const override
LIB_SYMBOL_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:627
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:579
SYMBOL_LIB * GetLib() const
Definition: lib_symbol.h:198
int GetPinCount() override
void SetLibId(const LIB_ID &aLibId)
Definition: lib_symbol.h:143
void AddField(SCH_FIELD *aField)
Add a field.
void ClearEditFlags() override
void deleteAllFields()
LIB_ID GetLIB_ID() const override
Definition: lib_symbol.h:138
LIB_SYMBOL_REF & GetParent()
Definition: lib_symbol.h:105
LIB_SYMBOL_SPTR GetRootSymbol() const
Get the parent symbol that does not have another parent.
Definition: lib_symbol.cpp:511
void SetUnitDisplayName(int aUnit, const wxString &aName)
Set the user-defined display name for aUnit to aName for symbols with units.
Definition: lib_symbol.cpp:551
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Definition: lib_symbol.cpp:969
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:563
void SetNormal()
Definition: lib_symbol.cpp:707
void CopyUnitDisplayNames(std::map< int, wxString > &aTarget) const
Copy all unit display names into the given map aTarget.
Definition: lib_symbol.cpp:544
const LIB_ITEMS_CONTAINER & GetDrawItems() const
Definition: lib_symbol.h:487
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
Definition: lib_tree_item.h:41
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:93
Multivector container type.
Definition: multivector.h:47
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:226
boost::ptr_vector< SCH_ITEM > ITEM_PTR_VECTOR
Helper for defining a list of library draw object pointers.
Definition: multivector.h:65
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:322
Base plotter engine class.
Definition: plotter.h:104
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:51
void SetText(const wxString &aText) override
Definition: sch_field.cpp:1138
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:174
@ EQUALITY
Definition: sch_item.h:668
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Object used to load, save, search, and otherwise manipulate symbol library files.
A base class for LIB_SYMBOL and SCH_SYMBOL.
Definition: symbol.h:34
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:46
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:81
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: kiid.h:46
LIBRENTRYOPTIONS
Definition: lib_symbol.h:53
@ ENTRY_NORMAL
Definition: lib_symbol.h:54
@ ENTRY_POWER
Definition: lib_symbol.h:55
std::weak_ptr< LIB_SYMBOL > LIB_SYMBOL_REF
weak pointer to LIB_SYMBOL
Definition: lib_symbol.h:46
MULTIVECTOR< SCH_ITEM, SCH_SHAPE_T, SCH_PIN_T > LIB_ITEMS_CONTAINER
Definition: lib_symbol.h:47
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
Definition: lib_symbol.h:45
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
Definition: lib_symbol.h:48
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
Definition: lib_symbol.cpp:82
int m_bodyStyle
The alternate body style of the unit.
Definition: lib_symbol.h:65
std::vector< SCH_ITEM * > m_items
The items unique to this unit and alternate body style.
Definition: lib_symbol.h:66
int m_unit
The unit number.
Definition: lib_symbol.h:64
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ LIB_SYMBOL_T
Definition: typeinfo.h:148
@ SCH_FIELD_T
Definition: typeinfo.h:150