42 std::vector<SEARCH_TERM> terms;
46 wxStringTokenizer keywordTokenizer(
GetKeyWords(), wxS(
" " ), wxTOKEN_STRTOK );
48 while( keywordTokenizer.HasMoreTokens() )
49 terms.emplace_back(
SEARCH_TERM( keywordTokenizer.GetNextToken(), 4 ) );
52 std::map<wxString, wxString> fields;
55 for(
const auto& [
name,
text ] : fields )
64 if( !footprint.IsEmpty() )
78 aColumnMap[field->
GetName()] = field->EDA_TEXT::GetShownText(
false );
167 wxFAIL_MSG(
"Failed to clone SCH_ITEM." );
181 if( &aSymbol ==
this )
231 parent = parent->GetParent().lock();
242 return sp->GetRootSymbol();
272 aTarget[it.first] = it.second;
280 if( aName.Length() > 0 )
306 std::unique_ptr< LIB_SYMBOL > retv;
312 wxCHECK_MSG( parent, retv,
313 wxString::Format(
"Parent of derived symbol '%s' undefined",
m_name ) );
316 if( parent->IsAlias() )
317 retv = parent->Flatten();
319 retv = std::make_unique<LIB_SYMBOL>( *parent.get() );
331 retv->GetFieldById( i )->SetText( retv->GetFieldById( i )->GetText() );
352 retv->AddDrawItem( newField );
356 retv->RemoveDrawItem( parentField );
357 retv->AddDrawItem( newField );
365 retv->SetExcludedFromBOM( parent->GetExcludedFromBOM() );
366 retv->SetExcludedFromBoard( parent->GetExcludedFromBoard() );
368 retv->UpdateFieldOrdinals();
369 retv->m_parent.reset();
373 retv = std::make_unique<LIB_SYMBOL>( *
this );
391 std::shared_ptr<LIB_SYMBOL> parent;
395 if( parent->IsRoot() )
398 return parent->IsPower();
409 if( parent->IsRoot() )
423 if( parent->IsRoot() )
426 return parent->IsNormal();
437 if( parent->IsRoot() )
457 u = ( aUnit - 1 ) % 26;
458 suffix = wxChar( aFirstId + u ) + suffix;
459 aUnit = ( aUnit - u ) / 26;
460 }
while( aUnit > 0 );
477 footprint = field.
GetShownText(
nullptr,
false, aDepth + 1 );
480 || token->IsSameAs( field.
GetName(),
false ) )
482 *token = field.
GetShownText(
nullptr,
false, aDepth + 1 );
489 if( token->IsSameAs( wxT(
"SIM.DEVICE" ) )
490 || token->IsSameAs( wxT(
"SIM.TYPE" ) )
491 || token->IsSameAs( wxT(
"SIM.PINS" ) )
492 || token->IsSameAs( wxT(
"SIM.PARAMS" ) )
493 || token->IsSameAs( wxT(
"SIM.LIBRARY" ) )
494 || token->IsSameAs( wxT(
"SIM.NAME" ) ) )
496 *token = wxEmptyString;
500 if( token->IsSameAs( wxT(
"FOOTPRINT_LIBRARY" ) ) )
502 wxArrayString parts = wxSplit( footprint,
':' );
504 if( parts.Count() > 0 )
507 *token = wxEmptyString;
511 else if( token->IsSameAs( wxT(
"FOOTPRINT_NAME" ) ) )
513 wxArrayString parts = wxSplit( footprint,
':' );
515 if( parts.Count() > 1 )
516 *token = parts[ std::min( 1, (
int) parts.size() - 1 ) ];
518 *token = wxEmptyString;
522 else if( token->IsSameAs( wxT(
"SYMBOL_LIBRARY" ) ) )
527 else if( token->IsSameAs( wxT(
"SYMBOL_NAME" ) ) )
532 else if( token->IsSameAs( wxT(
"SYMBOL_DESCRIPTION" ) ) )
537 else if( token->IsSameAs( wxT(
"SYMBOL_KEYWORDS" ) ) )
542 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOM" ) ) )
547 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOARD" ) ) )
552 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_SIM" ) ) )
557 else if( token->IsSameAs( wxT(
"DNP" ) ) )
559 *token = this->
GetDNP() ?
_(
"DNP" ) : wxString(
"" );
568 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
573 if( item.IsPrivate() )
577 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
580 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
585 item.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
594 item.
Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
601 if( shape.
GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
608 if( init_color == COLOR4D::UNSPECIFIED )
614 shape.
Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
620 item.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
627 const VECTOR2I& aOffset,
bool aDimmed )
638 if( item.IsPrivate() )
646 if( aUnit && shape.
m_unit && ( shape.
m_unit != aUnit ) )
652 if( shape.
GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
653 shape.
Print( aSettings, aUnit, aBodyStyle, aOffset,
false, aDimmed );
661 int aUnit,
int aBodyStyle,
const VECTOR2I &aOffset,
bool aDimmed )
663 wxASSERT( aPlotter !=
nullptr );
669 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->
GetColorMode() )
683 if( item.IsPrivate() )
691 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
694 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
697 item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
703 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
705 wxASSERT( aPlotter !=
nullptr );
711 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->
GetColorMode() )
731 wxString tmp = field.
GetText();
734 item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
743 std::vector<SCH_SHAPE*> potential_top_items;
744 std::vector<SCH_ITEM*> bottom_items;
752 if( shape.
GetFillMode() == FILL_T::FILLED_WITH_COLOR )
753 potential_top_items.push_back( &shape );
755 bottom_items.push_back( &item );
759 bottom_items.push_back( &item );
763 std::sort( potential_top_items.begin(), potential_top_items.end(),
766 return a->GetBoundingBox().GetArea() > b->GetBoundingBox().GetArea();
769 for(
SCH_SHAPE* item : potential_top_items )
771 for(
SCH_ITEM* bottom_item : bottom_items )
773 if( item->GetBoundingBox().Contains( bottom_item->GetBoundingBox() ) )
775 item->SetFillMode( FILL_T::FILLED_WITH_BG_BODYCOLOR );
785 wxASSERT( aItem !=
nullptr );
791 if(
static_cast<SCH_FIELD*
>( aItem )->IsMandatory() )
797 for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
824 std::vector<SCH_PIN*> pins;
839 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
843 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
862 return (
int)
GetPins( 0 , 1 ).size();
870 if( aNumber ==
pin->GetNumber() )
879 bool aTestType,
bool aTestOrientation,
bool aTestLength )
const
883 for(
const SCH_PIN* eachThisPin : thisPinList )
885 wxASSERT( eachThisPin );
886 std::vector<SCH_PIN*> otherPinList = aOtherPart.
GetAllLibPins();
887 bool foundMatch =
false;
889 for(
const SCH_PIN* eachOtherPin : otherPinList )
891 wxASSERT( eachOtherPin );
894 if( eachThisPin->GetUnit() != eachOtherPin->GetUnit() )
898 if( eachThisPin->GetBodyStyle() != eachOtherPin->GetBodyStyle() )
902 if( eachThisPin->GetPosition() != eachOtherPin->GetPosition() )
906 if( aTestNums && ( eachThisPin->GetNumber() != eachOtherPin->GetNumber() ) )
910 if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ) )
914 if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ) )
919 && ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ) )
923 if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ) )
944 bool aIgnoreHiddenFields )
const
950 if( item.m_unit > 0 &&
m_unitCount > 1 && aUnit > 0 && aUnit != item.m_unit )
953 if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
956 if( aIgnoreHiddenFields && item.Type() ==
SCH_FIELD_T )
958 if( !
static_cast<const SCH_FIELD&
>( item ).IsVisible() )
962 bBox.
Merge( item.GetBoundingBox() );
970 bool aIncludePrivateItems )
const
976 if( item.m_unit > 0 && aUnit > 0 && aUnit != item.m_unit )
979 if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
982 if( item.IsPrivate() && !aIncludePrivateItems )
992 if(
pin.IsVisible() )
998 bbox.
Merge(
pin.GetBoundingBox(
false,
false,
false ) );
1005 bbox.
Merge( item.GetBoundingBox() );
1029 for(
const SCH_FIELD& src : aFieldsList )
1054 aList.push_back( field );
1071 aList.push_back( *field );
1082 if( field->
GetId() == aId )
1094 if( aCaseInsensitive )
1096 if(
static_cast<SCH_FIELD*
>( &item )->GetCanonicalName().Upper() == aFieldName.Upper() )
1097 return static_cast<SCH_FIELD*
>( &item );
1102 return static_cast<SCH_FIELD*
>( &item );
1111 bool aCaseInsensitive )
const
1117 if( aCaseInsensitive )
1136 wxASSERT( field !=
nullptr );
1144 wxASSERT( field !=
nullptr );
1152 wxASSERT( field !=
nullptr );
1160 wxASSERT( field !=
nullptr );
1168 wxASSERT( field !=
nullptr );
1177 refDesignator.Replace( wxS(
"~" ), wxS(
" " ) );
1179 wxString prefix = refDesignator;
1181 while( prefix.Length() )
1183 wxUniCharRef last = prefix.Last();
1185 if( ( last >=
'0' && last <=
'9' ) || last ==
'?' || last ==
'*' )
1186 prefix.RemoveLast();
1192 prefix.Trim(
true );
1193 prefix.Trim(
false );
1219 if( field->
GetId() != lastOrdinal )
1221 field->
SetId( lastOrdinal );
1246 item.Move( aOffset );
1254 if( item.m_bodyStyle > BODY_STYLE::BASE )
1260 for(
const SCH_ITEM& item : parent->GetDrawItems() )
1262 if( item.m_bodyStyle > BODY_STYLE::BASE )
1273 int maxPinNumber = 0;
1280 long currentPinNumber = 0;
1282 if(
pin->GetNumber().ToLong( ¤tPinNumber ) )
1283 maxPinNumber = std::max( maxPinNumber, (
int) currentPinNumber );
1286 return maxPinNumber;
1295 item.ClearTempFlags();
1304 item.ClearEditFlags();
1313 if( ( aUnit && item.m_unit && aUnit != item.m_unit )
1314 || ( aBodyStyle && item.m_bodyStyle && aBodyStyle != item.m_bodyStyle )
1320 if( item.HitTest( aPoint ) )
1349 const std::vector<KICAD_T>& aScanTypes )
1354 if( item.IsType( aScanTypes ) )
1356 if( aInspector( &item, aTestData ) == INSPECT_RESULT::QUIT )
1357 return INSPECT_RESULT::QUIT;
1361 return INSPECT_RESULT::CONTINUE;
1376 if( i->m_unit > aCount )
1382 else if( aDuplicateDrawItems )
1389 std::vector<SCH_ITEM*> tmp;
1393 if( item.m_unit != 1 )
1396 for(
int j = prevCount + 1; j <= aCount; j++ )
1400 tmp.push_back( newItem );
1416 return parent->GetUnitCount();
1430 if( aDuplicatePins )
1432 std::vector<SCH_ITEM*> tmp;
1436 if( item.m_bodyStyle == 1 )
1440 tmp.push_back( newItem );
1456 if( i->m_bodyStyle > 1 )
1469 std::vector<SCH_ITEM*> unitItems;
1476 if( ( aBodyStyle == -1 && item.GetUnit() == aUnit )
1477 || ( aUnit == -1 && item.GetBodyStyle() == aBodyStyle )
1478 || ( aUnit == item.GetUnit() && aBodyStyle == item.GetBodyStyle() ) )
1480 unitItems.push_back( &item );
1490 std::vector<LIB_SYMBOL_UNIT> units;
1497 int unit = item.GetUnit();
1498 int bodyStyle = item.GetBodyStyle();
1500 auto it = std::find_if( units.begin(), units.end(),
1503 return a.m_unit == unit && a.m_bodyStyle == bodyStyle;
1506 if( it == units.end() )
1509 newUnit.
m_unit = item.GetUnit();
1511 newUnit.
m_items.push_back( &item );
1512 units.emplace_back( newUnit );
1516 it->m_items.push_back( &item );
1526#define REPORT( msg ) { if( aReporter ) aReporter->Report( msg ); }
1527#define ITEM_DESC( item ) ( item )->GetItemDescription( &unitsProvider, true )
1556 REPORT(
_(
"Power flag differs." ) );
1565 REPORT(
_(
"Unit count differs." ) );
1574 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> aShapes;
1575 std::set<const SCH_ITEM*> aFields;
1576 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> aPins;
1581 aShapes.insert( &(*it) );
1583 aFields.insert( &(*it) );
1585 aPins.insert( &(*it) );
1588 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> bShapes;
1589 std::set<const SCH_ITEM*> bFields;
1590 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> bPins;
1595 bShapes.insert( &(*it) );
1597 bFields.insert( &(*it) );
1599 bPins.insert( &(*it) );
1602 if(
int tmp =
static_cast<int>( aShapes.size() - bShapes.size() ) )
1605 REPORT(
_(
"Graphic item count differs." ) );
1612 for(
auto aIt = aShapes.begin(), bIt = bShapes.begin(); aIt != aShapes.end(); aIt++, bIt++ )
1614 if(
int tmp2 = (*aIt)->compare( *(*bIt), aCompareFlags ) )
1625 if(
int tmp =
static_cast<int>( aPins.size() - bPins.size() ) )
1628 REPORT(
_(
"Pin count differs." ) );
1635 for(
const SCH_ITEM* aPinItem : aPins )
1649 else if(
int tmp2 = aPinItem->compare( *bPin, aCompareFlags ) )
1660 for(
const SCH_ITEM* aFieldItem : aFields )
1674 tmp = aFieldItem->
compare( *bField, aCompareFlags );
1679 REPORT( wxString::Format(
_(
"%s field differs." ), aField->
GetName(
false ) ) );
1686 if(
int tmp =
static_cast<int>( aFields.size() - bFields.size() ) )
1689 REPORT(
_(
"Field count differs." ) );
1698 REPORT(
_(
"Footprint filters differs." ) );
1705 for(
size_t i = 0; i <
m_fpFilters.GetCount(); i++ )
1710 REPORT(
_(
"Footprint filters differ." ) );
1721 REPORT(
_(
"Symbol keywords differ." ) );
1730 REPORT(
_(
"Symbol pin name offsets differ." ) );
1741 REPORT(
_(
"Show pin names settings differ." ) );
1750 REPORT(
_(
"Show pin numbers settings differ." ) );
1759 REPORT(
_(
"Exclude from simulation settings differ." ) );
1768 REPORT(
_(
"Exclude from bill of materials settings differ." ) );
1777 REPORT(
_(
"Exclude from board settings differ." ) );
1807 return Compare( *tmp, aCompareFlags );
1816 double similarity = 0.0;
1825 double max_similarity = 0.0;
1829 double temp_similarity = item.
Similarity( otherItem );
1830 max_similarity = std::max( max_similarity, temp_similarity );
1832 if( max_similarity == 1.0 )
1836 similarity += max_similarity;
1842 double max_similarity = 0.0;
1846 double temp_similarity =
pin->Similarity( *otherPin );
1847 max_similarity = std::max( max_similarity, temp_similarity );
1849 if( max_similarity == 1.0 )
1853 similarity += max_similarity;
1856 if( totalItems == 0 )
1859 similarity /= totalItems;
1904 using EMBEDDING_PERMISSION = OUTLINE_FONT::EMBEDDING_PERMISSION;
1906 std::set<OUTLINE_FONT*>
fonts;
1914 if(
auto* font =
text->GetFont(); font && !font->IsStroke() )
1916 auto* outline =
static_cast<OUTLINE_FONT*
>( font );
1917 auto permission = outline->GetEmbeddingPermission();
1919 if( permission == EMBEDDING_PERMISSION::EDITABLE
1920 || permission == EMBEDDING_PERMISSION::INSTALLABLE )
1922 fonts.insert( outline );
1928 for(
auto* font :
fonts )
constexpr EDA_IU_SCALE schIUScale
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
virtual void ClearEditFlags()
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
EDA_ITEM_FLAGS GetFlags() const
virtual void ClearTempFlags()
FILL_T GetFillMode() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
virtual void SetVisible(bool aVisible)
EMBEDDED_FILE * AddFile(const wxFileName &aName, bool aOverwrite)
Loads a file from disk and adds it to the collection.
Class OUTLINE_FONT implements outline font drawing.
A color representation with 4 components: red, green, blue, alpha.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
int SetLibItemName(const UTF8 &aLibItemName)
Override the library item name portion of the LIB_ID to aLibItemName.
int compare(const LIB_ID &aLibId) const
Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname...
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
const wxString GetUniStringLibNickname() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
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
wxString GetKeyWords() 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 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.
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.
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of SCH_ITEM objects separated by unit and convert number.
std::map< int, wxString > m_unitDisplayNames
void ClearTempFlags() override
Clears the status flag all draw objects in this symbol.
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
int GetMaxPinNumber() const
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.
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).
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.
SCH_FIELD & GetFootprintField() const
Return reference to the footprint field.
void SetParent(LIB_SYMBOL *aParent=nullptr)
wxString GetName() const override
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.
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.
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.
bool HasUnitDisplayName(int aUnit) override
Return true if the given unit aUnit has a display name defined.
const BOX2I GetBodyBoundingBox(int aUnit, int aBodyStyle, bool aIncludePins, bool aIncludePrivateItems) const
Get the symbol bounding box excluding fields.
LIB_SYMBOL_SPTR SharedPtr() const
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...
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
EMBEDDED_FILES * GetEmbeddedFiles() override
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.
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.
int GetPinCount() override
void AddField(SCH_FIELD *aField)
Add a field.
void ClearEditFlags() 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.
ITERATOR_BASE< SCH_ITEM, MULTIVECTOR< SCH_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
The const iterator.
ITERATOR end(int aType=UNDEFINED_TYPE)
void clear(int aType=UNDEFINED_TYPE)
ITERATOR erase(const ITERATOR &aIterator)
ITERATOR begin(int aType=UNDEFINED_TYPE)
Base plotter engine class.
bool GetColorMode() const
virtual void SetColor(const COLOR4D &color)=0
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,...
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
wxString GetFullText(int unit=1) const
Return the text of a field.
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
bool ShowInChooser() const
void SetText(const wxString &aText) override
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
virtual void SetExcludedFromSim(bool aExclude)
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
const wxString & GetNumber() const
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
void SetStroke(const STROKE_PARAMS &aStroke) override
STROKE_PARAMS GetStroke() const override
Simple container to manage line stroke parameters.
void SetColor(const KIGFX::COLOR4D &aColor)
KIGFX::COLOR4D GetColor() const
Object used to load, save, search, and otherwise manipulate symbol library files.
const wxString GetName() const
Return the file name without path or extension.
A base class for LIB_SYMBOL and SCH_SYMBOL.
bool GetExcludedFromBoard() const
bool GetExcludedFromBOM() const
bool GetDNP() const
Set or clear the 'Do Not Populate' flaga.
SYMBOL & operator=(const SYMBOL &aItem)
int m_pinNameOffset
The offset in mils to draw the pin name.
bool GetExcludedFromSim() const override
#define DEFAULT_PIN_NAME_OFFSET
The intersheets references prefix string.
const INSPECTOR_FUNC & INSPECTOR
#define IS_NEW
New item, just created.
#define STRUCT_DELETED
flag indication structures to be erased
TRANSFORM DefaultTransform
bool GetGRForceBlackPenState(void)
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
constexpr int MilsToIU(int mils) const
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.
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
void operator()(void const *) const
Definition for symbol library class.
@ DATASHEET_FIELD
name of datasheet
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ MANDATORY_FIELDS
The first 5 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
@ DESCRIPTION_FIELD
Field Description of part, i.e. "1/4W 1% Metal Film Resistor".
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.