128 return wxT(
"LIB_SYMBOL" );
136 virtual void SetName(
const wxString& aName );
163 return parent->GetDescription();
176 return parent->GetKeyWords();
189 void GetChooserFields( std::map<wxString , wxString>& aColumnMap )
override;
211 return parent->GetFPFilters();
228 bool aIgnoreHiddenFields =
true )
const;
241 bool aIncludePrivateItems )
const;
271 void SetFields(
const std::vector<SCH_FIELD>& aFieldsList );
278 void GetFields( std::vector<SCH_FIELD*>& aList );
279 void GetFields( std::vector<SCH_FIELD>& aList );
299 bool aCaseInsensitive =
false )
const;
332 bool aAllowExtraText )
const override
363 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
override;
366 const VECTOR2I& aOffset,
bool aDimmed )
override;
369 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
override;
375 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed );
406 std::vector<SCH_PIN*>
GetPins(
int aUnit = 0,
int aBodyStyle = 0 )
const;
428 SCH_PIN*
GetPin(
const wxString& aNumber,
int aUnit = 0,
int aBodyStyle = 0 )
const;
442 bool aTestType,
bool aTestOrientation,
bool aTestLength )
const;
509 const std::vector<KICAD_T>& aScanTypes )
override;
522 void SetUnitCount(
int aCount,
bool aDuplicateDrawItems =
true );
581 REPORTER* aReporter =
nullptr )
const;
592 std::unique_ptr< LIB_SYMBOL >
Flatten()
const;
622 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
virtual const wxString & GetText() const
Return the string associated with the text object.
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
LIB_ITEMS_CONTAINER m_drawings
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the symbol.
wxString GetDescription() const override
const LIB_ID & GetLibId() const override
wxString GetKeyWords() const override
bool IsMulti() const override
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.)
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
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
void SetSourceLibId(const LIB_ID &aLibId)
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.
bool UnitsLocked() const
Check whether symbol units are interchangeable.
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.
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)
std::map< int, wxString > m_unitDisplayNames
void ClearTempFlags() override
Clears the status flag all draw objects in this symbol.
wxString GetFootprint() override
For items with footprint fields.
wxString GetUnitDisplayName(int aUnit) override
Return the user-defined display name for aUnit for symbols with units.
const wxString GetLibraryName() const
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
timestamp_t GetLastModDate() const
LIB_ID GetSourceLibId() const
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.
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.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
int Compare(const LIB_SYMBOL &aRhs, int aCompareFlags=0, REPORTER *aReporter=nullptr) const
Comparison test that can be used for operators.
void FixupDrawItems()
This function finds the filled draw items that are covering up smaller draw items and replaces their ...
static wxString LetterSubReference(int aUnit, int aFirstId)
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
std::vector< SCH_PIN * > GetAllLibPins() const
Return a list of pin pointers for all units / converts.
bool HasAlternateBodyStyle() const override
Test if symbol has more than one body conversion type (DeMorgan).
static bool ClassOf(const EDA_ITEM *aItem)
SCH_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
wxString m_keyWords
Search keywords.
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.
SCH_FIELD & GetDatasheetField() const
Return reference to the datasheet field.
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
SCH_FIELD & GetFootprintField() const
Return reference to the footprint field.
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
void SetParent(LIB_SYMBOL *aParent=nullptr)
wxString GetName() const override
void SetDescription(const wxString &aDescription)
Gets the Description field text value */.
const LIB_SYMBOL_REF & GetParent() const
void SetKeyWords(const wxString &aKeyWords)
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.
wxArrayString GetFPFilters() const
void RemoveDrawItem(SCH_ITEM *aItem)
Remove draw aItem from list.
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...
int compare(const SCH_ITEM &aOther, int aCompareFlags=SCH_ITEM::COMPARE_FLAGS::EQUALITY) const override
The library symbol specific sort order is as follows:
timestamp_t m_lastModDate
void SetLib(SYMBOL_LIB *aLibrary)
SCH_FIELD & GetDescriptionField() const
Return reference to the description field.
int GetSubUnitCount() const override
For items with units, return the number of units.
wxString GetLibNickname() const override
Sets the Description field text value.
virtual ~LIB_SYMBOL()
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
const LIB_SYMBOL & operator=(const LIB_SYMBOL &aSymbol)
bool m_unitsLocked
True if symbol has multiple units and changing one unit does not automatically change another unit.
wxArrayString m_fpFilters
List of suitable footprint names for the symbol (wild card names accepted).
void Move(const VECTOR2I &aOffset) override
Move the symbol aOffset.
void SetFPFilters(const wxArrayString &aFilters)
bool HasUnitDisplayName(int aUnit) override
Return true if the given unit aUnit has a display name defined.
size_t GetFieldCount() const
const BOX2I GetBodyBoundingBox(int aUnit, int aBodyStyle, bool aIncludePins, bool aIncludePrivateItems) const
Get the symbol bounding box excluding fields.
LIB_SYMBOL_SPTR SharedPtr() const
const wxString GetValue(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const override
wxString GetDesc() override
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
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
EMBEDDED_FILES * GetEmbeddedFiles() override
void AddField(SCH_FIELD &aField)
int m_unitCount
Number of units (parts) per package.
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.
LIB_ID m_sourceLibId
For database library symbols; the original symbol.
unsigned GetInheritanceDepth() const
Get the number of parents for this symbol.
int GetUnitCount() const override
LIB_SYMBOL_REF m_parent
Use for inherited symbols.
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
SYMBOL_LIB * GetLib() const
int GetPinCount() override
void SetLibId(const LIB_ID &aLibId)
void AddField(SCH_FIELD *aField)
Add a field.
void ClearEditFlags() override
LIB_ID GetLIB_ID() const override
LIB_SYMBOL_REF & GetParent()
LIB_SYMBOL_SPTR GetRootSymbol() const
Get the parent symbol that does not have another parent.
void SetUnitDisplayName(int aUnit, const wxString &aName)
Set the user-defined display name for aUnit to aName for symbols with units.
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
void EmbedFonts() override
virtual void SetName(const wxString &aName)
void CopyUnitDisplayNames(std::map< int, wxString > &aTarget) const
Copy all unit display names into the given map aTarget.
const LIB_ITEMS_CONTAINER & GetDrawItems() const
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Multivector container type.
size_t size(int aType=UNDEFINED_TYPE) const
boost::ptr_vector< SCH_ITEM > ITEM_PTR_VECTOR
Helper for defining a list of library draw object pointers.
Base plotter engine class.
A pure virtual class used to derive REPORTER objects from.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
void SetText(const wxString &aText) override
Base class for any item which can be embedded within the SCHEMATIC container class,...
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.
const INSPECTOR_FUNC & INSPECTOR
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
std::weak_ptr< LIB_SYMBOL > LIB_SYMBOL_REF
weak pointer to LIB_SYMBOL
MULTIVECTOR< SCH_ITEM, SCH_SHAPE_T, SCH_PIN_T > LIB_ITEMS_CONTAINER
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
int m_bodyStyle
The alternate body style of the unit.
std::vector< SCH_ITEM * > m_items
The items unique to this unit and alternate body style.
int m_unit
The unit number.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.