KiCad PCB EDA Suite
LIB_PART Class Reference

Define a library symbol object. More...

#include <lib_symbol.h>

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

Public Member Functions

 LIB_PART (const wxString &aName, LIB_PART *aParent=nullptr, PART_LIB *aLibrary=nullptr)
 
 LIB_PART (const LIB_PART &aPart, PART_LIB *aLibrary=NULL)
 
virtual ~LIB_PART ()
 http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared More...
 
PART_SPTR SharedPtr ()
 
virtual LIB_PARTDuplicate () const
 Create a copy of a LIB_PART and assigns unique KIIDs to the copy and its children. More...
 
void SetParent (LIB_PART *aParent=nullptr)
 
PART_REFGetParent ()
 
const PART_REFGetParent () const
 
virtual wxString GetClass () const override
 Return the class name. More...
 
virtual void SetName (const wxString &aName)
 
wxString GetName () const override
 
LIB_ID GetLibId () const override
 
void SetLibId (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
 
bool IsRoot () const override
 For symbols derived from other symbols, IsRoot() indicates no derivation. More...
 
bool IsAlias () const
 
const wxString GetLibraryName () const
 
PART_LIBGetLib ()
 
void SetLib (PART_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 EDA_RECT GetUnitBoundingBox (int aUnit, int aConvert) const
 Get the bounding box for the symbol. More...
 
const EDA_RECT GetBodyBoundingBox (int aUnit, int aConvert) const
 Get the symbol bounding box excluding fields. More...
 
const EDA_RECT 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 part units. More...
 
bool UnitsLocked () const
 Check whether part 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 part. More...
 
void GetFields (std::vector< LIB_FIELD > &aList)
 
void AddField (LIB_FIELD *aField)
 Add a field. More...
 
LIB_FIELDFindField (const wxString &aFieldName)
 Find a field within this part 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...
 
void Print (const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, int aMulti, int aConvert, const PART_DRAW_OPTIONS &aOpts)
 Print part. More...
 
void Plot (PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform)
 Plot lib part to plotter. More...
 
void PlotLibFields (PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform)
 Plot Lib Fields only of the part 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...
 
LIB_ITEMGetNextDrawItem (const LIB_ITEM *aItem=NULL, KICAD_T aType=TYPE_NOT_INIT)
 Return the next draw object pointer. More...
 
size_t GetPinCount () const
 
LIB_PINGetNextPin (LIB_PIN *aItem=NULL)
 Return the next pin object from the draw list. More...
 
void GetPins (LIB_PINS &aList, int aUnit=0, int aConvert=0)
 Return a list of pin object pointers from the draw item list. More...
 
LIB_PINGetPin (const wxString &aNumber, int aUnit=0, int aConvert=0)
 Return pin object with the requested pin aNumber. More...
 
bool PinsConflictWith (LIB_PART &aOtherPart, bool aTestNums, bool aTestNames, bool aTestType, bool aTestOrientation, bool aTestLength)
 Return true if this part's pins do not match another part's pins. More...
 
void SetOffset (const wxPoint &aOffset)
 Move the part aOffset. More...
 
void RemoveDuplicateDrawItems ()
 Remove duplicate draw items from list. More...
 
bool HasConversion () const
 Test if part has more than one body conversion type (DeMorgan). More...
 
void ClearTempFlags ()
 Clears the status flag all draw objects in this part. More...
 
void ClearEditFlags ()
 
LIB_ITEMLocateDrawItem (int aUnit, int aConvert, KICAD_T aType, const wxPoint &aPoint)
 Locate a draw object. More...
 
LIB_ITEMLocateDrawItem (int aUnit, int aConvert, KICAD_T aType, const wxPoint &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
 
SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) 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 part 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 IsMulti () const
 
void SetConversion (bool aSetConvert, bool aDuplicatePins=true)
 Set or clear the alternate body style (DeMorgan) for the part. More...
 
void SetPinNameOffset (int aOffset)
 Set the offset in mils of the pin name text from the pin symbol. More...
 
int GetPinNameOffset ()
 
void SetShowPinNames (bool aShow)
 Set or clear the pin name visibility flag. More...
 
bool ShowPinNames ()
 
void SetShowPinNumbers (bool aShow)
 Set or clear the pin number visibility flag. More...
 
bool ShowPinNumbers ()
 
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_PART &aRhs) const
 Comparison test that can be used for operators. More...
 
bool operator== (const LIB_PART *aPart) const
 
bool operator== (const LIB_PART &aPart) const
 
bool operator!= (const LIB_PART &aPart) const
 
const LIB_PARToperator= (const LIB_PART &aPart)
 
std::unique_ptr< LIB_PARTFlatten () const
 Return a flattened symbol inheritance to the caller. More...
 
std::vector< struct PART_UNITSGetUnitDrawItems ()
 Return a list of LIB_ITEM objects separated by unit and convert number. More...
 
std::vector< struct PART_UNITSGetUniqueUnits ()
 Return a list of unit numbers that are unique to this symbol. More...
 
std::vector< LIB_ITEM * > GetUnitItems (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...
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsEntered () const
 
bool IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, bool state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag) const
 
STATUS_FLAGS GetEditFlags () const
 
virtual bool IsType (const 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 bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const
 Test if aPosition is contained within or on the bounding box of an item. More...
 
virtual bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const
 Test if aRect intersects or is contained within the bounding box of an item. More...
 
virtual wxPoint GetPosition () const
 
virtual void SetPosition (const wxPoint &aPos)
 
virtual const wxPoint GetFocusPosition () const
 Similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual EDA_ITEMClone () const
 Create a duplicate of this item with linked list members set to NULL. More...
 
virtual wxString GetSelectMenuText (EDA_UNITS aUnits) const
 Return the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
virtual BITMAP_DEF GetMenuImage () const
 Return a pointer to an image to be used in menus. More...
 
virtual bool Matches (const wxFindReplaceData &aSearchData, void *aAuxData) const
 Compare the item against the search criteria in aSearchData. More...
 
virtual bool Replace (const wxFindReplaceData &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)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

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 SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 This changes first parameter to avoid the DList and use the main queue instead. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Change first parameter to avoid the DList and use std::vector instead. More...
 
static bool Replace (const wxFindReplaceData &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 wxFindReplaceData &aSearchData) const
 Compare aText against search criteria in aSearchData. More...
 

Protected Attributes

STATUS_FLAGS m_status
 
bool m_forceVisible
 
STATUS_FLAGS m_flags
 

Private Member Functions

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

Private Attributes

PART_SPTR m_me
 
PART_REF m_parent
 Use for inherited symbols. More...
 
LIB_ID m_libId
 
timestamp_t m_lastModDate
 
int m_unitCount
 Number of units (parts) per package. More...
 
bool m_unitsLocked
 True if part 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 part features such as POWER or NORMAL.) More...
 
LIB_ITEMS_CONTAINER m_drawings
 
PART_LIBm_library
 
wxString m_name
 
wxString m_description
 
wxString m_keyWords
 Search keywords. More...
 
wxArrayString m_fpFilters
 List of suitable footprint names for the part (wild card names accepted). More...
 

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 part 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 part library file (.lib). Library symbols are different from schematic symbols.

Definition at line 93 of file lib_symbol.h.

Constructor & Destructor Documentation

◆ LIB_PART() [1/2]

LIB_PART::LIB_PART ( const wxString &  aName,
LIB_PART aParent = nullptr,
PART_LIB aLibrary = nullptr 
)

Definition at line 82 of file lib_symbol.cpp.

82  :
84  m_me( this, null_deleter() ),
85  m_includeInBom( true ),
86  m_includeOnBoard( true )
87 {
88  m_lastModDate = 0;
89  m_unitCount = 1;
92  m_unitsLocked = false;
93  m_showPinNumbers = true;
94  m_showPinNames = true;
95 
96  // Add the MANDATORY_FIELDS in RAM only. These are assumed to be present
97  // when the field editors are invoked.
98  m_drawings[LIB_FIELD_T].reserve( 4 );
103 
104  SetName( aName );
105 
106  if( aParent )
107  SetParent( aParent );
108 
109  SetLib( aLibrary );
110 }
Field Reference of part, i.e. "IC21".
void SetLib(PART_LIB *aLibrary)
Definition: lib_symbol.h:173
bool m_showPinNumbers
Definition: lib_symbol.h:668
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:661
Field object used in symbol libraries.
Definition: lib_field.h:59
bool m_includeOnBoard
Definition: lib_symbol.h:671
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Definition: lib_symbol.h:672
bool m_includeInBom
Definition: lib_symbol.h:670
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:662
name of datasheet
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:665
Field Value of part, i.e. "3.3K".
void push_back(T *aItem)
Definition: multivector.h:174
void SetParent(LIB_PART *aParent=nullptr)
Definition: lib_symbol.cpp:325
#define DEFAULT_PIN_NAME_OFFSET
The intersheets references prefix string.
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: eda_item.cpp:51
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Definition: lib_symbol.cpp:74
timestamp_t m_lastModDate
Definition: lib_symbol.h:659
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:314
bool m_showPinNames
Definition: lib_symbol.h:667
Field Name Module PCB, i.e. "16DIP300".
PART_SPTR m_me
Definition: lib_symbol.h:656

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, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), REFERENCE_FIELD, SetLib(), SetName(), SetParent(), and VALUE_FIELD.

Referenced by Duplicate(), and Flatten().

◆ LIB_PART() [2/2]

LIB_PART::LIB_PART ( const LIB_PART aPart,
PART_LIB aLibrary = NULL 
)

Definition at line 113 of file lib_symbol.cpp.

113  :
114  EDA_ITEM( aPart ),
115  m_me( this, null_deleter() )
116 {
117  LIB_ITEM* newItem;
118 
119  m_library = aLibrary;
120  m_name = aPart.m_name;
121  m_fpFilters = wxArrayString( aPart.m_fpFilters );
122  m_unitCount = aPart.m_unitCount;
130  m_options = aPart.m_options;
131  m_libId = aPart.m_libId;
133  m_keyWords = aPart.m_keyWords;
134 
135  ClearSelected();
136 
137  for( const LIB_ITEM& oldItem : aPart.m_drawings )
138  {
139  if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 )
140  continue;
141 
142  try
143  {
144  newItem = (LIB_ITEM*) oldItem.Clone();
145  newItem->ClearSelected();
146  newItem->SetParent( this );
147  m_drawings.push_back( newItem );
148  }
149  catch( ... )
150  {
151  wxFAIL_MSG( "Failed to clone LIB_ITEM." );
152  }
153  }
154 
155  PART_SPTR parent = aPart.m_parent.lock();
156 
157  if( parent )
158  SetParent( parent.get() );
159 }
bool m_showPinNumbers
Definition: lib_symbol.h:668
void ClearSelected()
Definition: eda_item.h:181
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:661
PART_LIB * m_library
Definition: lib_symbol.h:676
bool m_includeOnBoard
Definition: lib_symbol.h:671
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Definition: lib_symbol.h:672
bool m_includeInBom
Definition: lib_symbol.h:670
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:662
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:165
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:665
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657
wxString m_name
Definition: lib_symbol.h:677
void push_back(T *aItem)
Definition: multivector.h:174
void SetParent(LIB_PART *aParent=nullptr)
Definition: lib_symbol.cpp:325
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:115
wxArrayString m_fpFilters
List of suitable footprint names for the part (wild card names accepted).
Definition: lib_symbol.h:680
LIB_ID m_libId
Definition: lib_symbol.h:658
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: eda_item.cpp:51
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Definition: lib_symbol.cpp:74
timestamp_t m_lastModDate
Definition: lib_symbol.h:659
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:679
STATUS_FLAGS GetFlags() const
Definition: eda_item.h:204
bool m_showPinNames
Definition: lib_symbol.h:667
wxString m_description
Definition: lib_symbol.h:678
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
PART_SPTR m_me
Definition: lib_symbol.h:656

References EDA_ITEM::ClearSelected(), EDA_ITEM::Clone(), 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_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), SetParent(), EDA_ITEM::SetParent(), and STRUCT_DELETED.

◆ ~LIB_PART()

LIB_PART::~LIB_PART ( )
virtual

Member Function Documentation

◆ AddDrawItem()

void LIB_PART::AddDrawItem ( LIB_ITEM aItem,
bool  aSort = true 
)

◆ AddField()

void LIB_PART::AddField ( LIB_FIELD aField)

Add a field.

Takes ownership of the pointer.

Definition at line 882 of file lib_symbol.cpp.

883 {
884  AddDrawItem( aField );
885 }
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:655

References AddDrawItem().

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearEditFlags()

void LIB_PART::ClearEditFlags ( )

Definition at line 1050 of file lib_symbol.cpp.

1051 {
1052  for( LIB_ITEM& item : m_drawings )
1053  item.ClearEditFlags();
1054 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62

References m_drawings.

Referenced by SYMBOL_EDIT_FRAME::SaveCopyInUndoList().

◆ ClearFlags()

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

Definition at line 203 of file eda_item.h.

203 { m_flags &= ~aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:530

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), FOOTPRINT::BuildPolyCourtyards(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), ConvertOutlineToPolygon(), 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(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), EE_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::narrowSelection(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_PIN_TOOL::RepeatPin(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearSelected()

◆ ClearTempFlags()

void LIB_PART::ClearTempFlags ( )

Clears the status flag all draw objects in this part.

Definition at line 1043 of file lib_symbol.cpp.

1044 {
1045  for( LIB_ITEM& item : m_drawings )
1046  item.ClearTempFlags();
1047 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62

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 148 of file view_item.h.

149  {
150  m_viewPrivData = nullptr;
151  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:156

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 FP_ZONE, ZONE, SCH_COMPONENT, PAD, SCH_SHEET, FOOTPRINT, CENTER_DIMENSION, SCH_HIERLABEL, LEADER, ORTHOGONAL_DIMENSION, VIA, SCH_GLOBALLABEL, SCH_LABEL, ALIGNED_DIMENSION, PCB_SHAPE, ARC, SCH_TEXT, LIB_PIN, SCH_LINE, FP_TEXT, TRACK, SCH_SHEET_PIN, SCH_BUS_BUS_ENTRY, SCH_FIELD, LIB_FIELD, SCH_BUS_WIRE_ENTRY, FP_SHAPE, SCH_BITMAP, PCB_TEXT, LIB_ARC, PCB_GROUP, LIB_TEXT, SCH_JUNCTION, SCH_NO_CONNECT, LIB_POLYLINE, SCH_MARKER, PCB_TARGET, LIB_RECTANGLE, LIB_CIRCLE, LIB_BEZIER, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 97 of file eda_item.cpp.

98 {
99  wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
100  wxT( ". Bad programmer!" ) );
101 }
#define NULL
virtual wxString GetClass() const =0
Return the class name.

References EDA_ITEM::GetClass(), and NULL.

Referenced by DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), DIMENSION_BASE::GetEffectiveShape(), LIB_PART(), new_clone(), operator=(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), SetConversion(), SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), COMMIT::Stage(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ Compare()

int LIB_PART::Compare ( const LIB_PART aRhs) 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 213 of file lib_symbol.cpp.

214 {
215  if( m_me == aRhs.m_me )
216  return 0;
217 
218  int retv = m_name.Cmp( aRhs.m_name );
219 
220  if( retv )
221  return retv;
222 
223  retv = m_libId.compare( aRhs.m_libId );
224 
225  if( retv )
226  return retv;
227 
228  if( m_parent.lock() < aRhs.m_parent.lock() )
229  return -1;
230 
231  if( m_parent.lock() > aRhs.m_parent.lock() )
232  return 1;
233 
234  if( m_options != aRhs.m_options )
235  return ( m_options == ENTRY_NORMAL ) ? -1 : 1;
236 
237  if( m_unitCount != aRhs.m_unitCount )
238  return m_unitCount - aRhs.m_unitCount;
239 
240  if( m_drawings.size() != aRhs.m_drawings.size() )
241  return m_drawings.size() - aRhs.m_drawings.size();
242 
245 
246  while( lhsItemIt != m_drawings.end() )
247  {
248  const LIB_ITEM* lhsItem = static_cast<const LIB_ITEM*>( &(*lhsItemIt) );
249  const LIB_ITEM* rhsItem = static_cast<const LIB_ITEM*>( &(*rhsItemIt) );
250 
251  wxCHECK( lhsItem && rhsItem, lhsItem - rhsItem );
252 
253  if( lhsItem->Type() != rhsItem->Type() )
254  return lhsItem->Type() - rhsItem->Type();
255 
256  retv = lhsItem->compare( *rhsItem );
257 
258  if( retv )
259  return retv;
260 
261  ++lhsItemIt;
262  ++rhsItemIt;
263  }
264 
265  if( m_fpFilters.GetCount() != aRhs.m_fpFilters.GetCount() )
266  return m_fpFilters.GetCount() - aRhs.m_fpFilters.GetCount();
267 
268  for( size_t i = 0; i < m_fpFilters.GetCount(); i++ )
269  {
270  retv = m_fpFilters[i].Cmp( aRhs.m_fpFilters[i] );
271 
272  if( retv )
273  return retv;
274  }
275 
276  retv = m_description.Cmp( aRhs.m_description );
277 
278  if( retv )
279  return retv;
280 
281  retv = m_keyWords.Cmp( aRhs.m_keyWords );
282 
283  if( retv )
284  return retv;
285 
286  if( m_pinNameOffset != aRhs.m_pinNameOffset )
287  return m_pinNameOffset - aRhs.m_pinNameOffset;
288 
289  if( m_unitsLocked != aRhs.m_unitsLocked )
290  return ( m_unitsLocked ) ? 1 : -1;
291 
292  if( m_showPinNames != aRhs.m_showPinNames )
293  return ( m_showPinNames ) ? 1 : -1;
294 
295  if( m_showPinNumbers != aRhs.m_showPinNumbers )
296  return ( m_showPinNumbers ) ? 1 : -1;
297 
298  if( m_includeInBom != aRhs.m_includeInBom )
299  return ( m_includeInBom ) ? 1 : -1;
300 
301  if( m_includeOnBoard != aRhs.m_includeOnBoard )
302  return ( m_includeOnBoard ) ? 1 : -1;
303 
304  return 0;
305 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:188
bool m_showPinNumbers
Definition: lib_symbol.h:668
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:661
bool m_includeOnBoard
Definition: lib_symbol.h:671
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Definition: lib_symbol.h:672
bool m_includeInBom
Definition: lib_symbol.h:670
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:311
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:662
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:194
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:665
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657
wxString m_name
Definition: lib_symbol.h:677
wxArrayString m_fpFilters
List of suitable footprint names for the part (wild card names accepted).
Definition: lib_symbol.h:680
LIB_ID m_libId
Definition: lib_symbol.h:658
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
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:679
bool m_showPinNames
Definition: lib_symbol.h:667
wxString m_description
Definition: lib_symbol.h:678
virtual int compare(const LIB_ITEM &aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags=LIB_ITEM::COMPARE_FLAGS::NORMAL) const
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_item.cpp:74
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:225
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162
PART_SPTR m_me
Definition: lib_symbol.h:656

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), LIB_ID::compare(), LIB_ITEM::compare(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), ENTRY_NORMAL, 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_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size(), and EDA_ITEM::Type().

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

◆ deleteAllFields()

void LIB_PART::deleteAllFields ( )
private

Definition at line 876 of file lib_symbol.cpp.

877 {
879 }
void clear(int aType=UNDEFINED_TYPE)
Definition: multivector.h:212
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674

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

Referenced by SetFields().

◆ Duplicate()

virtual LIB_PART* LIB_PART::Duplicate ( ) const
inlinevirtual

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

Definition at line 108 of file lib_symbol.h.

109  {
110  LIB_PART* dupe = new LIB_PART( *this, m_library );
111  const_cast<KIID&>( dupe->m_Uuid ) = KIID();
112 
113  for( LIB_ITEM& item : dupe->m_drawings )
114  const_cast<KIID&>( item.m_Uuid ) = KIID();
115 
116  return dupe;
117  }
PART_LIB * m_library
Definition: lib_symbol.h:676
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
Definition: kiid.h:44
Define a library symbol object.
Definition: lib_symbol.h:93
LIB_PART(const wxString &aName, LIB_PART *aParent=nullptr, PART_LIB *aLibrary=nullptr)
Definition: lib_symbol.cpp:82
const KIID m_Uuid
Definition: eda_item.h:524

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

◆ FindField() [1/2]

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

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

Definition at line 953 of file lib_symbol.cpp.

954 {
955  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
956  {
957  if( static_cast<LIB_FIELD*>( &item )->GetCanonicalName() == aFieldName )
958  return static_cast<LIB_FIELD*>( &item );
959  }
960 
961  return NULL;
962 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
#define NULL

References LIB_FIELD_T, m_drawings, and NULL.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), DIALOG_CHANGE_SYMBOLS::processSymbol(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), and FOOTPRINT_INFO_GENERATOR::SetHtmlFieldTable().

◆ FindField() [2/2]

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

Definition at line 965 of file lib_symbol.cpp.

966 {
967  for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
968  {
969  if( static_cast<const LIB_FIELD*>( &item )->GetCanonicalName() == aFieldName )
970  return static_cast<const LIB_FIELD*>( &item );
971  }
972 
973  return NULL;
974 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
#define NULL

References LIB_FIELD_T, m_drawings, and NULL.

◆ Flatten()

std::unique_ptr< LIB_PART > LIB_PART::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 334 of file lib_symbol.cpp.

335 {
336  std::unique_ptr< LIB_PART > retv;
337 
338  if( IsAlias() )
339  {
340  PART_SPTR parent = m_parent.lock();
341 
342  wxCHECK_MSG( parent, retv,
343  wxString::Format( "Parent of derived symbol '%s' undefined", m_name ) );
344 
345  // Copy the parent.
346  retv.reset( new LIB_PART( *parent.get() ) );
347 
348  retv->SetName( m_name );
349 
350  // Now add the inherited part mandatory field (this) information.
351  for( int i = 0; i < MANDATORY_FIELDS; i++ )
352  {
353  wxString tmp = GetFieldById( i )->GetText();
354 
355  // If the field isn't defined then inherit the parent field value.
356  if( tmp.IsEmpty() )
357  retv->GetFieldById( i )->SetText( parent->GetFieldById( i )->GetText() );
358  else
359  *retv->GetFieldById( i ) = *GetFieldById( i );
360  }
361 
362  // Grab all the rest of derived symbol fields.
363  for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
364  {
365  const LIB_FIELD* aliasField = dynamic_cast<const LIB_FIELD*>( &item );
366 
367  wxCHECK2( aliasField, continue );
368 
369  // Mandatory fields were already resolved.
370  if( aliasField->IsMandatory() )
371  continue;
372 
373  LIB_FIELD* newField = new LIB_FIELD( *aliasField );
374  newField->SetParent( retv.get() );
375 
376  LIB_FIELD* parentField = retv->FindField( aliasField->GetName() );
377 
378  if( !parentField ) // Derived symbol field does not exist in parent symbol.
379  {
380  retv->AddDrawItem( newField );
381  }
382  else // Derived symbol field overrides the parent symbol field.
383  {
384  retv->RemoveDrawItem( parentField );
385  retv->AddDrawItem( newField );
386  }
387  }
388 
389  retv->SetKeyWords( m_keyWords.IsEmpty() ? parent->GetKeyWords() : m_keyWords );
390  retv->SetDescription( m_description.IsEmpty() ? parent->GetDescription() : m_description );
391  retv->SetFPFilters( m_fpFilters.IsEmpty() ? parent->GetFPFilters() : m_fpFilters );
392  }
393  else
394  {
395  retv.reset( new LIB_PART( *this ) );
396  }
397 
398  return retv;
399 }
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:165
wxString GetName(bool aUseDefaultName=true) const
Returns the field name.
Definition: lib_field.cpp:364
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657
wxString m_name
Definition: lib_symbol.h:677
LIB_PART(const wxString &aName, LIB_PART *aParent=nullptr, PART_LIB *aLibrary=nullptr)
Definition: lib_symbol.cpp:82
wxArrayString m_fpFilters
List of suitable footprint names for the part (wild card names accepted).
Definition: lib_symbol.h:680
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
Definition: lib_symbol.cpp:939
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
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
bool IsAlias() const
Definition: lib_symbol.h:168
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:679
wxString m_description
Definition: lib_symbol.h:678
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
bool IsMandatory() const
Definition: lib_field.cpp:454

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

Referenced by EE_INSPECTION_TOOL::CheckSymbol(), SYMBOL_EDIT_FRAME::CopyPartToClipboard(), SCH_EDIT_FRAME::CreateArchiveLibrary(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDIT_FRAME::ExportPart(), SYMBOL_EDIT_FRAME::GetDocumentExtents(), RESCUE_CACHE_CANDIDATE::PerformAction(), RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction(), DIALOG_CHANGE_SYMBOLS::processSymbol(), SCH_COMPONENT::SCH_COMPONENT(), ERC_TESTER::TestLibSymbolIssues(), DIALOG_EDIT_COMPONENTS_LIBID::TransferDataFromWindow(), DIALOG_CHANGE_SYMBOLS::updateFieldsList(), SCH_EDIT_FRAME::UpdateSymbolFromEditor(), and SCH_SCREEN::UpdateSymbolLinks().

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 84 of file inspectable.h.

85  {
87  TYPE_ID thisType = TYPE_HASH( *this );
88  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
89  return object ? aProperty->getter( object ) : wxAny();
90  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:66
#define TYPE_HASH(x)
Definition: property.h:57
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:43
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual wxAny getter(void *aObject) const =0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:63
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

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

Referenced by CLASS_D_DESC::CLASS_D_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [2/3]

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

Definition at line 93 of file inspectable.h.

94  {
96  TYPE_ID thisType = TYPE_HASH( *this );
97  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
98  return object ? aProperty->get<T>( object ) : T();
99  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:66
#define TYPE_HASH(x)
Definition: property.h:57
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:43
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:63
T get(void *aObject)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

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

◆ Get() [3/3]

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

Definition at line 102 of file inspectable.h.

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

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

◆ GetBodyBoundingBox()

const EDA_RECT LIB_PART::GetBodyBoundingBox ( int  aUnit,
int  aConvert 
) const

Get the symbol bounding box excluding fields.

Returns
the part 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 849 of file lib_symbol.cpp.

850 {
851  EDA_RECT bbox;
852 
853  for( const LIB_ITEM& item : m_drawings )
854  {
855  if( item.m_unit > 0
856  && m_unitCount > 1
857  && aUnit > 0
858  && aUnit != item.m_unit )
859  {
860  continue;
861  }
862 
863  if( item.m_convert > 0 && aConvert > 0 && aConvert != item.m_convert )
864  continue;
865 
866  if( item.Type() == LIB_FIELD_T )
867  continue;
868 
869  bbox.Merge( item.GetBoundingBox() );
870  }
871 
872  return bbox;
873 }
void Merge(const EDA_RECT &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: eda_rect.cpp:431
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:661
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
Handle the component boundary box.
Definition: eda_rect.h:42

References LIB_FIELD_T, m_drawings, m_unitCount, and EDA_RECT::Merge().

Referenced by SCH_COMPONENT::GetBodyBoundingBox().

◆ GetBoundingBox()

const EDA_RECT LIB_PART::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 216 of file lib_symbol.h.

217  {
218  return GetUnitBoundingBox( 0, 0 );
219  }
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Definition: lib_symbol.cpp:803

References GetUnitBoundingBox().

◆ GetClass()

virtual wxString LIB_PART::GetClass ( ) const
inlineoverridevirtual

Return the class name.

Implements EDA_ITEM.

Definition at line 123 of file lib_symbol.h.

124  {
125  return wxT( "LIB_PART" );
126  }

◆ GetDatasheetField()

LIB_FIELD & LIB_PART::GetDatasheetField ( )

Return reference to the datasheet field.

Definition at line 1001 of file lib_symbol.cpp.

1002 {
1004  wxASSERT( field != NULL );
1005  return *field;
1006 }
Field object used in symbol libraries.
Definition: lib_field.h:59
name of datasheet
#define NULL
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
Definition: lib_symbol.cpp:939

References DATASHEET_FIELD, GetFieldById(), and NULL.

Referenced by SYMBOL_EDIT_FRAME::DisplaySymbolDatasheet(), FOOTPRINT_INFO_GENERATOR::GetHtmlFieldRow(), SYMBOL_VIEWER_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), and EE_INSPECTION_TOOL::ShowDatasheet().

◆ GetDescription()

wxString LIB_PART::GetDescription ( )
inlineoverridevirtual

Implements LIB_TREE_ITEM.

Definition at line 138 of file lib_symbol.h.

139  {
140  if( m_description.IsEmpty() && IsAlias() )
141  {
142  if( PART_SPTR parent = m_parent.lock() )
143  return parent->GetDescription();
144  }
145 
146  return m_description;
147  }
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657
bool IsAlias() const
Definition: lib_symbol.h:168
wxString m_description
Definition: lib_symbol.h:678

References IsAlias(), m_description, and m_parent.

Referenced by SYMBOL_EDIT_FRAME::DisplaySymbolDatasheet(), GetSearchText(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SCH_SEXPR_PLUGIN_CACHE::saveDcmInfoAsFields(), FOOTPRINT_INFO_GENERATOR::SetHtmlDesc(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), and SYMBOL_VIEWER_FRAME::updatePreviewSymbol().

◆ GetDrawItems() [1/2]

◆ GetDrawItems() [2/2]

const LIB_ITEMS_CONTAINER& LIB_PART::GetDrawItems ( ) const
inline

Definition at line 468 of file lib_symbol.h.

468 { return m_drawings; }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674

References m_drawings.

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 207 of file eda_item.h.

208  {
209  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
211 
212  return m_flags & mask;
213  }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:107
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:115
#define IS_MOVED
Item being moved.
Definition: eda_item.h:105
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:108
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: eda_item.h:119
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:110
STATUS_FLAGS m_flags
Definition: eda_item.h:530
#define IS_NEW
New item, just created.
Definition: eda_item.h:106

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, IS_WIRE_IMAGE, 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_COMPONENT::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), PAD_TOOL::recombinePad(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow().

◆ GetFieldById()

LIB_FIELD * LIB_PART::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 939 of file lib_symbol.cpp.

940 {
941  for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
942  {
943  LIB_FIELD* field = ( LIB_FIELD* ) &item;
944 
945  if( field->GetId() == aId )
946  return field;
947  }
948 
949  return NULL;
950 }
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
int GetId() const
Definition: lib_field.h:138
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
#define NULL

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

Referenced by SYMBOL_EDIT_FRAME::CreateNewPart(), Flatten(), GetDatasheetField(), GetFields(), GetFootprintField(), GetReferenceField(), GetValueField(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), SCH_LEGACY_PLUGIN_CACHE::loadDocs(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), DIALOG_CHANGE_SYMBOLS::processSymbol(), and DIALOG_CHOOSE_SYMBOL::ShowFootprintFor().

◆ GetFields() [1/2]

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

Return a list of fields within this part.

Parameters
aList- List to add fields to

Definition at line 905 of file lib_symbol.cpp.

906 {
907  // Grab the MANDATORY_FIELDS first, in expected order given by enum MANDATORY_FIELD_T
908  for( int id = 0; id < MANDATORY_FIELDS; ++id )
909  aList.push_back( GetFieldById( id ) );
910 
911  // Now grab all the rest of fields.
912  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
913  {
914  LIB_FIELD* field = static_cast<LIB_FIELD*>( &item );
915 
916  if( !field->IsMandatory() )
917  aList.push_back( field );
918  }
919 }
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
Definition: lib_symbol.cpp:939
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
bool IsMandatory() const
Definition: lib_field.cpp:454

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

Referenced by DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), DIALOG_CHANGE_SYMBOLS::processSymbol(), 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_PART::GetFields ( std::vector< LIB_FIELD > &  aList)

Definition at line 922 of file lib_symbol.cpp.

923 {
924  // Grab the MANDATORY_FIELDS first, in expected order given by enum MANDATORY_FIELD_T
925  for( int id = 0; id < MANDATORY_FIELDS; ++id )
926  aList.push_back( *GetFieldById( id ) );
927 
928  // Now grab all the rest of fields.
929  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
930  {
931  LIB_FIELD* field = static_cast<LIB_FIELD*>( &item );
932 
933  if( !field->IsMandatory() )
934  aList.push_back( *field );
935  }
936 }
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
Definition: lib_symbol.cpp:939
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
bool IsMandatory() const
Definition: lib_field.cpp:454

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

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint 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 TRACK.

Definition at line 308 of file eda_item.h.

308 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:301

References EDA_ITEM::GetPosition().

Referenced by PCB_BASE_FRAME::FocusOnItem(), and SCH_EDIT_FRAME::FocusOnItem().

◆ GetFootprintField()

LIB_FIELD & LIB_PART::GetFootprintField ( )

Return reference to the footprint field.

Definition at line 993 of file lib_symbol.cpp.

994 {
996  wxASSERT( field != NULL );
997  return *field;
998 }
Field object used in symbol libraries.
Definition: lib_field.h:59
#define NULL
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
Definition: lib_symbol.cpp:939
Field Name Module PCB, i.e. "16DIP300".

References FOOTPRINT_FIELD, GetFieldById(), and NULL.

Referenced by GetSearchText(), and CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().

◆ GetFPFilters()

wxArrayString LIB_PART::GetFPFilters ( ) const
inline

Definition at line 179 of file lib_symbol.h.

180  {
181  if( m_fpFilters.IsEmpty() && IsAlias() )
182  {
183  if( PART_SPTR parent = m_parent.lock() )
184  return parent->GetFPFilters();
185  }
186 
187  return m_fpFilters;
188  }
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657
wxArrayString m_fpFilters
List of suitable footprint names for the part (wild card names accepted).
Definition: lib_symbol.h:680
bool IsAlias() const
Definition: lib_symbol.h:168

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().

◆ GetIncludeInBom()

bool LIB_PART::GetIncludeInBom ( ) const
inline

◆ GetIncludeOnBoard()

bool LIB_PART::GetIncludeOnBoard ( ) const
inline

◆ GetKeyWords()

wxString LIB_PART::GetKeyWords ( ) const
inline

Definition at line 151 of file lib_symbol.h.

152  {
153  if( m_keyWords.IsEmpty() && IsAlias() )
154  {
155  if( PART_SPTR parent = m_parent.lock() )
156  return parent->GetKeyWords();
157  }
158 
159  return m_keyWords;
160  }
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657
bool IsAlias() const
Definition: lib_symbol.h:168
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:679

References IsAlias(), m_keyWords, and m_parent.

Referenced by SYMBOL_EDIT_FRAME::DisplaySymbolDatasheet(), GetSearchText(), SCH_SEXPR_PLUGIN_CACHE::saveDcmInfoAsFields(), FOOTPRINT_INFO_GENERATOR::SetHtmlKeywords(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), and SYMBOL_VIEWER_FRAME::updatePreviewSymbol().

◆ GetLastModDate()

timestamp_t LIB_PART::GetLastModDate ( ) const
inline

Definition at line 175 of file lib_symbol.h.

175 { return m_lastModDate; }
timestamp_t m_lastModDate
Definition: lib_symbol.h:659

References m_lastModDate.

Referenced by SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().

◆ GetLib()

PART_LIB* LIB_PART::GetLib ( )
inline

Definition at line 172 of file lib_symbol.h.

172 { return m_library; }
PART_LIB * m_library
Definition: lib_symbol.h:676

References m_library.

Referenced by SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::CreateBuffer(), and PART_LIB::FindPart().

◆ GetLibId()

◆ GetLibNickname()

wxString LIB_PART::GetLibNickname ( ) const
inlineoverridevirtual

Implements LIB_TREE_ITEM.

Definition at line 134 of file lib_symbol.h.

134 { return GetLibraryName(); }
const wxString GetLibraryName() const
Definition: lib_symbol.cpp:402

References GetLibraryName().

Referenced by SYMBOL_EDIT_FRAME::IsSymbolFromLegacyLibrary().

◆ GetLibraryName()

const wxString LIB_PART::GetLibraryName ( ) const

Definition at line 402 of file lib_symbol.cpp.

403 {
404  if( m_library )
405  return m_library->GetName();
406 
407  return m_libId.GetLibNickname();
408 }
const wxString GetName() const
Return the file name without path or extension.
PART_LIB * m_library
Definition: lib_symbol.h:676
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:92
LIB_ID m_libId
Definition: lib_symbol.h:658

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

Referenced by GetLibNickname().

◆ GetMenuImage()

BITMAP_DEF 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 ZONE, SCH_COMPONENT, PAD, SCH_SHEET, FOOTPRINT, CENTER_DIMENSION, SCH_HIERLABEL, LEADER, ORTHOGONAL_DIMENSION, SCH_GLOBALLABEL, VIA, SCH_LABEL, ALIGNED_DIMENSION, PCB_SHAPE, SCH_TEXT, LIB_PIN, GERBER_DRAW_ITEM, SCH_LINE, FP_TEXT, TRACK, SCH_BUS_BUS_ENTRY, SCH_SHEET_PIN, LIB_FIELD, SCH_FIELD, PCB_GROUP, SCH_BUS_WIRE_ENTRY, FP_SHAPE, SCH_BITMAP, LIB_ARC, PCB_TEXT, LIB_TEXT, LIB_POLYLINE, SCH_NO_CONNECT, SCH_MARKER, PCB_TARGET, SCH_JUNCTION, LIB_RECTANGLE, PCB_MARKER, and LIB_CIRCLE.

Definition at line 222 of file eda_item.cpp.

223 {
224  return dummy_xpm;
225 }
static const BITMAP_OPAQUE dummy_xpm[1]
Definition: eda_item.cpp:48

References dummy_xpm.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), and PCB_SELECTION_TOOL::doSelectionMenu().

◆ GetMsgPanelInfo()

◆ GetName()

wxString LIB_PART::GetName ( void  ) const
inlineoverridevirtual

Implements LIB_TREE_ITEM.

Definition at line 129 of file lib_symbol.h.

129 { return m_name; }
wxString m_name
Definition: lib_symbol.h:677

References m_name.

Referenced by SCH_SEXPR_PLUGIN_CACHE::AddSymbol(), SCH_LEGACY_PLUGIN_CACHE::AddSymbol(), SYMBOL_EDIT_FRAME::DisplaySymbolDatasheet(), SYMBOL_EDIT_FRAME::DuplicatePart(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), SYMBOL_EDIT_FRAME::ensureUniqueName(), SYMBOL_EDIT_FRAME::ExportPart(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), SYMBOL_EDITOR_CONTROL::ExportView(), SYMBOL_LIBRARY_MANAGER::GetBufferedPart(), PART_LIB::GetParts(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), SCH_LEGACY_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), SYMBOL_EDIT_FRAME::LoadOneLibraryPartAux(), CADSTAR_SCH_ARCHIVE_LOADER::loadPartsLibrary(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), operator<(), SCH_SEXPR_PARSER::ParseLib(), PART_LIB::RemovePart(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), PART_LIB::ReplacePart(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer(), SYMBOL_EDIT_FRAME::savePartAs(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), SYMBOL_EDIT_FRAME::SetCurPart(), FOOTPRINT_INFO_GENERATOR::SetHtmlName(), SYMBOL_EDIT_FRAME::SyncLibraries(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties(), FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary(), SYMBOL_LIBRARY_MANAGER::UpdatePart(), and SYMBOL_VIEWER_FRAME::updatePreviewSymbol().

◆ GetNextDrawItem()

LIB_ITEM * LIB_PART::GetNextDrawItem ( const LIB_ITEM aItem = NULL,
KICAD_T  aType = TYPE_NOT_INIT 
)

Return the next draw object pointer.

Parameters
aItem- Pointer to the current draw item. Setting item NULL with return the first item of type in the list.
aType- type of searched item (filter). if TYPE_NOT_INIT search for all items types
Returns
- The next drawing object in the list if found, otherwise NULL.

Definition at line 666 of file lib_symbol.cpp.

667 {
668  if( aItem == NULL )
669  {
671 
672  return (it1 != m_drawings.end( aType ) ) ? &( *( m_drawings.begin( aType ) ) ) : nullptr;
673  }
674 
675  // Search for the last item, assume aItem is of type aType
676  wxASSERT( ( aType == TYPE_NOT_INIT ) || ( aType == aItem->Type() ) );
678 
679  while( ( it != m_drawings.end( aType ) ) && ( aItem != &( *it ) ) )
680  ++it;
681 
682  // Search the next item
683  if( it != m_drawings.end( aType ) )
684  {
685  ++it;
686 
687  if( it != m_drawings.end( aType ) )
688  return &( *it );
689  }
690 
691  return NULL;
692 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:188
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:194
#define NULL
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
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), m_drawings, NULL, EDA_ITEM::Type(), and TYPE_NOT_INIT.

Referenced by BOOST_AUTO_TEST_CASE(), and GetNextPin().

◆ GetNextPin()

LIB_PIN* LIB_PART::GetNextPin ( LIB_PIN aItem = NULL)
inline

Return the next pin object from the draw list.

This is just a pin object specific version of GetNextDrawItem().

Parameters
aItem- Pointer to the previous pin item, or NULL to get the first pin in the draw object list.
Returns
- The next pin object in the list if found, otherwise NULL.

Definition at line 366 of file lib_symbol.h.

367  {
368  return (LIB_PIN*) GetNextDrawItem( (LIB_ITEM*) aItem, LIB_PIN_T );
369  }
LIB_ITEM * GetNextDrawItem(const LIB_ITEM *aItem=NULL, KICAD_T aType=TYPE_NOT_INIT)
Return the next draw object pointer.
Definition: lib_symbol.cpp:666
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62

References GetNextDrawItem(), and LIB_PIN_T.

Referenced by SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), 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().

◆ GetParent() [1/2]

◆ GetParent() [2/2]

const PART_REF& LIB_PART::GetParent ( void  ) const
inline

Definition at line 121 of file lib_symbol.h.

121 { return m_parent; }
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657

References m_parent.

◆ GetPin()

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

Return pin object with the requested pin aNumber.

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

Definition at line 718 of file lib_symbol.cpp.

719 {
720  LIB_PINS pinList;
721 
722  GetPins( pinList, aUnit, aConvert );
723 
724  for( size_t i = 0; i < pinList.size(); i++ )
725  {
726  wxASSERT( pinList[i]->Type() == LIB_PIN_T );
727 
728  if( aNumber == pinList[i]->GetNumber() )
729  return pinList[i];
730  }
731 
732  return NULL;
733 }
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:56
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:695
#define NULL
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162

References GetPins(), LIB_PIN_T, NULL, and EDA_ITEM::Type().

◆ GetPinCount()

size_t LIB_PART::GetPinCount ( ) const
inline

Definition at line 355 of file lib_symbol.h.

355 { return m_drawings.size( LIB_PIN_T ); }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:225

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

◆ GetPinNameOffset()

◆ GetPins()

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

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

Note pin objects are owned by the draw list of the part. 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 pin to add to list. Set to 0 to get pins from any part unit.
aConvert- Convert number of pin to add to list. Set to 0 to get pins from any convert of part.

Definition at line 695 of file lib_symbol.cpp.

696 {
697  /* Notes:
698  * when aUnit == 0: no unit filtering
699  * when aConvert == 0: no convert (shape selection) filtering
700  * when m_unit == 0, the body item is common to units
701  * when m_convert == 0, the body item is common to shapes
702  */
703  for( LIB_ITEM& item : m_drawings[ LIB_PIN_T ] )
704  {
705  // Unit filtering:
706  if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
707  continue;
708 
709  // Shape filtering:
710  if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
711  continue;
712 
713  aList.push_back( (LIB_PIN*) &item );
714  }
715 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62

References LIB_PIN_T, and m_drawings.

Referenced by KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), GetPin(), PinsConflictWith(), and DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector().

◆ GetPosition()

virtual wxPoint EDA_ITEM::GetPosition ( ) const
inlinevirtualinherited

Reimplemented in SCH_COMPONENT, SCH_SHEET, VIA, DELETED_BOARD_ITEM, DS_DRAW_ITEM_BITMAP, BOARD, DS_DRAW_ITEM_TEXT, SCH_TEXT, ARC, DS_DRAW_ITEM_PAGE, LIB_PIN, SCH_LINE, DS_DRAW_ITEM_RECT, SCH_FIELD, FOOTPRINT, LIB_FIELD, PAD, DS_DRAW_ITEM_POLYPOLYGONS, GERBER_DRAW_ITEM, SCH_BITMAP, PCB_SHAPE, DS_DRAW_ITEM_LINE, DIMENSION_BASE, PCB_GROUP, ZONE, SCH_NO_CONNECT, TRACK, SCH_MARKER, KIGFX::ORIGIN_VIEWITEM, SCH_BUS_ENTRY_BASE, LIB_TEXT, SCH_JUNCTION, LIB_POLYLINE, LIB_ARC, SCH_PIN, FP_TEXT, NETINFO_ITEM, LIB_BEZIER, LIB_RECTANGLE, LIB_CIRCLE, PCB_TEXT, PCB_MARKER, and PCB_TARGET.

Definition at line 301 of file eda_item.h.

301 { return wxPoint(); }

Referenced by EE_GRID_HELPER::computeAnchors(), PCB_GRID_HELPER::computeAnchors(), SCH_EDIT_FRAME::DeleteJunction(), KIGFX::PCB_PAINTER::draw(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), PCB_SELECTION_TOOL::findCallback(), GERBVIEW_SELECTION::GetCenter(), EDA_ITEM::GetFocusPosition(), SCH_FIELD::GetParentPosition(), SCH_SCREEN::GetSheets(), PCB_SELECTION::GetTopLeftItem(), EE_SELECTION::GetTopLeftItem(), BOARD_ITEM::GetX(), BOARD_ITEM::GetY(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_ITEM::operator<(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PCB_CONTROL::placeBoardItems(), DRAWING_TOOL::PlaceText(), POSITION_RELATIVE_TOOL::PositionRelative(), BACK_ANNOTATE::processNetNameChange(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), PCB_SELECTION_TOOL::selectConnectedTracks(), RC_ITEM::ShowReport(), TransformItem(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), PL_EDIT_TOOL::updateModificationPoint(), and EE_POINT_EDITOR::updatePoints().

◆ GetReferenceField()

LIB_FIELD & LIB_PART::GetReferenceField ( )

Return reference to the reference designator field.

Definition at line 985 of file lib_symbol.cpp.

986 {
988  wxASSERT( field != NULL );
989  return *field;
990 }
Field Reference of part, i.e. "IC21".
Field object used in symbol libraries.
Definition: lib_field.h:59
#define NULL
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
Definition: lib_symbol.cpp:939

References GetFieldById(), NULL, and REFERENCE_FIELD.

Referenced by SYMBOL_EDIT_FRAME::CreateNewPart(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), and SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().

◆ GetSearchText()

wxString LIB_PART::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  return text;
64 }
LIB_FIELD & GetFootprintField()
Return reference to the footprint field.
Definition: lib_symbol.cpp:993
wxString GetKeyWords() const
Definition: lib_symbol.h:151
wxString GetDescription() override
Definition: lib_symbol.h:138
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133

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

◆ GetSelectMenuText()

wxString EDA_ITEM::GetSelectMenuText ( EDA_UNITS  aUnits) const
virtualinherited

Return the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position.

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 ZONE, SCH_COMPONENT, PAD, BOARD, SCH_SHEET, FOOTPRINT, SCH_HIERLABEL, SCH_GLOBALLABEL, VIA, DELETED_BOARD_ITEM, SCH_LABEL, DS_DRAW_ITEM_BITMAP, PCB_SHAPE, DS_DRAW_ITEM_TEXT, SCH_TEXT, DS_DRAW_ITEM_PAGE, LIB_PIN, GERBER_DRAW_ITEM, DIMENSION_BASE, DS_DRAW_ITEM_RECT, SCH_LINE, FP_TEXT, TRACK, SCH_BUS_BUS_ENTRY, SCH_SHEET_PIN, LIB_FIELD, SCH_FIELD, DS_DRAW_ITEM_POLYPOLYGONS, PCB_GROUP, SCH_BUS_WIRE_ENTRY, FP_SHAPE, DS_DRAW_ITEM_LINE, LIB_ARC, PCB_TEXT, SCH_BITMAP, LIB_TEXT, LIB_POLYLINE, SCH_NO_CONNECT, SCH_MARKER, PCB_TARGET, LIB_RECTANGLE, PCB_MARKER, LIB_CIRCLE, SCH_JUNCTION, SCH_PIN, and DELETED_SHEET_ITEM.

Definition at line 123 of file eda_item.cpp.

124 {
125  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
126  GetClass() );
127 
128  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
129 }
virtual wxString GetClass() const =0
Return the class name.

References EDA_ITEM::GetClass().

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), DIALOG_GROUP_PROPERTIES::DoAddMember(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), DRC_ENGINE::EvalRules(), BOARD_INSPECTION_TOOL::getItemDescription(), PCB_MARKER::GetMsgPanelInfo(), RC_TREE_MODEL::GetValue(), BOARD_INSPECTION_TOOL::InspectClearance(), RC_ITEM::ShowReport(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 186 of file eda_item.h.

187  {
188  return m_status & type;
189  }
STATUS_FLAGS m_status
Definition: eda_item.h:527

References EDA_ITEM::m_status.

Referenced by BOARD_ITEM::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 199 of file eda_item.h.

199 { return m_status; }
STATUS_FLAGS m_status
Definition: eda_item.h:527

References EDA_ITEM::m_status.

◆ GetSubpartFirstId()

static int LIB_PART::GetSubpartFirstId ( )
inlinestatic

Definition at line 514 of file lib_symbol.h.

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

References m_subpartFirstId.

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

◆ GetSubpartIdSeparator()

static int LIB_PART::GetSubpartIdSeparator ( )
inlinestatic

Definition at line 508 of file lib_symbol.h.

508 { 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:683

References m_subpartIdSeparator.

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

◆ GetUniqueUnits()

std::vector< struct PART_UNITS > LIB_PART::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 1288 of file lib_symbol.cpp.

1289 {
1290  int unitNum;
1291  size_t i;
1292  struct PART_UNITS unit;
1293  std::vector<LIB_ITEM*> compareDrawItems;
1294  std::vector<LIB_ITEM*> currentDrawItems;
1295  std::vector<struct PART_UNITS> uniqueUnits;
1296 
1297  // The first unit is guarenteed to be unique so always include it.
1298  unit.m_unit = 1;
1299  unit.m_convert = 1;
1300  unit.m_items = GetUnitItems( 1, 1 );
1301 
1302  // There are no unique units if there are no draw items other than fields.
1303  if( unit.m_items.size() == 0 )
1304  return uniqueUnits;
1305 
1306  uniqueUnits.emplace_back( unit );
1307 
1308  if( ( GetUnitCount() == 1 || UnitsLocked() ) && !HasConversion() )
1309  return uniqueUnits;
1310 
1311  currentDrawItems = unit.m_items;
1312 
1313  for( unitNum = 2; unitNum <= GetUnitCount(); unitNum++ )
1314  {
1315  compareDrawItems = GetUnitItems( unitNum, 1 );
1316 
1317  wxCHECK2_MSG( compareDrawItems.size() != 0, continue,
1318  "Multiple unit symbol defined with empty units." );
1319 
1320  if( currentDrawItems.size() != compareDrawItems.size() )
1321  {
1322  unit.m_unit = unitNum;
1323  unit.m_convert = 1;
1324  unit.m_items = compareDrawItems;
1325  uniqueUnits.emplace_back( unit );
1326  }
1327  else
1328  {
1329  for( i = 0; i < currentDrawItems.size(); i++ )
1330  {
1331  if( currentDrawItems[i]->compare( *compareDrawItems[i],
1332  LIB_ITEM::COMPARE_FLAGS::UNIT ) != 0 )
1333  {
1334  unit.m_unit = unitNum;
1335  unit.m_convert = 1;
1336  unit.m_items = compareDrawItems;
1337  uniqueUnits.emplace_back( unit );
1338  }
1339  }
1340  }
1341  }
1342 
1343  if( HasConversion() )
1344  {
1345  currentDrawItems = GetUnitItems( 1, 2 );
1346 
1347  if( ( GetUnitCount() == 1 || UnitsLocked() ) )
1348  {
1349  unit.m_unit = 1;
1350  unit.m_convert = 2;
1351  unit.m_items = currentDrawItems;
1352  uniqueUnits.emplace_back( unit );
1353 
1354  return uniqueUnits;
1355  }
1356 
1357  for( unitNum = 2; unitNum <= GetUnitCount(); unitNum++ )
1358  {
1359  compareDrawItems = GetUnitItems( unitNum, 2 );
1360 
1361  wxCHECK2_MSG( compareDrawItems.size() != 0, continue,
1362  "Multiple unit symbol defined with empty units." );
1363 
1364  if( currentDrawItems.size() != compareDrawItems.size() )
1365  {
1366  unit.m_unit = unitNum;
1367  unit.m_convert = 2;
1368  unit.m_items = compareDrawItems;
1369  uniqueUnits.emplace_back( unit );
1370  }
1371  else
1372  {
1373  for( i = 0; i < currentDrawItems.size(); i++ )
1374  {
1375  if( currentDrawItems[i]->compare( *compareDrawItems[i],
1376  LIB_ITEM::COMPARE_FLAGS::UNIT ) != 0 )
1377  {
1378  unit.m_unit = unitNum;
1379  unit.m_convert = 2;
1380  unit.m_items = compareDrawItems;
1381  uniqueUnits.emplace_back( unit );
1382  }
1383  }
1384  }
1385  }
1386  }
1387 
1388  return uniqueUnits;
1389 }
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
int m_unit
The unit number.
Definition: lib_symbol.h:81
std::vector< LIB_ITEM * > GetUnitItems(int aUnit, int aConvert)
Return a list of item pointers for aUnit and aConvert for this symbol.
int GetUnitCount() const override
For items with units, return the number of units.
bool UnitsLocked() const
Check whether part units are interchangeable.
Definition: lib_symbol.h:237

References GetUnitCount(), GetUnitItems(), HasConversion(), PART_UNITS::m_convert, PART_UNITS::m_items, PART_UNITS::m_unit, and UnitsLocked().

◆ GetUnitBoundingBox()

const EDA_RECT LIB_PART::GetUnitBoundingBox ( int  aUnit,
int  aConvert 
) const

Get the bounding box for the symbol.

Returns
the part 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 Invisible fields are not taken in account

Definition at line 803 of file lib_symbol.cpp.

804 {
805  EDA_RECT bBox;
806  bool initialized = false;
807 
808  for( const LIB_ITEM& item : m_drawings )
809  {
810  if( item.m_unit > 0
811  && m_unitCount > 1
812  && aUnit > 0
813  && aUnit != item.m_unit )
814  {
815  continue;
816  }
817 
818  if( item.m_convert > 0 && aConvert > 0 && aConvert != item.m_convert )
819  continue;
820 
821  if ( ( item.Type() == LIB_FIELD_T ) && !( ( LIB_FIELD& ) item ).IsVisible() )
822  continue;
823 
824  if( initialized )
825  bBox.Merge( item.GetBoundingBox() );
826  else
827  {
828  bBox = item.GetBoundingBox();
829  initialized = true;
830  }
831  }
832 
833  return bBox;
834 }
void Merge(const EDA_RECT &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: eda_rect.cpp:431
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:661
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
Handle the component boundary box.
Definition: eda_rect.h:42

References LIB_FIELD_T, m_drawings, m_unitCount, and EDA_RECT::Merge().

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

◆ GetUnitCount()

◆ GetUnitDrawItems()

std::vector< struct PART_UNITS > LIB_PART::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 1253 of file lib_symbol.cpp.

1254 {
1255  std::vector<struct PART_UNITS> units;
1256 
1257  for( LIB_ITEM& item : m_drawings )
1258  {
1259  if( item.Type() == LIB_FIELD_T )
1260  continue;
1261 
1262  int unit = item.GetUnit();
1263  int convert = item.GetConvert();
1264 
1265  auto it = std::find_if( units.begin(), units.end(),
1266  [unit, convert] ( const auto& a ) {
1267  return a.m_unit == unit && a.m_convert == convert;
1268  } );
1269 
1270  if( it == units.end() )
1271  {
1272  struct PART_UNITS newUnit;
1273  newUnit.m_unit = item.GetUnit();
1274  newUnit.m_convert = item.GetConvert();
1275  newUnit.m_items.push_back( &item );
1276  units.emplace_back( newUnit );
1277  }
1278  else
1279  {
1280  it->m_items.push_back( &item );
1281  }
1282  }
1283 
1284  return units;
1285 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
int m_unit
The unit number.
Definition: lib_symbol.h:81
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62

References LIB_FIELD_T, PART_UNITS::m_convert, m_drawings, PART_UNITS::m_items, and PART_UNITS::m_unit.

Referenced by SCH_SEXPR_PLUGIN_CACHE::SaveSymbol().

◆ GetUnitItems()

std::vector< LIB_ITEM * > LIB_PART::GetUnitItems ( 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 1234 of file lib_symbol.cpp.

1235 {
1236  std::vector<LIB_ITEM*> unitItems;
1237 
1238  for( LIB_ITEM& item : m_drawings )
1239  {
1240  if( item.Type() == LIB_FIELD_T )
1241  continue;
1242 
1243  if( ( aConvert == -1 && item.GetUnit() == aUnit )
1244  || ( aUnit == -1 && item.GetConvert() == aConvert )
1245  || ( aUnit == item.GetUnit() && aConvert == item.GetConvert() ) )
1246  unitItems.push_back( &item );
1247  }
1248 
1249  return unitItems;
1250 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62

References LIB_FIELD_T, and m_drawings.

Referenced by GetUniqueUnits().

◆ GetUnitReference()

wxString LIB_PART::GetUnitReference ( int  aUnit)
overridevirtual

Return an identifier for aUnit for symbols with units.

Reimplemented from LIB_TREE_ITEM.

Definition at line 308 of file lib_symbol.cpp.

309 {
310  return LIB_PART::SubReference( aUnit, false );
311 }
static wxString SubReference(int aUnit, bool aAddSeparator=true)
Definition: lib_symbol.cpp:447

References SubReference().

◆ GetValueField()

LIB_FIELD & LIB_PART::GetValueField ( )

Return reference to the value field.

Definition at line 977 of file lib_symbol.cpp.

978 {
979  LIB_FIELD* field = GetFieldById( VALUE_FIELD );
980  wxASSERT( field != NULL );
981  return *field;
982 }
Field object used in symbol libraries.
Definition: lib_field.h:59
Field Value of part, i.e. "3.3K".
#define NULL
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
Definition: lib_symbol.cpp:939

References GetFieldById(), NULL, and VALUE_FIELD.

Referenced by PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), and SetName().

◆ HasConversion()

bool LIB_PART::HasConversion ( ) const

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

Returns
True if part has more than one conversion.

Definition at line 1022 of file lib_symbol.cpp.

1023 {
1024  for( const LIB_ITEM& item : m_drawings )
1025  {
1026  if( item.m_convert > LIB_ITEM::LIB_CONVERT::BASE )
1027  return true;
1028  }
1029 
1030  if( PART_SPTR parent = m_parent.lock() )
1031  {
1032  for( const LIB_ITEM& item : parent->GetDrawItems() )
1033  {
1034  if( item.m_convert > LIB_ITEM::LIB_CONVERT::BASE )
1035  return true;
1036  }
1037  }
1038 
1039  return false;
1040 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657

References m_drawings, and m_parent.

Referenced by EE_INSPECTION_TOOL::CheckSymbol(), 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_EDIT_DRAW_ITEM::TransferDataToWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), and DIALOG_LIB_SYMBOL_PROPERTIES::Validate().

◆ HasFlag()

◆ HitTest() [1/2]

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

◆ HitTest() [2/2]

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

Test if aRect intersects or is contained within the bounding box of an item.

Parameters
aRectA reference to a EDA_RECT 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 SCH_COMPONENT, PAD, SCH_SHEET, ZONE, FOOTPRINT, VIA, DS_DRAW_ITEM_BITMAP, DS_DRAW_ITEM_TEXT, SCH_TEXT, ARC, PCB_SHAPE, SCH_LINE, DIMENSION_BASE, DS_DRAW_ITEM_RECT, GERBER_DRAW_ITEM, LIB_PIN, SCH_FIELD, FP_TEXT, TRACK, DS_DRAW_ITEM_POLYPOLYGONS, LIB_ITEM, PCB_GROUP, SCH_BITMAP, SCH_JUNCTION, SCH_NO_CONNECT, SCH_BUS_ENTRY_BASE, PCB_TEXT, DS_DRAW_ITEM_BASE, PCB_TARGET, LIB_POLYLINE, LIB_ARC, LIB_BEZIER, LIB_TEXT, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 287 of file eda_item.h.

288  {
289  return false; // derived classes should override this function
290  }

◆ IsAlias()

◆ IsBrightened()

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 170 of file eda_item.h.

170 { return m_flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:108
STATUS_FLAGS m_flags
Definition: eda_item.h:530

References IS_DRAGGED, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), and KIGFX::SCH_PAINTER::setDeviceColors().

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 173 of file eda_item.h.

173 { return m_flags & ENTERED; }
#define ENTERED
indicates a group has been entered
Definition: eda_item.h:137
STATUS_FLAGS m_flags
Definition: eda_item.h:530

References ENTERED, and EDA_ITEM::m_flags.

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

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 255 of file eda_item.h.

255 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:529

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 167 of file eda_item.h.

167 { return m_flags & IS_CHANGED; }
#define IS_CHANGED
Item was edited, and modified.
Definition: eda_item.h:102
STATUS_FLAGS m_flags
Definition: eda_item.h:530

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsMulti()

bool LIB_PART::IsMulti ( ) const
inline
Returns
true if the part has multiple units per part. When true, the reference has a sub reference to identify part.

Definition at line 495 of file lib_symbol.h.

495 { return m_unitCount > 1; }
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:661

References m_unitCount.

Referenced by SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), SYMBOL_EDIT_FRAME::SetCurPart(), SYMBOL_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::SynchronizePins(), and ERC_TESTER::TestMultUnitPinConflicts().

◆ IsNew()

◆ IsNormal()

bool LIB_PART::IsNormal ( ) const

Definition at line 429 of file lib_symbol.cpp.

430 {
431  if( PART_SPTR parent = m_parent.lock() )
432  return parent->m_options == ENTRY_NORMAL;
433 
434  return m_options == ENTRY_NORMAL;
435 }
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Definition: lib_symbol.h:672
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657

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 SCH_COMPONENT, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 452 of file eda_item.h.

452 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 174 of file eda_item.h.

174 { return m_flags & IS_RESIZED; }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:107
STATUS_FLAGS m_flags
Definition: eda_item.h:530

References IS_RESIZED, and EDA_ITEM::m_flags.

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

◆ IsRoot()

◆ IsSelected()

◆ IsType()

virtual bool EDA_ITEM::IsType ( const 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 VIA, SCH_LABEL, DIMENSION_BASE, PAD, PCB_SHAPE, SCH_FIELD, SCH_LINE, FP_TEXT, FP_SHAPE, and PCB_TEXT.

Definition at line 232 of file eda_item.h.

233  {
234  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
235  return true;
236 
237  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
238  {
239  if( m_structType == *p )
240  return true;
241  }
242 
243  return false;
244  }
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:537

References EOT, EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by ROUTER_TOOL::CanInlineDrag(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), PCB_TEXT::IsType(), FP_SHAPE::IsType(), FP_TEXT::IsType(), SCH_LINE::IsType(), SCH_FIELD::IsType(), PCB_SHAPE::IsType(), PAD::IsType(), DIMENSION_BASE::IsType(), SCH_LABEL::IsType(), VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), SCH_BASE_FRAME::UpdateItem(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 171 of file eda_item.h.

171 { return m_flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:110
STATUS_FLAGS m_flags
Definition: eda_item.h:530

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ IterateForward() [1/2]

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

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

Definition at line 344 of file eda_item.h.

348  {
349  for( auto it : aList )
350  {
351  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
353  return SEARCH_RESULT::QUIT;
354  }
355 
357  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:107

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

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

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

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

Definition at line 363 of file eda_item.h.

365  {
366  for( auto it : aList )
367  {
368  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
370  return SEARCH_RESULT::QUIT;
371  }
372 
374  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:107

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

◆ LocateDrawItem() [1/2]

LIB_ITEM * LIB_PART::LocateDrawItem ( int  aUnit,
int  aConvert,
KICAD_T  aType,
const wxPoint &  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 1057 of file lib_symbol.cpp.

1059 {
1060  for( LIB_ITEM& item : m_drawings )
1061  {
1062  if( ( aUnit && item.m_unit && aUnit != item.m_unit )
1063  || ( aConvert && item.m_convert && aConvert != item.m_convert )
1064  || ( item.Type() != aType && aType != TYPE_NOT_INIT ) )
1065  {
1066  continue;
1067  }
1068 
1069  if( item.HitTest( aPoint ) )
1070  return &item;
1071  }
1072 
1073  return NULL;
1074 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
#define NULL

References m_drawings, NULL, and TYPE_NOT_INIT.

Referenced by LocateDrawItem().

◆ LocateDrawItem() [2/2]

LIB_ITEM * LIB_PART::LocateDrawItem ( int  aUnit,
int  aConvert,
KICAD_T  aType,
const wxPoint &  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 1077 of file lib_symbol.cpp.

1079 {
1080  /* we use LocateDrawItem( int aUnit, int convert, KICAD_T type, const
1081  * wxPoint& pt ) to search items.
1082  * because this function uses DefaultTransform as orient/mirror matrix
1083  * we temporary copy aTransform in DefaultTransform
1084  */
1085  LIB_ITEM* item;
1086  TRANSFORM transform = DefaultTransform;
1087  DefaultTransform = aTransform;
1088 
1089  item = LocateDrawItem( aUnit, aConvert, aType, aPoint );
1090 
1091  // Restore matrix
1092  DefaultTransform = transform;
1093 
1094  return item;
1095 }
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
TRANSFORM DefaultTransform
Definition: eeschema.cpp:56
LIB_ITEM * LocateDrawItem(int aUnit, int aConvert, KICAD_T aType, const wxPoint &aPoint)
Locate a draw object.

References DefaultTransform, and LocateDrawItem().

◆ LockUnits()

void LIB_PART::LockUnits ( bool  aLockUnits)
inline

Set interchangeable the property for part units.

Parameters
aLockUnitswhen true then units are set as not interchangeable.

Definition at line 231 of file lib_symbol.h.

231 { m_unitsLocked = aLockUnits; }
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:662

References m_unitsLocked.

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

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( const wxFindReplaceData &  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_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, ZONE, SCH_PIN, SCH_MARKER, PCB_MARKER, FP_TEXT, and PCB_TEXT.

Definition at line 414 of file eda_item.h.

415  {
416  return false;
417  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), PCB_TEXT::Matches(), FP_TEXT::Matches(), PCB_MARKER::Matches(), SCH_MARKER::Matches(), SCH_PIN::Matches(), ZONE::Matches(), SCH_FIELD::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_EDITOR_CONTROL::ReplaceAndFindNext(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
const wxFindReplaceData &  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 132 of file eda_item.cpp.

133 {
134  wxString text = aText;
135  wxString searchText = aSearchData.GetFindString();
136 
137  // Don't match if searching for replaceable item and the item doesn't support text replace.
138  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
139  return false;
140 
141  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
142  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
143 
144  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
145  {
146  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
147  return text.Matches( searchText );
148 
149  return text.MakeUpper().Matches( searchText.MakeUpper() );
150  }
151 
152  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
153  return aText.Find( searchText ) != wxNOT_FOUND;
154 
155  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
156 }
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Definition: eda_item.h:452

References FR_MATCH_WILDCARD, FR_SEARCH_REPLACE, and EDA_ITEM::IsReplaceable().

◆ operator!=()

bool LIB_PART::operator!= ( const LIB_PART aPart) const
inline

Definition at line 602 of file lib_symbol.h.

602 { return Compare( aPart ) != 0; }
int Compare(const LIB_PART &aRhs) const
Comparison test that can be used for operators.
Definition: lib_symbol.cpp:213

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 185 of file eda_item.cpp.

186 {
187  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
188  GetClass() ) );
189 
190  return false;
191 }
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
virtual wxString GetClass() const =0
Return the class name.

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

◆ operator=()

const LIB_PART & LIB_PART::operator= ( const LIB_PART aPart)

Definition at line 167 of file lib_symbol.cpp.

168 {
169  if( &aPart == this )
170  return aPart;
171 
172  LIB_ITEM* newItem;
173 
174  m_library = aPart.m_library;
175  m_name = aPart.m_name;
176  m_fpFilters = wxArrayString( aPart.m_fpFilters );
177  m_unitCount = aPart.m_unitCount;
185  m_options = aPart.m_options;
186  m_libId = aPart.m_libId;
188  m_keyWords = aPart.m_keyWords;
189 
190  m_drawings.clear();
191 
192  for( const LIB_ITEM& oldItem : aPart.m_drawings )
193  {
194  if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 )
195  continue;
196 
197  newItem = (LIB_ITEM*) oldItem.Clone();
198  newItem->SetParent( this );
199  m_drawings.push_back( newItem );
200  }
201 
202  m_drawings.sort();
203 
204  PART_SPTR parent = aPart.m_parent.lock();
205 
206  if( parent )
207  SetParent( parent.get() );
208 
209  return *this;
210 }
bool m_showPinNumbers
Definition: lib_symbol.h:668
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:661
PART_LIB * m_library
Definition: lib_symbol.h:676
void clear(int aType=UNDEFINED_TYPE)
Definition: multivector.h:212
bool m_includeOnBoard
Definition: lib_symbol.h:671
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
void sort()
Definition: multivector.h:247
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Definition: lib_symbol.h:672
bool m_includeInBom
Definition: lib_symbol.h:670
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:662
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:165
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:665
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657
wxString m_name
Definition: lib_symbol.h:677
void push_back(T *aItem)
Definition: multivector.h:174
void SetParent(LIB_PART *aParent=nullptr)
Definition: lib_symbol.cpp:325
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:115
wxArrayString m_fpFilters
List of suitable footprint names for the part (wild card names accepted).
Definition: lib_symbol.h:680
LIB_ID m_libId
Definition: lib_symbol.h:658
timestamp_t m_lastModDate
Definition: lib_symbol.h:659
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:679
STATUS_FLAGS GetFlags() const
Definition: eda_item.h:204
bool m_showPinNames
Definition: lib_symbol.h:667
wxString m_description
Definition: lib_symbol.h:678
#define IS_NEW
New item, just created.
Definition: eda_item.h:106

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), EDA_ITEM::Clone(), 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_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), SetParent(), EDA_ITEM::SetParent(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort(), and STRUCT_DELETED.

◆ operator==() [1/2]

bool LIB_PART::operator== ( const LIB_PART aPart) const
inline

Definition at line 600 of file lib_symbol.h.

600 { return this == aPart; }

◆ operator==() [2/2]

bool LIB_PART::operator== ( const LIB_PART aPart) const
inline

Definition at line 601 of file lib_symbol.h.

601 { return Compare( aPart ) == 0; }
int Compare(const LIB_PART &aRhs) const
Comparison test that can be used for operators.
Definition: lib_symbol.cpp:213

References Compare().

◆ PinsConflictWith()

bool LIB_PART::PinsConflictWith ( LIB_PART aOtherPart,
bool  aTestNums,
bool  aTestNames,
bool  aTestType,
bool  aTestOrientation,
bool  aTestLength 
)

Return true if this part's pins do not match another part's pins.

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

Parameters
aOtherPart- The other library part 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 736 of file lib_symbol.cpp.

738 {
739  LIB_PINS thisPinList;
740  GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 );
741 
742  for( LIB_PIN* eachThisPin : thisPinList )
743  {
744  wxASSERT( eachThisPin );
745  LIB_PINS otherPinList;
746  aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 );
747  bool foundMatch = false;
748 
749  for( LIB_PIN* eachOtherPin : otherPinList )
750  {
751  wxASSERT( eachOtherPin );
752 
753  // Same unit?
754  if( eachThisPin->GetUnit() != eachOtherPin->GetUnit() )
755  continue;
756 
757  // Same body stype?
758  if( eachThisPin->GetConvert() != eachOtherPin->GetConvert() )
759  continue;
760 
761  // Same position?
762  if( eachThisPin->GetPosition() != eachOtherPin->GetPosition() )
763  continue;
764 
765  // Same number?
766  if( aTestNums && ( eachThisPin->GetNumber() != eachOtherPin->GetNumber() ) )
767  continue;
768 
769  // Same name?
770  if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ) )
771  continue;
772 
773  // Same electrical type?
774  if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ) )
775  continue;
776 
777  // Same orientation?
778  if( aTestOrientation
779  && ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ) )
780  continue;
781 
782  // Same length?
783  if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ) )
784  continue;
785 
786  foundMatch = true;
787  break; // Match found so seach is complete.
788  }
789 
790  if( !foundMatch )
791  {
792  // This means there was not an identical (according to the arguments)
793  // pin at the same position in the other component.
794  return true;
795  }
796  }
797 
798  // The loop never gave up, so no conflicts were found.
799  return false;
800 }
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:56
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:695

References GetPins().

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

◆ Plot()

void LIB_PART::Plot ( PLOTTER aPlotter,
int  aUnit,
int  aConvert,
const wxPoint &  aOffset,
const TRANSFORM aTransform 
)

Plot lib part 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- Component part to plot.
aConvert- Component alternate body style to plot.
aOffset- Distance to shift the plot coordinates.
aTransform- Component plot transform matrix.

Definition at line 546 of file lib_symbol.cpp.

548 {
549  wxASSERT( aPlotter != NULL );
550 
551  aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
552  bool fill = aPlotter->GetColorMode();
553 
554  // draw background for filled items using background option
555  // Solid lines will be drawn after the background
556  for( LIB_ITEM& item : m_drawings )
557  {
558  // Lib Fields are not plotted here, because this plot function
559  // is used to plot schematic items, which have they own fields
560  if( item.Type() == LIB_FIELD_T )
561  continue;
562 
563  if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
564  continue;
565 
566  if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
567  continue;
568 
569  if( item.m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
570  item.Plot( aPlotter, aOffset, fill, aTransform );
571  }
572 
573  // Not filled items and filled shapes are now plotted
574  // Items that have BG fills only get re-stroked to ensure the edges are in the foreground
575  for( LIB_ITEM& item : m_drawings )
576  {
577  if( item.Type() == LIB_FIELD_T )
578  continue;
579 
580  if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
581  continue;
582 
583  if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
584  continue;
585 
586  item.Plot( aPlotter, aOffset,
587  fill && ( item.m_fill != FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ), aTransform );
588  }
589 }
virtual void SetColor(COLOR4D color)=0
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
#define NULL
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:155
bool GetColorMode() const
Definition: plotter.h:152

References FILLED_WITH_BG_BODYCOLOR, PLOTTER::GetColorMode(), KIGFX::RENDER_SETTINGS::GetLayerColor(), LAYER_DEVICE, LIB_FIELD_T, m_drawings, NULL, PLOTTER::RenderSettings(), and PLOTTER::SetColor().

Referenced by SYMBOL_EDIT_FRAME::SVGPlotSymbol().

◆ PlotLibFields()

void LIB_PART::PlotLibFields ( PLOTTER aPlotter,
int  aUnit,
int  aConvert,
const wxPoint &  aOffset,
const TRANSFORM aTransform 
)

Plot Lib Fields only of the part to plotter.

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

Parameters
aPlotter- Plotter object to plot to.
aUnit- Component part to plot.
aConvert- Component alternate body style to plot.
aOffset- Distance to shift the plot coordinates.
aTransform- Component plot transform matrix.

Definition at line 592 of file lib_symbol.cpp.

594 {
595  wxASSERT( aPlotter != NULL );
596 
597  aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_FIELDS ) );
598  bool fill = aPlotter->GetColorMode();
599 
600  for( LIB_ITEM& item : m_drawings )
601  {
602  if( item.Type() != LIB_FIELD_T )
603  continue;
604 
605  if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
606  continue;
607 
608  if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
609  continue;
610 
611  LIB_FIELD& field = (LIB_FIELD&) item;
612 
613  // The reference is a special case: we should change the basic text
614  // to add '?' and the part id
615  wxString tmp = field.GetShownText();
616 
617  if( field.GetId() == REFERENCE_FIELD )
618  {
619  wxString text = field.GetFullText( aUnit );
620  field.SetText( text );
621  }
622 
623  item.Plot( aPlotter, aOffset, fill, aTransform );
624  field.SetText( tmp );
625  }
626 }
Field Reference of part, i.e. "IC21".
virtual void SetColor(COLOR4D color)=0
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
int GetId() const
Definition: lib_field.h:138
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:121
#define NULL
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:155
wxString GetFullText(int unit=1) const
Return the text of a field.
Definition: lib_field.cpp:296
virtual wxString GetShownText(int aDepth=0) const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:141
bool GetColorMode() const
Definition: plotter.h:152

References PLOTTER::GetColorMode(), LIB_FIELD::GetFullText(), LIB_FIELD::GetId(), KIGFX::RENDER_SETTINGS::GetLayerColor(), EDA_TEXT::GetShownText(), LAYER_FIELDS, LIB_FIELD_T, m_drawings, NULL, REFERENCE_FIELD, PLOTTER::RenderSettings(), PLOTTER::SetColor(), and EDA_TEXT::SetText().

Referenced by SYMBOL_EDIT_FRAME::SVGPlotSymbol().

◆ Print()

void LIB_PART::Print ( const RENDER_SETTINGS aSettings,
const wxPoint &  aOffset,
int  aMulti,
int  aConvert,
const PART_DRAW_OPTIONS aOpts 
)

Print part.

Parameters
aOffset- Position of part.
aMulti- unit if multiple units per part.
aConvert- Component conversion (DeMorgan) if available.
aOpts- Drawing options

Definition at line 479 of file lib_symbol.cpp.

481 {
482  /* draw background for filled items using background option
483  * Solid lines will be drawn after the background
484  * Note also, background is not drawn when printing in black and white
485  */
486  if( !GetGRForceBlackPenState() )
487  {
488  for( LIB_ITEM& drawItem : m_drawings )
489  {
490  if( drawItem.m_fill != FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
491  continue;
492 
493  // Do not draw items not attached to the current part
494  if( aMulti && drawItem.m_unit && ( drawItem.m_unit != aMulti ) )
495  continue;
496 
497  if( aConvert && drawItem.m_convert && ( drawItem.m_convert != aConvert ) )
498  continue;
499 
500  if( drawItem.Type() == LIB_FIELD_T )
501  continue;
502 
503  // Now, draw only the background for items with
504  // m_fill == FILLED_WITH_BG_BODYCOLOR:
505  drawItem.Print( aSettings, aOffset, (void*) false, aOpts.transform );
506  }
507  }
508 
509  for( LIB_ITEM& drawItem : m_drawings )
510  {
511  // Do not draw items not attached to the current part
512  if( aMulti && drawItem.m_unit && ( drawItem.m_unit != aMulti ) )
513  continue;
514 
515  if( aConvert && drawItem.m_convert && ( drawItem.m_convert != aConvert ) )
516  continue;
517 
518  if( drawItem.Type() == LIB_FIELD_T )
519  {
520  LIB_FIELD& field = static_cast<LIB_FIELD&>( drawItem );
521 
522  if( field.IsVisible() && !aOpts.draw_visible_fields )
523  continue;
524 
525  if( !field.IsVisible() && !aOpts.draw_hidden_fields )
526  continue;
527  }
528 
529  if( drawItem.Type() == LIB_PIN_T )
530  {
531  drawItem.Print( aSettings, aOffset, (void*) &aOpts, aOpts.transform );
532  }
533  else if( drawItem.Type() == LIB_FIELD_T )
534  {
535  drawItem.Print( aSettings, aOffset, (void*) NULL, aOpts.transform );
536  }
537  else
538  {
539  bool forceNoFill = drawItem.m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
540  drawItem.Print( aSettings, aOffset, (void*) forceNoFill, aOpts.transform );
541  }
542  }
543 }
bool IsVisible() const
Definition: eda_text.h:193
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
bool draw_hidden_fields
Definition: lib_symbol.h:66
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
#define NULL
bool draw_visible_fields
Definition: lib_symbol.h:65
bool GetGRForceBlackPenState(void)
Function GetGRForceBlackPenState.
Definition: gr_basic.cpp:209
TRANSFORM transform
Definition: lib_symbol.h:64

References PART_DRAW_OPTIONS::draw_hidden_fields, PART_DRAW_OPTIONS::draw_visible_fields, FILLED_WITH_BG_BODYCOLOR, GetGRForceBlackPenState(), EDA_TEXT::IsVisible(), LIB_FIELD_T, LIB_PIN_T, m_drawings, NULL, and PART_DRAW_OPTIONS::transform.

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

◆ RemoveDrawItem()

void LIB_PART::RemoveDrawItem ( LIB_ITEM aItem)

Remove draw aItem from list.

Parameters
aItem- Draw item to remove from list.

Definition at line 629 of file lib_symbol.cpp.

630 {
631  wxASSERT( aItem != NULL );
632 
633  // none of the MANDATORY_FIELDS may be removed in RAM, but they may be
634  // omitted when saving to disk.
635  if( aItem->Type() == LIB_FIELD_T )
636  {
637  if( static_cast<LIB_FIELD*>( aItem )->IsMandatory() )
638  return;
639  }
640 
641  LIB_ITEMS& items = m_drawings[ aItem->Type() ];
642 
643  for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
644  {
645  if( *i == aItem )
646  {
647  items.erase( i );
648  SetModified();
649  break;
650  }
651  }
652 }
void SetModified()
Definition: eda_item.cpp:79
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
Definition: lib_symbol.h:48
#define NULL
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:179
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162

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

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

◆ RemoveDuplicateDrawItems()

void LIB_PART::RemoveDuplicateDrawItems ( )

Remove duplicate draw items from list.

Definition at line 1016 of file lib_symbol.cpp.

1017 {
1018  m_drawings.unique();
1019 }
void unique()
Remove duplicate elements in list.
Definition: multivector.h:256
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674

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

◆ Replace() [1/2]

bool EDA_ITEM::Replace ( const wxFindReplaceData &  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 159 of file eda_item.cpp.

160 {
161  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
162 
163  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
164  aSearchData.GetFindString() :
165  aSearchData.GetFindString().Upper() );
166 
167  if( result == wxNOT_FOUND )
168  return false;
169 
170  wxString prefix = aText.Left( result );
171  wxString suffix;
172 
173  if( aSearchData.GetFindString().length() + result < aText.length() )
174  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
175 
176  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
177  aText, prefix, aSearchData.GetReplaceString(), suffix );
178 
179  aText = prefix + aSearchData.GetReplaceString() + suffix;
180 
181  return true;
182 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.

References traceFindReplace.

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

◆ Replace() [2/2]

virtual bool EDA_ITEM::Replace ( const wxFindReplaceData &  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 SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, and SCH_PIN.

Definition at line 441 of file eda_item.h.

442  {
443  return false;
444  }

◆ Set() [1/3]

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

Definition at line 40 of file inspectable.h.

41  {
43  TYPE_ID thisType = TYPE_HASH( *this );
44  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
45 
46  if( object )
47  aProperty->setter( object, aValue );
48 
49  return object != nullptr;
50  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:66
#define TYPE_HASH(x)
Definition: property.h:57
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:43
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:63
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

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

◆ Set() [2/3]

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

Definition at line 53 of file inspectable.h.

54  {
56  TYPE_ID thisType = TYPE_HASH( *this );
57  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
58 
59  if( object )
60  aProperty->set<T>( object, aValue );
61 
62  return object != nullptr;
63  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:66
#define TYPE_HASH(x)
Definition: property.h:57
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:43
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:63
void set(void *aObject, T aValue)
Definition: property.h:259
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

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

◆ Set() [3/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  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:66
#define TYPE_HASH(x)
Definition: property.h:57
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:43
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:63
void set(void *aObject, T aValue)
Definition: property.h:259
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

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

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

◆ SetConversion()

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

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

If the part 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 part.

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

Definition at line 1171 of file lib_symbol.cpp.

1172 {
1173  if( aSetConvert == HasConversion() )
1174  return;
1175 
1176  // Duplicate items to create the converted shape
1177  if( aSetConvert )
1178  {
1179  if( aDuplicatePins )
1180  {
1181  std::vector< LIB_ITEM* > tmp; // Temporarily store the duplicated pins here.
1182 
1183  for( LIB_ITEM& item : m_drawings )
1184  {
1185  // Only pins are duplicated.
1186  if( item.Type() != LIB_PIN_T )
1187  continue;
1188 
1189  if( item.m_convert == 1 )
1190  {
1191  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1192  newItem->m_convert = 2;
1193  tmp.push_back( newItem );
1194  }
1195  }
1196 
1197  // Transfer the new pins to the LIB_PART.
1198  for( unsigned i = 0; i < tmp.size(); i++ )
1199  m_drawings.push_back( tmp[i] );
1200  }
1201  }
1202  else
1203  {
1204  // Delete converted shape items because the converted shape does
1205  // not exist
1207 
1208  while( i != m_drawings.end() )
1209  {
1210  if( i->m_convert > 1 )
1211  i = m_drawings.erase( i );
1212  else
1213  ++i;
1214  }
1215  }
1216 
1217  m_drawings.sort();
1218 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:188
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
void sort()
Definition: multivector.h:247
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:194
void push_back(T *aItem)
Definition: multivector.h:174
int m_convert
Shape identification for alternate body styles.
Definition: lib_item.h:320
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:179
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::CreateNewPart(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetDescription()

◆ SetFields()

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

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

The only known caller of this function is the library part field editor, and it establishes needed behavior.

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

Definition at line 888 of file lib_symbol.cpp.

889 {
890  deleteAllFields();
891 
892  for( unsigned i=0; i<aFields.size(); ++i )
893  {
894  // drawings is a ptr_vector, new and copy an object on the heap.
895  LIB_FIELD* field = new LIB_FIELD( aFields[i] );
896 
897  field->SetParent( this );
898  m_drawings.push_back( field );
899  }
900 
901  m_drawings.sort();
902 }
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
void sort()
Definition: multivector.h:247
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:165
void deleteAllFields()
Definition: lib_symbol.cpp:876
void push_back(T *aItem)
Definition: multivector.h:174

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 ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 202 of file eda_item.h.

202 { m_flags |= aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:530

References EDA_ITEM::m_flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddFootprintToBoard(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SCH_MOVE_TOOL::AlignElements(), PCB_CONTROL::AppendBoard(), FOOTPRINT::BuildPolyCourtyards(), SCH_EDIT_TOOL::ChangeTextType(), TRACKS_CLEANER::cleanup(), GRAPHICS_CLEANER::cleanupSegments(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), SYMBOL_EDITOR_PIN_TOOL::CreatePin(), SCH_DRAWING_TOOLS::createSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::Duplicate(), PCB_SELECTION_TOOL::EnterGroup(), SCH_MOVE_TOOL::getConnectedDragItems(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), EE_SELECTION_TOOL::Main(), TRACKS_CLEANER::mergeCollinearSegments(), SYMBOL_EDITOR_MOVE_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), EE_SELECTION_TOOL::narrowSelection(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), 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::ParseWire(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceText(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_SELECTION_TOOL::RebuildSelection(), FOOTPRINT::Remove(), BOARD::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_PIN_TOOL::RepeatPin(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_TEXT::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_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 253 of file eda_item.h.

253 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: eda_item.h:529

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetFPFilters()

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

Definition at line 177 of file lib_symbol.h.

177 { m_fpFilters = aFilters; }
wxArrayString m_fpFilters
List of suitable footprint names for the part (wild card names accepted).
Definition: lib_symbol.h:680

References m_fpFilters.

Referenced by BOOST_AUTO_TEST_CASE(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetIncludeInBom()

void LIB_PART::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 578 of file lib_symbol.h.

578 { m_includeInBom = aIncludeInBom; }
bool m_includeInBom
Definition: lib_symbol.h:670

References m_includeInBom.

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

◆ SetIncludeOnBoard()

void LIB_PART::SetIncludeOnBoard ( bool  aIncludeOnBoard)
inline

Set or clear include in board netlist flag.

Parameters
aIncludeOnBoardtrue to include symbol in the board netlist

Definition at line 586 of file lib_symbol.h.

586 { m_includeOnBoard = aIncludeOnBoard; }
bool m_includeOnBoard
Definition: lib_symbol.h:671

References m_includeOnBoard.

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

◆ SetKeyWords()

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

◆ SetLib()

void LIB_PART::SetLib ( PART_LIB aLibrary)
inline

Definition at line 173 of file lib_symbol.h.

173 { m_library = aLibrary; }
PART_LIB * m_library
Definition: lib_symbol.h:676

References m_library.

Referenced by LEGACY_RESCUER::AddPart(), PART_LIB::FindPart(), LIB_PART(), and PART_LIB::LoadLibrary().

◆ SetLibId()

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

Definition at line 79 of file eda_item.cpp.

80 {
82 
83  // If this a child object, then the parent modification state also needs to be set.
84  if( m_parent )
86 }
void SetModified()
Definition: eda_item.cpp:79
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:528
#define IS_CHANGED
Item was edited, and modified.
Definition: eda_item.h:102
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:202

References IS_CHANGED, EDA_ITEM::m_parent, EDA_ITEM::SetFlags(), and EDA_ITEM::SetModified().

Referenced by SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), LEGACY_PLUGIN::loadZONE_CONTAINER(), SCH_LINE::Move(), SCH_COMPONENT::Move(), SCH_LINE::MoveEnd(), SCH_LINE::MoveStart(), LIB_PIN::MoveTo(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_ALTIUM_PLUGIN::Parse(), ALTIUM_PCB::Parse(), RemoveDrawItem(), SCH_COMPONENT::SetConvert(), SCH_COMPONENT::SetLibId(), EDA_ITEM::SetModified(), LIB_FIELD::SetName(), SCH_COMPONENT::SetTransform(), and SCH_COMPONENT::SetUnit().

◆ SetName()

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

Definition at line 314 of file lib_symbol.cpp.

315 {
316  wxString validatedName = LIB_ID::FixIllegalChars( aName );
317 
318  m_name = validatedName;
319  m_libId.SetLibItemName( validatedName, false );
320 
321  GetValueField().SetText( validatedName );
322 }
static UTF8 FixIllegalChars(const UTF8 &aLibItemName, bool aLib=false)
Replace illegal LIB_ID item name characters with underscores '_'.
Definition: lib_id.cpp:347
LIB_FIELD & GetValueField()
Return reference to the value field.
Definition: lib_symbol.cpp:977
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:121
wxString m_name
Definition: lib_symbol.h:677
LIB_ID m_libId
Definition: lib_symbol.h:658
int SetLibItemName(const UTF8 &aLibItemName, bool aTestForRev=true)
Override the library item name portion of the LIB_ID to aLibItemName.
Definition: lib_id.cpp:204

References LIB_ID::FixIllegalChars(), GetValueField(), m_libId, m_name, LIB_ID::SetLibItemName(), and EDA_TEXT::SetText().

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties(), SYMBOL_EDIT_FRAME::ensureUniqueName(), LIB_PART(), SCH_ALTIUM_PLUGIN::ParseComponent(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), SYMBOL_EDIT_FRAME::savePartAs(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow(), SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties(), and DIALOG_LIB_EDIT_ONE_FIELD::UpdateField().

◆ SetNormal()

void LIB_PART::SetNormal ( )

Definition at line 438 of file lib_symbol.cpp.

439 {
440  if( PART_SPTR parent = m_parent.lock() )
441  parent->m_options = ENTRY_NORMAL;
442 
444 }
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Definition: lib_symbol.h:672
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657

References ENTRY_NORMAL, m_options, and m_parent.

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

◆ SetOffset()

void LIB_PART::SetOffset ( const wxPoint &  aOffset)

Move the part aOffset.

Parameters
aOffset- Offset displacement.

Definition at line 1009 of file lib_symbol.cpp.

1010 {
1011  for( LIB_ITEM& item : m_drawings )
1012  item.Offset( aOffset );
1013 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62

References m_drawings.

Referenced by SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor().

◆ SetParent() [1/3]

◆ SetParent() [2/3]

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Reimplemented in DIMENSION_BASE.

Definition at line 165 of file eda_item.h.

165 { m_parent = aParent; }
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:528

References EDA_ITEM::m_parent.

Referenced by FOOTPRINT::Add(), BOARD::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewComponent(), SCH_SHEET::AddPin(), PAD::AddPrimitive(), PAD::AddPrimitiveArc(), PAD::AddPrimitiveCircle(), PAD::AddPrimitiveCurve(), PAD::AddPrimitivePoly(), PAD::AddPrimitiveRect(), PAD::AddPrimitiveSegment(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SCH_SCREEN::Append(), LIB_FIELD::Copy(), SYMBOL_EDIT_FRAME::CreateNewPart(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SCH_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), Flatten(), FOOTPRINT::FOOTPRINT(), GPCB_PLUGIN::FootprintLoad(), LEGACY_PLUGIN::FootprintLoad(), EAGLE_PLUGIN::FootprintLoad(), PCB_IO::FootprintLoad(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), LIB_PART(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), FOOTPRINT::operator=(), operator=(), PCB_PARSER::parseFOOTPRINT_unchecked(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_SEXPR_PARSER::ParseSymbol(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PCB_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), pasteFootprintItemsToFootprintEditor(), SCH_DRAWING_TOOLS::PlaceComponent(), BOARD_EDITOR_CONTROL::PlaceFootprint(), BACK_ANNOTATE::processNetNameChange(), BOARD_COMMIT::Push(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET_PIN::SCH_SHEET_PIN(), SetFields(), DIMENSION_BASE::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_GLOBALLABEL::SwapData(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), and SwapItemData().

◆ SetParent() [3/3]

virtual void EDA_ITEM::SetParent
inlineprivate

Definition at line 165 of file eda_item.h.

165 { m_parent = aParent; }
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657

◆ SetPinNameOffset()

void LIB_PART::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 554 of file lib_symbol.h.

554 { m_pinNameOffset = aOffset; }
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:665

References m_pinNameOffset.

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

◆ SetPosition()

◆ SetPower()

void LIB_PART::SetPower ( )

Definition at line 420 of file lib_symbol.cpp.

421 {
422  if( PART_SPTR parent = m_parent.lock() )
423  parent->m_options = ENTRY_POWER;
424 
426 }
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Definition: lib_symbol.h:672
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:657

References ENTRY_POWER, m_options, and m_parent.

Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::CreateNewPart(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetSelected()

◆ SetShowPinNames()

void LIB_PART::SetShowPinNames ( bool  aShow)
inline

◆ SetShowPinNumbers()

void LIB_PART::SetShowPinNumbers ( bool  aShow)
inline

◆ SetState()

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

Definition at line 191 of file eda_item.h.

192  {
193  if( state )
194  m_status |= type; // state = ON or OFF
195  else
196  m_status &= ~type;
197  }
STATUS_FLAGS m_status
Definition: eda_item.h:527

References EDA_ITEM::m_status.

Referenced by LEGACY_PLUGIN::loadTrackList(), TRACKS_CLEANER::mergeCollinearSegments(), PCB_SELECTION_TOOL::selectConnectedTracks(), and BOARD_ITEM::SetLocked().

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 200 of file eda_item.h.

200 { m_status = aStatus; }
STATUS_FLAGS m_status
Definition: eda_item.h:527

References EDA_ITEM::m_status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetSubpartIdNotation()

void LIB_PART::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 part 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 part ('A' or '1')

Definition at line 1221 of file lib_symbol.cpp.

1222 {
1223  m_subpartFirstId = 'A';
1225 
1226  if( aSep == '.' || aSep == '-' || aSep == '_' )
1227  m_subpartIdSeparator = aSep;
1228 
1229  if( aFirstId == '1' && aSep != 0 )
1230  m_subpartFirstId = aFirstId;
1231 }
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
Definition: lib_symbol.h:683
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the part number: only 'A',...
Definition: lib_symbol.h:686

References m_subpartFirstId, and m_subpartIdSeparator.

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

◆ SetUnitCount()

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

Set the units per part count.

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

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

Definition at line 1114 of file lib_symbol.cpp.

1115 {
1116  if( m_unitCount == aCount )
1117  return;
1118 
1119  if( aCount < m_unitCount )
1120  {
1122 
1123  while( i != m_drawings.end() )
1124  {
1125  if( i->m_unit > aCount )
1126  i = m_drawings.erase( i );
1127  else
1128  ++i;
1129  }
1130  }
1131  else if( aDuplicateDrawItems )
1132  {
1133  int prevCount = m_unitCount;
1134 
1135  // Temporary storage for new items, as adding new items directly to
1136  // m_drawings may cause the buffer reallocation which invalidates the
1137  // iterators
1138  std::vector< LIB_ITEM* > tmp;
1139 
1140  for( LIB_ITEM& item : m_drawings )
1141  {
1142  if( item.m_unit != 1 )
1143  continue;
1144 
1145  for( int j = prevCount + 1; j <= aCount; j++ )
1146  {
1147  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1148  newItem->m_unit = j;
1149  tmp.push_back( newItem );
1150  }
1151  }
1152 
1153  for( auto item : tmp )
1154  m_drawings.push_back( item );
1155  }
1156 
1157  m_drawings.sort();
1158  m_unitCount = aCount;
1159 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:188
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:661
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
void sort()
Definition: multivector.h:247
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:194
int m_unit
Unit identification for multiple parts per package.
Definition: lib_item.h:314
void push_back(T *aItem)
Definition: multivector.h:174
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:179
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(), 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::CreateNewPart(), CADSTAR_SCH_ARCHIVE_LOADER::loadPartsLibrary(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 177 of file eda_item.h.

177 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:202
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:110

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ 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 470 of file eda_item.h.

470 { return *aLeft < *aRight; }

◆ SubpartFirstIdPtr()

static int* LIB_PART::SubpartFirstIdPtr ( )
inlinestatic

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

Definition at line 519 of file lib_symbol.h.

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

References m_subpartFirstId.

Referenced by SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS().

◆ SubpartIdSeparatorPtr()

static int* LIB_PART::SubpartIdSeparatorPtr ( )
inlinestatic

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

Definition at line 513 of file lib_symbol.h.

513 { 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:683

References m_subpartIdSeparator.

Referenced by SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS().

◆ SubReference()

wxString LIB_PART::SubReference ( int  aUnit,
bool  aAddSeparator = true 
)
static
Returns
the sub reference for part having multiple units per part. The sub reference identify the part (or unit)
Parameters
aUnit= the part 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 447 of file lib_symbol.cpp.

448 {
449  wxString subRef;
450 
451  if( m_subpartIdSeparator != 0 && aAddSeparator )
452  subRef << wxChar( m_subpartIdSeparator );
453 
454  if( m_subpartFirstId >= '0' && m_subpartFirstId <= '9' )
455  subRef << aUnit;
456  else
457  {
458  // use letters as notation. To allow more than 26 units, the sub ref
459  // use one letter if letter = A .. Z or a ... z, and 2 letters otherwise
460  // first letter is expected to be 'A' or 'a' (i.e. 26 letters are available)
461  int u;
462  aUnit -= 1; // Unit number starts to 1. now to 0.
463 
464  while( aUnit >= 26 ) // more than one letter are needed
465  {
466  u = aUnit / 26;
467  subRef << wxChar( m_subpartFirstId + u -1 );
468  aUnit %= 26;
469  }
470 
471  u = m_subpartFirstId + aUnit;
472  subRef << wxChar( u );
473  }
474 
475  return subRef;
476 }
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
Definition: lib_symbol.h:683
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the part number: only 'A',...
Definition: lib_symbol.h:686

References m_subpartFirstId, and m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), SCH_REFERENCE_LIST::CheckAnnotation(), SCH_REFERENCE::GetFullRef(), LIB_FIELD::GetFullText(), SCH_COMPONENT::GetRef(), SCH_FIELD::GetShownText(), GetUnitReference(), SCH_EDIT_FRAME::mapExistingAnnotation(), SCH_FIELD::Matches(), SYMBOL_EDIT_FRAME::RebuildSymbolUnitsList(), SCH_COMPONENT::ResolveTextVar(), 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 162 of file eda_item.h.

162 { return m_structType; }
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:537

References EDA_ITEM::m_structType.

Referenced by KIGFX::PCB_VIEW::Add(), FOOTPRINT::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), PCB_POINT_EDITOR::addCorner(), CONNECTION_SUBGRAPH::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), ZONE_FILLER::addKnockout(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), SCH_SCREEN::Append(), CONNECTION_GRAPH::buildConnectionGraph(), DIALOG_NET_INSPECTOR::buildNewItem(), SCH_SCREENS::buildScreenList(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PCB_POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), SCH_EDIT_TOOL::ChangeTextType(), CN_VISITOR::checkZoneItemConnection(), SCH_MARKER::ClassOf(), PCB_TEXT::ClassOf(), PCB_MARKER::ClassOf(), FP_SHAPE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_NO_CONNECT::ClassOf(), PCB_GROUP::ClassOf(), PCB_TARGET::ClassOf(), SCH_PIN::ClassOf(), SCH_LINE::ClassOf(), FP_TEXT::ClassOf(), SCH_FIELD::ClassOf(), NETINFO_ITEM::ClassOf(), PCB_SHAPE::ClassOf(), ZONE::ClassOf(), SCH_BITMAP::ClassOf(), PAD::ClassOf(), TRACK::ClassOf(), SCH_SHEET_PIN::ClassOf(), FOOTPRINT::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_COMPONENT::ClassOf(), SCH_SCREEN::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), SCH_TEXT::ClassOf(), SCH_SHEET::ClassOf(), BOARD::ClassOf(), ARC::ClassOf(), SCH_LABEL::ClassOf(), VIA::ClassOf(), ALIGNED_DIMENSION::ClassOf(), SCH_GLOBALLABEL::ClassOf(), ORTHOGONAL_DIMENSION::ClassOf(), SCH_HIERLABEL::ClassOf(), LEADER::ClassOf(), CENTER_DIMENSION::ClassOf(), TRACKS_CLEANER::cleanup(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_ITEM::compare(), Compare(), EE_GRID_HELPER::computeAnchors(), PCB_GRID_HELPER::computeAnchors(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), EE_RTREE::contains(), BOARD::ConvertKIIDsToCrossReferences(), SCHEMATIC::ConvertKIIDsToRefs(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), FOOTPRINT::CoverageRatio(), EDIT_TOOL::CreateArray(), BOARD_ADAPTER::createLayers(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewText(), ZONE_CREATE_HELPER::createNewZone(), BOARD_ADAPTER::createTrack(), SCH_SCREEN::DeleteItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally(), ALIGN_DISTRIBUTE_TOOL::DistributeVertically(), 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(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawVia(), CONNECTION_SUBGRAPH::driverName(), CN_ITEM::Dump(), EDIT_TOOL::Duplicate(), FOOTPRINT::DuplicateItem(), EDA_ITEM_DESC::EDA_ITEM_DESC(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_EDIT_TOOL::editTextProperties(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), DRC_ENGINE::EvalRules(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::FilterCollectorForGroups(), NETLIST_EXPORTER_BASE::findNextSymbol(), EDIT_TOOL::Flip(), PCB_BASE_FRAME::FocusOnItem(), EDIT_TOOL::FootprintFilter(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), FP_TEXT::FP_TEXT(), PCB_POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), SCH_FIELD::GetBoundingBox(), TRACK::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetContextualTextVars(), FOOTPRINT::GetCoverageArea(), CONNECTION_GRAPH::getDefaultConnection(), getDrilledHoleShape(), CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_TEXT::GetEndPoints(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_FIELD::GetMenuImage(), DIMENSION_BASE::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTIVITY_DATA::GetNetItems(), GetNextDrawItem(), PCB_SHAPE::GetParentFootprint(), GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), KIGFX::SCH_PAINTER::getRenderColor(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), DRC_ENGINE::GetShape(), PCB_TEXT::GetShownText(), SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), CONVERT_TOOL::getStartEndPoints(), GROUP_TOOL::Group(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), EE_SELECTION_TOOL::GuessSelectionCandidates(), hash_fp_item(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlightInternal(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::highlightNet(), highlightNet(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_RTREE::insert(), DRC_RTREE::Insert(), insideArea(), insideCourtyard(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), ARRAY_CREATOR::Invoke(), isCopper(), CN_ANCHOR::IsDangling(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), PNS_KICAD_IFACE::IsFlashedOnLayer(), CADSTAR_PCB_ARCHIVE_LOADER::isFootprint(), SCH_FIELD::IsHypertext(), isKeepoutZone(), DRC_ENGINE::IsNetTie(), TRACK::IsNull(), SCH_LINE::IsParallel(), isPlated(), SCH_FIELD::IsReplaceable(), PNS::ROUTER::isStartingPointRoutable(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), PCB_SELECTION_TOOL::itemPassesFilter(), CONVERT_TOOL::LinesToPoly(), CLIPBOARD_IO::Load(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), EE_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeListOfNets(), PCB_POINT_EDITOR::makePoints(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), SCH_FIELD::Matches(), memberOf(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), SCH_EDITOR_CONTROL::nextMatch(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), EDA_3D_CANVAS::OnMouseMove(), TRACK::cmp_tracks::operator()(), CN_VISITOR::operator()(), BOARD_ITEM::ptr_cmp::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), SCH_BUS_ENTRY_BASE::operator<(), SCH_JUNCTION::operator<(), SCH_FIELD::operator<(), SCH_LINE::operator<(), SCH_TEXT::operator<(), SCH_ITEM::operator<(), SCH_SHEET::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), PAD::PAD(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCB_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), SCH_SCREEN::Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), CONVERT_TOOL::PolyToLines(), POSITION_RELATIVE_TOOL::PositionRelative(), SCH_FIELD::Print(), SCH_SCREEN::Print(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), BACK_ANNOTATE::processNetNameChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_GRID_HELPER::queryVisible(), SCH_CONNECTION::recacheName(), SCH_BASE_FRAME::RefreshSelection(), KIGFX::PCB_VIEW::Remove(), EE_RTREE::remove(), FOOTPRINT::Remove(), CN_CONNECTIVITY_ALGO::Remove(), SCH_SCREEN::Remove(), BOARD::Remove(), PCB_POINT_EDITOR::removeCorner(), PCB_POINT_EDITOR::removeCornerCondition(), RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_FIELD::Replace(), PCB_SELECTION_TOOL::RequestSelection(), SCHEMATIC::ResolveCrossReference(), PCB_PARSER::resolveGroups(), DS_PROXY_UNDO_ITEM::Restore(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), SCH_SEXPR_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_SEXPR_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_SEXPR_PLUGIN_CACHE::saveCircle(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_SEXPR_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), CLIPBOARD_IO::SaveSelection(), SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SCREEN::Schematic(), SCH_ITEM::Schematic(), CONVERT_TOOL::SegmentToArc(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectConnectedTracks(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), BOARD_COMMIT::Stage(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_SHEET_PIN::SwapData(), PCB_GROUP::SwapData(), SCH_FIELD::SwapData(), PCB_TEXT::SwapData(), TRACK::SwapData(), ARC::SwapData(), ALIGNED_DIMENSION::SwapData(), ORTHOGONAL_DIMENSION::SwapData(), SCH_SHEET::SwapData(), LEADER::SwapData(), VIA::SwapData(), SCH_COMPONENT::SwapData(), CENTER_DIMENSION::SwapData(), PAD::SwapData(), FOOTPRINT::SwapData(), ZONE::SwapData(), SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), ERC_TESTER::TestMultUnitPinConflicts(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), PCB_GROUP::TopLevelGroup(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), KIGFX::PCB_VIEW::Update(), SCH_TEXT::UpdateDanglingState(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), SCH_BASE_FRAME::UpdateItem(), CONNECTION_GRAPH::updateItemConnectivity(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), SCH_EDITOR_CONTROL::updatePastedInstances(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), PCB_GROUP::Visit(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), SCH_GLOBALLABEL::Visit(), SCH_SHEET::Visit(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), PCB_GROUP::WithinScope(), and NETLIST_EXPORTER_CADSTAR::writeListOfNets().

◆ UnitsLocked()

bool LIB_PART::UnitsLocked ( ) const
inline

Check whether part units are interchangeable.

Returns
False when interchangeable, true otherwise.

Definition at line 237 of file lib_symbol.h.

237 { return m_unitsLocked; }
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:662

References m_unitsLocked.

Referenced by SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), GetUniqueUnits(), SCH_REFERENCE::IsUnitsLocked(), SYMBOL_EDIT_FRAME::LoadPart(), SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), SYMBOL_EDIT_FRAME::SetCurPart(), SYMBOL_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::SynchronizePins(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow().

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

Return the bounding box of the item covering all its layers.

Returns
the current bounding box.

Implements KIGFX::VIEW_ITEM.

Reimplemented in PAD, FOOTPRINT, CENTER_DIMENSION, EDIT_POINTS, PCB_SHAPE, DIMENSION_BASE, GERBER_DRAW_ITEM, FP_TEXT, TRACK, DS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, PCB_MARKER, MY_DRAWING, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::POLYGON_ITEM, RATSNEST_VIEW_ITEM, KIGFX::PREVIEW::RULER_ITEM, BRIGHT_BOX, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 206 of file eda_item.cpp.

207 {
208  // Basic fallback
209  EDA_RECT bbox = GetBoundingBox();
210 
211  return BOX2I( bbox.GetOrigin(), bbox.GetSize() );
212 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:522
const wxPoint GetOrigin() const
Definition: eda_rect.h:106
Handle the component boundary box.
Definition: eda_rect.h:42
virtual const EDA_RECT GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:89
const wxSize GetSize() const
Definition: eda_rect.h:96

References EDA_ITEM::GetBoundingBox(), EDA_RECT::GetOrigin(), and EDA_RECT::GetSize().

Referenced by GERBVIEW_FRAME::GetDocumentExtents(), BRIGHT_BOX::ViewBBox(), DIMENSION_BASE::ViewBBox(), PCB_SHAPE::ViewBBox(), and BRIGHT_BOX::ViewDraw().

◆ 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 EDIT_POINTS, DS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, KIGFX::VIEW_GROUP, KIGFX::PREVIEW::SELECTION_AREA, MY_DRAWING, KIGFX::VIEW_OVERLAY, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::ORIGIN_VIEWITEM, BRIGHT_BOX, KIGFX::PREVIEW::ARC_ASSISTANT, KIGFX::PREVIEW::RULER_ITEM, RATSNEST_VIEW_ITEM, and PCB_BRIGHT_BOX.

Definition at line 111 of file view_item.h.

112  {}

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

◆ ViewGetLayers()

void LIB_PART::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 837 of file lib_symbol.cpp.

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 FP_ZONE, PAD, FOOTPRINT, VIA, GERBER_DRAW_ITEM, FP_TEXT, TRACK, ZONE, PCB_GROUP, and FP_SHAPE.

Definition at line 137 of file view_item.h.

138  {
139  // By default always show the item
140  return 0.0;
141  }

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

◆ viewPrivData()

◆ Visit()

SEARCH_RESULT LIB_PART::Visit ( INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
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 scanTypes[], 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.
scanTypesWhich# KICAD_T types are of interest and the order is significant too, terminated by EOT.
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 1098 of file lib_symbol.cpp.

1099 {
1100  // The part itself is never inspected, only its children
1101  for( LIB_ITEM& item : m_drawings )
1102  {
1103  if( item.IsType( aFilterTypes ) )
1104  {
1105  if( aInspector( &item, aTestData ) == SEARCH_RESULT::QUIT )
1106  return SEARCH_RESULT::QUIT;
1107  }
1108  }
1109 
1110  return SEARCH_RESULT::CONTINUE;
1111 }
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:674
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62

References CONTINUE, m_drawings, and QUIT.

Member Data Documentation

◆ m_description

wxString LIB_PART::m_description
private

Definition at line 678 of file lib_symbol.h.

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

◆ m_drawings

◆ m_flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_fpFilters

wxArrayString LIB_PART::m_fpFilters
private

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

Definition at line 680 of file lib_symbol.h.

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

◆ m_includeInBom

bool LIB_PART::m_includeInBom
private

Definition at line 670 of file lib_symbol.h.

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

◆ m_includeOnBoard

bool LIB_PART::m_includeOnBoard
private

Definition at line 671 of file lib_symbol.h.

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

◆ m_keyWords

wxString LIB_PART::m_keyWords
private

Search keywords.

Definition at line 679 of file lib_symbol.h.

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

◆ m_lastModDate

timestamp_t LIB_PART::m_lastModDate
private

Definition at line 659 of file lib_symbol.h.

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

◆ m_libId

LIB_ID LIB_PART::m_libId
private

Definition at line 658 of file lib_symbol.h.

Referenced by Compare(), GetLibId(), GetLibraryName(), LIB_PART(), operator=(), SetLibId(), and SetName().

◆ m_library

PART_LIB* LIB_PART::m_library
private

Definition at line 676 of file lib_symbol.h.

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

◆ m_me

PART_SPTR LIB_PART::m_me
private

Definition at line 656 of file lib_symbol.h.

Referenced by Compare(), and SharedPtr().

◆ m_name

wxString LIB_PART::m_name
private

Definition at line 677 of file lib_symbol.h.

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

◆ m_options

LIBRENTRYOPTIONS LIB_PART::m_options
private

Special part features such as POWER or NORMAL.)

Definition at line 672 of file lib_symbol.h.

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

◆ m_parent

◆ m_pinNameOffset

int LIB_PART::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 665 of file lib_symbol.h.

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

◆ m_showPinNames

bool LIB_PART::m_showPinNames
private

Definition at line 667 of file lib_symbol.h.

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

◆ m_showPinNumbers

bool LIB_PART::m_showPinNumbers
private

Definition at line 668 of file lib_symbol.h.

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

◆ m_status

STATUS_FLAGS EDA_ITEM::m_status
protectedinherited

◆ m_subpartFirstId

int LIB_PART::m_subpartFirstId = 'A'
staticprivate

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

Definition at line 686 of file lib_symbol.h.

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

◆ m_subpartIdSeparator

int LIB_PART::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 683 of file lib_symbol.h.

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

◆ m_unitCount

int LIB_PART::m_unitCount
private

Number of units (parts) per package.

Definition at line 661 of file lib_symbol.h.

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

◆ m_unitsLocked

bool LIB_PART::m_unitsLocked
private

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

Definition at line 662 of file lib_symbol.h.

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

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 524 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddHierarchicalReference(), RC_ITEM::AddItem(), SCH_EDIT_FRAME::AnnotateComponents(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), DRAWING_TOOL::DrawVia(), Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), FOOTPRINT::Duplicate(), FOOTPRINT::DuplicateItem(), PAD_TOOL::EditPad(), PCB_EDIT_FRAME::ExchangeFootprint(), PAD_TOOL::explodePad(), SCH_SHEET_LIST::FillItemMap(), BOARD::FillItemMap(), PCB_BASE_FRAME::FocusOnItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_IO::format(), FormatProbeItem(), SCH_PIN::GetDefaultNetName(), SCH_SHEET_LIST::GetItem(), BOARD::GetItem(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), FP_TEXT::GetParentAsString(), PAD::GetParentAsString(), FP_SHAPE::GetParentAsString(), SCH_REFERENCE::GetPath(), SCH_MARKER::GetUUID(), PCB_MARKER::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), SCH_LEGACY_PLUGIN::loadComponent(), LEGACY_PLUGIN::loadFOOTPRINT(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), LEGACY_PLUGIN::loadTrackList(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), TRACK::cmp_tracks::operator()(), BOARD_ITEM::ptr_cmp::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_pads::operator()(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), PAD::PAD(), PCB_PARSER::parseDIMENSION(), PCB_PARSER::parseFOOTPRINT_unchecked(), SCH_SEXPR_PARSER::parseSchSheetInstances(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_COMPONENT::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN::saveLine(), SCH_SEXPR_PLUGIN::saveNoConnect(), SCH_EDIT_FRAME::SaveProject(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), SCH_COMPONENT::SCH_COMPONENT(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), RC_ITEM::SetItems(), SwapItemData(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), testGroupEqual(), SCH_EDITOR_CONTROL::updatePastedInstances(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().


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