KiCad PCB EDA Suite
LIB_SYMBOL Class Reference

Define a library symbol object. More...

#include <lib_symbol.h>

Inheritance diagram for LIB_SYMBOL:
EDA_ITEM LIB_TREE_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 LIB_SYMBOL (const wxString &aName, LIB_SYMBOL *aParent=nullptr, SYMBOL_LIB *aLibrary=nullptr)
 
 LIB_SYMBOL (const LIB_SYMBOL &aSymbol, SYMBOL_LIB *aLibrary=nullptr)
 
virtual ~LIB_SYMBOL ()
 http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared More...
 
LIB_SYMBOL_SPTR SharedPtr () const
 
virtual LIB_SYMBOLDuplicate () const
 Create a copy of a LIB_SYMBOL and assigns unique KIIDs to the copy and its children. More...
 
void SetParent (LIB_SYMBOL *aParent=nullptr)
 
LIB_SYMBOL_REFGetParent ()
 
const LIB_SYMBOL_REFGetParent () const
 
void ClearCaches ()
 
virtual wxString GetClass () const override
 Return the class name. More...
 
virtual void SetName (const wxString &aName)
 
wxString GetName () const override
 
LIB_IDLibId ()
 
LIB_ID GetLibId () const override
 
void SetLibId (const LIB_ID &aLibId)
 
LIB_ID GetSourceLibId () const
 
void SetSourceLibId (const LIB_ID &aLibId)
 
wxString GetLibNickname () const override
 
void SetDescription (const wxString &aDescription)
 
wxString GetDescription () override
 
void SetKeyWords (const wxString &aKeyWords)
 
wxString GetKeyWords () const
 
wxString GetSearchText () override
 
wxString GetFootprint () override
 For items with footprint fields. More...
 
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/chooser for displaying in columns, searching, etc. More...
 
bool IsRoot () const override
 For symbols derived from other symbols, IsRoot() indicates no derivation. More...
 
bool IsAlias () const
 
const wxString GetLibraryName () const
 
SYMBOL_LIBGetLib () const
 
void SetLib (SYMBOL_LIB *aLibrary)
 
timestamp_t GetLastModDate () const
 
void SetFPFilters (const wxArrayString &aFilters)
 
wxArrayString GetFPFilters () const
 
void ViewGetLayers (int aLayers[], int &aCount) const override
 Return the all the layers within the VIEW the object is painted on. More...
 
const BOX2I GetUnitBoundingBox (int aUnit, int aConvert, bool aIgnoreHiddenFields=true) const
 Get the bounding box for the symbol. More...
 
const BOX2I GetBodyBoundingBox (int aUnit, int aConvert, bool aIncludePins, bool aIncludePrivateItems) const
 Get the symbol bounding box excluding fields. More...
 
const BOX2I GetBoundingBox () const override
 Return the orthogonal bounding box of this object for display purposes. More...
 
bool IsPower () const
 
bool IsNormal () const
 
void SetPower ()
 
void SetNormal ()
 
void LockUnits (bool aLockUnits)
 Set interchangeable the property for symbol units. More...
 
bool UnitsLocked () const
 Check whether symbol units are interchangeable. More...
 
void SetFields (const std::vector< LIB_FIELD > &aFieldsList)
 Overwrite all the existing fields in this symbol with fields supplied in aFieldsList. More...
 
void GetFields (std::vector< LIB_FIELD * > &aList)
 Return a list of fields within this symbol. More...
 
void GetFields (std::vector< LIB_FIELD > &aList)
 
void AddField (LIB_FIELD *aField)
 Add a field. More...
 
void AddField (LIB_FIELD &aField)
 
LIB_FIELDFindField (const wxString &aFieldName)
 Find a field within this symbol matching aFieldName and returns it or NULL if not found. More...
 
const LIB_FIELDFindField (const wxString &aFieldName) const
 
LIB_FIELDGetFieldById (int aId) const
 Return pointer to the requested field. More...
 
LIB_FIELDGetValueField ()
 Return reference to the value field. More...
 
LIB_FIELDGetReferenceField ()
 Return reference to the reference designator field. More...
 
LIB_FIELDGetFootprintField ()
 Return reference to the footprint field. More...
 
LIB_FIELDGetDatasheetField ()
 Return reference to the datasheet field. More...
 
wxString GetPrefix ()
 
int UpdateFieldOrdinals ()
 Order optional field indices. More...
 
int GetNextAvailableFieldId () const
 
void Print (const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, int aMulti, int aConvert, const LIB_SYMBOL_OPTIONS &aOpts, bool aDimmed)
 Print symbol. More...
 
void PrintBackground (const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, int aMulti, int aConvert, const LIB_SYMBOL_OPTIONS &aOpts, bool aDimmed)
 Print just the background fills of a symbol. More...
 
void Plot (PLOTTER *aPlotter, int aUnit, int aConvert, bool aBackground, const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed) const
 Plot lib symbol to plotter. More...
 
void PlotLibFields (PLOTTER *aPlotter, int aUnit, int aConvert, bool aBackground, const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed, bool aPlotHidden=true)
 Plot Lib Fields only of the symbol to plotter. More...
 
void AddDrawItem (LIB_ITEM *aItem, bool aSort=true)
 Add a new draw aItem to the draw object list and sort according to aSort. More...
 
void RemoveDrawItem (LIB_ITEM *aItem)
 Remove draw aItem from list. More...
 
void RemoveField (LIB_FIELD *aField)
 
size_t GetPinCount () const
 
size_t GetFieldCount () const
 
void GetPins (LIB_PINS &aList, int aUnit=0, int aConvert=0) const
 Return a list of pin object pointers from the draw item list. More...
 
std::vector< LIB_PIN * > GetAllLibPins () const
 Return a list of pin pointers for all units / converts. More...
 
size_t GetFullPinCount ()
 
LIB_PINGetPin (const wxString &aNumber, int aUnit=0, int aConvert=0) const
 Return pin object with the requested pin aNumber. More...
 
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. More...
 
void SetOffset (const VECTOR2I &aOffset)
 Move the symbol aOffset. More...
 
void RemoveDuplicateDrawItems ()
 Remove duplicate draw items from list. More...
 
bool HasConversion () const
 Test if symbol has more than one body conversion type (DeMorgan). More...
 
int GetMaxPinNumber () const
 
void ClearTempFlags ()
 Clears the status flag all draw objects in this symbol. More...
 
void ClearEditFlags ()
 
LIB_ITEMLocateDrawItem (int aUnit, int aConvert, KICAD_T aType, const VECTOR2I &aPoint)
 Locate a draw object. More...
 
LIB_ITEMLocateDrawItem (int aUnit, int aConvert, KICAD_T aType, const VECTOR2I &aPoint, const TRANSFORM &aTransform)
 Locate a draw object (overlaid) More...
 
LIB_ITEMS_CONTAINERGetDrawItems ()
 Return a reference to the draw item list. More...
 
const LIB_ITEMS_CONTAINERGetDrawItems () const
 
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 data. More...
 
void SetUnitCount (int aCount, bool aDuplicateDrawItems=true)
 Set the units per symbol count. More...
 
int GetUnitCount () const override
 For items with units, return the number of units. More...
 
wxString GetUnitReference (int aUnit) override
 Return an identifier for aUnit for symbols with units. More...
 
bool HasUnitDisplayName (int aUnit) override
 Return true if the given unit aUnit has a display name defined. More...
 
wxString GetUnitDisplayName (int aUnit) override
 Return the user-defined display name for aUnit for symbols with units. More...
 
void CopyUnitDisplayNames (std::map< int, wxString > &aTarget) const
 Copy all unit display names into the given map aTarget. More...
 
void SetUnitDisplayName (int aUnit, const wxString &aName)
 Set the user-defined display name for aUnit to aName for symbols with units. More...
 
bool IsMulti () const
 
void SetConversion (bool aSetConvert, bool aDuplicatePins=true)
 Set or clear the alternate body style (DeMorgan) for the symbol. More...
 
void SetPinNameOffset (int aOffset)
 Set the offset in mils of the pin name text from the pin symbol. More...
 
int GetPinNameOffset () const
 
void SetShowPinNames (bool aShow)
 Set or clear the pin name visibility flag. More...
 
bool ShowPinNames () const
 
void SetShowPinNumbers (bool aShow)
 Set or clear the pin number visibility flag. More...
 
bool ShowPinNumbers () const
 
void SetIncludeInBom (bool aIncludeInBom)
 Set or clear the include in schematic bill of materials flag. More...
 
bool GetIncludeInBom () const
 
void SetIncludeOnBoard (bool aIncludeOnBoard)
 Set or clear include in board netlist flag. More...
 
bool GetIncludeOnBoard () const
 
int Compare (const LIB_SYMBOL &aRhs, int aCompareFlags=0) const
 Comparison test that can be used for operators. More...
 
bool operator== (const LIB_SYMBOL *aSymbol) const
 
bool operator== (const LIB_SYMBOL &aSymbol) const
 
bool operator!= (const LIB_SYMBOL &aSymbol) const
 
const LIB_SYMBOLoperator= (const LIB_SYMBOL &aSymbol)
 
std::unique_ptr< LIB_SYMBOLFlatten () const
 Return a flattened symbol inheritance to the caller. More...
 
std::vector< struct LIB_SYMBOL_UNITGetUnitDrawItems ()
 Return a list of LIB_ITEM objects separated by unit and convert number. More...
 
std::vector< struct LIB_SYMBOL_UNITGetUniqueUnits ()
 Return a list of unit numbers that are unique to this symbol. More...
 
std::vector< LIB_ITEM * > GetUnitDrawItems (int aUnit, int aConvert)
 Return a list of item pointers for aUnit and aConvert for this symbol. More...
 
KICAD_T Type () const
 Returns the type of object. More...
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsSelected () const
 
bool IsEntered () const
 
bool IsBrightened () const
 
bool IsRollover () const
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (EDA_ITEM_FLAGS type) const
 
void SetState (EDA_ITEM_FLAGS type, bool state)
 
EDA_ITEM_FLAGS GetStatus () const
 
void SetStatus (EDA_ITEM_FLAGS aStatus)
 
void SetFlags (EDA_ITEM_FLAGS aMask)
 
void XorFlags (EDA_ITEM_FLAGS aMask)
 
void ClearFlags (EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
EDA_ITEM_FLAGS GetFlags () const
 
bool HasFlag (EDA_ITEM_FLAGS aFlag) const
 
EDA_ITEM_FLAGS GetEditFlags () const
 
virtual bool RenderAsBitmap (double aWorldScale) const
 
void SetIsShownAsBitmap (bool aBitmap)
 
bool IsShownAsBitmap () const
 
virtual bool IsType (const std::vector< KICAD_T > &aScanTypes) const
 Check whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool IsForceVisible () const
 
virtual void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
 Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
virtual wxString GetFriendlyName () const
 
virtual bool HitTest (const VECTOR2I &aPosition, int aAccuracy=0) const
 Test if aPosition is inside or on the boundary of this item. More...
 
virtual bool HitTest (const BOX2I &aRect, bool aContained, int aAccuracy=0) const
 Test if aRect intersects this item. More...
 
virtual VECTOR2I GetPosition () const
 
virtual void SetPosition (const VECTOR2I &aPos)
 
virtual const VECTOR2I GetFocusPosition () const
 Similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual VECTOR2I GetSortPosition () const
 Return the coordinates that should be used for sorting this element visually compared to other elements. More...
 
virtual EDA_ITEMClone () const
 Create a duplicate of this item with linked list members set to NULL. More...
 
wxString GetTypeDesc () const
 Return a translated description of the type for this EDA_ITEM for display in user facing messages. More...
 
virtual wxString GetItemDescription (UNITS_PROVIDER *aUnitsProvider) const
 Return a user-visible description string of this item. More...
 
virtual BITMAPS GetMenuImage () const
 Return a pointer to an image to be used in menus. More...
 
virtual bool Matches (const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
 Compare the item against the search criteria in aSearchData. More...
 
virtual bool Replace (const EDA_SEARCH_DATA &aSearchData, void *aAuxData=nullptr)
 Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Override this method in any derived object that supports test find and replace. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer. More...
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Return the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
std::optional< T > Get (const wxString &aProperty) const
 

Static Public Member Functions

static wxString SubReference (int aUnit, bool aAddSeparator=true)
 
static int GetSubpartIdSeparator ()
 
static int * SubpartIdSeparatorPtr ()
 Return a reference to m_subpartIdSeparator, only for read/save setting functions. More...
 
static int GetSubpartFirstId ()
 
static int * SubpartFirstIdPtr ()
 Return a reference to m_subpartFirstId, only for read/save setting functions. More...
 
static void SetSubpartIdNotation (int aSep, int aFirstId)
 Set the separator char between the subpart id and the reference 0 (no separator) or '. More...
 
template<class T >
static INSPECT_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 This changes first parameter to avoid the DList and use the main queue instead. More...
 
template<class T >
static INSPECT_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 Change first parameter to avoid the DList and use std::vector instead. More...
 
static bool Replace (const EDA_SEARCH_DATA &aSearchData, wxString &aText)
 Perform a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

const KIID m_Uuid
 

Protected Member Functions

bool Matches (const wxString &aText, const EDA_SEARCH_DATA &aSearchData) const
 Compare aText against search criteria in aSearchData. More...
 

Protected Attributes

EDA_ITEM_FLAGS m_status
 
bool m_forceVisible
 
EDA_ITEM_FLAGS m_flags
 

Private Member Functions

void deleteAllFields ()
 
virtual void SetParent (EDA_ITEM *aParent)
 

Private Attributes

LIB_SYMBOL_SPTR m_me
 
LIB_SYMBOL_REF m_parent
 Use for inherited symbols. More...
 
LIB_ID m_libId
 
LIB_ID m_sourceLibId
 For database library symbols; the original symbol. More...
 
timestamp_t m_lastModDate
 
int m_unitCount
 Number of units (parts) per package. More...
 
bool m_unitsLocked
 True if symbol has multiple units and changing one unit does not automatically change another unit. More...
 
int m_pinNameOffset
 The offset in mils to draw the pin name. More...
 
bool m_showPinNames
 
bool m_showPinNumbers
 
bool m_includeInBom
 
bool m_includeOnBoard
 
LIBRENTRYOPTIONS m_options
 Special symbol features such as POWER or NORMAL.) More...
 
LIB_ITEMS_CONTAINER m_drawings
 
SYMBOL_LIBm_library
 
wxString m_name
 
wxString m_description
 
wxString m_keyWords
 Search keywords. More...
 
wxArrayString m_fpFilters
 List of suitable footprint names for the symbol (wild card names accepted). More...
 
std::map< int, wxString > m_unitDisplayNames
 
KICAD_T m_structType
 Run time identification, keep private so it can never be changed after a ctor sets it. More...
 
VIEW_ITEM_DATA * m_viewPrivData
 

Static Private Attributes

static int m_subpartIdSeparator = 0
 the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or U1.A or U1-A More...
 
static int m_subpartFirstId = 'A'
 the ASCII char value to calculate the subpart symbol id from the symbol number: only 'A', 'a' or '1' can be used, other values have no sense. More...
 

Detailed Description

Define a library symbol object.

A library symbol object is typically saved and loaded in a symbol library file (.lib). Library symbols are different from schematic symbols.

Definition at line 98 of file lib_symbol.h.

Constructor & Destructor Documentation

◆ LIB_SYMBOL() [1/2]

LIB_SYMBOL::LIB_SYMBOL ( const wxString &  aName,
LIB_SYMBOL aParent = nullptr,
SYMBOL_LIB aLibrary = nullptr 
)

Definition at line 101 of file lib_symbol.cpp.

101 :
103 m_me( this, null_deleter() ),
104 m_includeInBom( true ),
105 m_includeOnBoard( true )
106{
107 m_lastModDate = 0;
108 m_unitCount = 1;
111 m_unitsLocked = false;
112 m_showPinNumbers = true;
113 m_showPinNames = true;
114
115 // Add the MANDATORY_FIELDS in RAM only. These are assumed to be present
116 // when the field editors are invoked.
117 m_drawings[LIB_FIELD_T].reserve( 4 );
122
123 SetName( aName );
124
125 if( aParent )
126 SetParent( aParent );
127
128 SetLib( aLibrary );
129}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: eda_item.cpp:36
Field object used in symbol libraries.
Definition: lib_field.h:61
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:744
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.)
Definition: lib_symbol.h:742
LIB_SYMBOL_SPTR m_me
Definition: lib_symbol.h:725
bool m_includeInBom
Definition: lib_symbol.h:740
void SetParent(LIB_SYMBOL *aParent=nullptr)
Definition: lib_symbol.cpp:447
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:735
bool m_showPinNumbers
Definition: lib_symbol.h:738
timestamp_t m_lastModDate
Definition: lib_symbol.h:729
bool m_includeOnBoard
Definition: lib_symbol.h:741
void SetLib(SYMBOL_LIB *aLibrary)
Definition: lib_symbol.h:193
bool m_unitsLocked
True if symbol has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:732
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:731
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:437
bool m_showPinNames
Definition: lib_symbol.h:737
void push_back(T *aItem)
Definition: multivector.h:174
#define DEFAULT_PIN_NAME_OFFSET
The intersheets references prefix string.
@ ENTRY_NORMAL
Definition: lib_symbol.h:54
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Definition: lib_symbol.cpp:94
@ DATASHEET_FIELD
name of datasheet
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
@ LIB_SYMBOL_T
Definition: typeinfo.h:198
@ LIB_FIELD_T
Definition: typeinfo.h:208

References DATASHEET_FIELD, DEFAULT_PIN_NAME_OFFSET, ENTRY_NORMAL, FOOTPRINT_FIELD, LIB_FIELD_T, m_drawings, m_lastModDate, m_options, m_pinNameOffset, m_showPinNames, m_showPinNumbers, m_unitCount, m_unitsLocked, EDA_IU_SCALE::MilsToIU(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), REFERENCE_FIELD, schIUScale, SetLib(), SetName(), SetParent(), and VALUE_FIELD.

Referenced by Duplicate(), and Flatten().

◆ LIB_SYMBOL() [2/2]

LIB_SYMBOL::LIB_SYMBOL ( const LIB_SYMBOL aSymbol,
SYMBOL_LIB aLibrary = nullptr 
)

Definition at line 132 of file lib_symbol.cpp.

132 :
133 EDA_ITEM( aSymbol ),
134 m_me( this, null_deleter() )
135{
136 LIB_ITEM* newItem;
137
138 m_library = aLibrary;
139 m_name = aSymbol.m_name;
140 m_fpFilters = wxArrayString( aSymbol.m_fpFilters );
141 m_unitCount = aSymbol.m_unitCount;
149 m_options = aSymbol.m_options;
150 m_libId = aSymbol.m_libId;
152 m_keyWords = aSymbol.m_keyWords;
153
155
157
158 for( const LIB_ITEM& oldItem : aSymbol.m_drawings )
159 {
160 if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 )
161 continue;
162
163 try
164 {
165 newItem = (LIB_ITEM*) oldItem.Clone();
166 newItem->ClearSelected();
167 newItem->SetParent( this );
168 m_drawings.push_back( newItem );
169 }
170 catch( ... )
171 {
172 wxFAIL_MSG( "Failed to clone LIB_ITEM." );
173 return;
174 }
175 }
176
177 LIB_SYMBOL_SPTR parent = aSymbol.m_parent.lock();
178
179 if( parent )
180 SetParent( parent.get() );
181}
void ClearSelected()
Definition: eda_item.h:118
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:100
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:82
EDA_ITEM_FLAGS GetFlags() const
Definition: eda_item.h:142
The base class for drawable items used by schematic library symbols.
Definition: lib_item.h:61
std::map< int, wxString > m_unitDisplayNames
Definition: lib_symbol.h:759
SYMBOL_LIB * m_library
Definition: lib_symbol.h:746
wxString m_name
Definition: lib_symbol.h:747
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:749
LIB_ID m_libId
Definition: lib_symbol.h:727
wxString m_description
Definition: lib_symbol.h:748
wxArrayString m_fpFilters
List of suitable footprint names for the symbol (wild card names accepted).
Definition: lib_symbol.h:750
LIB_SYMBOL_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:726
void CopyUnitDisplayNames(std::map< int, wxString > &aTarget) const
Copy all unit display names into the given map aTarget.
Definition: lib_symbol.cpp:412
#define IS_NEW
New item, just created.
#define STRUCT_DELETED
flag indication structures to be erased
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
Definition: lib_symbol.h:45

References EDA_ITEM::ClearSelected(), EDA_ITEM::Clone(), CopyUnitDisplayNames(), EDA_ITEM::GetFlags(), IS_NEW, m_description, m_drawings, m_fpFilters, m_includeInBom, m_includeOnBoard, m_keyWords, m_lastModDate, m_libId, m_library, m_name, m_options, m_parent, m_pinNameOffset, m_showPinNames, m_showPinNumbers, m_unitCount, m_unitDisplayNames, m_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), EDA_ITEM::SetParent(), SetParent(), and STRUCT_DELETED.

◆ ~LIB_SYMBOL()

virtual LIB_SYMBOL::~LIB_SYMBOL ( )
inlinevirtual

Member Function Documentation

◆ AddDrawItem()

◆ AddField() [1/2]

void LIB_SYMBOL::AddField ( LIB_FIELD aField)
inline

Definition at line 280 of file lib_symbol.h.

280{ AddField( new LIB_FIELD( aField ) ); }
void AddField(LIB_FIELD *aField)
Add a field.

References AddField().

Referenced by AddField().

◆ AddField() [2/2]

void LIB_SYMBOL::AddField ( LIB_FIELD aField)

Add a field.

Takes ownership of the pointer.

Definition at line 1047 of file lib_symbol.cpp.

1048{
1049 AddDrawItem( aField );
1050}
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Definition: lib_symbol.cpp:823

References AddDrawItem().

Referenced by SCH_DATABASE_PLUGIN::loadSymbolFromRow(), and CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 119 of file eda_item.h.

void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:141
#define BRIGHTENED
item is drawn with a bright contour

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by SCH_EDIT_FRAME::FocusOnItem(), PCB_BASE_FRAME::FocusOnItems(), EE_SELECTION_TOOL::unhighlight(), PL_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ ClearCaches()

void LIB_SYMBOL::ClearCaches ( )

Definition at line 526 of file lib_symbol.cpp.

527{
528 for( LIB_ITEM& item : m_drawings )
529 {
530 if( EDA_TEXT* eda_text = dynamic_cast<EDA_TEXT*>( &item ) )
531 {
532 eda_text->ClearBoundingBoxCache();
533 eda_text->ClearRenderCache();
534 }
535 }
536}
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72

References m_drawings.

Referenced by SYMBOL_EDIT_FRAME::CommonSettingsChanged(), and SYMBOL_EDIT_FRAME::HardRedraw().

◆ ClearEditFlags()

void LIB_SYMBOL::ClearEditFlags ( )

Definition at line 1301 of file lib_symbol.cpp.

1302{
1303 for( LIB_ITEM& item : m_drawings )
1304 item.ClearEditFlags();
1305}

References m_drawings.

Referenced by SYMBOL_EDIT_FRAME::SaveCopyInUndoList().

◆ ClearFlags()

void EDA_ITEM::ClearFlags ( EDA_ITEM_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 141 of file eda_item.h.

141{ m_flags &= ~aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:498

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), SCH_EDIT_TOOL::BreakWire(), FOOTPRINT::BuildCourtyardCaches(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), SYMBOL_EDITOR_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_TOOL_BASE::doInteractiveItemPlacement(), KIGFX::SCH_PAINTER::draw(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::Init(), EE_COLLECTOR::Inspect(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), DIALOG_SYMBOL_PROPERTIES::OnUnitChoice(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), PAD_TOOL::RecombinePad(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), DRC_TEST_PROVIDER_DISALLOW::Run(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), EE_SELECTION_TOOL::selectMultiple(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetIsShownAsBitmap(), BOARD_COMMIT::Stage(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), and EE_SELECTION_TOOL::unhighlight().

◆ ClearSelected()

◆ ClearTempFlags()

void LIB_SYMBOL::ClearTempFlags ( )

Clears the status flag all draw objects in this symbol.

Definition at line 1294 of file lib_symbol.cpp.

1295{
1296 for( LIB_ITEM& item : m_drawings )
1297 item.ClearTempFlags();
1298}

References m_drawings.

Referenced by SYMBOL_EDITOR_PIN_TOOL::CreatePin(), and SYMBOL_EDIT_FRAME::SaveCopyInUndoList().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 143 of file view_item.h.

144 {
145 m_viewPrivData = nullptr;
146 }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:151

References KIGFX::VIEW_ITEM::m_viewPrivData.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Create a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

Reimplemented in LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_JUNCTION, SCH_LABEL, SCH_DIRECTIVE_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, KIGFX::ORIGIN_VIEWITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, NETINFO_ITEM, PAD, PCB_BITMAP, PCB_DIM_ALIGNED, PCB_DIM_ORTHOGONAL, PCB_DIM_RADIAL, PCB_DIM_LEADER, PCB_DIM_CENTER, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_ARC, PCB_VIA, ZONE, and FP_ZONE.

Definition at line 82 of file eda_item.cpp.

83{
84 wxCHECK_MSG( false, nullptr, wxT( "Clone not implemented in derived class " ) + GetClass() +
85 wxT( ". Bad programmer!" ) );
86}
virtual wxString GetClass() const =0
Return the class name.

References EDA_ITEM::GetClass().

Referenced by SCH_EDIT_FRAME::AddCopyForRepeatItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_DIMENSION_BASE::GetEffectiveShape(), LIB_SYMBOL(), BOARD_COMMIT::makeImage(), new_clone(), operator=(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_LIB_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), SetConversion(), SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ Compare()

int LIB_SYMBOL::Compare ( const LIB_SYMBOL aRhs,
int  aCompareFlags = 0 
) const

Comparison test that can be used for operators.

Parameters
aRhsis the right hand side symbol used for comparison.
Returns
-1 if this symbol is less than aRhs 1 if this symbol is greater than aRhs 0 if this symbol is the same as aRhs

Definition at line 233 of file lib_symbol.cpp.

234{
235 if( m_me == aRhs.m_me )
236 return 0;
237
238 int retv = 0;
239
240 if( ( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::ERC ) == 0 )
241 {
242 retv = m_name.Cmp( aRhs.m_name );
243
244 if( retv )
245 return retv;
246
247 retv = m_libId.compare( aRhs.m_libId );
248
249 if( retv )
250 return retv;
251 }
252
253 if( m_parent.lock() < aRhs.m_parent.lock() )
254 return -1;
255
256 if( m_parent.lock() > aRhs.m_parent.lock() )
257 return 1;
258
259 if( m_options != aRhs.m_options )
260 return ( m_options == ENTRY_NORMAL ) ? -1 : 1;
261
262 if( m_unitCount != aRhs.m_unitCount )
263 return m_unitCount - aRhs.m_unitCount;
264
265 if( m_drawings.size() != aRhs.m_drawings.size() )
266 return m_drawings.size() - aRhs.m_drawings.size();
267
270
271 while( lhsItemIt != m_drawings.end() )
272 {
273 const LIB_ITEM* lhsItem = static_cast<const LIB_ITEM*>( &(*lhsItemIt) );
274 const LIB_ITEM* rhsItem = static_cast<const LIB_ITEM*>( &(*rhsItemIt) );
275
276 wxCHECK( lhsItem && rhsItem, lhsItem - rhsItem );
277
278 if( lhsItem->Type() != rhsItem->Type() )
279 return lhsItem->Type() - rhsItem->Type();
280
281 // Non-mandatory fields are a special case. They can have different ordinal numbers
282 // and are compared separately below.
283 if( lhsItem->Type() == LIB_FIELD_T )
284 {
285 const LIB_FIELD* lhsField = static_cast<const LIB_FIELD*>( lhsItem );
286
287 if( lhsField->GetId() == VALUE_FIELD )
288 {
289 if( ( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::ERC ) == 0 || IsPower() )
290 retv = lhsItem->compare( *rhsItem, aCompareFlags );
291 }
292 else if( lhsField->IsMandatory() )
293 {
294 retv = lhsItem->compare( *rhsItem, aCompareFlags );
295 }
296 }
297 else
298 {
299 retv = lhsItem->compare( *rhsItem, aCompareFlags );
300 }
301
302 if( retv )
303 return retv;
304
305 ++lhsItemIt;
306 ++rhsItemIt;
307 }
308
309 // Compare the optional fields.
310 for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
311 {
312 const LIB_FIELD* field = dynamic_cast<const LIB_FIELD*>( &item );
313
314 wxCHECK2( field, continue );
315
316 // Mandatory fields were already compared above.
317 if( field->IsMandatory() )
318 continue;
319
320 const LIB_FIELD* foundField = aRhs.FindField( field->GetName() );
321
322 if( foundField == nullptr )
323 return 1;
324
325 retv = item.compare( static_cast<const LIB_ITEM&>( *foundField ), aCompareFlags );
326
327 if( retv )
328 return retv;
329 }
330
331 if( m_fpFilters.GetCount() != aRhs.m_fpFilters.GetCount() )
332 return m_fpFilters.GetCount() - aRhs.m_fpFilters.GetCount();
333
334 for( size_t i = 0; i < m_fpFilters.GetCount(); i++ )
335 {
336 retv = m_fpFilters[i].Cmp( aRhs.m_fpFilters[i] );
337
338 if( retv )
339 return retv;
340 }
341
342 retv = m_description.Cmp( aRhs.m_description );
343
344 if( retv )
345 return retv;
346
347 retv = m_keyWords.Cmp( aRhs.m_keyWords );
348
349 if( retv )
350 return retv;
351
352 if( m_pinNameOffset != aRhs.m_pinNameOffset )
353 return m_pinNameOffset - aRhs.m_pinNameOffset;
354
355 if( m_unitsLocked != aRhs.m_unitsLocked )
356 return ( m_unitsLocked ) ? 1 : -1;
357
358 if( ( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::ERC ) == 0 )
359 {
360 if( m_showPinNames != aRhs.m_showPinNames )
361 return ( m_showPinNames ) ? 1 : -1;
362
364 return ( m_showPinNumbers ) ? 1 : -1;
365
366 if( m_includeInBom != aRhs.m_includeInBom )
367 return ( m_includeInBom ) ? 1 : -1;
368
370 return ( m_includeOnBoard ) ? 1 : -1;
371 }
372
373 // Compare unit display names
375 {
376 return -1;
377 }
378 else if( m_unitDisplayNames > aRhs.m_unitDisplayNames )
379 {
380 return 1;
381 }
382
383 return 0;
384}
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
Definition: lib_field.cpp:470
bool IsMandatory() const
Definition: lib_field.cpp:574
int GetId() const
Definition: lib_field.h:114
int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_field.cpp:222
int compare(const LIB_ID &aLibId) const
Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname...
Definition: lib_id.cpp:159
virtual int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_item.cpp:74
bool IsPower() const
Definition: lib_symbol.cpp:548
LIB_FIELD * FindField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName and returns it or NULL if not found.
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:225
ITERATOR_BASE< const LIB_ITEM, const MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::const_iterator > CONST_ITERATOR
Definition: multivector.h:167
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:194
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:188

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), LIB_ID::compare(), LIB_ITEM::compare(), LIB_FIELD::compare(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), ENTRY_NORMAL, FindField(), LIB_FIELD::GetId(), LIB_FIELD::GetName(), LIB_FIELD::IsMandatory(), IsPower(), LIB_FIELD_T, m_description, m_drawings, m_fpFilters, m_includeInBom, m_includeOnBoard, m_keyWords, m_libId, m_me, m_name, m_options, m_parent, m_pinNameOffset, m_showPinNames, m_showPinNumbers, m_unitCount, m_unitDisplayNames, m_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size(), EDA_ITEM::Type(), and VALUE_FIELD.

Referenced by BOOST_AUTO_TEST_CASE(), operator!=(), and operator==().

◆ CopyUnitDisplayNames()

void LIB_SYMBOL::CopyUnitDisplayNames ( std::map< int, wxString > &  aTarget) const

Copy all unit display names into the given map aTarget.

Definition at line 412 of file lib_symbol.cpp.

413{
414 for( const auto& it : m_unitDisplayNames )
415 {
416 aTarget[it.first] = it.second;
417 }
418}

References m_unitDisplayNames.

Referenced by LIB_SYMBOL(), and operator=().

◆ deleteAllFields()

void LIB_SYMBOL::deleteAllFields ( )
private

Definition at line 1041 of file lib_symbol.cpp.

1042{
1044}
void clear(int aType=UNDEFINED_TYPE)
Definition: multivector.h:212

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), LIB_FIELD_T, and m_drawings.

Referenced by SetFields().

◆ Duplicate()

virtual LIB_SYMBOL * LIB_SYMBOL::Duplicate ( ) const
inlinevirtual

Create a copy of a LIB_SYMBOL and assigns unique KIIDs to the copy and its children.

Definition at line 115 of file lib_symbol.h.

116 {
117 LIB_SYMBOL* dupe = new LIB_SYMBOL( *this, m_library );
118 const_cast<KIID&>( dupe->m_Uuid ) = KIID();
119
120 for( LIB_ITEM& item : dupe->m_drawings )
121 const_cast<KIID&>( item.m_Uuid ) = KIID();
122
123 return dupe;
124 }
const KIID m_Uuid
Definition: eda_item.h:492
Definition: kiid.h:48
Define a library symbol object.
Definition: lib_symbol.h:99
LIB_SYMBOL(const wxString &aName, LIB_SYMBOL *aParent=nullptr, SYMBOL_LIB *aLibrary=nullptr)
Definition: lib_symbol.cpp:101

References LIB_SYMBOL(), m_drawings, m_library, and EDA_ITEM::m_Uuid.

Referenced by SCH_DATABASE_PLUGIN::loadSymbolFromRow().

◆ FindField() [1/2]

LIB_FIELD * LIB_SYMBOL::FindField ( const wxString &  aFieldName)

Find a field within this symbol matching aFieldName and returns it or NULL if not found.

Definition at line 1118 of file lib_symbol.cpp.

1119{
1120 for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
1121 {
1122 if( static_cast<LIB_FIELD*>( &item )->GetCanonicalName() == aFieldName )
1123 return static_cast<LIB_FIELD*>( &item );
1124 }
1125
1126 return nullptr;
1127}

References LIB_FIELD_T, and m_drawings.

Referenced by Compare(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), DIALOG_CHANGE_SYMBOLS::processSymbols(), SCH_LIB_PLUGIN_CACHE::removeSymbol(), FOOTPRINT_INFO_GENERATOR::SetHtmlFieldTable(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow().

◆ FindField() [2/2]

const LIB_FIELD * LIB_SYMBOL::FindField ( const wxString &  aFieldName) const

Definition at line 1130 of file lib_symbol.cpp.

1131{
1132 for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
1133 {
1134 if( static_cast<const LIB_FIELD*>( &item )->GetCanonicalName() == aFieldName )
1135 return static_cast<const LIB_FIELD*>( &item );
1136 }
1137
1138 return nullptr;
1139}

References LIB_FIELD_T, and m_drawings.

◆ Flatten()

std::unique_ptr< LIB_SYMBOL > LIB_SYMBOL::Flatten ( ) const

Return a flattened symbol inheritance to the caller.

If the symbol does not inherit from another symbol, a copy of the symbol is returned.

Returns
a flattened symbol on the heap

Definition at line 456 of file lib_symbol.cpp.

457{
458 std::unique_ptr< LIB_SYMBOL > retv;
459
460 if( IsAlias() )
461 {
462 LIB_SYMBOL_SPTR parent = m_parent.lock();
463
464 wxCHECK_MSG( parent, retv,
465 wxString::Format( "Parent of derived symbol '%s' undefined", m_name ) );
466
467 // Copy the parent.
468 retv.reset( new LIB_SYMBOL( *parent.get() ) );
469
470 retv->m_name = m_name;
471 retv->SetLibId( m_libId );
472
473 // Now add the inherited part mandatory field (this) information.
474 for( int i = 0; i < MANDATORY_FIELDS; i++ )
475 {
476 wxString tmp = GetFieldById( i )->GetText();
477
478 // If the field isn't defined then inherit the parent field value.
479 if( tmp.IsEmpty() )
480 retv->GetFieldById( i )->SetText( parent->GetFieldById( i )->GetText() );
481 else
482 *retv->GetFieldById( i ) = *GetFieldById( i );
483 }
484
485 // Grab all the rest of derived symbol fields.
486 for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
487 {
488 const LIB_FIELD* aliasField = dynamic_cast<const LIB_FIELD*>( &item );
489
490 wxCHECK2( aliasField, continue );
491
492 // Mandatory fields were already resolved.
493 if( aliasField->IsMandatory() )
494 continue;
495
496 LIB_FIELD* newField = new LIB_FIELD( *aliasField );
497 newField->SetParent( retv.get() );
498
499 LIB_FIELD* parentField = retv->FindField( aliasField->GetName() );
500
501 if( !parentField ) // Derived symbol field does not exist in parent symbol.
502 {
503 retv->AddDrawItem( newField );
504 }
505 else // Derived symbol field overrides the parent symbol field.
506 {
507 retv->RemoveDrawItem( parentField );
508 retv->AddDrawItem( newField );
509 }
510 }
511
512 retv->SetKeyWords( m_keyWords.IsEmpty() ? parent->GetKeyWords() : m_keyWords );
513 retv->SetDescription( m_description.IsEmpty() ? parent->GetDescription() : m_description );
514 retv->SetFPFilters( m_fpFilters.IsEmpty() ? parent->GetFPFilters() : m_fpFilters );
515 retv->UpdateFieldOrdinals();
516 }
517 else
518 {
519 retv.reset( new LIB_SYMBOL( *this ) );
520 }
521
522 return retv;
523}
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:87
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
bool IsAlias() const
Definition: lib_symbol.h:188
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
@ MANDATORY_FIELDS
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.

References Format(), GetFieldById(), LIB_FIELD::GetName(), EDA_TEXT::GetText(), IsAlias(), LIB_FIELD::IsMandatory(), LIB_FIELD_T, LIB_SYMBOL(), m_description, m_drawings, m_fpFilters, m_keyWords, m_libId, m_name, m_parent, MANDATORY_FIELDS, and EDA_ITEM::SetParent().

Referenced by SCH_SCREEN::Append(), SYMBOL_EDIT_FRAME::CopySymbolToClipboard(), SCH_EDIT_FRAME::CreateArchiveLibrary(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), EESCHEMA_JOBS_HANDLER::doSymExportSvg(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDIT_FRAME::ExportSymbol(), SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), SYMBOL_EDIT_FRAME::GetDocumentExtents(), RESCUE_CASE_CANDIDATE::PerformAction(), RESCUE_CACHE_CANDIDATE::PerformAction(), RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction(), DIALOG_CHANGE_SYMBOLS::processSymbols(), SCH_EDIT_FRAME::SaveSymbolToSchematic(), SCH_SYMBOL::SCH_SYMBOL(), ERC_TESTER::TestLibSymbolIssues(), DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow(), DIALOG_CHANGE_SYMBOLS::updateFieldsList(), and SCH_SCREEN::UpdateSymbolLinks().

◆ Get() [1/3]

template<typename T >
std::optional< T > INSPECTABLE::Get ( const wxString &  aProperty) const
inlineinherited

Definition at line 104 of file inspectable.h.

105 {
107 TYPE_ID thisType = TYPE_HASH( *this );
108 PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
109 std::optional<T> ret;
110
111 if( prop )
112 {
113 const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114
115 if( object )
116 ret = prop->get<T>( object );
117 }
118
119 return ret;
120 }
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.
T get(const void *aObject) const
Definition: property.h:316
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:74
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:76
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
#define TYPE_HASH(x)
Definition: property.h:62
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:46

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [2/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 84 of file inspectable.h.

85 {
87 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
88 return object ? aProperty->getter( object ) : wxAny();
89 }
virtual wxAny getter(const void *aObject) const =0

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by BOOST_AUTO_TEST_CASE(), CLASS_D_DESC::CLASS_D_DESC(), EDA_SHAPE_DESC::EDA_SHAPE_DESC(), PROPERTIES_PANEL::getItemValue(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [3/3]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 92 of file inspectable.h.

93 {
95 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
96
97 if( !object )
98 throw std::runtime_error( "Could not cast INSPECTABLE to the requested type" );
99
100 return aProperty->get<T>( object );
101 }

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ GetAllLibPins()

std::vector< LIB_PIN * > LIB_SYMBOL::GetAllLibPins ( ) const

Return a list of pin pointers for all units / converts.

Used primarily for SPICE where we want to treat all unit as a single part.

Definition at line 861 of file lib_symbol.cpp.

862{
863 std::vector<LIB_PIN*> pinList;
864
865 GetPins( pinList, 0, 0 );
866 return pinList;
867}
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0) const
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:834

References GetPins().

Referenced by SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), GetFullPinCount(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), SYMBOL_EDITOR_PIN_TOOL::PushPinProperties(), DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow(), and DIALOG_LIB_EDIT_PIN_TABLE::TransferDataToWindow().

◆ GetBodyBoundingBox()

const BOX2I LIB_SYMBOL::GetBodyBoundingBox ( int  aUnit,
int  aConvert,
bool  aIncludePins,
bool  aIncludePrivateItems 
) const

Get the symbol bounding box excluding fields.

Returns
the symbol bounding box ( in user coordinates ) without fields
Parameters
aUnit= unit selection = 0, or 1..n
aConvert= 0, 1 or 2 If aUnit == 0, unit is not used if aConvert == 0 Convert is non used Fields are not taken in account

Definition at line 997 of file lib_symbol.cpp.

999{
1000 BOX2I bbox;
1001
1002 for( const LIB_ITEM& item : m_drawings )
1003 {
1004 if( item.m_unit > 0 && aUnit > 0 && aUnit != item.m_unit )
1005 continue;
1006
1007 if( item.m_convert > 0 && aConvert > 0 && aConvert != item.m_convert )
1008 continue;
1009
1010 if( item.IsPrivate() && !aIncludePrivateItems )
1011 continue;
1012
1013 if( item.Type() == LIB_FIELD_T )
1014 continue;
1015
1016 if( item.Type() == LIB_PIN_T )
1017 {
1018 const LIB_PIN& pin = static_cast<const LIB_PIN&>( item );
1019
1020 if( pin.IsVisible() )
1021 {
1022 // Note: the roots of the pins are always included for symbols that don't have
1023 // a well-defined body.
1024
1025 if( aIncludePins )
1026 bbox.Merge( pin.GetBoundingBox( false, false, false ) );
1027 else
1028 bbox.Merge( pin.GetPinRoot() );
1029 }
1030 }
1031 else
1032 {
1033 bbox.Merge( item.GetBoundingBox() );
1034 }
1035 }
1036
1037 return bbox;
1038}
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:588
@ LIB_PIN_T
Definition: typeinfo.h:202

References LIB_FIELD_T, LIB_PIN_T, m_drawings, BOX2< Vec >::Merge(), and pin.

Referenced by SCH_SYMBOL::doGetBoundingBox().

◆ GetBoundingBox()

const BOX2I LIB_SYMBOL::GetBoundingBox ( ) const
inlineoverridevirtual

Return the orthogonal bounding box of this object for display purposes.

This box should be an enclosing perimeter for visible components of this object, and the units should be in the pcb or schematic coordinate system. It is OK to overestimate the size by a few counts.

Reimplemented from EDA_ITEM.

Definition at line 237 of file lib_symbol.h.

238 {
239 return GetUnitBoundingBox( 0, 0 );
240 }
const BOX2I GetUnitBoundingBox(int aUnit, int aConvert, bool aIgnoreHiddenFields=true) const
Get the bounding box for the symbol.
Definition: lib_symbol.cpp:956

References GetUnitBoundingBox().

◆ GetChooserFields()

void LIB_SYMBOL::GetChooserFields ( std::map< wxString, wxString > &  aColumnMap)
overridevirtual

Retrieves a key/value map of the fields on this item that should be exposed to the library browser/chooser for displaying in columns, searching, etc.

Reimplemented from LIB_TREE_ITEM.

Definition at line 74 of file lib_symbol.cpp.

75{
76 for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
77 {
78 LIB_FIELD* field = static_cast<LIB_FIELD*>( &item );
79
80 if( field->ShowInChooser() )
81 aColumnMap[field->GetName()] = field->EDA_TEXT::GetShownText();
82 }
83}
bool ShowInChooser() const
Definition: lib_field.h:186

References LIB_FIELD::GetName(), LIB_FIELD_T, m_drawings, and LIB_FIELD::ShowInChooser().

Referenced by GetSearchText().

◆ GetClass()

virtual wxString LIB_SYMBOL::GetClass ( ) const
inlineoverridevirtual

Return the class name.

Implements EDA_ITEM.

Definition at line 132 of file lib_symbol.h.

133 {
134 return wxT( "LIB_SYMBOL" );
135 }

◆ GetDatasheetField()

LIB_FIELD & LIB_SYMBOL::GetDatasheetField ( )

◆ GetDescription()

wxString LIB_SYMBOL::GetDescription ( )
inlineoverridevirtual

◆ GetDrawItems() [1/2]

◆ GetDrawItems() [2/2]

const LIB_ITEMS_CONTAINER & LIB_SYMBOL::GetDrawItems ( ) const
inline

Definition at line 509 of file lib_symbol.h.

509{ return m_drawings; }

References m_drawings.

◆ GetEditFlags()

EDA_ITEM_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 145 of file eda_item.h.

146 {
147 constexpr int mask =
149
150 return m_flags & mask;
151 }
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_CHANGED
Item was edited, and modified.
#define IS_BROKEN
Is a segment just broken by BreakSegment.
#define IS_MOVING
Item being moved.

References IS_BROKEN, IS_CHANGED, IS_MOVING, IS_NEW, IS_PASTED, EDA_ITEM::m_flags, and STRUCT_DELETED.

Referenced by SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SCH_SYMBOL::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_IMAGE_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow().

◆ GetFieldById()

LIB_FIELD * LIB_SYMBOL::GetFieldById ( int  aId) const

Return pointer to the requested field.

Parameters
aId- Id of field to return.
Returns
The field if found, otherwise NULL.

Definition at line 1104 of file lib_symbol.cpp.

1105{
1106 for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
1107 {
1108 LIB_FIELD* field = ( LIB_FIELD* ) &item;
1109
1110 if( field->GetId() == aId )
1111 return field;
1112 }
1113
1114 return nullptr;
1115}

References LIB_FIELD::GetId(), LIB_FIELD_T, and m_drawings.

Referenced by SYMBOL_EDIT_FRAME::CreateNewSymbol(), Flatten(), GetDatasheetField(), GetFields(), GetFootprintField(), GetNextAvailableFieldId(), GetPrefix(), GetReferenceField(), GetValueField(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), SCH_LEGACY_PLUGIN_CACHE::loadDocs(), SCH_EAGLE_PLUGIN::loadInstance(), DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), DIALOG_CHANGE_SYMBOLS::processSymbols(), SYMBOL_EDITOR_CONTROL::RenameSymbol(), and DIALOG_CHOOSE_SYMBOL::ShowFootprintFor().

◆ GetFieldCount()

size_t LIB_SYMBOL::GetFieldCount ( ) const
inline

◆ GetFields() [1/2]

void LIB_SYMBOL::GetFields ( std::vector< LIB_FIELD * > &  aList)

Return a list of fields within this symbol.

Parameters
aList- List to add fields to

Definition at line 1070 of file lib_symbol.cpp.

1071{
1072 // Grab the MANDATORY_FIELDS first, in expected order given by enum MANDATORY_FIELD_T
1073 for( int id = 0; id < MANDATORY_FIELDS; ++id )
1074 aList.push_back( GetFieldById( id ) );
1075
1076 // Now grab all the rest of fields.
1077 for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
1078 {
1079 LIB_FIELD* field = static_cast<LIB_FIELD*>( &item );
1080
1081 if( !field->IsMandatory() )
1082 aList.push_back( field );
1083 }
1084}

References GetFieldById(), LIB_FIELD::IsMandatory(), LIB_FIELD_T, m_drawings, and MANDATORY_FIELDS.

Referenced by SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), SCH_EAGLE_PLUGIN::loadInstance(), SCH_DATABASE_PLUGIN::loadSymbolFromRow(), DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), DIALOG_CHANGE_SYMBOLS::processSymbols(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), FOOTPRINT_INFO_GENERATOR::SetHtmlFieldTable(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), and DIALOG_UPDATE_SYMBOL_FIELDS::updateFieldsList().

◆ GetFields() [2/2]

void LIB_SYMBOL::GetFields ( std::vector< LIB_FIELD > &  aList)

Definition at line 1087 of file lib_symbol.cpp.

1088{
1089 // Grab the MANDATORY_FIELDS first, in expected order given by enum MANDATORY_FIELD_T
1090 for( int id = 0; id < MANDATORY_FIELDS; ++id )
1091 aList.push_back( *GetFieldById( id ) );
1092
1093 // Now grab all the rest of fields.
1094 for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
1095 {
1096 LIB_FIELD* field = static_cast<LIB_FIELD*>( &item );
1097
1098 if( !field->IsMandatory() )
1099 aList.push_back( *field );
1100 }
1101}

References GetFieldById(), LIB_FIELD::IsMandatory(), LIB_FIELD_T, m_drawings, and MANDATORY_FIELDS.

◆ GetFlags()

◆ GetFocusPosition()

virtual const VECTOR2I EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in BOARD, PCB_SHAPE, and PCB_TRACK.

Definition at line 256 of file eda_item.h.

256{ return GetPosition(); }
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:249

References EDA_ITEM::GetPosition().

Referenced by SCH_EDIT_FRAME::FocusOnItem().

◆ GetFootprint()

wxString LIB_SYMBOL::GetFootprint ( )
inlineoverridevirtual

For items with footprint fields.

Reimplemented from LIB_TREE_ITEM.

Definition at line 177 of file lib_symbol.h.

178 {
179 return GetFootprintField().GetText();
180 }
LIB_FIELD & GetFootprintField()
Return reference to the footprint field.

References GetFootprintField(), and EDA_TEXT::GetText().

◆ GetFootprintField()

LIB_FIELD & LIB_SYMBOL::GetFootprintField ( )

Return reference to the footprint field.

Definition at line 1158 of file lib_symbol.cpp.

1159{
1161 wxASSERT( field != nullptr );
1162 return *field;
1163}

References FOOTPRINT_FIELD, and GetFieldById().

Referenced by GetFootprint(), GetSearchText(), SCH_DATABASE_PLUGIN::loadSymbolFromRow(), and CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().

◆ GetFPFilters()

wxArrayString LIB_SYMBOL::GetFPFilters ( ) const
inline

Definition at line 199 of file lib_symbol.h.

200 {
201 if( m_fpFilters.IsEmpty() && IsAlias() )
202 {
203 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
204 return parent->GetFPFilters();
205 }
206
207 return m_fpFilters;
208 }

References IsAlias(), m_fpFilters, and m_parent.

Referenced by DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), SCH_SEXPR_PLUGIN_CACHE::saveDcmInfoAsFields(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow().

◆ GetFriendlyName()

wxString EDA_ITEM::GetFriendlyName ( ) const
virtualinherited

Reimplemented in PCB_SHAPE, PCB_TRACK, and ZONE.

Definition at line 310 of file eda_item.cpp.

311{
312 return GetTypeDesc();
313}
wxString GetTypeDesc() const
Return a translated description of the type for this EDA_ITEM for display in user facing messages.
Definition: eda_item.cpp:301

References EDA_ITEM::GetTypeDesc().

Referenced by PROPERTIES_PANEL::rebuildProperties().

◆ GetFullPinCount()

size_t LIB_SYMBOL::GetFullPinCount ( )
inline
Returns
a count of pins for all units / converts.

Definition at line 421 of file lib_symbol.h.

421{ return GetAllLibPins().size(); }
std::vector< LIB_PIN * > GetAllLibPins() const
Return a list of pin pointers for all units / converts.
Definition: lib_symbol.cpp:861

References GetAllLibPins().

◆ GetIncludeInBom()

bool LIB_SYMBOL::GetIncludeInBom ( ) const
inline

◆ GetIncludeOnBoard()

bool LIB_SYMBOL::GetIncludeOnBoard ( ) const
inline

◆ GetItemDescription()

wxString EDA_ITEM::GetItemDescription ( UNITS_PROVIDER aUnitsProvider) const
virtualinherited

Return a user-visible description string of this item.

This description is used in disambiguation menus, the message panel, ERC/DRC reports, etc.

The default version of this function raises an assertion in the debug mode and returns a string to indicate that it was not overridden to provide the object specific text.

Returns
The menu text string.

Reimplemented in LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_JUNCTION, SCH_LABEL, SCH_DIRECTIVE_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, DELETED_SHEET_ITEM, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, GERBER_DRAW_ITEM, DELETED_BOARD_ITEM, DS_DRAW_ITEM_LINE, DS_DRAW_ITEM_POLYPOLYGONS, DS_DRAW_ITEM_RECT, DS_DRAW_ITEM_PAGE, DS_DRAW_ITEM_TEXT, DS_DRAW_ITEM_BITMAP, PCB_GROUP, BOARD, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_DIMENSION_BASE, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, and ZONE.

Definition at line 108 of file eda_item.cpp.

109{
110 wxFAIL_MSG( wxT( "GetItemDescription() was not overridden for schematic item type " ) +
111 GetClass() );
112
113 return wxString( wxT( "Undefined item description for " ) + GetClass() );
114}

References EDA_ITEM::GetClass().

Referenced by CONNECTION_GRAPH::collectAllDriverValues(), DIALOG_GROUP_PROPERTIES::DoAddMember(), SELECTION_TOOL::doSelectionMenu(), DRC_ENGINE::EvalRules(), BOARD_INSPECTION_TOOL::getItemDescription(), PCB_MARKER::GetMsgPanelInfo(), ERC_TREE_MODEL::GetValue(), RC_TREE_MODEL::GetValue(), RC_ITEM::ShowReport(), DIALOG_POSITION_RELATIVE::updateAnchorInfo(), and PCB_CONTROL::UpdateMessagePanel().

◆ GetKeyWords()

wxString LIB_SYMBOL::GetKeyWords ( ) const
inline

◆ GetLastModDate()

timestamp_t LIB_SYMBOL::GetLastModDate ( ) const
inline

Definition at line 195 of file lib_symbol.h.

195{ return m_lastModDate; }

References m_lastModDate.

Referenced by SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().

◆ GetLib()

SYMBOL_LIB * LIB_SYMBOL::GetLib ( ) const
inline

Definition at line 192 of file lib_symbol.h.

192{ return m_library; }

References m_library.

Referenced by SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::CreateBuffer(), and SYMBOL_LIB::FindSymbol().

◆ GetLibId()

◆ GetLibNickname()

wxString LIB_SYMBOL::GetLibNickname ( ) const
inlineoverridevirtual

Implements LIB_TREE_ITEM.

Definition at line 147 of file lib_symbol.h.

147{ return GetLibraryName(); }
const wxString GetLibraryName() const
Definition: lib_symbol.cpp:539

References GetLibraryName().

Referenced by SYMBOL_EDIT_FRAME::IsSymbolFromLegacyLibrary().

◆ GetLibraryName()

const wxString LIB_SYMBOL::GetLibraryName ( ) const

Definition at line 539 of file lib_symbol.cpp.

540{
541 if( m_library )
542 return m_library->GetName();
543
544 return m_libId.GetLibNickname();
545}
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:87
const wxString GetName() const
Return the file name without path or extension.

References LIB_ID::GetLibNickname(), SYMBOL_LIB::GetName(), m_libId, and m_library.

Referenced by GetLibNickname().

◆ GetMaxPinNumber()

int LIB_SYMBOL::GetMaxPinNumber ( ) const
Returns
the highest pin number of the symbol's pins. If none of the pins has pin number assigned it returns 0.

Definition at line 1272 of file lib_symbol.cpp.

1273{
1274 int maxPinNumber = 0;
1275 LIB_SYMBOL_SPTR parent = m_parent.lock();
1276 const LIB_ITEMS_CONTAINER& drawItems = parent ? parent->m_drawings : m_drawings;
1277
1278 for( const LIB_ITEM& item : drawItems[LIB_PIN_T] )
1279 {
1280 const LIB_PIN* pin = static_cast<const LIB_PIN*>( &item );
1281 long currentPinNumber = 0;
1282 bool isNum = pin->GetNumber().ToLong( &currentPinNumber );
1283
1284 if( isNum && currentPinNumber > maxPinNumber )
1285 {
1286 maxPinNumber = currentPinNumber;
1287 }
1288 }
1289
1290 return maxPinNumber;
1291}

References LIB_PIN_T, m_drawings, m_parent, and pin.

Referenced by SYMBOL_EDITOR_EDIT_TOOL::Duplicate().

◆ GetMenuImage()

BITMAPS EDA_ITEM::GetMenuImage ( ) const
virtualinherited

Return a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented in LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_JUNCTION, SCH_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_SHAPE, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, GERBER_DRAW_ITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_DIM_ALIGNED, PCB_DIM_ORTHOGONAL, PCB_DIM_RADIAL, PCB_DIM_LEADER, PCB_DIM_CENTER, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, and ZONE.

Definition at line 269 of file eda_item.cpp.

270{
271 return BITMAPS::dummy_item;
272}

References dummy_item.

Referenced by SELECTION_TOOL::doSelectionMenu().

◆ GetMsgPanelInfo()

◆ GetName()

wxString LIB_SYMBOL::GetName ( void  ) const
inlineoverridevirtual

Implements LIB_TREE_ITEM.

Definition at line 138 of file lib_symbol.h.

138{ return m_name; }

References m_name.

Referenced by SCH_LIB_PLUGIN_CACHE::AddSymbol(), EESCHEMA_JOBS_HANDLER::doSymExportSvg(), SYMBOL_EDIT_FRAME::ensureUniqueName(), SYMBOL_EDIT_FRAME::ExportSymbol(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), SYMBOL_EDITOR_CONTROL::ExportView(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), SYMBOL_EDIT_FRAME::ImportSymbol(), SCH_LEGACY_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux(), CADSTAR_SCH_ARCHIVE_LOADER::loadPartsLibrary(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), operator<(), SCH_SEXPR_PARSER::ParseLib(), SCH_LIB_PLUGIN_CACHE::removeSymbol(), SYMBOL_LIB::RemoveSymbol(), SYMBOL_LIB::ReplaceSymbol(), SYMBOL_LIBRARY_MANAGER::RevertSymbol(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), SYMBOL_EDIT_FRAME::saveSymbolAs(), SYMBOL_EDIT_FRAME::SetCurSymbol(), FOOTPRINT_INFO_GENERATOR::SetHtmlName(), SYMBOL_EDIT_FRAME::SyncLibraries(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties(), SYMBOL_VIEWER_FRAME::updatePreviewSymbol(), SYMBOL_LIBRARY_MANAGER::UpdateSymbol(), and SYMBOL_EDIT_FRAME::UpdateSymbolMsgPanelInfo().

◆ GetNextAvailableFieldId()

int LIB_SYMBOL::GetNextAvailableFieldId ( ) const

Definition at line 1228 of file lib_symbol.cpp.

1229{
1230 int retv = MANDATORY_FIELDS;
1231
1232 while( GetFieldById( retv ) )
1233 retv += 1;
1234
1235 return retv;
1236}

References GetFieldById(), and MANDATORY_FIELDS.

Referenced by SCH_DATABASE_PLUGIN::loadSymbolFromRow(), and SCH_SEXPR_PLUGIN_CACHE::SaveSymbol().

◆ GetParent() [1/2]

◆ GetParent() [2/2]

const LIB_SYMBOL_REF & LIB_SYMBOL::GetParent ( void  ) const
inline

Definition at line 128 of file lib_symbol.h.

128{ return m_parent; }

References m_parent.

◆ GetPin()

LIB_PIN * LIB_SYMBOL::GetPin ( const wxString &  aNumber,
int  aUnit = 0,
int  aConvert = 0 
) const

Return pin object with the requested pin aNumber.

Parameters
aNumber- Number of the pin to find.
aUnit- Unit filter. Set to 0 if a specific unit number is not required.
aConvert- DeMorgan variant filter. Set to 0 if no specific DeMorgan variant is required.
Returns
The pin object if found. Otherwise NULL.

Definition at line 871 of file lib_symbol.cpp.

872{
873 LIB_PINS pinList;
874
875 GetPins( pinList, aUnit, aConvert );
876
877 for( LIB_PIN* pin : pinList )
878 {
879 wxASSERT( pin->Type() == LIB_PIN_T );
880
881 if( aNumber == pin->GetNumber() )
882 return pin;
883 }
884
885 return nullptr;
886}
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:54

References GetPins(), LIB_PIN_T, and pin.

◆ GetPinCount()

size_t LIB_SYMBOL::GetPinCount ( ) const
inline

◆ GetPinNameOffset()

◆ GetPins()

void LIB_SYMBOL::GetPins ( LIB_PINS aList,
int  aUnit = 0,
int  aConvert = 0 
) const

Return a list of pin object pointers from the draw item list.

Note pin objects are owned by the draw list of the symbol. Deleting any of the objects will leave list in a unstable state and will likely segfault when the list is destroyed.

Parameters
aList- Pin list to place pin object pointers into.
aUnit- Unit number of pins to collect. Set to 0 to get pins from any symbol unit.
aConvert- Convert number of pins to collect. Set to 0 to get pins from any DeMorgan variant of symbol.

Definition at line 834 of file lib_symbol.cpp.

835{
836 /* Notes:
837 * when aUnit == 0: no unit filtering
838 * when aConvert == 0: no convert (shape selection) filtering
839 * when m_unit == 0, the body item is common to units
840 * when m_convert == 0, the body item is common to shapes
841 */
842
843 LIB_SYMBOL_SPTR parent = m_parent.lock();
844 const LIB_ITEMS_CONTAINER& drawItems = parent ? parent->m_drawings : m_drawings;
845
846 for( const LIB_ITEM& item : drawItems[LIB_PIN_T] )
847 {
848 // Unit filtering:
849 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
850 continue;
851
852 // Shape filtering:
853 if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
854 continue;
855
856 aList.push_back( (LIB_PIN*) &item );
857 }
858}

References LIB_PIN_T, m_drawings, m_parent, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back().

Referenced by CheckLibSymbol(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), CADSTAR_SCH_ARCHIVE_LOADER::fixUpLibraryPins(), GetAllLibPins(), GetPin(), PinsConflictWith(), SCH_SYMBOL::Plot(), SCH_SYMBOL::PlotPins(), DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), and ERC_TESTER::TestMissingUnits().

◆ GetPosition()

virtual VECTOR2I EDA_ITEM::GetPosition ( ) const
inlinevirtualinherited

Reimplemented in LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, SCH_BITMAP, SCH_BUS_ENTRY_BASE, SCH_FIELD, SCH_JUNCTION, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, SCH_SYMBOL, SCH_TEXT, GERBER_DRAW_ITEM, DELETED_BOARD_ITEM, DS_DRAW_ITEM_LINE, DS_DRAW_ITEM_POLYPOLYGONS, DS_DRAW_ITEM_RECT, DS_DRAW_ITEM_PAGE, DS_DRAW_ITEM_TEXT, DS_DRAW_ITEM_BITMAP, KIGFX::ORIGIN_VIEWITEM, PCB_GROUP, BOARD, FOOTPRINT, FP_TEXT, NETINFO_ITEM, PAD, PCB_BITMAP, PCB_DIMENSION_BASE, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TRACK, PCB_ARC, PCB_VIA, and ZONE.

Definition at line 249 of file eda_item.h.

249{ return VECTOR2I(); }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

Referenced by SCH_MOVE_TOOL::AlignElements(), SCH_EDITOR_CONTROL::AssignNetclass(), SCH_EDIT_TOOL::ChangeTextType(), TEST_BOARD_ITEM_FIXTURE::CompareItems(), TEST_EE_ITEM_FIXTURE::CompareItems(), PCB_GRID_HELPER::computeAnchors(), EE_GRID_HELPER::computeAnchors(), CONVERT_TOOL::CreatePolys(), SCH_EDIT_FRAME::DeleteJunction(), EDIT_TOOL::doMoveSelection(), KIGFX::PCB_PAINTER::draw(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNetclassConflicts(), CONNECTION_GRAPH::ercCheckNoConnects(), PCB_SELECTION_TOOL::FindItem(), GERBVIEW_SELECTION::GetCenter(), EDA_ITEM::GetFocusPosition(), getMinDist(), SCH_FIELD::GetParentPosition(), EDA_ITEM::GetSortPosition(), PCB_SELECTION::GetTopLeftItem(), EE_SELECTION::GetTopLeftItem(), BOARD_ITEM::GetX(), BOARD_ITEM::GetY(), SCH_MOVE_TOOL::Main(), SCH_EDIT_TOOL::Mirror(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_FIND_REPLACE_TOOL::nextMatch(), DIALOG_MIGRATE_BUSES::onItemSelected(), BOARD::cmp_items::operator()(), SCH_ITEM::operator<(), SCH_EDITOR_CONTROL::Paste(), PL_EDIT_TOOL::Paste(), PCB_CONTROL::placeBoardItems(), POSITION_RELATIVE_TOOL::PositionRelative(), BACK_ANNOTATE::processNetNameChange(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), RC_ITEM::ShowReport(), SCH_EDIT_TOOL::Swap(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_MISC::testTextVars(), TransformItem(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), EDIT_TOOL::updateModificationPoint(), and PL_EDIT_TOOL::updateModificationPoint().

◆ GetPrefix()

wxString LIB_SYMBOL::GetPrefix ( )

Definition at line 1174 of file lib_symbol.cpp.

1175{
1176 wxString refDesignator = GetFieldById( REFERENCE_FIELD )->GetText();
1177
1178 refDesignator.Replace( wxS( "~" ), wxS( " " ) );
1179
1180 wxString prefix = refDesignator;
1181
1182 while( prefix.Length() )
1183 {
1184 wxUniCharRef last = prefix.Last();
1185
1186 if( ( last >= '0' && last <= '9' ) || last == '?' || last == '*' )
1187 prefix.RemoveLast();
1188 else
1189 break;
1190 }
1191
1192 // Avoid a prefix containing trailing/leading spaces
1193 prefix.Trim( true );
1194 prefix.Trim( false );
1195
1196 return prefix;
1197}

References GetFieldById(), EDA_TEXT::GetText(), and REFERENCE_FIELD.

◆ GetReferenceField()

LIB_FIELD & LIB_SYMBOL::GetReferenceField ( )

◆ GetSearchText()

wxString LIB_SYMBOL::GetSearchText ( )
overridevirtual

Reimplemented from LIB_TREE_ITEM.

Definition at line 49 of file lib_symbol.cpp.

50{
51 // Matches are scored by offset from front of string, so inclusion of this spacer
52 // discounts matches found after it.
53 static const wxString discount( wxT( " " ) );
54
55 wxString text = GetKeyWords() + discount + GetDescription();
56 wxString footprint = GetFootprintField().GetText();
57
58 if( !footprint.IsEmpty() )
59 {
60 text += discount + footprint;
61 }
62
63 // TODO(JE) rework this later so we can highlight matches in their column
64 std::map<wxString, wxString> fields;
65 GetChooserFields( fields );
66
67 for( const auto& it : fields )
68 text += discount + it.second;
69
70 return text;
71}
wxString GetKeyWords() const
Definition: lib_symbol.h:164
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:74
wxString GetDescription() override
Definition: lib_symbol.h:151

References GetChooserFields(), GetDescription(), GetFootprintField(), GetKeyWords(), EDA_TEXT::GetText(), and text.

◆ GetSortPosition()

virtual VECTOR2I EDA_ITEM::GetSortPosition ( ) const
inlinevirtualinherited

Return the coordinates that should be used for sorting this element visually compared to other elements.

For instance, for lines the midpoint might be a better sorting point than either end.

Returns
X,Y coordinate of the sort point

Reimplemented in SCH_LINE.

Definition at line 265 of file eda_item.h.

265{ return GetPosition(); }

References EDA_ITEM::GetPosition().

◆ GetSourceLibId()

LIB_ID LIB_SYMBOL::GetSourceLibId ( ) const
inline

Definition at line 144 of file lib_symbol.h.

144{ return m_sourceLibId; }
LIB_ID m_sourceLibId
For database library symbols; the original symbol.
Definition: lib_symbol.h:728

References m_sourceLibId.

Referenced by SYMBOL_EDIT_FRAME::LoadSymbol().

◆ GetState()

int EDA_ITEM::GetState ( EDA_ITEM_FLAGS  type) const
inlineinherited

Definition at line 123 of file eda_item.h.

124 {
125 return m_status & type;
126 }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:495

References EDA_ITEM::m_status.

◆ GetStatus()

EDA_ITEM_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 136 of file eda_item.h.

136{ return m_status; }

References EDA_ITEM::m_status.

◆ GetSubpartFirstId()

static int LIB_SYMBOL::GetSubpartFirstId ( )
inlinestatic

Definition at line 576 of file lib_symbol.h.

576{ return m_subpartFirstId; }
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the symbol number: only 'A',...
Definition: lib_symbol.h:756

References m_subpartFirstId.

Referenced by SCH_EDIT_FRAME::LoadProjectSettings(), PANEL_SETUP_FORMATTING::TransferDataFromWindow(), and PANEL_SETUP_FORMATTING::TransferDataToWindow().

◆ GetSubpartIdSeparator()

static int LIB_SYMBOL::GetSubpartIdSeparator ( )
inlinestatic

Definition at line 570 of file lib_symbol.h.

570{ return m_subpartIdSeparator; }
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
Definition: lib_symbol.h:753

References m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::LoadProjectSettings(), PANEL_SETUP_FORMATTING::TransferDataFromWindow(), and PANEL_SETUP_FORMATTING::TransferDataToWindow().

◆ GetTypeDesc()

wxString EDA_ITEM::GetTypeDesc ( ) const
inherited

Return a translated description of the type for this EDA_ITEM for display in user facing messages.

Definition at line 301 of file eda_item.cpp.

302{
303 //@see EDA_ITEM_DESC for definition of ENUM_MAP<KICAD_T>
304 wxString typeDescr = ENUM_MAP<KICAD_T>::Instance().ToString( Type() );
305
306 return wxGetTranslation( typeDescr );
307}
static ENUM_MAP< T > & Instance()
Definition: property.h:573

References ENUM_MAP< T >::Instance(), and EDA_ITEM::Type().

Referenced by PCB_GROUP::AddItem(), EDIT_TOOL::doMoveSelection(), and EDA_ITEM::GetFriendlyName().

◆ GetUniqueUnits()

std::vector< struct LIB_SYMBOL_UNIT > LIB_SYMBOL::GetUniqueUnits ( )

Return a list of unit numbers that are unique to this symbol.

If the symbol is inherited (alias), the unique units of the parent symbol are returned. When comparing pins, the pin number is ignored.

Returns
a list of unique unit numbers and their associated draw items.

Definition at line 1543 of file lib_symbol.cpp.

1544{
1545 int unitNum;
1546 size_t i;
1547 struct LIB_SYMBOL_UNIT unit;
1548 std::vector<LIB_ITEM*> compareDrawItems;
1549 std::vector<LIB_ITEM*> currentDrawItems;
1550 std::vector<struct LIB_SYMBOL_UNIT> uniqueUnits;
1551
1552 // The first unit is guaranteed to be unique so always include it.
1553 unit.m_unit = 1;
1554 unit.m_convert = 1;
1555 unit.m_items = GetUnitDrawItems( 1, 1 );
1556
1557 // There are no unique units if there are no draw items other than fields.
1558 if( unit.m_items.size() == 0 )
1559 return uniqueUnits;
1560
1561 uniqueUnits.emplace_back( unit );
1562
1563 if( ( GetUnitCount() == 1 || UnitsLocked() ) && !HasConversion() )
1564 return uniqueUnits;
1565
1566 currentDrawItems = unit.m_items;
1567
1568 for( unitNum = 2; unitNum <= GetUnitCount(); unitNum++ )
1569 {
1570 compareDrawItems = GetUnitDrawItems( unitNum, 1 );
1571
1572 wxCHECK2_MSG( compareDrawItems.size() != 0, continue,
1573 "Multiple unit symbol defined with empty units." );
1574
1575 if( currentDrawItems.size() != compareDrawItems.size() )
1576 {
1577 unit.m_unit = unitNum;
1578 unit.m_convert = 1;
1579 unit.m_items = compareDrawItems;
1580 uniqueUnits.emplace_back( unit );
1581 }
1582 else
1583 {
1584 for( i = 0; i < currentDrawItems.size(); i++ )
1585 {
1586 if( currentDrawItems[i]->compare( *compareDrawItems[i],
1587 LIB_ITEM::COMPARE_FLAGS::UNIT ) != 0 )
1588 {
1589 unit.m_unit = unitNum;
1590 unit.m_convert = 1;
1591 unit.m_items = compareDrawItems;
1592 uniqueUnits.emplace_back( unit );
1593 }
1594 }
1595 }
1596 }
1597
1598 if( HasConversion() )
1599 {
1600 currentDrawItems = GetUnitDrawItems( 1, 2 );
1601
1602 if( ( GetUnitCount() == 1 || UnitsLocked() ) )
1603 {
1604 unit.m_unit = 1;
1605 unit.m_convert = 2;
1606 unit.m_items = currentDrawItems;
1607 uniqueUnits.emplace_back( unit );
1608
1609 return uniqueUnits;
1610 }
1611
1612 for( unitNum = 2; unitNum <= GetUnitCount(); unitNum++ )
1613 {
1614 compareDrawItems = GetUnitDrawItems( unitNum, 2 );
1615
1616 wxCHECK2_MSG( compareDrawItems.size() != 0, continue,
1617 "Multiple unit symbol defined with empty units." );
1618
1619 if( currentDrawItems.size() != compareDrawItems.size() )
1620 {
1621 unit.m_unit = unitNum;
1622 unit.m_convert = 2;
1623 unit.m_items = compareDrawItems;
1624 uniqueUnits.emplace_back( unit );
1625 }
1626 else
1627 {
1628 for( i = 0; i < currentDrawItems.size(); i++ )
1629 {
1630 if( currentDrawItems[i]->compare( *compareDrawItems[i],
1631 LIB_ITEM::COMPARE_FLAGS::UNIT ) != 0 )
1632 {
1633 unit.m_unit = unitNum;
1634 unit.m_convert = 2;
1635 unit.m_items = compareDrawItems;
1636 uniqueUnits.emplace_back( unit );
1637 }
1638 }
1639 }
1640 }
1641 }
1642
1643 return uniqueUnits;
1644}
bool UnitsLocked() const
Check whether symbol units are interchangeable.
Definition: lib_symbol.h:258
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of LIB_ITEM objects separated by unit and convert number.
int GetUnitCount() const override
For items with units, return the number of units.
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
int m_unit
The unit number.
Definition: lib_symbol.h:86

References GetUnitCount(), GetUnitDrawItems(), HasConversion(), LIB_SYMBOL_UNIT::m_convert, LIB_SYMBOL_UNIT::m_items, LIB_SYMBOL_UNIT::m_unit, and UnitsLocked().

◆ GetUnitBoundingBox()

const BOX2I LIB_SYMBOL::GetUnitBoundingBox ( int  aUnit,
int  aConvert,
bool  aIgnoreHiddenFields = true 
) const

Get the bounding box for the symbol.

Returns
the symbol bounding box ( in user coordinates )
Parameters
aUnit= unit selection = 0, or 1..n
aConvert= 0, 1 or 2 If aUnit == 0, unit is not used if aConvert == 0 Convert is non used
aIgnoreHiddenFieldsdefault true, ignores any hidden fields

Definition at line 956 of file lib_symbol.cpp.

958{
959 BOX2I bBox; // Start with a fresh BOX2I so the Merge algorithm works
960
961 for( const LIB_ITEM& item : m_drawings )
962 {
963 if( item.m_unit > 0
964 && m_unitCount > 1
965 && aUnit > 0
966 && aUnit != item.m_unit )
967 {
968 continue;
969 }
970
971 if( item.m_convert > 0 && aConvert > 0 && aConvert != item.m_convert )
972 continue;
973
974 if( aIgnoreHiddenFields && ( item.Type() == LIB_FIELD_T )
975 && !( (LIB_FIELD&) item ).IsVisible() )
976 continue;
977
978 bBox.Merge( item.GetBoundingBox() );
979 }
980
981 return bBox;
982}
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: lib_field.cpp:419

References LIB_FIELD::GetBoundingBox(), LIB_FIELD_T, m_drawings, m_unitCount, and BOX2< Vec >::Merge().

Referenced by SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), and GetBoundingBox().

◆ GetUnitCount()

◆ GetUnitDisplayName()

wxString LIB_SYMBOL::GetUnitDisplayName ( int  aUnit)
overridevirtual

Return the user-defined display name for aUnit for symbols with units.

Reimplemented from LIB_TREE_ITEM.

Definition at line 399 of file lib_symbol.cpp.

400{
401 if( HasUnitDisplayName( aUnit ) )
402 {
403 return m_unitDisplayNames[aUnit];
404 }
405 else
406 {
407 return wxString::Format( _( "Unit %s" ), GetUnitReference( aUnit ) );
408 }
409}
bool HasUnitDisplayName(int aUnit) override
Return true if the given unit aUnit has a display name defined.
Definition: lib_symbol.cpp:393
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
Definition: lib_symbol.cpp:387
#define _(s)

References _, Format(), GetUnitReference(), HasUnitDisplayName(), and m_unitDisplayNames.

Referenced by SYMBOL_VIEWER_FRAME::onUpdateUnitChoice(), SYMBOL_EDIT_FRAME::RebuildSymbolUnitsList(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SYMBOL_EDITOR_EDIT_TOOL::SetUnitDisplayName(), and ERC_TESTER::TestMissingUnits().

◆ GetUnitDrawItems() [1/2]

std::vector< struct LIB_SYMBOL_UNIT > LIB_SYMBOL::GetUnitDrawItems ( )

Return a list of LIB_ITEM objects separated by unit and convert number.

Note
This does not include LIB_FIELD objects since they are not associated with unit and/or convert numbers.

Definition at line 1507 of file lib_symbol.cpp.

1508{
1509 std::vector<struct LIB_SYMBOL_UNIT> units;
1510
1511 for( LIB_ITEM& item : m_drawings )
1512 {
1513 if( item.Type() == LIB_FIELD_T )
1514 continue;
1515
1516 int unit = item.GetUnit();
1517 int convert = item.GetConvert();
1518
1519 auto it = std::find_if( units.begin(), units.end(),
1520 [unit, convert]( const LIB_SYMBOL_UNIT& a )
1521 {
1522 return a.m_unit == unit && a.m_convert == convert;
1523 } );
1524
1525 if( it == units.end() )
1526 {
1527 struct LIB_SYMBOL_UNIT newUnit;
1528 newUnit.m_unit = item.GetUnit();
1529 newUnit.m_convert = item.GetConvert();
1530 newUnit.m_items.push_back( &item );
1531 units.emplace_back( newUnit );
1532 }
1533 else
1534 {
1535 it->m_items.push_back( &item );
1536 }
1537 }
1538
1539 return units;
1540}

References convert, LIB_FIELD_T, LIB_SYMBOL_UNIT::m_convert, m_drawings, LIB_SYMBOL_UNIT::m_items, and LIB_SYMBOL_UNIT::m_unit.

Referenced by GetUniqueUnits(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), and SCH_SEXPR_PLUGIN_CACHE::SaveSymbol().

◆ GetUnitDrawItems() [2/2]

std::vector< LIB_ITEM * > LIB_SYMBOL::GetUnitDrawItems ( int  aUnit,
int  aConvert 
)

Return a list of item pointers for aUnit and aConvert for this symbol.

Note
LIB_FIELD objects are not included.
Parameters
aUnitis the unit number of the item, -1 includes all units.
aConvertis the alternate body styple of the item, -1 includes all body styles.
Returns
a list of unit items.

Definition at line 1486 of file lib_symbol.cpp.

1487{
1488 std::vector<LIB_ITEM*> unitItems;
1489
1490 for( LIB_ITEM& item : m_drawings )
1491 {
1492 if( item.Type() == LIB_FIELD_T )
1493 continue;
1494
1495 if( ( aConvert == -1 && item.GetUnit() == aUnit )
1496 || ( aUnit == -1 && item.GetConvert() == aConvert )
1497 || ( aUnit == item.GetUnit() && aConvert == item.GetConvert() ) )
1498 {
1499 unitItems.push_back( &item );
1500 }
1501 }
1502
1503 return unitItems;
1504}

References LIB_FIELD_T, and m_drawings.

◆ GetUnitReference()

wxString LIB_SYMBOL::GetUnitReference ( int  aUnit)
overridevirtual

Return an identifier for aUnit for symbols with units.

Reimplemented from LIB_TREE_ITEM.

Definition at line 387 of file lib_symbol.cpp.

388{
389 return LIB_SYMBOL::SubReference( aUnit, false );
390}
static wxString SubReference(int aUnit, bool aAddSeparator=true)
Definition: lib_symbol.cpp:584

References SubReference().

Referenced by CheckLibSymbol(), DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE(), GetUnitDisplayName(), and SYMBOL_EDITOR_EDIT_TOOL::SetUnitDisplayName().

◆ GetValueField()

◆ HasConversion()

bool LIB_SYMBOL::HasConversion ( ) const

Test if symbol has more than one body conversion type (DeMorgan).

Returns
True if symbol has more than one conversion.

Definition at line 1252 of file lib_symbol.cpp.

1253{
1254 for( const LIB_ITEM& item : m_drawings )
1255 {
1256 if( item.m_convert > LIB_ITEM::LIB_CONVERT::BASE )
1257 return true;
1258 }
1259
1260 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
1261 {
1262 for( const LIB_ITEM& item : parent->GetDrawItems() )
1263 {
1264 if( item.m_convert > LIB_ITEM::LIB_CONVERT::BASE )
1265 return true;
1266 }
1267 }
1268
1269 return false;
1270}

References m_drawings, and m_parent.

Referenced by CheckLibSymbol(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), GetUniqueUnits(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), SetConversion(), SYMBOL_VIEWER_FRAME::setupUIConditions(), DIALOG_LIB_SHAPE_PROPERTIES::TransferDataToWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow(), and DIALOG_LIB_SYMBOL_PROPERTIES::Validate().

◆ HasFlag()

◆ HasUnitDisplayName()

bool LIB_SYMBOL::HasUnitDisplayName ( int  aUnit)
overridevirtual

Return true if the given unit aUnit has a display name defined.

Reimplemented from LIB_TREE_ITEM.

Definition at line 393 of file lib_symbol.cpp.

394{
395 return ( m_unitDisplayNames.count( aUnit ) == 1 );
396}

References m_unitDisplayNames.

Referenced by GetUnitDisplayName(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), and SYMBOL_EDITOR_EDIT_TOOL::SetUnitDisplayName().

◆ HitTest() [1/2]

virtual bool EDA_ITEM::HitTest ( const BOX2I aRect,
bool  aContained,
int  aAccuracy = 0 
) const
inlinevirtualinherited

Test if aRect intersects this item.

Parameters
aRectA reference to a BOX2I object containing the rectangle to test.
aContainedSet to true to test for containment instead of an intersection.
aAccuracyIncrease aRect by this amount.
Returns
True if aRect contains or intersects the item bounding box.

Reimplemented in LIB_ITEM, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_ENTRY_BASE, SCH_FIELD, SCH_JUNCTION, SCH_LABEL_BASE, SCH_LINE, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, DS_DRAW_ITEM_BASE, DS_DRAW_ITEM_POLYPOLYGONS, DS_DRAW_ITEM_RECT, DS_DRAW_ITEM_TEXT, DS_DRAW_ITEM_BITMAP, PCB_GROUP, FOOTPRINT, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_DIMENSION_BASE, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, PCB_ARC, ZONE, and GERBER_DRAW_ITEM.

Definition at line 235 of file eda_item.h.

236 {
237 return false; // derived classes should override this function
238 }

◆ HitTest() [2/2]

virtual bool EDA_ITEM::HitTest ( const VECTOR2I aPosition,
int  aAccuracy = 0 
) const
inlinevirtualinherited

◆ IsAlias()

◆ IsBrightened()

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 107 of file eda_item.h.

107{ return m_flags & ENTERED; }
#define ENTERED
indicates a group has been entered

References ENTERED, and EDA_ITEM::m_flags.

Referenced by KIGFX::PCB_PAINTER::draw().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 201 of file eda_item.h.

201{ return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:497

References EDA_ITEM::m_forceVisible.

Referenced by KIGFX::SCH_PAINTER::draw(), and SCH_FIELD::Print().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 102 of file eda_item.h.

102{ return m_flags & IS_CHANGED; }

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsMulti()

◆ IsNew()

◆ IsNormal()

bool LIB_SYMBOL::IsNormal ( ) const

Definition at line 566 of file lib_symbol.cpp.

567{
568 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
569 return parent->m_options == ENTRY_NORMAL;
570
571 return m_options == ENTRY_NORMAL;
572}

References ENTRY_NORMAL, m_options, and m_parent.

◆ IsPower()

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Override this method in any derived object that supports test find and replace.

Returns
True if the item has replaceable text that can be modified using the find and replace dialog.

Reimplemented in LIB_TEXTBOX, SCH_FIELD, SCH_LABEL, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 420 of file eda_item.h.

420{ return false; }

Referenced by EDA_ITEM::Matches().

◆ IsRollover()

bool EDA_ITEM::IsRollover ( ) const
inlineinherited

Definition at line 110 of file eda_item.h.

111 {
112 return ( m_flags & ( IS_ROLLOVER | IS_MOVING ) ) == IS_ROLLOVER;
113 }
#define IS_ROLLOVER
Rollover active. Used for hyperlink highlighting.

References IS_MOVING, IS_ROLLOVER, and EDA_ITEM::m_flags.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ IsRoot()

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 106 of file eda_item.h.

106{ return m_flags & SELECTED; }

References EDA_ITEM::m_flags, and SELECTED.

Referenced by ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), SCH_EDIT_TOOL::ChangeTextType(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), EDIT_TOOL::doMoveSelection(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), DS_PROXY_UNDO_ITEM::DS_PROXY_UNDO_ITEM(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::DS_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_PAINTER::getLineWidth(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), DIALOG_CHANGE_SYMBOLS::isMatch(), SCH_SCREEN::MarkConnections(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), KIGFX::SCH_PAINTER::nonCached(), SCH_MOVE_TOOL::orthoLineDrag(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), BOARD_COMMIT::Push(), EE_SELECTION_TOOL::RebuildSelection(), PCB_SELECTION_TOOL::RebuildSelection(), RENDER_3D_OPENGL::renderFootprint(), SCH_EDIT_TOOL::Rotate(), EE_TOOL_BASE< T >::saveCopyInUndoList(), GERBVIEW_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::select(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), KIGFX::SCH_PAINTER::setDeviceColors(), GERBVIEW_SELECTION_TOOL::unselect(), HIERARCHY_PANE::UpdateHierarchySelection(), PCB_BASE_FRAME::UpdateUserUnits(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ IsShownAsBitmap()

bool EDA_ITEM::IsShownAsBitmap ( ) const
inlineinherited

Definition at line 173 of file eda_item.h.

173{ return m_flags & IS_SHOWN_AS_BITMAP; }
#define IS_SHOWN_AS_BITMAP

References IS_SHOWN_AS_BITMAP, and EDA_ITEM::m_flags.

◆ IsType()

virtual bool EDA_ITEM::IsType ( const std::vector< KICAD_T > &  aScanTypes) const
inlinevirtualinherited

Check whether the item is one of the listed types.

Parameters
aScanTypesList of item types
Returns
true if the item type is contained in the list aScanTypes

Reimplemented in SCH_FIELD, SCH_ITEM, SCH_LABEL_BASE, SCH_LINE, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_DIMENSION_BASE, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, and PCB_VIA.

Definition at line 181 of file eda_item.h.

182 {
183 for( KICAD_T scanType : aScanTypes )
184 {
185 if( scanType == SCH_LOCATE_ANY_T || scanType == m_structType )
186 return true;
187 }
188
189 return false;
190 }
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:505
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_LOCATE_ANY_T
Definition: typeinfo.h:183

References EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by SCH_EDIT_TOOL::AutoplaceFields(), ROUTER_TOOL::CanInlineDrag(), DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES(), SCH_FIELD::GetCanonicalName(), KIGFX::SCH_PAINTER::getLineWidth(), SCH_FIELD::GetName(), KIGFX::SCH_PAINTER::getRenderColor(), SCH_FIELD::GetShownText(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), SCH_ITEM::IsType(), FP_TEXT::IsType(), FP_TEXTBOX::IsType(), PAD::IsType(), PCB_DIMENSION_BASE::IsType(), PCB_SHAPE::IsType(), PCB_TEXT::IsType(), PCB_TEXTBOX::IsType(), PCB_VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), CONVERT_TOOL::makePolysFromChainedSegs(), EE_SELECTION_TOOL::RequestSelection(), SCH_FIELD::SetId(), SCH_BASE_FRAME::UpdateItem(), and EDA_ITEM::Visit().

◆ IterateForward() [1/2]

template<class T >
static INSPECT_RESULT EDA_ITEM::IterateForward ( std::deque< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  scanTypes 
)
inlinestaticinherited

This changes first parameter to avoid the DList and use the main queue instead.

Definition at line 302 of file eda_item.h.

304 {
305 for( const auto& it : aList )
306 {
307 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
308 testData,
309 scanTypes ) == INSPECT_RESULT::QUIT )
310 {
312 }
313 }
314
316 }
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:91

References CONTINUE, QUIT, and EDA_ITEM::Visit().

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

template<class T >
static INSPECT_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  scanTypes 
)
inlinestaticinherited

Change first parameter to avoid the DList and use std::vector instead.

Definition at line 322 of file eda_item.h.

324 {
325 for( const auto& it : aList )
326 {
327 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
328 testData,
329 scanTypes ) == INSPECT_RESULT::QUIT )
330 {
332 }
333 }
334
336 }

References CONTINUE, QUIT, and EDA_ITEM::Visit().

◆ LibId()

LIB_ID & LIB_SYMBOL::LibId ( )
inline

Definition at line 140 of file lib_symbol.h.

140{ return m_libId; }

References m_libId.

Referenced by SCH_DATABASE_PLUGIN::loadSymbolFromRow().

◆ LocateDrawItem() [1/2]

LIB_ITEM * LIB_SYMBOL::LocateDrawItem ( int  aUnit,
int  aConvert,
KICAD_T  aType,
const VECTOR2I aPoint 
)

Locate a draw object.

Parameters
aUnit- Unit number of draw item.
aConvert- Body style of draw item.
aType- Draw object type, set to 0 to search for any type.
aPoint- Coordinate for hit testing.
Returns
The draw object if found. Otherwise NULL.

Definition at line 1308 of file lib_symbol.cpp.

1310{
1311 for( LIB_ITEM& item : m_drawings )
1312 {
1313 if( ( aUnit && item.m_unit && aUnit != item.m_unit )
1314 || ( aConvert && item.m_convert && aConvert != item.m_convert )
1315 || ( item.Type() != aType && aType != TYPE_NOT_INIT ) )
1316 {
1317 continue;
1318 }
1319
1320 if( item.HitTest( aPoint ) )
1321 return &item;
1322 }
1323
1324 return nullptr;
1325}
@ TYPE_NOT_INIT
Definition: typeinfo.h:81

References m_drawings, and TYPE_NOT_INIT.

Referenced by LocateDrawItem().

◆ LocateDrawItem() [2/2]

LIB_ITEM * LIB_SYMBOL::LocateDrawItem ( int  aUnit,
int  aConvert,
KICAD_T  aType,
const VECTOR2I aPoint,
const TRANSFORM aTransform 
)

Locate a draw object (overlaid)

Parameters
aUnit- Unit number of draw item.
aConvert- Body style of draw item.
aType- Draw object type, set to 0 to search for any type.
aPoint- Coordinate for hit testing.
aTransform= the transform matrix
Returns
The draw object if found. Otherwise NULL.

Definition at line 1328 of file lib_symbol.cpp.

1330{
1331 /* we use LocateDrawItem( int aUnit, int convert, KICAD_T type, const
1332 * VECTOR2I& pt ) to search items.
1333 * because this function uses DefaultTransform as orient/mirror matrix
1334 * we temporary copy aTransform in DefaultTransform
1335 */
1336 LIB_ITEM* item;
1337 TRANSFORM transform = DefaultTransform;
1338 DefaultTransform = aTransform;
1339
1340 item = LocateDrawItem( aUnit, aConvert, aType, aPoint );
1341
1342 // Restore matrix
1343 DefaultTransform = transform;
1344
1345 return item;
1346}
LIB_ITEM * LocateDrawItem(int aUnit, int aConvert, KICAD_T aType, const VECTOR2I &aPoint)
Locate a draw object.
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:47
TRANSFORM DefaultTransform
Definition: transform.cpp:33

References DefaultTransform, and LocateDrawItem().

◆ LockUnits()

void LIB_SYMBOL::LockUnits ( bool  aLockUnits)
inline

Set interchangeable the property for symbol units.

Parameters
aLockUnitswhen true then units are set as not interchangeable.

Definition at line 252 of file lib_symbol.h.

252{ m_unitsLocked = aLockUnits; }

References m_unitsLocked.

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( const EDA_SEARCH_DATA aSearchData,
void *  aAuxData 
) const
inlinevirtualinherited

Compare the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_MARKER, LIB_TEXTBOX, SCH_FIELD, SCH_LABEL_BASE, SCH_PIN, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, FP_TEXT, FP_TEXTBOX, NETINFO_ITEM, PCB_MARKER, PCB_TEXT, PCB_TEXTBOX, and ZONE.

Definition at line 382 of file eda_item.h.

383 {
384 return false;
385 }

Referenced by SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_FIND_REPLACE_TOOL::HasMatch(), SCH_MARKER::Matches(), LIB_TEXTBOX::Matches(), SCH_FIELD::Matches(), SCH_LABEL_BASE::Matches(), SCH_PIN::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_TEXTBOX::Matches(), FP_TEXT::Matches(), FP_TEXTBOX::Matches(), NETINFO_ITEM::Matches(), PCB_MARKER::Matches(), PCB_TEXT::Matches(), PCB_TEXTBOX::Matches(), ZONE::Matches(), SCH_FIND_REPLACE_TOOL::ReplaceAndFindNext(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_FIND_REPLACE_TOOL::UpdateFind().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
const EDA_SEARCH_DATA aSearchData 
) const
protectedinherited

Compare aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 117 of file eda_item.cpp.

118{
119 wxString text = aText;
120 wxString searchText = aSearchData.findString;
121
122 // Don't match if searching for replaceable item and the item doesn't support text replace.
123 if( aSearchData.searchAndReplace && !IsReplaceable() )
124 return false;
125
126 if( !aSearchData.matchCase )
127 {
128 text.MakeUpper();
129 searchText.MakeUpper();
130 }
131
133 {
134 int ii = 0;
135
136 while( ii < (int) text.length() )
137 {
138 int next = text.find( searchText, ii );
139
140 if( next == wxNOT_FOUND )
141 return false;
142
143 ii = next;
144 next += searchText.length();
145
146 bool startOK = ( ii == 0 || !wxIsalnum( text.GetChar( ii - 1 ) ) );
147 bool endOK = ( next == (int) text.length() || !wxIsalnum( text.GetChar( next ) ) );
148
149 if( startOK && endOK )
150 return true;
151 else
152 ii++;
153 }
154
155 return false;
156 }
157 else if( aSearchData.matchMode == EDA_SEARCH_MATCH_MODE::WILDCARD )
158 {
159 return text.Matches( searchText );
160 }
161 else
162 {
163 return text.Find( searchText ) != wxNOT_FOUND;
164 }
165}
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Definition: eda_item.h:420
CITER next(CITER it)
Definition: ptree.cpp:126
EDA_SEARCH_MATCH_MODE matchMode

References EDA_SEARCH_DATA::findString, EDA_ITEM::IsReplaceable(), EDA_SEARCH_DATA::matchCase, EDA_SEARCH_DATA::matchMode, next(), EDA_SEARCH_DATA::searchAndReplace, text, WHOLEWORD, and WILDCARD.

◆ operator!=()

bool LIB_SYMBOL::operator!= ( const LIB_SYMBOL aSymbol) const
inline

Definition at line 668 of file lib_symbol.h.

669 {
670 return Compare( aSymbol, LIB_ITEM::COMPARE_FLAGS::EQUALITY ) != 0;
671 }
int Compare(const LIB_SYMBOL &aRhs, int aCompareFlags=0) const
Comparison test that can be used for operators.
Definition: lib_symbol.cpp:233

References Compare().

◆ operator<()

bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 231 of file eda_item.cpp.

232{
233 wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
234 GetClass() ) );
235
236 return false;
237}

References Format(), and EDA_ITEM::GetClass().

◆ operator=()

const LIB_SYMBOL & LIB_SYMBOL::operator= ( const LIB_SYMBOL aSymbol)

Definition at line 184 of file lib_symbol.cpp.

185{
186 if( &aSymbol == this )
187 return aSymbol;
188
189 LIB_ITEM* newItem;
190
191 m_library = aSymbol.m_library;
192 m_name = aSymbol.m_name;
193 m_fpFilters = wxArrayString( aSymbol.m_fpFilters );
194 m_unitCount = aSymbol.m_unitCount;
202 m_options = aSymbol.m_options;
203 m_libId = aSymbol.m_libId;
205 m_keyWords = aSymbol.m_keyWords;
206
207 m_unitDisplayNames.clear();
209
211
212 for( const LIB_ITEM& oldItem : aSymbol.m_drawings )
213 {
214 if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 )
215 continue;
216
217 newItem = (LIB_ITEM*) oldItem.Clone();
218 newItem->SetParent( this );
219 m_drawings.push_back( newItem );
220 }
221
223
224 LIB_SYMBOL_SPTR parent = aSymbol.m_parent.lock();
225
226 if( parent )
227 SetParent( parent.get() );
228
229 return *this;
230}

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), EDA_ITEM::Clone(), CopyUnitDisplayNames(), EDA_ITEM::GetFlags(), IS_NEW, m_description, m_drawings, m_fpFilters, m_includeInBom, m_includeOnBoard, m_keyWords, m_lastModDate, m_libId, m_library, m_name, m_options, m_parent, m_pinNameOffset, m_showPinNames, m_showPinNumbers, m_unitCount, m_unitDisplayNames, m_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), EDA_ITEM::SetParent(), SetParent(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort(), and STRUCT_DELETED.

◆ operator==() [1/2]

bool LIB_SYMBOL::operator== ( const LIB_SYMBOL aSymbol) const
inline

Definition at line 663 of file lib_symbol.h.

664 {
665 return Compare( aSymbol, LIB_ITEM::COMPARE_FLAGS::EQUALITY ) == 0;
666 }

References Compare().

◆ operator==() [2/2]

bool LIB_SYMBOL::operator== ( const LIB_SYMBOL aSymbol) const
inline

Definition at line 662 of file lib_symbol.h.

662{ return this == aSymbol; }

◆ PinsConflictWith()

bool LIB_SYMBOL::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.

This is used to detect whether the project cache is out of sync with the system libs.

Parameters
aOtherSymbol- The other library symbol to test
aTestNums- Whether two pins at the same point must have the same number.
aTestNames- Whether two pins at the same point must have the same name.
aTestType- Whether two pins at the same point must have the same electrical type.
aTestOrientation- Whether two pins at the same point must have the same orientation.
aTestLength- Whether two pins at the same point must have the same length.

Definition at line 889 of file lib_symbol.cpp.

891{
892 LIB_PINS thisPinList;
893 GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 );
894
895 for( const LIB_PIN* eachThisPin : thisPinList )
896 {
897 wxASSERT( eachThisPin );
898 LIB_PINS otherPinList;
899 aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 );
900 bool foundMatch = false;
901
902 for( const LIB_PIN* eachOtherPin : otherPinList )
903 {
904 wxASSERT( eachOtherPin );
905
906 // Same unit?
907 if( eachThisPin->GetUnit() != eachOtherPin->GetUnit() )
908 continue;
909
910 // Same body stype?
911 if( eachThisPin->GetConvert() != eachOtherPin->GetConvert() )
912 continue;
913
914 // Same position?
915 if( eachThisPin->GetPosition() != eachOtherPin->GetPosition() )
916 continue;
917
918 // Same number?
919 if( aTestNums && ( eachThisPin->GetNumber() != eachOtherPin->GetNumber() ) )
920 continue;
921
922 // Same name?
923 if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ) )
924 continue;
925
926 // Same electrical type?
927 if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ) )
928 continue;
929
930 // Same orientation?
931 if( aTestOrientation
932 && ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ) )
933 continue;
934
935 // Same length?
936 if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ) )
937 continue;
938
939 foundMatch = true;
940 break; // Match found so search is complete.
941 }
942
943 if( !foundMatch )
944 {
945 // This means there was not an identical (according to the arguments)
946 // pin at the same position in the other symbol.
947 return true;
948 }
949 }
950
951 // The loop never gave up, so no conflicts were found.
952 return false;
953}

References GetPins().

Referenced by RESCUE_CACHE_CANDIDATE::FindRescues(), and RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues().

◆ Plot()

void LIB_SYMBOL::Plot ( PLOTTER aPlotter,
int  aUnit,
int  aConvert,
bool  aBackground,
const VECTOR2I aOffset,
const TRANSFORM aTransform,
bool  aDimmed 
) const

Plot lib symbol to plotter.

Lib Fields not are plotted here, because this plot function is used to plot schematic items, which have they own fields

Parameters
aPlotter- Plotter object to plot to.
aUnit- Symbol symbol to plot.
aConvert- Symbol alternate body style to plot.
aBackground- A poor-man's Z-order.
aOffset- Distance to shift the plot coordinates.
aTransform- Symbol plot transform matrix.
aDimmed- Reduce brightness of symbol

Definition at line 705 of file lib_symbol.cpp.

707{
708 wxASSERT( aPlotter != nullptr );
709
711 COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
712
713 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
714 bg = COLOR4D::WHITE;
715
716 if( aDimmed )
717 {
718 color.Desaturate( );
719 color = color.Mix( bg, 0.5f );
720 }
721 aPlotter->SetColor( color );
722
723 for( const LIB_ITEM& item : m_drawings )
724 {
725 // Do not plot private items
726 if( item.IsPrivate() )
727 continue;
728
729 // LIB_FIELDs are not plotted here, because this plot function is used to plot schematic
730 // items which have their own SCH_FIELDs
731 if( item.Type() == LIB_FIELD_T )
732 continue;
733
734 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
735 continue;
736
737 if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
738 continue;
739
740 item.Plot( aPlotter, aBackground, aOffset, aTransform, aDimmed );
741 }
742}
int color
Definition: DXF_plotter.cpp:57
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
virtual const COLOR4D & GetBackgroundColor() const =0
Return current background color settings.
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:141
bool GetColorMode() const
Definition: plotter.h:138
virtual void SetColor(const COLOR4D &color)=0
@ WHITE
Definition: color4d.h:48
@ LAYER_DEVICE
Definition: layer_ids.h:357

References color, KIGFX::RENDER_SETTINGS::GetBackgroundColor(), PLOTTER::GetColorMode(), KIGFX::RENDER_SETTINGS::GetLayerColor(), LAYER_DEVICE, LIB_FIELD_T, m_drawings, PLOTTER::RenderSettings(), PLOTTER::SetColor(), and WHITE.

Referenced by EESCHEMA_JOBS_HANDLER::doSymExportSvg(), SCH_SYMBOL::Plot(), and SYMBOL_EDIT_FRAME::SVGPlotSymbol().

◆ PlotLibFields()

void LIB_SYMBOL::PlotLibFields ( PLOTTER aPlotter,
int  aUnit,
int  aConvert,
bool  aBackground,
const VECTOR2I aOffset,
const TRANSFORM aTransform,
bool  aDimmed,
bool  aPlotHidden = true 
)

Plot Lib Fields only of the symbol to plotter.

is used to plot the full lib symbol, outside the schematic

Parameters
aPlotter- Plotter object to plot to.
aUnit- Symbol to plot.
aConvert- Symbol alternate body style to plot.
aBackground- A poor-man's Z-order.
aOffset- Distance to shift the plot coordinates.
aTransform- Symbol plot transform matrix.
aDimmed- reduce brightness of fields

Definition at line 745 of file lib_symbol.cpp.

748{
749 wxASSERT( aPlotter != nullptr );
750
752 COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
753
754 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
755 bg = COLOR4D::WHITE;
756
757 if( aDimmed )
758 {
759 color.Desaturate( );
760 color = color.Mix( bg, 0.5f );
761 }
762
763 aPlotter->SetColor( color );
764
765 for( LIB_ITEM& item : m_drawings )
766 {
767 if( item.Type() != LIB_FIELD_T )
768 continue;
769
770 if( !aPlotHidden && !( (LIB_FIELD&) item ).IsVisible() )
771 continue;
772
773 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
774 continue;
775
776 if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
777 continue;
778
779 LIB_FIELD& field = (LIB_FIELD&) item;
780
781 // The reference is a special case: we should change the basic text
782 // to add '?' and the part id
783 wxString tmp = field.GetShownText();
784
785 if( field.GetId() == REFERENCE_FIELD )
786 {
787 wxString text = field.GetFullText( aUnit );
788 field.SetText( text );
789 }
790
791 item.Plot( aPlotter, aBackground, aOffset, aTransform, aDimmed );
792 field.SetText( tmp );
793 }
794}
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:163
void Plot(PLOTTER *aPlotter, bool aBackground, const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed) const override
Plot the draw item using the plot object.
Definition: lib_field.cpp:327
wxString GetFullText(int unit=1) const
Return the text of a field.
Definition: lib_field.cpp:391
wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const override
Return the string actually shown after processing of the base text.
Definition: lib_field.cpp:408
int m_convert
Shape identification for alternate body styles.
Definition: lib_item.h:333
int m_unit
Unit identification for multiple parts per package.
Definition: lib_item.h:327
@ LAYER_FIELDS
Definition: layer_ids.h:354

References color, KIGFX::RENDER_SETTINGS::GetBackgroundColor(), PLOTTER::GetColorMode(), LIB_FIELD::GetFullText(), LIB_FIELD::GetId(), KIGFX::RENDER_SETTINGS::GetLayerColor(), LIB_FIELD::GetShownText(), LAYER_FIELDS, LIB_FIELD_T, LIB_ITEM::m_convert, m_drawings, LIB_ITEM::m_unit, LIB_FIELD::Plot(), REFERENCE_FIELD, PLOTTER::RenderSettings(), PLOTTER::SetColor(), EDA_TEXT::SetText(), text, and WHITE.

Referenced by EESCHEMA_JOBS_HANDLER::doSymExportSvg(), and SYMBOL_EDIT_FRAME::SVGPlotSymbol().

◆ Print()

void LIB_SYMBOL::Print ( const RENDER_SETTINGS aSettings,
const VECTOR2I aOffset,
int  aMulti,
int  aConvert,
const LIB_SYMBOL_OPTIONS aOpts,
bool  aDimmed 
)

Print symbol.

Parameters
aOffset- Position of symbol.
aMulti- unit if multiple units per symbol.
aConvert- Symbol conversion (DeMorgan) if available.
aOpts- Drawing options
aDimmed- Reduce brightness of symbol

Definition at line 654 of file lib_symbol.cpp.

656{
657
658 for( LIB_ITEM& item : m_drawings )
659 {
660 // Do not print private items
661 if( item.IsPrivate() )
662 continue;
663
664 // Do not draw items not attached to the current part
665 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
666 continue;
667
668 if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
669 continue;
670
671 if( item.Type() == LIB_FIELD_T )
672 {
673 LIB_FIELD& field = static_cast<LIB_FIELD&>( item );
674
675 if( field.IsVisible() && !aOpts.draw_visible_fields )
676 continue;
677
678 if( !field.IsVisible() && !aOpts.draw_hidden_fields )
679 continue;
680 }
681
682 if( item.Type() == LIB_PIN_T )
683 {
684 item.Print( aSettings, aOffset, (void*) &aOpts, aOpts.transform, aDimmed );
685 }
686 else if( item.Type() == LIB_FIELD_T )
687 {
688 item.Print( aSettings, aOffset, nullptr, aOpts.transform, aDimmed );
689 }
690 else if( item.Type() == LIB_SHAPE_T )
691 {
692 LIB_SHAPE& shape = static_cast<LIB_SHAPE&>( item );
693 bool forceNoFill = shape.GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR;
694
695 shape.Print( aSettings, aOffset, (void*) forceNoFill, aOpts.transform, aDimmed );
696 }
697 else
698 {
699 item.Print( aSettings, aOffset, (void*) false, aOpts.transform, aDimmed );
700 }
701 }
702}
FILL_T GetFillMode() const
Definition: eda_shape.h:101
virtual bool IsVisible() const
Definition: eda_text.h:136
virtual void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, void *aData, const TRANSFORM &aTransform, bool aDimmed)
Draw an item.
Definition: lib_item.cpp:136
@ FILLED_WITH_BG_BODYCOLOR
bool draw_visible_fields
Definition: lib_symbol.h:66
TRANSFORM transform
Definition: lib_symbol.h:64
@ LIB_SHAPE_T
Definition: typeinfo.h:199

References LIB_SYMBOL_OPTIONS::draw_hidden_fields, LIB_SYMBOL_OPTIONS::draw_visible_fields, FILLED_WITH_BG_BODYCOLOR, EDA_SHAPE::GetFillMode(), EDA_TEXT::IsVisible(), LIB_FIELD_T, LIB_PIN_T, LIB_SHAPE_T, m_drawings, LIB_ITEM::Print(), and LIB_SYMBOL_OPTIONS::transform.

Referenced by SCH_SYMBOL::Print(), and SYMBOL_EDIT_FRAME::PrintPage().

◆ PrintBackground()

void LIB_SYMBOL::PrintBackground ( const RENDER_SETTINGS aSettings,
const VECTOR2I aOffset,
int  aMulti,
int  aConvert,
const LIB_SYMBOL_OPTIONS aOpts,
bool  aDimmed 
)

Print just the background fills of a symbol.

Parameters
aOffset- Position of symbol.
aMulti- unit if multiple units per symbol.
aConvert- Symbol conversion (DeMorgan) if available.
aOpts- Drawing options
aDimmed- Reduce brightness of symbol

Definition at line 620 of file lib_symbol.cpp.

622{
623 /* draw background for filled items using background option
624 * Solid lines will be drawn after the background
625 * Note also, background is not drawn when printing in black and white
626 */
628 {
629 for( LIB_ITEM& item : m_drawings )
630 {
631 // Do not print private items
632 if( item.IsPrivate() )
633 continue;
634
635 if( item.Type() == LIB_SHAPE_T )
636 {
637 LIB_SHAPE& shape = static_cast<LIB_SHAPE&>( item );
638
639 // Do not draw items not attached to the current part
640 if( aUnit && shape.m_unit && ( shape.m_unit != aUnit ) )
641 continue;
642
643 if( aConvert && shape.m_convert && ( shape.m_convert != aConvert ) )
644 continue;
645
647 shape.Print( aSettings, aOffset, (void*) false, aOpts.transform, aDimmed );
648 }
649 }
650 }
651}
bool GetGRForceBlackPenState(void)
Definition: gr_basic.cpp:156

References FILLED_WITH_BG_BODYCOLOR, EDA_SHAPE::GetFillMode(), GetGRForceBlackPenState(), LIB_SHAPE_T, LIB_ITEM::m_convert, m_drawings, LIB_ITEM::m_unit, LIB_ITEM::Print(), and LIB_SYMBOL_OPTIONS::transform.

Referenced by SYMBOL_EDIT_FRAME::PrintPage().

◆ RemoveDrawItem()

void LIB_SYMBOL::RemoveDrawItem ( LIB_ITEM aItem)

Remove draw aItem from list.

Parameters
aItem- Draw item to remove from list.

Definition at line 797 of file lib_symbol.cpp.

798{
799 wxASSERT( aItem != nullptr );
800
801 // none of the MANDATORY_FIELDS may be removed in RAM, but they may be
802 // omitted when saving to disk.
803 if( aItem->Type() == LIB_FIELD_T )
804 {
805 if( static_cast<LIB_FIELD*>( aItem )->IsMandatory() )
806 return;
807 }
808
809 LIB_ITEMS& items = m_drawings[ aItem->Type() ];
810
811 for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
812 {
813 if( &*i == aItem )
814 {
815 items.erase( i );
816 SetModified();
817 break;
818 }
819 }
820}
void SetModified()
Definition: eda_item.cpp:64
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:179
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
Definition: lib_symbol.h:48

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::erase(), LIB_FIELD_T, m_drawings, EDA_ITEM::SetModified(), and EDA_ITEM::Type().

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), RemoveField(), and DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow().

◆ RemoveDuplicateDrawItems()

void LIB_SYMBOL::RemoveDuplicateDrawItems ( )

Remove duplicate draw items from list.

Definition at line 1246 of file lib_symbol.cpp.

1247{
1249}
void unique()
Remove duplicate elements in list.
Definition: multivector.h:256

References m_drawings, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::unique().

◆ RemoveField()

void LIB_SYMBOL::RemoveField ( LIB_FIELD aField)
inline

Definition at line 393 of file lib_symbol.h.

393{ RemoveDrawItem( aField ); }
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.
Definition: lib_symbol.cpp:797

References RemoveDrawItem().

◆ RenderAsBitmap()

virtual bool EDA_ITEM::RenderAsBitmap ( double  aWorldScale) const
inlinevirtualinherited

Reimplemented in SCH_ITEM.

Definition at line 163 of file eda_item.h.

163{ return false; }

◆ Replace() [1/2]

virtual bool EDA_ITEM::Replace ( const EDA_SEARCH_DATA aSearchData,
void *  aAuxData = nullptr 
)
inlinevirtualinherited

Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

This function must be overridden for items that support text replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item text was modified, otherwise false.

Reimplemented in LIB_TEXTBOX, SCH_LABEL_BASE, SCH_PIN, SCH_TEXT, SCH_TEXTBOX, SCH_FIELD, and SCH_SHEET_PIN.

Definition at line 409 of file eda_item.h.

410 {
411 return false;
412 }

◆ Replace() [2/2]

bool EDA_ITEM::Replace ( const EDA_SEARCH_DATA aSearchData,
wxString &  aText 
)
staticinherited

Perform a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aTextA reference to a wxString object containing the text to be replaced.
Returns
True if aText was modified, otherwise false.

Definition at line 168 of file eda_item.cpp.

169{
170 wxString text = aText;
171 wxString searchText = aSearchData.findString;
172 wxString result;
173 bool replaced = false;
174
175 if( !aSearchData.matchCase )
176 {
177 text = text.Upper();
178 searchText = searchText.Upper();
179 }
180
181 int ii = 0;
182
183 while( ii < (int) text.length() )
184 {
185 int next = text.find( searchText, ii );
186
187 if( next == wxNOT_FOUND )
188 {
189 result += aText.Mid( ii, wxString::npos );
190 break;
191 }
192
193 if( next > ii )
194 result += aText.Mid( ii, next - ii );
195
196 ii = next;
197 next += searchText.length();
198
199 bool startOK;
200 bool endOK;
201
203 {
204 startOK = ( ii == 0 || !wxIsalnum( text.GetChar( ii - 1 ) ) );
205 endOK = ( next == (int) text.length() || !wxIsalnum( text.GetChar( next ) ) );
206 }
207 else
208 {
209 startOK = true;
210 endOK = true;
211 }
212
213 if( startOK && endOK )
214 {
215 result += aSearchData.replaceString;
216 replaced = true;
217 ii = next;
218 }
219 else
220 {
221 result += aText.GetChar( ii );
222 ii++;
223 }
224 }
225
226 aText = result;
227 return replaced;
228}
wxString replaceString

References EDA_SEARCH_DATA::findString, EDA_SEARCH_DATA::matchCase, EDA_SEARCH_DATA::matchMode, next(), EDA_SEARCH_DATA::replaceString, text, and WHOLEWORD.

Referenced by EDA_TEXT::Replace(), SCH_FIELD::Replace(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), and SCH_FIND_REPLACE_TOOL::ReplaceAndFindNext().

◆ Set() [1/3]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 66 of file inspectable.h.

67 {
69 TYPE_ID thisType = TYPE_HASH( *this );
70 PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71 void* object = nullptr;
72
73 if( prop )
74 {
75 object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76
77 if( object )
78 prop->set<T>( object, aValue );
79 }
80
81 return object != nullptr;
82 }
void set(void *aObject, T aValue)
Definition: property.h:289

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [2/3]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 54 of file inspectable.h.

55 {
57 void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
58
59 if( object )
60 aProperty->set<T>( object, aValue );
61
62 return object != nullptr;
63 }

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [3/3]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 42 of file inspectable.h.

43 {
45 void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
46
47 if( object )
48 aProperty->setter( object, aValue );
49
50 return object != nullptr;
51 }
virtual void setter(void *aObject, wxAny &aValue)=0

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by PCB_PROPERTIES_PANEL::valueChanged().

◆ SetBrightened()

◆ SetConversion()

void LIB_SYMBOL::SetConversion ( bool  aSetConvert,
bool  aDuplicatePins = true 
)

Set or clear the alternate body style (DeMorgan) for the symbol.

If the symbol already has an alternate body style set and a asConvert if false, all of the existing draw items for the alternate body style are remove. If the alternate body style is not set and asConvert is true, than the base draw items are duplicated and added to the symbol.

Parameters
aSetConvert- Set or clear the symbol alternate body style.
aDuplicatePins- Duplicate all pins from original body style if true.

Definition at line 1423 of file lib_symbol.cpp.

1424{
1425 if( aSetConvert == HasConversion() )
1426 return;
1427
1428 // Duplicate items to create the converted shape
1429 if( aSetConvert )
1430 {
1431 if( aDuplicatePins )
1432 {
1433 std::vector< LIB_ITEM* > tmp; // Temporarily store the duplicated pins here.
1434
1435 for( LIB_ITEM& item : m_drawings )
1436 {
1437 // Only pins are duplicated.
1438 if( item.Type() != LIB_PIN_T )
1439 continue;
1440
1441 if( item.m_convert == 1 )
1442 {
1443 LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1444 newItem->m_convert = 2;
1445 tmp.push_back( newItem );
1446 }
1447 }
1448
1449 // Transfer the new pins to the LIB_SYMBOL.
1450 for( unsigned i = 0; i < tmp.size(); i++ )
1451 m_drawings.push_back( tmp[i] );
1452 }
1453 }
1454 else
1455 {
1456 // Delete converted shape items because the converted shape does
1457 // not exist
1459
1460 while( i != m_drawings.end() )
1461 {
1462 if( i->m_convert > 1 )
1463 i = m_drawings.erase( i );
1464 else
1465 ++i;
1466 }
1467 }
1468
1469 m_drawings.sort();
1470}
ITERATOR_BASE< LIB_ITEM, MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
The const iterator.
Definition: multivector.h:164

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), EDA_ITEM::Clone(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::erase(), HasConversion(), LIB_PIN_T, LIB_ITEM::m_convert, m_drawings, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort().

Referenced by SYMBOL_EDIT_FRAME::CreateNewSymbol(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetDescription()

◆ SetFields()

void LIB_SYMBOL::SetFields ( const std::vector< LIB_FIELD > &  aFieldsList)

Overwrite all the existing fields in this symbol with fields supplied in aFieldsList.

Parameters
aFieldsListis a set of fields to import, removing all previous fields.

Definition at line 1053 of file lib_symbol.cpp.

1054{
1056
1057 for( size_t ii = 0; ii < aFields.size(); ++ii )
1058 {
1059 // drawings is a ptr_vector, new and copy an object on the heap.
1060 LIB_FIELD* field = new LIB_FIELD( aFields[ ii ] );
1061
1062 field->SetParent( this );
1063 m_drawings.push_back( field );
1064 }
1065
1066 m_drawings.sort();
1067}
void deleteAllFields()

References deleteAllFields(), m_drawings, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), EDA_ITEM::SetParent(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort().

Referenced by DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetFlags()

void EDA_ITEM::SetFlags ( EDA_ITEM_FLAGS  aMask)
inlineinherited

Definition at line 139 of file eda_item.h.

139{ m_flags |= aMask; }

References EDA_ITEM::m_flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddFootprintToBoard(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SCH_ALTIUM_PLUGIN::AddTextBox(), SCH_MOVE_TOOL::AlignElements(), PCB_CONTROL::AppendBoard(), SCH_EDIT_FRAME::BreakSegment(), SCH_EDIT_TOOL::BreakWire(), FOOTPRINT::BuildCourtyardCaches(), SCH_EDIT_TOOL::ChangeTextType(), GRAPHICS_CLEANER::cleanupShapes(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), SCH_DRAWING_TOOLS::createSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCBNEW_JOBS_HANDLER::doFpExportSvg(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_SELECTION_TOOL::EnterGroup(), PAD_TOOL::explodePad(), SCH_MOVE_TOOL::getConnectedDragItems(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), EE_COLLECTOR::Inspect(), CONVERT_TOOL::makePolysFromChainedSegs(), CONVERT_TOOL::makePolysFromClosedGraphics(), CONVERT_TOOL::makePolysFromOpenGraphics(), SCH_SCREEN::MarkConnections(), TRACKS_CLEANER::mergeCollinearSegments(), SCH_MOVE_TOOL::moveItem(), SYMBOL_EDITOR_MOVE_TOOL::moveItem(), DIALOG_SYMBOL_PROPERTIES::OnUnitChoice(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), SCH_MOVE_TOOL::orthoLineDrag(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), SCH_ALTIUM_PLUGIN::ParseHarnessPort(), SCH_ALTIUM_PLUGIN::ParseJunction(), SCH_ALTIUM_PLUGIN::ParseLabel(), SCH_ALTIUM_PLUGIN::ParseLine(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseNoERC(), SCH_ALTIUM_PLUGIN::ParsePolygon(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_ALTIUM_PLUGIN::ParseSignalHarness(), SCH_ALTIUM_PLUGIN::ParseWire(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceText(), SCH_SYMBOL::Plot(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_SELECTION_TOOL::RebuildSelection(), BOARD::Remove(), FOOTPRINT::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::selectMultiple(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetIsShownAsBitmap(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), SCH_DRAWING_TOOLS::SingleClickPlace(), BOARD_COMMIT::Stage(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible.

Parameters
aEnableTrue forces the item to be drawn. False uses the item's visibility setting to determine if the item is to be drawn.

Definition at line 199 of file eda_item.h.

199{ m_forceVisible = aEnable; }

References EDA_ITEM::m_forceVisible.

Referenced by SCH_FIND_REPLACE_TOOL::FindNext(), and SCH_FIND_REPLACE_TOOL::UpdateFind().

◆ SetFPFilters()

void LIB_SYMBOL::SetFPFilters ( const wxArrayString &  aFilters)
inline

◆ SetIncludeInBom()

void LIB_SYMBOL::SetIncludeInBom ( bool  aIncludeInBom)
inline

Set or clear the include in schematic bill of materials flag.

Parameters
aIncludeInBomtrue to include symbol in schematic bill of material

Definition at line 640 of file lib_symbol.h.

640{ m_includeInBom = aIncludeInBom; }

References m_includeInBom.

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SCH_DATABASE_PLUGIN::loadSymbolFromRow(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetIncludeOnBoard()

void LIB_SYMBOL::SetIncludeOnBoard ( bool  aIncludeOnBoard)
inline

Set or clear include in board netlist flag.

Parameters
aIncludeOnBoardtrue to include symbol in the board netlist

Definition at line 648 of file lib_symbol.h.

648{ m_includeOnBoard = aIncludeOnBoard; }

References m_includeOnBoard.

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SCH_DATABASE_PLUGIN::loadSymbolFromRow(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetIsShownAsBitmap()

void EDA_ITEM::SetIsShownAsBitmap ( bool  aBitmap)
inlineinherited

Definition at line 165 of file eda_item.h.

166 {
167 if( aBitmap )
169 else
171 }

References EDA_ITEM::ClearFlags(), IS_SHOWN_AS_BITMAP, and EDA_ITEM::SetFlags().

◆ SetKeyWords()

void LIB_SYMBOL::SetKeyWords ( const wxString &  aKeyWords)
inline

◆ SetLib()

void LIB_SYMBOL::SetLib ( SYMBOL_LIB aLibrary)
inline

Definition at line 193 of file lib_symbol.h.

193{ m_library = aLibrary; }

References m_library.

Referenced by LEGACY_RESCUER::AddSymbol(), SYMBOL_LIB::FindSymbol(), LIB_SYMBOL(), and SYMBOL_LIB::LoadSymbolLibrary().

◆ SetLibId()

◆ SetModified()

◆ SetName()

void LIB_SYMBOL::SetName ( const wxString &  aName)
virtual

◆ SetNormal()

void LIB_SYMBOL::SetNormal ( )

Definition at line 575 of file lib_symbol.cpp.

576{
577 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
578 parent->m_options = ENTRY_NORMAL;
579
581}

References ENTRY_NORMAL, m_options, and m_parent.

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetOffset()

void LIB_SYMBOL::SetOffset ( const VECTOR2I aOffset)

Move the symbol aOffset.

Parameters
aOffset- Offset displacement.

Definition at line 1239 of file lib_symbol.cpp.

1240{
1241 for( LIB_ITEM& item : m_drawings )
1242 item.Offset( aOffset );
1243}

References m_drawings.

Referenced by SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor().

◆ SetParent() [1/2]

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlineprivatevirtual

Reimplemented from EDA_ITEM.

Definition at line 100 of file eda_item.h.

100{ m_parent = aParent; }

◆ SetParent() [2/2]

◆ SetPinNameOffset()

void LIB_SYMBOL::SetPinNameOffset ( int  aOffset)
inline

Set the offset in mils of the pin name text from the pin symbol.

Set the offset to 0 to draw the pin name above the pin symbol.

Parameters
aOffset- The offset in mils.

Definition at line 616 of file lib_symbol.h.

616{ m_pinNameOffset = aOffset; }

References m_pinNameOffset.

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetPosition()

◆ SetPower()

◆ SetSelected()

◆ SetShowPinNames()

void LIB_SYMBOL::SetShowPinNames ( bool  aShow)
inline

◆ SetShowPinNumbers()

void LIB_SYMBOL::SetShowPinNumbers ( bool  aShow)
inline

◆ SetSourceLibId()

void LIB_SYMBOL::SetSourceLibId ( const LIB_ID aLibId)
inline

Definition at line 145 of file lib_symbol.h.

145{ m_sourceLibId = aLibId; }

References m_sourceLibId.

Referenced by SCH_DATABASE_PLUGIN::loadSymbolFromRow().

◆ SetState()

void EDA_ITEM::SetState ( EDA_ITEM_FLAGS  type,
bool  state 
)
inlineinherited

Definition at line 128 of file eda_item.h.

129 {
130 if( state )
131 m_status |= type; // state = ON or OFF
132 else
133 m_status &= ~type;
134 }

References EDA_ITEM::m_status.

Referenced by LEGACY_PLUGIN::loadTrackList(), and TRACKS_CLEANER::mergeCollinearSegments().

◆ SetStatus()

void EDA_ITEM::SetStatus ( EDA_ITEM_FLAGS  aStatus)
inlineinherited

Definition at line 137 of file eda_item.h.

137{ m_status = aStatus; }

References EDA_ITEM::m_status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetSubpartIdNotation()

void LIB_SYMBOL::SetSubpartIdNotation ( int  aSep,
int  aFirstId 
)
static

Set the separator char between the subpart id and the reference 0 (no separator) or '.

' , '-' and '_' and the ascii char value to calculate the subpart symbol id from the symbol number: 'A' or '1' only are allowed. (to print U1.A or U1.1) if this is a digit, a number is used as id symbol Note also if the subpart symbol is a digit, the separator cannot be null.

Parameters
aSep= the separator symbol (0 (no separator) or '.' , '-' and '_')
aFirstId= the Id of the first symbol ('A' or '1')

Definition at line 1473 of file lib_symbol.cpp.

1474{
1475 m_subpartFirstId = 'A';
1477
1478 if( aSep == '.' || aSep == '-' || aSep == '_' )
1479 m_subpartIdSeparator = aSep;
1480
1481 if( aFirstId == '1' && aSep != 0 )
1482 m_subpartFirstId = aFirstId;
1483}

References m_subpartFirstId, and m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::LoadProjectSettings(), and PANEL_SETUP_FORMATTING::TransferDataFromWindow().

◆ SetUnitCount()

void LIB_SYMBOL::SetUnitCount ( int  aCount,
bool  aDuplicateDrawItems = true 
)

Set the units per symbol count.

If the count is greater than the current count, then the all of the current draw items are duplicated for each additional symbol. If the count is less than the current count, all draw objects for units greater that count are removed from the symbol.

Parameters
aCount- Number of units per package.
aDuplicateDrawItemsCreate duplicate draw items of unit 1 for each additionl unit.

Definition at line 1366 of file lib_symbol.cpp.

1367{
1368 if( m_unitCount == aCount )
1369 return;
1370
1371 if( aCount < m_unitCount )
1372 {
1374
1375 while( i != m_drawings.end() )
1376 {
1377 if( i->m_unit > aCount )
1378 i = m_drawings.erase( i );
1379 else
1380 ++i;
1381 }
1382 }
1383 else if( aDuplicateDrawItems )
1384 {
1385 int prevCount = m_unitCount;
1386
1387 // Temporary storage for new items, as adding new items directly to
1388 // m_drawings may cause the buffer reallocation which invalidates the
1389 // iterators
1390 std::vector< LIB_ITEM* > tmp;
1391
1392 for( LIB_ITEM& item : m_drawings )
1393 {
1394 if( item.m_unit != 1 )
1395 continue;
1396
1397 for( int j = prevCount + 1; j <= aCount; j++ )
1398 {
1399 LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1400 newItem->m_unit = j;
1401 tmp.push_back( newItem );
1402 }
1403 }
1404
1405 for( LIB_ITEM* item : tmp )
1406 m_drawings.push_back( item );
1407 }
1408
1409 m_drawings.sort();
1410 m_unitCount = aCount;
1411}

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), EDA_ITEM::Clone(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::erase(), m_drawings, LIB_ITEM::m_unit, m_unitCount, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort().

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadPartsLibrary(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetUnitDisplayName()

void LIB_SYMBOL::SetUnitDisplayName ( int  aUnit,
const wxString &  aName 
)

Set the user-defined display name for aUnit to aName for symbols with units.

Definition at line 421 of file lib_symbol.cpp.

422{
423 if( aUnit <= GetUnitCount() )
424 {
425 if( aName.Length() > 0 )
426 {
427 m_unitDisplayNames[aUnit] = aName;
428 }
429 else
430 {
431 m_unitDisplayNames.erase( aUnit );
432 }
433 }
434}

References GetUnitCount(), and m_unitDisplayNames.

Referenced by SYMBOL_EDITOR_EDIT_TOOL::SetUnitDisplayName().

◆ SharedPtr()

◆ ShowPinNames()

◆ ShowPinNumbers()

◆ Sort()

static bool EDA_ITEM::Sort ( const EDA_ITEM aLeft,
const EDA_ITEM aRight 
)
inlinestaticinherited

Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers.

Parameters
aLeftThe left hand item to compare.
aRightThe right hand item to compare.
Returns
True if aLeft is less than aRight.

Definition at line 438 of file eda_item.h.

438{ return *aLeft < *aRight; }

◆ SubpartFirstIdPtr()

static int * LIB_SYMBOL::SubpartFirstIdPtr ( )
inlinestatic

Return a reference to m_subpartFirstId, only for read/save setting functions.

Definition at line 581 of file lib_symbol.h.

581{ return &m_subpartFirstId; }

References m_subpartFirstId.

Referenced by SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS().

◆ SubpartIdSeparatorPtr()

static int * LIB_SYMBOL::SubpartIdSeparatorPtr ( )
inlinestatic

Return a reference to m_subpartIdSeparator, only for read/save setting functions.

Definition at line 575 of file lib_symbol.h.

575{ return &m_subpartIdSeparator; }

References m_subpartIdSeparator.

Referenced by SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS().

◆ SubReference()

wxString LIB_SYMBOL::SubReference ( int  aUnit,
bool  aAddSeparator = true 
)
static
Returns
the sub reference for symbol having multiple units per symbol. The sub reference identify the symbol (or unit)
Parameters
aUnit= the symbol identifier ( 1 to max count)
aAddSeparator= true (default) to prepend the sub ref by the separator symbol (if any) Note: this is a static function.

Definition at line 584 of file lib_symbol.cpp.

585{
586 wxString subRef;
587
588 if( aUnit < 1 )
589 return subRef;
590
591 if( m_subpartIdSeparator != 0 && aAddSeparator )
592 subRef << wxChar( m_subpartIdSeparator );
593
594 if( m_subpartFirstId >= '0' && m_subpartFirstId <= '9' )
595 {
596 subRef << aUnit;
597 }
598 else
599 {
600 // use letters as notation. To allow more than 26 units, the sub ref
601 // use one letter if letter = A .. Z or a ... z, and 2 letters otherwise
602 // first letter is expected to be 'A' or 'a' (i.e. 26 letters are available)
603 int u;
604 wxString suffix;
605
606 do
607 {
608 u = ( aUnit - 1 ) % 26;
609 suffix = wxChar( m_subpartFirstId + u ) + suffix;
610 aUnit = ( aUnit - u ) / 26;
611 } while( aUnit > 0 );
612
613 subRef << suffix;
614 }
615
616 return subRef;
617}

References m_subpartFirstId, and m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), SCH_REFERENCE_LIST::CheckAnnotation(), DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE(), SCH_REFERENCE::GetFullRef(), LIB_FIELD::GetFullText(), LIB_ITEM::GetMsgPanelInfo(), SCH_SYMBOL::GetRef(), SCH_FIELD::GetShownText(), SCH_SYMBOL::GetUnitDisplayName(), GetUnitReference(), PIN_TABLE_DATA_MODEL::GetValue(), SCH_FIELD::Matches(), SCH_SYMBOL::ResolveTextVar(), PIN_TABLE_DATA_MODEL::SetValue(), DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow(), and SYMBOL_UNIT_MENU::update().

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Returns the type of object.

This attribute should never be changed after a ctor sets it, so there is no public "setter" method.

Returns
the type of object.

Definition at line 97 of file eda_item.h.

97{ return m_structType; }

References EDA_ITEM::m_structType.

Referenced by CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), FOOTPRINT::Add(), CN_CLUSTER::Add(), KIGFX::PCB_VIEW::Add(), PCB_POINT_EDITOR::addCorner(), PCB_GROUP::AddItem(), CONNECTION_SUBGRAPH::AddItem(), DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), ZONE_FILLER::addKnockout(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), SCH_MOVE_TOOL::AlignElements(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), SCH_SCREEN::Append(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), PNS::TOPOLOGY::AssembleTuningPath(), SCH_LABEL_BASE::AutoplaceFields(), EE_SELECTION_TOOL::autostartEvent(), DIALOG_NET_INSPECTOR::buildNewItem(), SCH_SCREENS::buildScreenList(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PCB_POINT_EDITOR::canAddCorner(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_JUNCTION::CanConnect(), SCH_LABEL_BASE::CanConnect(), SCH_LINE::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_SHEET::CanConnect(), SCH_SYMBOL::CanConnect(), SCH_EDIT_TOOL::ChangeTextType(), KI_TEST::CheckFootprint(), KI_TEST::CheckFpShape(), KI_TEST::CheckFpZone(), CN_VISITOR::checkZoneItemConnection(), LIB_TEXTBOX::ClassOf(), SCH_BITMAP::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), SCH_FIELD::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_LABEL::ClassOf(), SCH_DIRECTIVE_LABEL::ClassOf(), SCH_GLOBALLABEL::ClassOf(), SCH_HIERLABEL::ClassOf(), SCH_LINE::ClassOf(), SCH_MARKER::ClassOf(), SCH_NO_CONNECT::ClassOf(), SCH_PIN::ClassOf(), SCH_SCREEN::ClassOf(), SCH_SHEET::ClassOf(), SCH_SHEET_PIN::ClassOf(), SCH_SYMBOL::ClassOf(), SCH_TEXT::ClassOf(), SCH_TEXTBOX::ClassOf(), PCB_GROUP::ClassOf(), BOARD::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), FOOTPRINT::ClassOf(), FP_SHAPE::ClassOf(), FP_TEXT::ClassOf(), FP_TEXTBOX::ClassOf(), NETINFO_ITEM::ClassOf(), PAD::ClassOf(), PCB_BITMAP::ClassOf(), PCB_DIM_ALIGNED::ClassOf(), PCB_DIM_ORTHOGONAL::ClassOf(), PCB_DIM_RADIAL::ClassOf(), PCB_DIM_LEADER::ClassOf(), PCB_DIM_CENTER::ClassOf(), PCB_MARKER::ClassOf(), PCB_SHAPE::ClassOf(), PCB_TARGET::ClassOf(), PCB_TEXT::ClassOf(), PCB_TEXTBOX::ClassOf(), PCB_TRACK::ClassOf(), PCB_ARC::ClassOf(), PCB_VIA::ClassOf(), ZONE::ClassOf(), CONNECTION_GRAPH::collectAllDriverValues(), collidesWithArea(), LIB_ITEM::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_TEXT::compare(), LIB_TEXTBOX::compare(), Compare(), PCB_GRID_HELPER::computeAnchors(), EE_GRID_HELPER::computeAnchors(), TEARDROP_MANAGER::ComputePointsOnPadVia(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), SCH_LINE::ConnectionPropagatesTo(), EE_RTREE::contains(), BOARD::ConvertKIIDsToCrossReferences(), SCHEMATIC::ConvertKIIDsToRefs(), PAD_TOOL::copyPadSettings(), FOOTPRINT::CoverageRatio(), BOARD_ADAPTER::createLayers(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewText(), ZONE_CREATE_HELPER::createNewZone(), BOARD_ADAPTER::createTrack(), DRC_TOOL::CrossProbe(), SCH_SCREEN::DeleteItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES(), BOARD_COMMIT::dirtyIntersectingZones(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDIT_TOOL::DoDelete(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), APPEARANCE_CONTROLS::doesBoardItemNeedRebuild(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), DRAWING_TOOL::DrawDimension(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawVia(), CONNECTION_SUBGRAPH::driverName(), CN_ITEM::Dump(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), FOOTPRINT::DuplicateItem(), EDA_ITEM_DESC::EDA_ITEM_DESC(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_EDIT_TOOL::editTextBoxProperties(), SYMBOL_EDITOR_EDIT_TOOL::editTextProperties(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), DRC_ENGINE::EvalRules(), DRC_ENGINE::EvalZoneConnection(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::FilterCollectorForFreePads(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), PCB_SELECTION_TOOL::FilterCollectorForMarkers(), PCB_SELECTION_TOOL::FindItem(), NETLIST_EXPORTER_BASE::findNextSymbol(), CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), PCB_BASE_FRAME::FocusOnItems(), EDIT_TOOL::FootprintFilter(), PCB_PLUGIN::Format(), PCB_PLUGIN::format(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), FormatProbeItem(), FP_TEXT::FP_TEXT(), PCB_POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), SCH_FIELD::GetBoundingBox(), SCH_LABEL_BASE::GetBoundingBox(), PCB_TRACK::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), getClosestGroup(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::DS_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_MOVE_TOOL::getConnectedItems(), FOOTPRINT::GetCoverageArea(), CONNECTION_GRAPH::getDefaultConnection(), SCH_FIELD::GetDrawRotation(), getDrilledHoleShape(), CONNECTION_SUBGRAPH::GetDriverPriority(), getFieldFunc(), PCB_TRACK::GetFriendlyName(), getInferredSymbols(), PCB_TRACK::GetItemDescription(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_FIELD::GetMenuImage(), getMinDist(), SCH_LABEL_BASE::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), SCH_FIELD::GetName(), SCH_SCREEN::GetNeededJunctions(), CONNECTION_SUBGRAPH::GetNetclassForDriver(), CONNECTIVITY_DATA::GetNetItems(), BOARD_ITEM::GetParentFootprint(), SCH_SYMBOL::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), KIGFX::SCH_PAINTER::getRenderColor(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), SCH_FIELD::GetShownText(), CONVERT_TOOL::getStartEndPoints(), KIGFX::SCH_PAINTER::getTextThickness(), EDA_ITEM::GetTypeDesc(), PCB_EXPR_TYPE_REF::GetValue(), PCB_SELECTION_TOOL::grabUnconnected(), GROUP_TOOL::Group(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), hasDrilledHole(), hash_fp_item(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlightInternal(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::highlightNet(), highlightNet(), SCH_FIELD::HitTest(), SCH_LABEL_BASE::HitTest(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRC_RTREE::Insert(), EE_RTREE::insert(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_INSPECTION_TOOL::InspectDRCError(), ARRAY_CREATOR::Invoke(), CONNECTIVITY_DATA::IsConnectedOnLayer(), isCopper(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), PNS_KICAD_IFACE_BASE::IsFlashedOnLayer(), CADSTAR_PCB_ARCHIVE_LOADER::isFootprint(), SCH_FIELD::IsHypertext(), isKeepoutZone(), isMaskAperture(), isNPTHPad(), PCB_TRACK::IsNull(), isNullAperture(), SCH_LINE::IsParallel(), isPlatedFunc(), SCH_FIELD::IsReplaceable(), PNS::ROUTER::isStartingPointRoutable(), SCH_ITEM::IsType(), itemIsIncludedByFilter(), PCB_SELECTION_TOOL::itemPassesFilter(), CLIPBOARD_IO::Load(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeListOfNets(), PCB_POINT_EDITOR::makePoints(), CONVERT_TOOL::makePolysFromChainedSegs(), SCH_SCREEN::MarkConnections(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), SCH_FIELD::Matches(), memberOfFunc(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), DIALOG_DRC::OnDRCItemSelected(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), EDA_3D_CANVAS::OnMouseMove(), CN_VISITOR::operator()(), BOARD_ITEM::ptr_cmp::operator()(), BOARD::cmp_items::operator()(), BOARD::cmp_drawings::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), KI_TEST::kitest_cmp_drawings::operator()(), PCB_TRACK::cmp_tracks::operator()(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_BUS_ENTRY_BASE::operator<(), SCH_FIELD::operator<(), SCH_JUNCTION::operator<(), SCH_LINE::operator<(), SCH_SHEET::operator<(), SCH_SYMBOL::operator<(), SCH_TEXT::operator<(), SCH_TEXTBOX::operator<(), PCB_BITMAP::operator=(), SCH_BITMAP::operator=(), SCH_SYMBOL::operator=(), SCH_SHEET::operator=(), LIB_ITEM::operator==(), PAD::PAD(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), SCH_SEXPR_PARSER::parseSchField(), SCH_EDITOR_CONTROL::Paste(), PCB_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), SCH_LABEL_BASE::Plot(), BRDITEMS_PLOTTER::PlotPcbGraphicItem(), SCH_FIELD::Print(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), BACK_ANNOTATE::processNetNameChange(), CONNECTION_GRAPH::processSubGraphs(), SCH_EDIT_TOOL::Properties(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), PCB_GRID_HELPER::queryVisible(), BOARD_REANNOTATE_TOOL::ReannotateDuplicates(), SCH_CONNECTION::recacheName(), SCH_BASE_FRAME::RefreshZoomDependentItems(), BOARD::Remove(), CN_CONNECTIVITY_ALGO::Remove(), FOOTPRINT::Remove(), EE_RTREE::remove(), SCH_SCREEN::Remove(), KIGFX::PCB_VIEW::Remove(), PCB_POINT_EDITOR::removeCorner(), PCB_POINT_EDITOR::removeCornerCondition(), RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_FIELD::Replace(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), PCB_SELECTION_TOOL::RequestSelection(), CONNECTION_GRAPH::resolveAllDrivers(), SCHEMATIC::ResolveCrossReference(), PCB_PARSER::resolveGroups(), SCH_LABEL_BASE::ResolveTextVar(), BOARD::ResolveTextVar(), DS_PROXY_UNDO_ITEM::Restore(), BOARD_COMMIT::Revert(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), EE_TOOL_BASE< T >::saveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePin(), CLIPBOARD_IO::SaveSelection(), SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveTextBox(), SCH_ITEM::Schematic(), SCH_SCREEN::Schematic(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectSameSheet(), PCB_SELECTION_TOOL::selectUnconnected(), PCB_EDIT_FRAME::SetActiveLayer(), PCB_POINT_EDITOR::setAltConstraint(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), PCB_EDIT_FRAME::ShowFindDialog(), SCH_EDIT_FRAME::ShowFindReplaceDialog(), BOARD_COMMIT::Stage(), PNS::LINE_PLACER::Start(), SCH_EDIT_TOOL::Swap(), PCB_GROUP::swapData(), FOOTPRINT::swapData(), PAD::swapData(), PCB_DIM_ALIGNED::swapData(), PCB_DIM_ORTHOGONAL::swapData(), PCB_DIM_RADIAL::swapData(), PCB_DIM_LEADER::swapData(), PCB_DIM_CENTER::swapData(), PCB_TARGET::swapData(), PCB_TEXT::swapData(), PCB_TEXTBOX::swapData(), PCB_TRACK::swapData(), PCB_ARC::swapData(), PCB_VIA::swapData(), ZONE::swapData(), PCB_BITMAP::swapData(), SCH_BITMAP::SwapData(), SCH_FIELD::SwapData(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_SHEET::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_SYMBOL::SwapData(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), ERC_TESTER::TestMultUnitPinConflicts(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataToWindow(), DIALOG_SYMBOL_FIELDS_TABLE::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), PCB_TRACK::TransformShapeToPolygon(), SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), KIGFX::PCB_VIEW::Update(), SCH_SHEET_PATH::UpdateAllScreenReferences(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_SCH_FIELD_PROPERTIES::UpdateField(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< T >::updateItem(), SCH_BASE_FRAME::UpdateItem(), PCB_CONTROL::UpdateMessagePanel(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), SCH_EDITOR_CONTROL::updatePastedSheet(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), PCB_GROUP::Visit(), SCH_SHEET::Visit(), GERBER_DRAW_ITEM::Visit(), PCB_TRACK::Visit(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and NETLIST_EXPORTER_CADSTAR::writeListOfNets().

◆ UnitsLocked()

◆ UpdateFieldOrdinals()

int LIB_SYMBOL::UpdateFieldOrdinals ( )

Order optional field indices.

It's possible when calling LIB_SYMBOL::Flatten that there can be gaps and/or duplicate optional field indices. This method correctly orders the indices so there are no gaps and/or duplicate indices.

Definition at line 1200 of file lib_symbol.cpp.

1201{
1202 int retv = 0;
1203 int lastOrdinal = MANDATORY_FIELDS;
1204
1205 for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
1206 {
1207 LIB_FIELD* field = dynamic_cast<LIB_FIELD*>( &item );
1208
1209 wxCHECK2( field, continue );
1210
1211 // Mandatory fields were already resolved always have the same ordinal values.
1212 if( field->IsMandatory() )
1213 continue;
1214
1215 if( field->GetId() != lastOrdinal )
1216 {
1217 field->SetId( lastOrdinal );
1218 retv += 1;
1219 }
1220
1221 lastOrdinal += 1;
1222 }
1223
1224 return retv;
1225}
void SetId(int aId)
Definition: lib_field.cpp:108

References LIB_FIELD::GetId(), LIB_FIELD::IsMandatory(), LIB_FIELD_T, m_drawings, MANDATORY_FIELDS, and LIB_FIELD::SetId().

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

◆ ViewDraw()

virtual void KIGFX::VIEW_ITEM::ViewDraw ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Draw the parts of the object belonging to layer aLayer.

An alternative way for drawing objects if there is no #PAINTER assigned for the view or if the PAINTER doesn't know how to paint this particular implementation of VIEW_ITEM. The preferred way of drawing is to design an appropriate PAINTER object, the method below is intended only for quick hacks and debugging purposes.

Parameters
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.

Reimplemented in DS_PROXY_VIEW_ITEM, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, EDIT_POINTS, RATSNEST_VIEW_ITEM, ROUTER_PREVIEW_ITEM, MY_DRAWING, KIGFX::PREVIEW::ARC_ASSISTANT, KIGFX::PREVIEW::RULER_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::ORIGIN_VIEWITEM, KIGFX::VIEW_GROUP, and KIGFX::VIEW_OVERLAY.

Definition at line 106 of file view_item.h.

107 {}

Referenced by KIGFX::VIEW::draw(), and KIGFX::VIEW::updateItemGeometry().

◆ ViewGetLayers()

void LIB_SYMBOL::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtual

Return the all the layers within the VIEW the object is painted on.

For instance, a PAD spans zero or more copper layers and a few technical layers. ViewDraw() or PAINTER::Draw() is repeatedly called for each of the layers returned by ViewGetLayers(), depending on the rendering order.

Parameters
aLayers[]is the output layer index array.
aCountis the number of layer indices in aLayers[].

Reimplemented from EDA_ITEM.

Definition at line 985 of file lib_symbol.cpp.

986{
987 aCount = 6;
988 aLayers[0] = LAYER_DEVICE;
989 aLayers[1] = LAYER_DEVICE_BACKGROUND;
990 aLayers[2] = LAYER_REFERENCEPART;
991 aLayers[3] = LAYER_VALUEPART;
992 aLayers[4] = LAYER_FIELDS;
993 aLayers[5] = LAYER_SELECTION_SHADOWS;
994}
@ LAYER_VALUEPART
Definition: layer_ids.h:353
@ LAYER_DEVICE_BACKGROUND
Definition: layer_ids.h:372
@ LAYER_REFERENCEPART
Definition: layer_ids.h:352
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:381

References LAYER_DEVICE, LAYER_DEVICE_BACKGROUND, LAYER_FIELDS, LAYER_REFERENCEPART, LAYER_SELECTION_SHADOWS, and LAYER_VALUEPART.

◆ ViewGetLOD()

virtual double KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Return the level of detail (LOD) of the item.

A level of detail is the minimal VIEW scale that is sufficient for an item to be shown on a given layer.

Parameters
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.
Returns
the level of detail. 0 always show the item, because the actual zoom level (or VIEW scale) is always > 0

Reimplemented in GERBER_DRAW_ITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, ZONE, and FP_ZONE.

Definition at line 132 of file view_item.h.

133 {
134 // By default always show the item
135 return 0.0;
136 }

Referenced by PNS_KICAD_IFACE::IsItemVisible(), KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()(), EE_GRID_HELPER::queryVisible(), and PCB_GRID_HELPER::queryVisible().

◆ viewPrivData()

◆ Visit()

INSPECT_RESULT LIB_SYMBOL::Visit ( INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  aScanTypes 
)
overridevirtual

May be re-implemented for each derived class in order to handle all the types given by its member data.

Implementations should call inspector->Inspect() on types in aScanTypes, and may use IterateForward() to do so on lists of such data.

Parameters
inspectorAn INSPECTOR instance to use in the inspection.
testDataArbitrary data used by the inspector.
aScanTypesWhich KICAD_T types are of interest and the order in which they should be processed.
Returns
#SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan, else #SCAN_CONTINUE, and determined by the inspector.

Reimplemented from EDA_ITEM.

Definition at line 1349 of file lib_symbol.cpp.

1351{
1352 // The part itself is never inspected, only its children
1353 for( LIB_ITEM& item : m_drawings )
1354 {
1355 if( item.IsType( aScanTypes ) )
1356 {
1357 if( aInspector( &item, aTestData ) == INSPECT_RESULT::QUIT )
1358 return INSPECT_RESULT::QUIT;
1359 }
1360 }
1361
1363}

References CONTINUE, m_drawings, and QUIT.

◆ XorFlags()

void EDA_ITEM::XorFlags ( EDA_ITEM_FLAGS  aMask)
inlineinherited

Definition at line 140 of file eda_item.h.

140{ m_flags ^= aMask; }

References EDA_ITEM::m_flags.

Referenced by EE_SELECTION_TOOL::selectMultiple().

Member Data Documentation

◆ m_description

wxString LIB_SYMBOL::m_description
private

Definition at line 748 of file lib_symbol.h.

Referenced by Compare(), Flatten(), GetDescription(), LIB_SYMBOL(), operator=(), and SetDescription().

◆ m_drawings

◆ m_flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_fpFilters

wxArrayString LIB_SYMBOL::m_fpFilters
private

List of suitable footprint names for the symbol (wild card names accepted).

Definition at line 750 of file lib_symbol.h.

Referenced by Compare(), Flatten(), GetFPFilters(), LIB_SYMBOL(), operator=(), and SetFPFilters().

◆ m_includeInBom

bool LIB_SYMBOL::m_includeInBom
private

Definition at line 740 of file lib_symbol.h.

Referenced by Compare(), GetIncludeInBom(), LIB_SYMBOL(), operator=(), and SetIncludeInBom().

◆ m_includeOnBoard

bool LIB_SYMBOL::m_includeOnBoard
private

Definition at line 741 of file lib_symbol.h.

Referenced by Compare(), GetIncludeOnBoard(), LIB_SYMBOL(), operator=(), and SetIncludeOnBoard().

◆ m_keyWords

wxString LIB_SYMBOL::m_keyWords
private

Search keywords.

Definition at line 749 of file lib_symbol.h.

Referenced by Compare(), Flatten(), GetKeyWords(), LIB_SYMBOL(), operator=(), and SetKeyWords().

◆ m_lastModDate

timestamp_t LIB_SYMBOL::m_lastModDate
private

Definition at line 729 of file lib_symbol.h.

Referenced by GetLastModDate(), LIB_SYMBOL(), and operator=().

◆ m_libId

LIB_ID LIB_SYMBOL::m_libId
private

◆ m_library

SYMBOL_LIB* LIB_SYMBOL::m_library
private

Definition at line 746 of file lib_symbol.h.

Referenced by Duplicate(), GetLib(), GetLibraryName(), LIB_SYMBOL(), operator=(), and SetLib().

◆ m_me

LIB_SYMBOL_SPTR LIB_SYMBOL::m_me
private

Definition at line 725 of file lib_symbol.h.

Referenced by Compare(), and SharedPtr().

◆ m_name

wxString LIB_SYMBOL::m_name
private

Definition at line 747 of file lib_symbol.h.

Referenced by Compare(), Flatten(), GetName(), LIB_SYMBOL(), operator=(), and SetName().

◆ m_options

LIBRENTRYOPTIONS LIB_SYMBOL::m_options
private

Special symbol features such as POWER or NORMAL.)

Definition at line 742 of file lib_symbol.h.

Referenced by Compare(), IsNormal(), IsPower(), LIB_SYMBOL(), operator=(), SetNormal(), and SetPower().

◆ m_parent

◆ m_pinNameOffset

int LIB_SYMBOL::m_pinNameOffset
private

The offset in mils to draw the pin name.

Set to 0 to draw the pin name above the pin.

Definition at line 735 of file lib_symbol.h.

Referenced by Compare(), GetPinNameOffset(), LIB_SYMBOL(), operator=(), and SetPinNameOffset().

◆ m_showPinNames

bool LIB_SYMBOL::m_showPinNames
private

Definition at line 737 of file lib_symbol.h.

Referenced by Compare(), LIB_SYMBOL(), operator=(), SetShowPinNames(), and ShowPinNames().

◆ m_showPinNumbers

bool LIB_SYMBOL::m_showPinNumbers
private

Definition at line 738 of file lib_symbol.h.

Referenced by Compare(), LIB_SYMBOL(), operator=(), SetShowPinNumbers(), and ShowPinNumbers().

◆ m_sourceLibId

LIB_ID LIB_SYMBOL::m_sourceLibId
private

For database library symbols; the original symbol.

Definition at line 728 of file lib_symbol.h.

Referenced by GetSourceLibId(), and SetSourceLibId().

◆ m_status

◆ m_structType

KICAD_T EDA_ITEM::m_structType
privateinherited

Run time identification, keep private so it can never be changed after a ctor sets it.

See comment near SetType() regarding virtual functions.

Definition at line 505 of file eda_item.h.

Referenced by EDA_ITEM::IsType(), EDA_ITEM::operator=(), and EDA_ITEM::Type().

◆ m_subpartFirstId

int LIB_SYMBOL::m_subpartFirstId = 'A'
staticprivate

the ASCII char value to calculate the subpart symbol id from the symbol number: only 'A', 'a' or '1' can be used, other values have no sense.

Definition at line 756 of file lib_symbol.h.

Referenced by GetSubpartFirstId(), SetSubpartIdNotation(), SubpartFirstIdPtr(), and SubReference().

◆ m_subpartIdSeparator

int LIB_SYMBOL::m_subpartIdSeparator = 0
staticprivate

the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or U1.A or U1-A

Definition at line 753 of file lib_symbol.h.

Referenced by GetSubpartIdSeparator(), SetSubpartIdNotation(), SubpartIdSeparatorPtr(), and SubReference().

◆ m_unitCount

int LIB_SYMBOL::m_unitCount
private

Number of units (parts) per package.

Definition at line 731 of file lib_symbol.h.

Referenced by Compare(), GetUnitBoundingBox(), GetUnitCount(), IsMulti(), LIB_SYMBOL(), operator=(), and SetUnitCount().

◆ m_unitDisplayNames

std::map<int, wxString> LIB_SYMBOL::m_unitDisplayNames
private

◆ m_unitsLocked

bool LIB_SYMBOL::m_unitsLocked
private

True if symbol has multiple units and changing one unit does not automatically change another unit.

Definition at line 732 of file lib_symbol.h.

Referenced by Compare(), LIB_SYMBOL(), LockUnits(), operator=(), and UnitsLocked().

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 492 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_SYMBOL::AddHierarchicalReference(), SCH_SHEET::addInstance(), RC_ITEM::AddItem(), SCH_EDIT_FRAME::AnnotateSymbols(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), SCH_EDIT_FRAME::CreateScreens(), ZONE_FILLER_TOOL::DirtyZone(), DRAWING_TOOL::DrawVia(), Duplicate(), BOARD_ITEM::Duplicate(), FOOTPRINT::Duplicate(), SCH_ITEM::Duplicate(), FOOTPRINT::DuplicateItem(), PCB_EDIT_FRAME::ExchangeFootprint(), PAD_TOOL::explodePad(), SCH_SHEET_LIST::FillItemMap(), BOARD::FillItemMap(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_PLUGIN::format(), SCH_SEXPR_PLUGIN::Format(), SCH_PIN::GetDefaultNetName(), SCH_SHEET_PATH::GetItem(), BOARD::GetItem(), PAD::GetMsgPanelInfo(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), SCH_SHEET::getPageNumber(), FP_SHAPE::GetParentAsString(), FP_TEXT::GetParentAsString(), FP_TEXTBOX::GetParentAsString(), PAD::GetParentAsString(), SCH_MARKER::GetUUID(), PCB_MARKER::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::GetValue(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), ZONE::HigherPriority(), SCH_SHEET_PATH::IsContainedWithin(), SCH_ALTIUM_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), LEGACY_PLUGIN::loadFOOTPRINT(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PCB_EDIT_FRAME::LoadFootprints(), SCH_LEGACY_PLUGIN::loadHierarchy(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), SCH_EDIT_FRAME::LoadSheetFromFile(), SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic(), LEGACY_PLUGIN::loadTrackList(), PNS::LOGGER::Log(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), BOARD_ITEM::ptr_cmp::operator()(), BOARD::cmp_items::operator()(), BOARD::cmp_drawings::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_zones::operator()(), FOOTPRINT::cmp_pads::operator()(), PCB_TRACK::cmp_tracks::operator()(), SCH_ITEM::operator<(), SCH_SYMBOL::operator<(), PAD::PAD(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), PCB_VIA::PCB_VIA(), SCH_EDIT_FRAME::RecalculateConnections(), FIELDS_EDITOR_GRID_DATA_MODEL::RemoveColumn(), SCH_SYMBOL::RemoveInstance(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SYMBOL::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN::saveJunction(), SCH_SEXPR_PLUGIN::saveLine(), SCH_SEXPR_PLUGIN::saveNoConnect(), SCH_EDIT_FRAME::SaveProject(), SCH_SEXPR_PLUGIN::saveShape(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_LEGACY_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN::saveTextBox(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), SCH_SYMBOL::SCH_SYMBOL(), RC_ITEM::SetItems(), SCH_SHEET::setPageNumber(), FIELDS_EDITOR_GRID_DATA_MODEL::SetValue(), SCH_DRAWING_TOOLS::SingleClickPlace(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), testGroupEqual(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), SCH_EDITOR_CONTROL::updatePastedSheet(), SCH_SHEET_LIST::UpdateSymbolInstanceData(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ m_viewPrivData

VIEW_ITEM_DATA* KIGFX::VIEW_ITEM::m_viewPrivData
privateinherited

The documentation for this class was generated from the following files: