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 ) );
59 if( !footprint.IsEmpty() )
73 aColumnMap[field->
GetName()] = field->EDA_TEXT::GetShownText(
false );
105 [&](
FIELD_T id,
bool visible )
113 addField( FIELD_T::REFERENCE,
true );
114 addField( FIELD_T::VALUE,
true );
115 addField( FIELD_T::FOOTPRINT,
false );
116 addField( FIELD_T::DATASHEET,
false );
117 addField( FIELD_T::DESCRIPTION,
false );
164 wxFAIL_MSG(
"Failed to clone SCH_ITEM." );
178 if( &aSymbol ==
this )
262 parent = parent->GetParent().lock();
275 return sp->GetRootSymbol();
300 if( aBodyStyle == BODY_STYLE::DEMORGAN )
301 return aLabel ?
_(
"Alternate" ) : wxString(
_HKI(
"Alternate" ) );
302 else if( aBodyStyle == BODY_STYLE::BASE )
303 return aLabel ?
_(
"Standard" ) : wxString(
_HKI(
"Standard" ) );
312 aTarget[it.first] = it.second;
320 if( aName.Length() > 0 )
346 std::unique_ptr< LIB_SYMBOL > retv;
352 wxCHECK_MSG( parent, retv,
353 wxString::Format(
"Parent of derived symbol '%s' undefined",
m_name ) );
356 if( parent->IsDerived() )
357 retv = parent->Flatten();
359 retv = std::make_unique<LIB_SYMBOL>( *parent.get() );
368 *retv->GetField( fieldId ) = *
GetField( fieldId );
387 retv->AddDrawItem( newField );
391 retv->RemoveDrawItem( parentField );
392 retv->AddDrawItem( newField );
400 retv->SetExcludedFromBOM( parent->GetExcludedFromBOM() );
401 retv->SetExcludedFromBoard( parent->GetExcludedFromBoard() );
403 retv->m_parent.reset();
407 retv = std::make_unique<LIB_SYMBOL>( *
this );
425 std::shared_ptr<LIB_SYMBOL> parent;
429 if( parent->IsRoot() )
432 return parent->IsLocalPower();
443 if( parent->IsRoot() )
446 parent->SetLocalPower();
455 std::shared_ptr<LIB_SYMBOL> parent;
459 if( parent->IsRoot() )
462 return parent->IsGlobalPower();
479 if( parent->IsRoot() )
482 parent->SetGlobalPower();
493 if( parent->IsRoot() )
496 return parent->IsNormal();
507 if( parent->IsRoot() )
527 u = ( aUnit - 1 ) % 26;
528 suffix = wxChar( aInitialLetter + u ) + suffix;
529 aUnit = ( aUnit - u ) / 26;
530 }
while( aUnit > 0 );
546 if( field.
GetId() == FIELD_T::FOOTPRINT )
547 footprint = field.
GetShownText(
nullptr,
false, aDepth + 1 );
550 || token->IsSameAs( field.
GetName(),
false ) )
552 *token = field.
GetShownText(
nullptr,
false, aDepth + 1 );
559 if( token->IsSameAs( wxT(
"SIM.DEVICE" ) )
560 || token->IsSameAs( wxT(
"SIM.TYPE" ) )
561 || token->IsSameAs( wxT(
"SIM.PINS" ) )
562 || token->IsSameAs( wxT(
"SIM.PARAMS" ) )
563 || token->IsSameAs( wxT(
"SIM.LIBRARY" ) )
564 || token->IsSameAs( wxT(
"SIM.NAME" ) ) )
566 *token = wxEmptyString;
570 if( token->IsSameAs( wxT(
"FOOTPRINT_LIBRARY" ) ) )
572 wxArrayString parts = wxSplit( footprint,
':' );
574 if( parts.Count() > 0 )
577 *token = wxEmptyString;
581 else if( token->IsSameAs( wxT(
"FOOTPRINT_NAME" ) ) )
583 wxArrayString parts = wxSplit( footprint,
':' );
585 if( parts.Count() > 1 )
586 *token = parts[ std::min( 1, (
int) parts.size() - 1 ) ];
588 *token = wxEmptyString;
592 else if( token->IsSameAs( wxT(
"SYMBOL_LIBRARY" ) ) )
597 else if( token->IsSameAs( wxT(
"SYMBOL_NAME" ) ) )
602 else if( token->IsSameAs( wxT(
"SYMBOL_DESCRIPTION" ) ) )
607 else if( token->IsSameAs( wxT(
"SYMBOL_KEYWORDS" ) ) )
612 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOM" ) ) )
617 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOARD" ) ) )
622 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_SIM" ) ) )
627 else if( token->IsSameAs( wxT(
"DNP" ) ) )
629 *token = this->
GetDNP() ?
_(
"DNP" ) : wxString(
"" );
638 int aUnit,
int aBodyStyle,
const VECTOR2I &aOffset,
bool aDimmed )
640 wxASSERT( aPlotter !=
nullptr );
646 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->
GetColorMode() )
660 if( item.IsPrivate() )
668 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
671 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
674 item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
680 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
682 wxASSERT( aPlotter !=
nullptr );
688 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->
GetColorMode() )
708 wxString tmp = field.
GetText();
711 item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
720 std::vector<SCH_SHAPE*> potential_top_items;
721 std::vector<SCH_ITEM*> bottom_items;
729 if( shape.
GetFillMode() == FILL_T::FILLED_WITH_COLOR )
730 potential_top_items.push_back( &shape );
732 bottom_items.push_back( &item );
736 bottom_items.push_back( &item );
740 std::sort( potential_top_items.begin(), potential_top_items.end(),
743 return a->GetBoundingBox().GetArea() > b->GetBoundingBox().GetArea();
746 for(
SCH_SHAPE* item : potential_top_items )
748 for(
SCH_ITEM* bottom_item : bottom_items )
750 if( item->GetBoundingBox().Contains( bottom_item->GetBoundingBox() ) )
752 item->SetFillMode( FILL_T::FILLED_WITH_BG_BODYCOLOR );
762 wxASSERT( aItem !=
nullptr );
768 if(
static_cast<SCH_FIELD*
>( aItem )->IsMandatory() )
774 for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
801 std::vector<SCH_PIN*> pins;
816 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
820 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
839 return (
int)
GetPins( 0 , 1 ).size();
847 if( aNumber ==
pin->GetNumber() )
856 bool aTestType,
bool aTestOrientation,
bool aTestLength )
const
861 bool foundMatch =
false;
865 wxASSERT( otherPin );
868 if(
pin->GetUnit() != otherPin->GetUnit() )
872 if(
pin->GetBodyStyle() != otherPin->GetBodyStyle() )
876 if(
pin->GetPosition() != otherPin->GetPosition() )
880 if( aTestNums && (
pin->GetNumber() != otherPin->GetNumber() ) )
884 if( aTestNames && (
pin->GetName() != otherPin->GetName() ) )
888 if( aTestType && (
pin->GetType() != otherPin->GetType() ) )
893 && (
pin->GetOrientation() != otherPin->GetOrientation() ) )
897 if( aTestLength && (
pin->GetLength() != otherPin->GetLength() ) )
918 bool aIgnoreHiddenFields )
const
924 if( item.m_unit > 0 &&
m_unitCount > 1 && aUnit > 0 && aUnit != item.m_unit )
927 if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
930 if( aIgnoreHiddenFields && item.Type() ==
SCH_FIELD_T )
932 if( !
static_cast<const SCH_FIELD&
>( item ).IsVisible() )
936 bBox.
Merge( item.GetBoundingBox() );
944 bool aIncludePrivateItems )
const
950 if( item.m_unit > 0 && aUnit > 0 && aUnit != item.m_unit )
953 if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
956 if( item.IsPrivate() && !aIncludePrivateItems )
966 if(
pin.IsVisible() )
972 bbox.
Merge(
pin.GetBoundingBox(
false,
false,
false ) );
979 bbox.
Merge( item.GetBoundingBox() );
1003 for(
const SCH_FIELD& src : aFieldsList )
1028 aList.push_back(
const_cast<SCH_FIELD*
>( field ) );
1031 std::sort( aList.begin(), aList.end(),
1034 return lhs->GetOrdinal() < rhs->GetOrdinal();
1041 std::vector<SCH_FIELD*> orderedFields;
1046 aList.emplace_back( *field );
1055 ordinal = std::max( ordinal,
static_cast<const SCH_FIELD*
>( &item )->GetOrdinal() + 1 );
1067 if( field->
GetId() == aFieldType )
1081 if( field->
GetId() == aFieldType )
1095 if( field.
GetName() == aFieldName )
1109 if( field.
GetName() == aFieldName )
1134 wxASSERT( field !=
nullptr );
1142 wxASSERT( field !=
nullptr );
1150 wxASSERT( field !=
nullptr );
1158 wxASSERT( field !=
nullptr );
1166 wxASSERT( field !=
nullptr );
1175 refDesignator.Replace( wxS(
"~" ), wxS(
" " ) );
1177 wxString prefix = refDesignator;
1179 while( prefix.Length() )
1181 wxUniCharRef last = prefix.Last();
1183 if( ( last >=
'0' && last <=
'9' ) || last ==
'?' || last ==
'*' )
1184 prefix.RemoveLast();
1190 prefix.Trim(
true );
1191 prefix.Trim(
false );
1207 item.Move( aOffset );
1215 if( item.m_bodyStyle > BODY_STYLE::BASE )
1221 for(
const SCH_ITEM& item : parent->GetDrawItems() )
1223 if( item.m_bodyStyle > BODY_STYLE::BASE )
1234 int maxPinNumber = 0;
1241 long currentPinNumber = 0;
1243 if(
pin->GetNumber().ToLong( ¤tPinNumber ) )
1244 maxPinNumber = std::max( maxPinNumber, (
int) currentPinNumber );
1247 return maxPinNumber;
1256 item.ClearTempFlags();
1265 item.ClearEditFlags();
1274 if( ( aUnit && item.m_unit && aUnit != item.m_unit )
1275 || ( aBodyStyle && item.m_bodyStyle && aBodyStyle != item.m_bodyStyle )
1281 if( item.HitTest( aPoint ) )
1310 const std::vector<KICAD_T>& aScanTypes )
1315 if( item.IsType( aScanTypes ) )
1317 if( aInspector( &item, aTestData ) == INSPECT_RESULT::QUIT )
1318 return INSPECT_RESULT::QUIT;
1322 return INSPECT_RESULT::CONTINUE;
1337 if( i->m_unit > aCount )
1343 else if( aDuplicateDrawItems )
1350 std::vector<SCH_ITEM*> tmp;
1354 if( item.m_unit != 1 )
1357 for(
int j = prevCount + 1; j <= aCount; j++ )
1361 tmp.push_back( newItem );
1377 return parent->GetUnitCount();
1391 if( aDuplicatePins )
1393 std::vector<SCH_ITEM*> tmp;
1397 if( item.m_bodyStyle == 1 )
1401 tmp.push_back( newItem );
1417 if( i->m_bodyStyle > 1 )
1430 std::vector<SCH_ITEM*> unitItems;
1437 if( ( aBodyStyle == -1 && item.GetUnit() == aUnit )
1438 || ( aUnit == -1 && item.GetBodyStyle() == aBodyStyle )
1439 || ( aUnit == item.GetUnit() && aBodyStyle == item.GetBodyStyle() ) )
1441 unitItems.push_back( &item );
1451 std::vector<LIB_SYMBOL_UNIT> units;
1458 int unit = item.GetUnit();
1459 int bodyStyle = item.GetBodyStyle();
1461 auto it = std::find_if( units.begin(), units.end(),
1464 return a.m_unit == unit && a.m_bodyStyle == bodyStyle;
1467 if( it == units.end() )
1470 newUnit.
m_unit = item.GetUnit();
1472 newUnit.
m_items.push_back( &item );
1473 units.emplace_back( newUnit );
1477 it->m_items.push_back( &item );
1487#define REPORT( msg ) { if( aReporter ) aReporter->Report( msg ); }
1488#define ITEM_DESC( item ) ( item )->GetItemDescription( &unitsProvider, true )
1517 REPORT(
_(
"Power flag differs." ) );
1526 REPORT(
_(
"Unit count differs." ) );
1535 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> aShapes;
1536 std::set<const SCH_ITEM*> aFields;
1537 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> aPins;
1542 aShapes.insert( &(*it) );
1544 aFields.insert( &(*it) );
1546 aPins.insert( &(*it) );
1549 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> bShapes;
1550 std::set<const SCH_ITEM*> bFields;
1551 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> bPins;
1556 bShapes.insert( &(*it) );
1558 bFields.insert( &(*it) );
1560 bPins.insert( &(*it) );
1563 if(
int tmp =
static_cast<int>( aShapes.size() - bShapes.size() ) )
1566 REPORT(
_(
"Graphic item count differs." ) );
1573 for(
auto aIt = aShapes.begin(), bIt = bShapes.begin(); aIt != aShapes.end(); aIt++, bIt++ )
1575 if(
int tmp2 = (*aIt)->compare( *(*bIt), aCompareFlags ) )
1586 if(
int tmp =
static_cast<int>( aPins.size() - bPins.size() ) )
1589 REPORT(
_(
"Pin count differs." ) );
1596 for(
const SCH_ITEM* aPinItem : aPins )
1610 else if(
int tmp2 = aPinItem->compare( *bPin, aCompareFlags ) )
1621 for(
const SCH_ITEM* aFieldItem : aFields )
1635 tmp = aFieldItem->
compare( *bField, aCompareFlags );
1640 REPORT( wxString::Format(
_(
"%s field differs." ), aField->
GetName(
false ) ) );
1647 if(
int tmp =
static_cast<int>( aFields.size() - bFields.size() ) )
1650 REPORT(
_(
"Field count differs." ) );
1659 REPORT(
_(
"Footprint filters differs." ) );
1666 for(
size_t i = 0; i <
m_fpFilters.GetCount(); i++ )
1671 REPORT(
_(
"Footprint filters differ." ) );
1682 REPORT(
_(
"Symbol keywords differ." ) );
1691 REPORT(
_(
"Symbol pin name offsets differ." ) );
1702 REPORT(
_(
"Show pin names settings differ." ) );
1711 REPORT(
_(
"Show pin numbers settings differ." ) );
1720 REPORT(
_(
"Exclude from simulation settings differ." ) );
1729 REPORT(
_(
"Exclude from bill of materials settings differ." ) );
1738 REPORT(
_(
"Exclude from board settings differ." ) );
1768 return Compare( *tmp, aCompareFlags );
1777 double similarity = 0.0;
1786 double max_similarity = 0.0;
1790 double temp_similarity = item.
Similarity( otherItem );
1791 max_similarity = std::max( max_similarity, temp_similarity );
1793 if( max_similarity == 1.0 )
1797 similarity += max_similarity;
1803 double max_similarity = 0.0;
1807 double temp_similarity =
pin->Similarity( *otherPin );
1808 max_similarity = std::max( max_similarity, temp_similarity );
1810 if( max_similarity == 1.0 )
1814 similarity += max_similarity;
1817 if( totalItems == 0 )
1820 similarity /= totalItems;
1866 std::set<KIFONT::OUTLINE_FONT*>
fonts;
1874 if(
auto* font =
text.GetFont(); font && !font->IsStroke() )
1879 if( permission == EMBEDDING_PERMISSION::EDITABLE
1880 || permission == EMBEDDING_PERMISSION::INSTALLABLE )
1882 fonts.insert( outline );
1908 if(
group.contains( aPinNumber ) )
1912 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
bool HasUnitDisplayName(int aUnit) const
Return true if the given unit aUnit has a display name defined.
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.
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 ...
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.
static wxString LetterSubReference(int aUnit, wxChar aInitialLetter)
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.
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...
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
wxString GetBodyStyleDescription(int aBodyStyle, bool aLabel) 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.
wxString GetUnitDisplayName(int aUnit, bool aLabel) const override
Return the user-defined display name for aUnit for symbols with units.
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,...
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