42 std::vector<SEARCH_TERM> terms;
48 wxStringTokenizer keywordTokenizer(
GetKeyWords(), wxS(
" " ), wxTOKEN_STRTOK );
50 while( keywordTokenizer.HasMoreTokens() )
51 terms.emplace_back(
SEARCH_TERM( keywordTokenizer.GetNextToken(), 4 ) );
54 std::map<wxString, wxString> fields;
57 for(
const auto& [
name,
text ] : fields )
66 if( !footprint.IsEmpty() )
80 aColumnMap[field->
GetName()] = field->EDA_TEXT::GetShownText(
false );
112 [&](
FIELD_T id,
bool visible )
121 addField( FIELD_T::REFERENCE,
true );
122 addField( FIELD_T::VALUE,
true );
123 addField( FIELD_T::FOOTPRINT,
false );
124 addField( FIELD_T::DATASHEET,
false );
125 addField( FIELD_T::DESCRIPTION,
false );
172 wxFAIL_MSG(
"Failed to clone SCH_ITEM." );
186 if( &aSymbol ==
this )
270 parent = parent->GetParent().lock();
283 return sp->GetRootSymbol();
313 aTarget[it.first] = it.second;
321 if( aName.Length() > 0 )
347 std::unique_ptr< LIB_SYMBOL > retv;
353 wxCHECK_MSG( parent, retv,
354 wxString::Format(
"Parent of derived symbol '%s' undefined",
m_name ) );
357 if( parent->IsDerived() )
358 retv = parent->Flatten();
360 retv = std::make_unique<LIB_SYMBOL>( *parent.get() );
369 *retv->GetField( fieldId ) = *
GetField( fieldId );
388 retv->AddDrawItem( newField );
392 retv->RemoveDrawItem( parentField );
393 retv->AddDrawItem( newField );
401 retv->SetExcludedFromBOM( parent->GetExcludedFromBOM() );
402 retv->SetExcludedFromBoard( parent->GetExcludedFromBoard() );
404 retv->m_parent.reset();
408 retv = std::make_unique<LIB_SYMBOL>( *
this );
426 std::shared_ptr<LIB_SYMBOL> parent;
430 if( parent->IsRoot() )
433 return parent->IsLocalPower();
444 if( parent->IsRoot() )
447 parent->SetLocalPower();
456 std::shared_ptr<LIB_SYMBOL> parent;
460 if( parent->IsRoot() )
463 return parent->IsGlobalPower();
480 if( parent->IsRoot() )
483 parent->SetGlobalPower();
494 if( parent->IsRoot() )
497 return parent->IsNormal();
508 if( parent->IsRoot() )
528 u = ( aUnit - 1 ) % 26;
529 suffix = wxChar( aFirstId + u ) + suffix;
530 aUnit = ( aUnit - u ) / 26;
531 }
while( aUnit > 0 );
547 if( field.
GetId() == FIELD_T::FOOTPRINT )
548 footprint = field.
GetShownText(
nullptr,
false, aDepth + 1 );
551 || token->IsSameAs( field.
GetName(),
false ) )
553 *token = field.
GetShownText(
nullptr,
false, aDepth + 1 );
560 if( token->IsSameAs( wxT(
"SIM.DEVICE" ) )
561 || token->IsSameAs( wxT(
"SIM.TYPE" ) )
562 || token->IsSameAs( wxT(
"SIM.PINS" ) )
563 || token->IsSameAs( wxT(
"SIM.PARAMS" ) )
564 || token->IsSameAs( wxT(
"SIM.LIBRARY" ) )
565 || token->IsSameAs( wxT(
"SIM.NAME" ) ) )
567 *token = wxEmptyString;
571 if( token->IsSameAs( wxT(
"FOOTPRINT_LIBRARY" ) ) )
573 wxArrayString parts = wxSplit( footprint,
':' );
575 if( parts.Count() > 0 )
578 *token = wxEmptyString;
582 else if( token->IsSameAs( wxT(
"FOOTPRINT_NAME" ) ) )
584 wxArrayString parts = wxSplit( footprint,
':' );
586 if( parts.Count() > 1 )
587 *token = parts[ std::min( 1, (
int) parts.size() - 1 ) ];
589 *token = wxEmptyString;
593 else if( token->IsSameAs( wxT(
"SYMBOL_LIBRARY" ) ) )
598 else if( token->IsSameAs( wxT(
"SYMBOL_NAME" ) ) )
603 else if( token->IsSameAs( wxT(
"SYMBOL_DESCRIPTION" ) ) )
608 else if( token->IsSameAs( wxT(
"SYMBOL_KEYWORDS" ) ) )
613 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOM" ) ) )
618 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOARD" ) ) )
623 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_SIM" ) ) )
628 else if( token->IsSameAs( wxT(
"DNP" ) ) )
630 *token = this->
GetDNP() ?
_(
"DNP" ) : wxString(
"" );
639 int aUnit,
int aBodyStyle,
const VECTOR2I &aOffset,
bool aDimmed )
641 wxASSERT( aPlotter !=
nullptr );
647 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->
GetColorMode() )
661 if( item.IsPrivate() )
669 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
672 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
675 item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
681 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
683 wxASSERT( aPlotter !=
nullptr );
689 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->
GetColorMode() )
709 wxString tmp = field.
GetText();
712 item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
721 std::vector<SCH_SHAPE*> potential_top_items;
722 std::vector<SCH_ITEM*> bottom_items;
730 if( shape.
GetFillMode() == FILL_T::FILLED_WITH_COLOR )
731 potential_top_items.push_back( &shape );
733 bottom_items.push_back( &item );
737 bottom_items.push_back( &item );
741 std::sort( potential_top_items.begin(), potential_top_items.end(),
744 return a->GetBoundingBox().GetArea() > b->GetBoundingBox().GetArea();
747 for(
SCH_SHAPE* item : potential_top_items )
749 for(
SCH_ITEM* bottom_item : bottom_items )
751 if( item->GetBoundingBox().Contains( bottom_item->GetBoundingBox() ) )
753 item->SetFillMode( FILL_T::FILLED_WITH_BG_BODYCOLOR );
763 wxASSERT( aItem !=
nullptr );
769 if(
static_cast<SCH_FIELD*
>( aItem )->IsMandatory() )
775 for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
802 std::vector<SCH_PIN*> pins;
817 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
821 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
840 return (
int)
GetPins( 0 , 1 ).size();
848 if( aNumber ==
pin->GetNumber() )
857 bool aTestType,
bool aTestOrientation,
bool aTestLength )
const
862 bool foundMatch =
false;
866 wxASSERT( otherPin );
869 if(
pin->GetUnit() != otherPin->GetUnit() )
873 if(
pin->GetBodyStyle() != otherPin->GetBodyStyle() )
877 if(
pin->GetPosition() != otherPin->GetPosition() )
881 if( aTestNums && (
pin->GetNumber() != otherPin->GetNumber() ) )
885 if( aTestNames && (
pin->GetName() != otherPin->GetName() ) )
889 if( aTestType && (
pin->GetType() != otherPin->GetType() ) )
894 && (
pin->GetOrientation() != otherPin->GetOrientation() ) )
898 if( aTestLength && (
pin->GetLength() != otherPin->GetLength() ) )
919 bool aIgnoreHiddenFields )
const
925 if( item.m_unit > 0 &&
m_unitCount > 1 && aUnit > 0 && aUnit != item.m_unit )
928 if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
931 if( aIgnoreHiddenFields && item.Type() ==
SCH_FIELD_T )
933 if( !
static_cast<const SCH_FIELD&
>( item ).IsVisible() )
937 bBox.
Merge( item.GetBoundingBox() );
945 bool aIncludePrivateItems )
const
951 if( item.m_unit > 0 && aUnit > 0 && aUnit != item.m_unit )
954 if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
957 if( item.IsPrivate() && !aIncludePrivateItems )
967 if(
pin.IsVisible() )
973 bbox.
Merge(
pin.GetBoundingBox(
false,
false,
false ) );
980 bbox.
Merge( item.GetBoundingBox() );
1004 for(
const SCH_FIELD& src : aFieldsList )
1029 aList.push_back(
const_cast<SCH_FIELD*
>( field ) );
1032 std::sort( aList.begin(), aList.end(),
1035 return lhs->GetOrdinal() < rhs->GetOrdinal();
1042 std::vector<SCH_FIELD*> orderedFields;
1047 aList.emplace_back( *field );
1056 ordinal = std::max( ordinal,
static_cast<const SCH_FIELD*
>( &item )->GetOrdinal() + 1 );
1068 if( field->
GetId() == aFieldType )
1082 if( field->
GetId() == aFieldType )
1096 if( field.
GetName() == aFieldName )
1110 if( field.
GetName() == aFieldName )
1135 wxASSERT( field !=
nullptr );
1143 wxASSERT( field !=
nullptr );
1151 wxASSERT( field !=
nullptr );
1159 wxASSERT( field !=
nullptr );
1167 wxASSERT( field !=
nullptr );
1176 refDesignator.Replace( wxS(
"~" ), wxS(
" " ) );
1178 wxString prefix = refDesignator;
1180 while( prefix.Length() )
1182 wxUniCharRef last = prefix.Last();
1184 if( ( last >=
'0' && last <=
'9' ) || last ==
'?' || last ==
'*' )
1185 prefix.RemoveLast();
1191 prefix.Trim(
true );
1192 prefix.Trim(
false );
1208 item.Move( aOffset );
1216 if( item.m_bodyStyle > BODY_STYLE::BASE )
1222 for(
const SCH_ITEM& item : parent->GetDrawItems() )
1224 if( item.m_bodyStyle > BODY_STYLE::BASE )
1235 int maxPinNumber = 0;
1242 long currentPinNumber = 0;
1244 if(
pin->GetNumber().ToLong( ¤tPinNumber ) )
1245 maxPinNumber = std::max( maxPinNumber, (
int) currentPinNumber );
1248 return maxPinNumber;
1257 item.ClearTempFlags();
1266 item.ClearEditFlags();
1275 if( ( aUnit && item.m_unit && aUnit != item.m_unit )
1276 || ( aBodyStyle && item.m_bodyStyle && aBodyStyle != item.m_bodyStyle )
1282 if( item.HitTest( aPoint ) )
1311 const std::vector<KICAD_T>& aScanTypes )
1316 if( item.IsType( aScanTypes ) )
1318 if( aInspector( &item, aTestData ) == INSPECT_RESULT::QUIT )
1319 return INSPECT_RESULT::QUIT;
1323 return INSPECT_RESULT::CONTINUE;
1338 if( i->m_unit > aCount )
1344 else if( aDuplicateDrawItems )
1351 std::vector<SCH_ITEM*> tmp;
1355 if( item.m_unit != 1 )
1358 for(
int j = prevCount + 1; j <= aCount; j++ )
1362 tmp.push_back( newItem );
1378 return parent->GetUnitCount();
1392 if( aDuplicatePins )
1394 std::vector<SCH_ITEM*> tmp;
1398 if( item.m_bodyStyle == 1 )
1402 tmp.push_back( newItem );
1418 if( i->m_bodyStyle > 1 )
1431 std::vector<SCH_ITEM*> unitItems;
1438 if( ( aBodyStyle == -1 && item.GetUnit() == aUnit )
1439 || ( aUnit == -1 && item.GetBodyStyle() == aBodyStyle )
1440 || ( aUnit == item.GetUnit() && aBodyStyle == item.GetBodyStyle() ) )
1442 unitItems.push_back( &item );
1452 std::vector<LIB_SYMBOL_UNIT> units;
1459 int unit = item.GetUnit();
1460 int bodyStyle = item.GetBodyStyle();
1462 auto it = std::find_if( units.begin(), units.end(),
1465 return a.m_unit == unit && a.m_bodyStyle == bodyStyle;
1468 if( it == units.end() )
1471 newUnit.
m_unit = item.GetUnit();
1473 newUnit.
m_items.push_back( &item );
1474 units.emplace_back( newUnit );
1478 it->m_items.push_back( &item );
1488#define REPORT( msg ) { if( aReporter ) aReporter->Report( msg ); }
1489#define ITEM_DESC( item ) ( item )->GetItemDescription( &unitsProvider, true )
1518 REPORT(
_(
"Power flag differs." ) );
1527 REPORT(
_(
"Unit count differs." ) );
1536 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> aShapes;
1537 std::set<const SCH_ITEM*> aFields;
1538 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> aPins;
1543 aShapes.insert( &(*it) );
1545 aFields.insert( &(*it) );
1547 aPins.insert( &(*it) );
1550 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> bShapes;
1551 std::set<const SCH_ITEM*> bFields;
1552 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> bPins;
1557 bShapes.insert( &(*it) );
1559 bFields.insert( &(*it) );
1561 bPins.insert( &(*it) );
1564 if(
int tmp =
static_cast<int>( aShapes.size() - bShapes.size() ) )
1567 REPORT(
_(
"Graphic item count differs." ) );
1574 for(
auto aIt = aShapes.begin(), bIt = bShapes.begin(); aIt != aShapes.end(); aIt++, bIt++ )
1576 if(
int tmp2 = (*aIt)->compare( *(*bIt), aCompareFlags ) )
1587 if(
int tmp =
static_cast<int>( aPins.size() - bPins.size() ) )
1590 REPORT(
_(
"Pin count differs." ) );
1597 for(
const SCH_ITEM* aPinItem : aPins )
1611 else if(
int tmp2 = aPinItem->compare( *bPin, aCompareFlags ) )
1622 for(
const SCH_ITEM* aFieldItem : aFields )
1636 tmp = aFieldItem->
compare( *bField, aCompareFlags );
1641 REPORT( wxString::Format(
_(
"%s field differs." ), aField->
GetName(
false ) ) );
1648 if(
int tmp =
static_cast<int>( aFields.size() - bFields.size() ) )
1651 REPORT(
_(
"Field count differs." ) );
1660 REPORT(
_(
"Footprint filters differs." ) );
1667 for(
size_t i = 0; i <
m_fpFilters.GetCount(); i++ )
1672 REPORT(
_(
"Footprint filters differ." ) );
1683 REPORT(
_(
"Symbol keywords differ." ) );
1692 REPORT(
_(
"Symbol pin name offsets differ." ) );
1703 REPORT(
_(
"Show pin names settings differ." ) );
1712 REPORT(
_(
"Show pin numbers settings differ." ) );
1721 REPORT(
_(
"Exclude from simulation settings differ." ) );
1730 REPORT(
_(
"Exclude from bill of materials settings differ." ) );
1739 REPORT(
_(
"Exclude from board settings differ." ) );
1769 return Compare( *tmp, aCompareFlags );
1778 double similarity = 0.0;
1787 double max_similarity = 0.0;
1791 double temp_similarity = item.
Similarity( otherItem );
1792 max_similarity = std::max( max_similarity, temp_similarity );
1794 if( max_similarity == 1.0 )
1798 similarity += max_similarity;
1804 double max_similarity = 0.0;
1808 double temp_similarity =
pin->Similarity( *otherPin );
1809 max_similarity = std::max( max_similarity, temp_similarity );
1811 if( max_similarity == 1.0 )
1815 similarity += max_similarity;
1818 if( totalItems == 0 )
1821 similarity /= totalItems;
1867 std::set<KIFONT::OUTLINE_FONT*>
fonts;
1875 if(
auto* font =
text.GetFont(); font && !font->IsStroke() )
1880 if( permission == EMBEDDING_PERMISSION::EDITABLE
1881 || permission == EMBEDDING_PERMISSION::INSTALLABLE )
1883 fonts.insert( outline );
1909 if(
group.contains( aPinNumber ) )
1913 return std::nullopt;
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_FILES & operator=(EMBEDDED_FILES &&other) noexcept
EMBEDDED_FILE * AddFile(const wxFileName &aName, bool aOverwrite)
Load a file from disk and adds it to the collection.
Class OUTLINE_FONT implements outline font drawing.
EMBEDDING_PERMISSION GetEmbeddingPermission() const
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.
SCH_FIELD & GetDescriptionField()
Return reference to the description field.
wxString GetDescription() const override
wxString GetKeyWords() const override
std::vector< SCH_PIN * > GetPins(int aUnit, int aBodyStyle) const
Return a list of pin object pointers from the draw item list.
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.)
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.
void GetFields(std::vector< SCH_FIELD * > &aList, bool aVisibleOnly=false) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
bool IsPower() const override
void SetUnitCount(int aCount, bool aDuplicateDrawItems=true)
Set the units per symbol count.
SCH_FIELD & GetDatasheetField()
Return reference to the datasheet field.
const BOX2I GetUnitBoundingBox(int aUnit, int aBodyStyle, bool aIgnoreHiddenFields=true) const
Get the bounding box for the 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
std::vector< std::set< wxString > > m_jumperPinGroups
A list of jumper pin groups, each of which is a set of pin numbers that should be jumpered together (...
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.
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.
SCH_FIELD * GetField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName; return nullptr if not found.
SCH_FIELD & GetFootprintField()
Return reference to the footprint field.
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::set< KIFONT::OUTLINE_FONT * > GetFonts() const override
bool HasAlternateBodyStyle() const override
Test if symbol has more than one body conversion type (DeMorgan).
SCH_FIELD * FindFieldCaseInsensitive(const wxString &aFieldName)
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.
static LIB_SYMBOL * GetDummy()
Returns a dummy LIB_SYMBOL, used when one is missing in the schematic.
void PlotFields(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed)
Plot symbol fields.
void SetParent(LIB_SYMBOL *aParent=nullptr)
wxString GetName() const override
SCH_FIELD & GetValueField()
Return reference to the value field.
bool IsLocalPower() const override
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
std::optional< const std::set< wxString > > GetJumperPinGroup(const wxString &aPinNumber) const
Retrieves the jumper group containing the specified pin number, if one exists.
void SetLib(SYMBOL_LIB *aLibrary)
std::vector< SCH_PIN * > GetPins() const override
Return a list of pin pointers for all units / converts.
wxString GetLibNickname() const override
Sets the Description field text value.
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.
void CopyFields(std::vector< SCH_FIELD > &aList)
Create a copy of the SCH_FIELDs, sorted in ordinal order.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
LIB_SYMBOL_SPTR SharedPtr() const
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared.
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.
bool IsGlobalPower() const override
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.
BOX2I GetBodyBoundingBox() const override
Return a bounding box for the symbol body but not the pins or fields.
int GetPinCount() override
void AddField(SCH_FIELD *aField)
Add a field.
void ClearEditFlags() override
LIB_ID GetLIB_ID() const override
LIB_SYMBOL_REF & GetParent()
bool m_duplicatePinNumbersAreJumpers
Flag that this symbol should automatically treat sets of two or more pins with the same number as jum...
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.
SCH_FIELD & GetReferenceField()
Return reference to the reference designator field.
int GetNextFieldOrdinal() const
Return the next ordinal for a user field for this symbol.
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.
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.
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
void SetShowInChooser(bool aShow=true)
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_ITEM * Duplicate(bool addToParentGroup, SCH_COMMIT *aCommit=nullptr, bool doClone=false) const
Routine to create a new copy of given item.
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
virtual void SetExcludedFromSim(bool aExclude)
const wxString & GetNumber() const
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
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 override
bool GetDNP() const override
Set or clear the 'Do Not Populate' flag.
SYMBOL & operator=(const SYMBOL &aItem)
bool GetExcludedFromBOM() const override
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
std::function passed to nested users by ref, avoids copying std::function.
#define IGNORE_PARENT_GROUP
#define IS_NEW
New item, just created.
#define STRUCT_DELETED
flag indication structures to be erased
TRANSFORM DefaultTransform
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
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
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.
A structure for storing weighted search terms.
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.
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I