KiCad PCB EDA Suite
LIB_PART Class Reference

Define a library symbol object. More...

#include <class_libentry.h>

Inheritance diagram for LIB_PART:
EDA_ITEM LIB_TREE_ITEM KIGFX::VIEW_ITEM

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)
 Copy constructor. More...
 
virtual ~LIB_PART ()
 
PART_SPTR SharedPtr ()
 
void SetParent (LIB_PART *aParent=nullptr)
 
PART_REFGetParent ()
 
virtual wxString GetClass () const override
 Function GetClass returns 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
 
void SetDocFileName (const wxString &aDocFileName)
 
wxString GetDocFileName () 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 GetDateLastEdition () const
 
wxArrayString GetFootprints () const
 
void SetFootprintFilters (const wxArrayString &aFootprintFilters)
 
void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns 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
 Function GetBoundingBox returns 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 (LIB_FIELDS &aList)
 Return a list of fields within this part. More...
 
LIB_FIELDFindField (const wxString &aFieldName)
 Find a field within this part matching aFieldName and returns it or NULL if not found. More...
 
LIB_FIELDGetField (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...
 
void Print (wxDC *aDc, 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)
 Add a new draw aItem to the draw object list. More...
 
void RemoveDrawItem (LIB_ITEM *aItem)
 Remove draw aItem from list. More...
 
LIB_ITEMGetNextDrawItem (LIB_ITEM *aItem=NULL, KICAD_T aType=TYPE_NOT_INIT)
 Return the next draw object pointer. More...
 
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...
 
SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
 Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
void SetUnitCount (int count)
 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)
 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 ()
 
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
 
std::unique_ptr< LIB_PARTFlatten () const
 Return a flattened symbol inheritance to the caller. More...
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (timestamp_t aNewTimeStamp)
 
timestamp_t GetTimeStamp () const
 
EDA_ITEMNext () const
 
EDA_ITEMBack () const
 
EDA_ITEMGetParent () const
 
DHEADGetList () const
 
void SetNext (EDA_ITEM *aNext)
 
void SetBack (EDA_ITEM *aBack)
 
void SetParent (EDA_ITEM *aParent)
 
void SetList (DHEAD *aList)
 
bool IsNew () const
 
bool IsModified () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int 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)
 
STATUS_FLAGS GetEditFlags () const
 
virtual bool IsType (const KICAD_T aScanTypes[])
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
virtual void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList)
 Function GetMsgPanelInfo populates 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
 Function HitTest tests 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
 Function HitTest tests if aRect intersects or is contained within the bounding box of an item. More...
 
virtual EDA_ITEMClone () const
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
virtual wxString GetSelectMenuText (EDA_UNITS_T aUnits) const
 Function GetSelectMenuText returns 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
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
virtual unsigned int ViewGetLOD (int aLayer, VIEW *aView) const
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 

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...
 
static SEARCH_RESULT IterateForward (EDA_ITEM *listStart, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
static bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs 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)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Protected Member Functions

bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. More...
 

Protected Attributes

EDA_ITEMPnext
 next in linked list More...
 
EDA_ITEMPback
 previous in linked list More...
 
DHEADm_List
 which DLIST I am on. More...
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
timestamp_t m_TimeStamp
 Time stamp used for logical links. More...
 
bool m_forceVisible
 Set to true to override the visibility setting of the item. More...
 
STATUS_FLAGS m_Flags
 Flag bits for editing and other uses. More...
 

Private Member Functions

void deleteAllFields ()
 

Private Attributes

PART_SPTR m_me
 < http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared More...
 
PART_REF m_parent
 Use for inherited symbols. More...
 
LIB_ID m_libId
 
int m_pinNameOffset
 The offset in mils to draw the pin name. More...
 
bool m_unitsLocked
 True if part has multiple units and changing one unit does not automatically change another unit. More...
 
bool m_showPinNames
 Determines if part pin names are visible. More...
 
bool m_showPinNumbers
 Determines if part pin numbers are visible. More...
 
timestamp_t m_dateLastEdition
 Date of the last modification. More...
 
LIBRENTRYOPTIONS m_options
 Special part features such as POWER or NORMAL.) More...
 
int m_unitCount
 Number of units (parts) per package. More...
 
LIB_ITEMS_CONTAINER m_drawings
 Drawing items of this part. More...
 
wxArrayString m_FootprintList
 List of suitable footprint names for the part (wild card names accepted). More...
 
PART_LIBm_library
 Library the part belongs to if any. More...
 
wxString m_name
 Symbol name. More...
 
wxString m_description
 documentation for info More...
 
wxString m_keyWords
 keyword list (used for search for parts by keyword) More...
 
wxString m_docFileName
 Associate doc file name. 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 91 of file class_libentry.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 87 of file class_libentry.cpp.

87  :
89  m_me( this, null_deleter() )
90 {
92  m_unitCount = 1;
93  m_pinNameOffset = 40;
95  m_unitsLocked = false;
96  m_showPinNumbers = true;
97  m_showPinNames = true;
98 
99  // Add the MANDATORY_FIELDS in RAM only. These are assumed to be present
100  // when the field editors are invoked.
101  m_drawings[LIB_FIELD_T].reserve( 4 );
106 
107  SetName( aName );
108 
109  if( aParent )
110  SetParent( aParent );
111 
112  SetLib( aLibrary );
113 }
timestamp_t m_dateLastEdition
Date of the last modification.
void SetLib(PART_LIB *aLibrary)
name of datasheet
bool m_showPinNumbers
Determines if part pin numbers are visible.
int m_unitCount
Number of units (parts) per package.
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Field Name Module PCB, i.e. "16DIP300".
Field Reference of part, i.e. "IC21".
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
int m_pinNameOffset
The offset in mils to draw the pin name.
#define VALUE
void push_back(T *aItem)
Definition: multivector.h:169
void SetParent(LIB_PART *aParent=nullptr)
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: base_struct.cpp:62
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
virtual void SetName(const wxString &aName)
bool m_showPinNames
Determines if part pin names are visible.
PART_SPTR m_me
< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared

References DATASHEET, ENTRY_NORMAL, FOOTPRINT, LIB_FIELD_T, m_dateLastEdition, m_drawings, m_options, m_pinNameOffset, m_showPinNames, m_showPinNumbers, m_unitCount, m_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), REFERENCE, SetLib(), SetName(), SetParent(), and VALUE.

Referenced by Flatten(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), LIB_MANAGER::PART_BUFFER::PART_BUFFER(), LIB_MANAGER::RevertPart(), LIB_MANAGER::LIB_BUFFER::SaveBuffer(), LIB_MANAGER::SaveLibrary(), and LIB_MANAGER::UpdatePart().

◆ LIB_PART() [2/2]

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

Copy constructor.

Definition at line 116 of file class_libentry.cpp.

116  :
117  EDA_ITEM( aPart ),
118  m_me( this, null_deleter() )
119 {
120  LIB_ITEM* newItem;
121 
122  m_library = aLibrary;
123  m_name = aPart.m_name;
124  m_FootprintList = wxArrayString( aPart.m_FootprintList );
125  m_unitCount = aPart.m_unitCount;
131  m_options = aPart.m_options;
132  m_libId = aPart.m_libId;
134  m_keyWords = aPart.m_keyWords;
136 
137  for( const LIB_ITEM& oldItem : aPart.m_drawings )
138  {
139  if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 )
140  continue;
141 
142  newItem = (LIB_ITEM*) oldItem.Clone();
143  newItem->SetParent( this );
144  m_drawings.push_back( newItem );
145  }
146 
147  PART_SPTR parent = aPart.m_parent.lock();
148 
149  if( parent )
150  SetParent( parent.get() );
151 }
timestamp_t m_dateLastEdition
Date of the last modification.
bool m_showPinNumbers
Determines if part pin numbers are visible.
int m_unitCount
Number of units (parts) per package.
PART_LIB * m_library
Library the part belongs to if any.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
wxString m_docFileName
Associate doc file name.
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define IS_NEW
New item, just created.
Definition: base_struct.h:120
int m_pinNameOffset
The offset in mils to draw the pin name.
PART_REF m_parent
Use for inherited symbols.
wxString m_name
Symbol name.
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:225
void push_back(T *aItem)
Definition: multivector.h:169
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
void SetParent(LIB_PART *aParent=nullptr)
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:129
wxArrayString m_FootprintList
List of suitable footprint names for the part (wild card names accepted).
LIB_ID m_libId
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: base_struct.cpp:62
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
wxString m_keyWords
keyword list (used for search for parts by keyword)
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:267
bool m_showPinNames
Determines if part pin names are visible.
wxString m_description
documentation for info
PART_SPTR m_me
< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared

References EDA_ITEM::Clone(), EDA_ITEM::GetFlags(), IS_NEW, m_dateLastEdition, m_description, m_docFileName, m_drawings, m_FootprintList, m_keyWords, 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

Definition at line 154 of file class_libentry.cpp.

155 {
156 }

Member Function Documentation

◆ AddDrawItem()

void LIB_PART::AddDrawItem ( LIB_ITEM aItem)

Add a new draw aItem to the draw object list.

Parameters
aItem- New draw object to add to part.

Definition at line 559 of file class_libentry.cpp.

560 {
561  if( !aItem )
562  return;
563 
564  m_drawings.push_back( aItem );
565 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
void push_back(T *aItem)
Definition: multivector.h:169

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

Referenced by LIB_PIN_TOOL::CreateImagePins(), LIB_DRAWING_TOOLS::DrawShape(), dummy(), KIGFX::dummy(), LIB_EDIT_FRAME::LoadOneSymbol(), LIB_EDIT_TOOL::Paste(), LIB_PIN_TOOL::PlacePin(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow(), and LIB_DRAWING_TOOLS::TwoClickPlace().

◆ Back()

EDA_ITEM* EDA_ITEM::Back ( ) const
inlineinherited

Definition at line 219 of file base_struct.h.

219 { return Pback; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:177

References EDA_ITEM::Pback.

Referenced by DHEAD::insert(), and DHEAD::remove().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 245 of file base_struct.h.

245 { ClearFlags( BRIGHTENED ); }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:143
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:266

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::unhighlight(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ ClearEditFlags()

void LIB_PART::ClearEditFlags ( )

Definition at line 910 of file class_libentry.cpp.

911 {
912  for( LIB_ITEM& item : m_drawings )
913  item.ClearEditFlags();
914 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References m_drawings.

Referenced by LIB_EDIT_FRAME::SaveCopyInUndoList().

◆ ClearFlags()

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

Definition at line 266 of file base_struct.h.

266 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187

References EDA_ITEM::m_Flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_COMPONENT::ClearAllHighlightFlags(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearHighlighted(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), MWAVE::CreateMicrowaveInductor(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), KIGFX::SCH_VIEW::HighlightItem(), MODULE_EDITOR_TOOLS::ImportFootprint(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), EDIT_POINTS_FACTORY::Make(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceModule(), LIB_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::RollbackPartFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN_CACHE::savePin(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearHighlighted()

void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 244 of file base_struct.h.

244 { ClearFlags( HIGHLIGHTED ); }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:142
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:266

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

◆ ClearSelected()

void EDA_ITEM::ClearSelected ( )
inlineinherited

◆ ClearTempFlags()

void LIB_PART::ClearTempFlags ( )

Clears the status flag all draw objects in this part.

Definition at line 903 of file class_libentry.cpp.

904 {
905  for( LIB_ITEM& item : m_drawings )
906  item.ClearTempFlags();
907 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References m_drawings.

Referenced by LIB_PIN_TOOL::CreatePin(), and LIB_EDIT_FRAME::SaveCopyInUndoList().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 153 of file view_item.h.

154  {
155  m_viewPrivData = NULL;
156  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:161

References KIGFX::VIEW_ITEM::m_viewPrivData.

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

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Function Clone creates 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 MODULE_ZONE_CONTAINER, D_PAD, SCH_COMPONENT, ZONE_CONTAINER, MODULE, SCH_SHEET, LIB_PIN, SCH_HIERLABEL, VIA, SCH_GLOBALLABEL, DRAWSEGMENT, SCH_LABEL, DIMENSION, TRACK, TEXTE_MODULE, SCH_LINE, SCH_TEXT, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_SHEET_PIN, LIB_FIELD, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, EDGE_MODULE, LIB_ARC, TEXTE_PCB, SCH_NO_CONNECT, LIB_POLYLINE, SCH_JUNCTION, PCB_TARGET, SCH_MARKER, LIB_TEXT, LIB_BEZIER, LIB_CIRCLE, LIB_RECTANGLE, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 121 of file base_struct.cpp.

122 {
123  wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
124  wxT( ". Bad programmer!" ) );
125 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass().

Referenced by LIB_DRAWING_TOOLS::DrawShape(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), BOARD::Duplicate(), LIB_PART(), LIB_EDIT_FRAME::LoadOneSymbol(), new_clone(), LIB_EDIT_TOOL::Paste(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SetConversion(), SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), COMMIT::Stage(), LIB_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 159 of file class_libentry.cpp.

160 {
161  if( m_me == aRhs.m_me )
162  return 0;
163 
164  int retv = m_name.Cmp( aRhs.m_name );
165 
166  if( retv )
167  return retv;
168 
169  retv = m_libId.compare( aRhs.m_libId );
170 
171  if( retv )
172  return retv;
173 
174  if( m_parent.lock() < aRhs.m_parent.lock() )
175  return -1;
176 
177  if( m_parent.lock() > aRhs.m_parent.lock() )
178  return 1;
179 
180  if( m_options != aRhs.m_options )
181  return ( m_options == ENTRY_NORMAL ) ? -1 : 1;
182 
183  if( m_unitCount != aRhs.m_unitCount )
184  return m_unitCount - aRhs.m_unitCount;
185 
186  if( m_drawings.size() != aRhs.m_drawings.size() )
187  return m_drawings.size() - aRhs.m_drawings.size();
188 
191 
192  while( lhsItem != m_drawings.end() )
193  {
194  if( lhsItem->Type() != rhsItem->Type() )
195  return lhsItem->Type() - rhsItem->Type();
196 
197  retv = lhsItem->compare( *rhsItem );
198 
199  if( retv )
200  return retv;
201 
202  ++lhsItem;
203  ++rhsItem;
204  }
205 
206  if( m_FootprintList.GetCount() != aRhs.m_FootprintList.GetCount() )
207  return m_FootprintList.GetCount() - aRhs.m_FootprintList.GetCount();
208 
209  for( size_t i = 0; i < m_FootprintList.GetCount(); i++ )
210  {
211  retv = m_FootprintList[i].Cmp( aRhs.m_FootprintList[i] );
212 
213  if( retv )
214  return retv;
215  }
216 
217  retv = m_description.Cmp( aRhs.m_description );
218 
219  if( retv )
220  return retv;
221 
222  retv = m_keyWords.Cmp( aRhs.m_keyWords );
223 
224  if( retv )
225  return retv;
226 
227  retv = m_docFileName.Cmp( aRhs.m_docFileName );
228 
229  if( retv )
230  return retv;
231 
232  if( m_pinNameOffset != aRhs.m_pinNameOffset )
233  return m_pinNameOffset - aRhs.m_pinNameOffset;
234 
235  if( m_unitsLocked != aRhs.m_unitsLocked )
236  return ( m_unitsLocked ) ? 1 : -1;
237 
238  if( m_showPinNames != aRhs.m_showPinNames )
239  return ( m_showPinNames ) ? 1 : -1;
240 
241  if( m_showPinNumbers != aRhs.m_showPinNumbers )
242  return ( m_showPinNumbers ) ? 1 : -1;
243 
244  return 0;
245 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
bool m_showPinNumbers
Determines if part pin numbers are visible.
int m_unitCount
Number of units (parts) per package.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
wxString m_docFileName
Associate doc file name.
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
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:316
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:189
int m_pinNameOffset
The offset in mils to draw the pin name.
PART_REF m_parent
Use for inherited symbols.
wxString m_name
Symbol name.
wxArrayString m_FootprintList
List of suitable footprint names for the part (wild card names accepted).
LIB_ID m_libId
size_t i
Definition: json11.cpp:649
ITERATOR_BASE< const LIB_ITEM, const MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::const_iterator > CONST_ITERATOR
The const iterator
Definition: multivector.h:162
wxString m_keyWords
keyword list (used for search for parts by keyword)
bool m_showPinNames
Determines if part pin names are visible.
wxString m_description
documentation for info
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:207
PART_SPTR m_me
< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), LIB_ID::compare(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), ENTRY_NORMAL, i, m_description, m_docFileName, m_drawings, m_FootprintList, m_keyWords, m_libId, m_me, m_name, m_options, m_parent, m_pinNameOffset, m_showPinNames, m_showPinNumbers, m_unitCount, m_unitsLocked, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size().

Referenced by operator==().

◆ deleteAllFields()

void LIB_PART::deleteAllFields ( )
private

Definition at line 767 of file class_libentry.cpp.

768 {
769  m_drawings[ LIB_FIELD_T ].clear();
770 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.

References LIB_FIELD_T, and m_drawings.

Referenced by SetFields().

◆ FindField()

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 831 of file class_libentry.cpp.

832 {
833  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
834  {
835  LIB_FIELD* field = ( LIB_FIELD* ) &item;
836 
837  if( field->GetName() == aFieldName )
838  return field;
839  }
840 
841  return NULL;
842 }
wxString GetName(bool aTranslate=true) const
Returns the field name.
Definition: lib_field.cpp:366
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

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

Referenced by SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), and FOOTPRINT_INFO_GENERATOR::SetHtmlFieldTable().

◆ 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 302 of file class_libentry.cpp.

303 {
304  std::unique_ptr< LIB_PART > retv;
305 
306  if( IsAlias() )
307  {
308  PART_SPTR parent = m_parent.lock();
309 
310  wxCHECK_MSG( parent, retv,
311  wxString::Format( "Parent of derived symbol '%s' undefined", m_name ) );
312 
313  // Copy the parent.
314  retv.reset( new LIB_PART( *parent.get() ) );
315 
316  // Now add the inherited part (this) information.
317  retv->SetName( m_name );
318 
319  const LIB_FIELD* datasheetField = GetField( DATASHEET );
320  retv->GetField( DATASHEET )->SetText( datasheetField->GetText() );
321  retv->SetDocFileName( m_docFileName );
322  retv->SetKeyWords( m_keyWords );
323  retv->SetDescription( m_description );
324  }
325  else
326  {
327  retv.reset( new LIB_PART( *this ) );
328  }
329 
330  return retv;
331 }
name of datasheet
Field object used in symbol libraries.
Definition: lib_field.h:59
wxString m_docFileName
Associate doc file name.
PART_REF m_parent
Use for inherited symbols.
wxString m_name
Symbol name.
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
LIB_PART(const wxString &aName, LIB_PART *aParent=nullptr, PART_LIB *aLibrary=nullptr)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
bool IsAlias() const
wxString m_keyWords
keyword list (used for search for parts by keyword)
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.
wxString m_description
documentation for info
virtual const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:124

References DATASHEET, Format(), GetField(), EDA_TEXT::GetText(), IsAlias(), LIB_PART(), m_description, m_docFileName, m_keyWords, m_name, and m_parent.

Referenced by SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_FRAME::GetDocumentExtents(), SCH_COMPONENT::Resolve(), and SCH_COMPONENT::SetLibId().

◆ 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 737 of file class_libentry.cpp.

738 {
739  EDA_RECT bBox;
740  bool initialized = false;
741 
742  for( const LIB_ITEM& item : m_drawings )
743  {
744  if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
745  && ( aUnit != item.m_Unit ) ) )
746  continue;
747 
748  if( item.m_Convert > 0 && ( ( aConvert > 0 ) && ( aConvert != item.m_Convert ) ) )
749  continue;
750 
751  if( item.Type() == LIB_FIELD_T )
752  continue;
753 
754  if( initialized )
755  bBox.Merge( item.GetBoundingBox() );
756  else
757  {
758  bBox = item.GetBoundingBox();
759  initialized = true;
760  }
761  }
762 
763  return bBox;
764 }
void Merge(const EDA_RECT &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
int m_unitCount
Number of units (parts) per package.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

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

Function GetBoundingBox returns 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 222 of file class_libentry.h.

223  {
224  return GetUnitBoundingBox( 0, 0 );
225  }
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.

References GetUnitBoundingBox().

◆ GetClass()

virtual wxString LIB_PART::GetClass ( ) const
inlineoverridevirtual

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 141 of file class_libentry.h.

142  {
143  return wxT( "LIB_PART" );
144  }

◆ GetDateLastEdition()

timestamp_t LIB_PART::GetDateLastEdition ( ) const
inline

Definition at line 188 of file class_libentry.h.

188 { return m_dateLastEdition; }
timestamp_t m_dateLastEdition
Date of the last modification.

References m_dateLastEdition.

Referenced by SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().

◆ GetDescription()

wxString LIB_PART::GetDescription ( )
inlineoverridevirtual

◆ GetDocFileName()

◆ GetDrawItems()

LIB_ITEMS_CONTAINER& LIB_PART::GetDrawItems ( )
inline

Return a reference to the draw item list.

Returns
LIB_ITEMS_CONTAINER& - Reference to the draw item object container.

Definition at line 459 of file class_libentry.h.

459 { return m_drawings; }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.

References m_drawings.

Referenced by LIB_EDIT_TOOL::Copy(), KIGFX::SCH_VIEW::DisplayComponent(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), LIB_EDIT_FRAME::LoadOneSymbol(), KIGFX::orientPart(), LIB_EDIT_TOOL::Paste(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), LIB_EDIT_FRAME::SaveOneSymbol(), and SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 270 of file base_struct.h.

271  {
275  return m_Flags & mask;
276  }
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: base_struct.h:128
#define END_ONPAD
Pcbnew: flag set for track segment ending on a pad.
Definition: base_struct.h:139
#define BEGIN_ONPAD
Pcbnew: flag set for track segment starting on a pad.
Definition: base_struct.h:138
#define EDA_ITEM_ALL_FLAGS
Definition: base_struct.h:154
#define SELECTED
Definition: base_struct.h:127
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:143
#define DP_COUPLED
item is coupled with another item making a differential pair
Definition: base_struct.h:145
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:142
#define IS_DANGLING
indicates a pin is dangling
Definition: base_struct.h:149
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:126
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:125

References BEGIN_ONPAD, BRIGHTENED, DP_COUPLED, EDA_ITEM_ALL_FLAGS, END_ONPAD, ENDPOINT, HIGHLIGHTED, IS_DANGLING, EDA_ITEM::m_Flags, SELECTED, STARTPOINT, and TEMP_SELECTED.

Referenced by SCH_EDIT_TOOL::ChangeShape(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::ConvertTextType(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editComponentFieldText(), SCH_EDITOR_CONTROL::EditWithLibEdit(), LIB_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), BOARD::Print(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_EDIT_PIN::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ GetField()

LIB_FIELD * LIB_PART::GetField ( 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 817 of file class_libentry.cpp.

818 {
819  for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
820  {
821  LIB_FIELD* field = ( LIB_FIELD* ) &item;
822 
823  if( field->GetId() == aId )
824  return field;
825  }
826 
827  return NULL;
828 }
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
int GetId() const
Definition: lib_field.h:135
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

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

Referenced by Flatten(), GetFields(), GetFootprintField(), GetReferenceField(), GetValueField(), SCH_LEGACY_PLUGIN_CACHE::loadDocs(), SCH_EAGLE_PLUGIN::loadInstance(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), LIB_EDIT_FRAME::SetCurPart(), SetParent(), and DIALOG_CHOOSE_COMPONENT::ShowFootprintFor().

◆ GetFields()

void LIB_PART::GetFields ( LIB_FIELDS aList)

Return a list of fields within this part.

Parameters
aList- List to add fields to

Definition at line 788 of file class_libentry.cpp.

789 {
790  LIB_FIELD* field;
791 
792  // Grab the MANDATORY_FIELDS first, in expected order given by
793  // enum NumFieldType
794  for( int id=0; id<MANDATORY_FIELDS; ++id )
795  {
796  field = GetField( id );
797 
798  // the MANDATORY_FIELDS are exactly that in RAM.
799  wxASSERT( field );
800 
801  aList.push_back( *field );
802  }
803 
804  // Now grab all the rest of fields.
805  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
806  {
807  field = ( LIB_FIELD* ) &item;
808 
809  if( (unsigned) field->GetId() < MANDATORY_FIELDS )
810  continue; // was added above
811 
812  aList.push_back( *field );
813  }
814 }
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
int GetId() const
Definition: lib_field.h:135
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.

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

Referenced by SCH_EAGLE_PLUGIN::loadInstance(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), FOOTPRINT_INFO_GENERATOR::SetHtmlFieldTable(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ GetFlags()

◆ GetFootprintField()

LIB_FIELD & LIB_PART::GetFootprintField ( )

Return reference to the footprint field.

Definition at line 861 of file class_libentry.cpp.

862 {
863  LIB_FIELD* field = GetField( FOOTPRINT );
864  wxASSERT( field != NULL );
865  return *field;
866 }
Field object used in symbol libraries.
Definition: lib_field.h:59
Field Name Module PCB, i.e. "16DIP300".
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.

References FOOTPRINT, and GetField().

Referenced by GetSearchText().

◆ GetFootprints()

wxArrayString LIB_PART::GetFootprints ( ) const
inline

Definition at line 190 of file class_libentry.h.

190 { return m_FootprintList; }
wxArrayString m_FootprintList
List of suitable footprint names for the part (wild card names accepted).

References m_FootprintList.

Referenced by DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ GetKeyWords()

wxString LIB_PART::GetKeyWords ( ) const
inline

◆ GetLib()

PART_LIB* LIB_PART::GetLib ( )
inline

Definition at line 185 of file class_libentry.h.

185 { return m_library; }
PART_LIB * m_library
Library the part belongs to if any.

References m_library.

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

◆ GetLibId()

◆ GetLibNickname()

wxString LIB_PART::GetLibNickname ( ) const
inlineoverridevirtual

Implements LIB_TREE_ITEM.

Definition at line 152 of file class_libentry.h.

152 { return GetLibraryName(); }
const wxString GetLibraryName() const

References GetLibraryName().

◆ GetLibraryName()

const wxString LIB_PART::GetLibraryName ( ) const

Definition at line 334 of file class_libentry.cpp.

335 {
336  if( m_library )
337  return m_library->GetName();
338 
339  return m_libId.GetLibNickname();
340 }
const wxString GetName() const
Return the file name without path or extension.
PART_LIB * m_library
Library the part belongs to if any.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
LIB_ID m_libId

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

Referenced by GetLibNickname(), and RemoveDrawItem().

◆ GetList()

DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited

Definition at line 221 of file base_struct.h.

221 { return m_List; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:178

References EDA_ITEM::m_List.

Referenced by DHEAD::insert(), DHEAD::remove(), and GERBER_DRAW_ITEM::UnLink().

◆ GetMenuImage()

BITMAP_DEF EDA_ITEM::GetMenuImage ( ) const
virtualinherited

Function GetMenuImage returns 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 D_PAD, ZONE_CONTAINER, SCH_COMPONENT, MODULE, SCH_SHEET, LIB_PIN, SCH_HIERLABEL, VIA, GERBER_DRAW_ITEM, SCH_GLOBALLABEL, DRAWSEGMENT, SCH_LABEL, DIMENSION, TRACK, TEXTE_MODULE, SCH_BUS_BUS_ENTRY, SCH_LINE, SCH_TEXT, LIB_FIELD, SCH_SHEET_PIN, SCH_FIELD, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, EDGE_MODULE, LIB_ARC, TEXTE_PCB, MARKER_PCB, LIB_POLYLINE, SCH_NO_CONNECT, PCB_TARGET, LIB_TEXT, SCH_JUNCTION, SCH_MARKER, LIB_CIRCLE, and LIB_RECTANGLE.

Definition at line 251 of file base_struct.cpp.

252 {
253  return dummy_xpm;
254 }
static const BITMAP_OPAQUE dummy_xpm[1]
Definition: base_struct.cpp:54

References dummy_xpm.

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

◆ GetMsgPanelInfo()

virtual void EDA_ITEM::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
inlinevirtualinherited

Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Note
This method replaces DisplayInfo() so that KiCad objects no longer have any knowledge of wxWidgets UI objects.
Parameters
aListis the list to populate.

Reimplemented in BOARD, D_PAD, MODULE, SCH_SHEET, SCH_COMPONENT, GERBER_DRAW_ITEM, NETINFO_ITEM, DIMENSION, DRAWSEGMENT, SCH_LINE, SCH_TEXT, LIB_ITEM, TEXTE_MODULE, TRACK, LIB_FIELD, SCH_BITMAP, EDGE_MODULE, SCH_BUS_ENTRY_BASE, LIB_PIN, MARKER_PCB, ZONE_CONTAINER, LIB_BEZIER, SCH_MARKER, TEXTE_PCB, LIB_POLYLINE, LIB_ARC, LIB_TEXT, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 328 of file base_struct.h.

329  {
330  }

Referenced by EDA_DRAW_FRAME::SetMsgPanel(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), and FOOTPRINT_WIZARD_FRAME::UpdateMsgPanel().

◆ GetName()

wxString LIB_PART::GetName ( ) const
inlineoverridevirtual

◆ GetNextDrawItem()

LIB_ITEM * LIB_PART::GetNextDrawItem ( 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 568 of file class_libentry.cpp.

569 {
570  if( aItem == NULL )
571  {
573 
574  return (it1 != m_drawings.end( aType ) ) ? &( *( m_drawings.begin( aType ) ) ) : nullptr;
575  }
576 
577  // Search for the last item, assume aItem is of type aType
578  wxASSERT( ( aType == TYPE_NOT_INIT ) || ( aType == aItem->Type() ) );
580 
581  while( ( it != m_drawings.end( aType ) ) && ( aItem != &( *it ) ) )
582  ++it;
583 
584  // Search the next item
585  if( it != m_drawings.end( aType ) )
586  {
587  ++it;
588 
589  if( it != m_drawings.end( aType ) )
590  return &( *it );
591  }
592 
593  return NULL;
594 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:189
ITERATOR_BASE< LIB_ITEM, MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
The non-const iterator
Definition: multivector.h:160
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210

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

Referenced by 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 358 of file class_libentry.h.

359  {
360  return (LIB_PIN*) GetNextDrawItem( (LIB_ITEM*) aItem, LIB_PIN_T );
361  }
LIB_ITEM * GetNextDrawItem(LIB_ITEM *aItem=NULL, KICAD_T aType=TYPE_NOT_INIT)
Return the next draw object pointer.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References GetNextDrawItem(), and LIB_PIN_T.

Referenced by LIB_EDIT_TOOL::DoDelete(), NETLIST_EXPORTER::findAllUnitsOfComponent(), LIB_MOVE_TOOL::Main(), LIB_PIN_TOOL::PlacePin(), LIB_PIN_TOOL::PushPinProperties(), LIB_PIN::SetConversion(), LIB_PIN::SetPartNumber(), DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow(), and DIALOG_LIB_EDIT_PIN_TABLE::TransferDataToWindow().

◆ GetParent() [1/2]

◆ GetParent() [2/2]

◆ 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 620 of file class_libentry.cpp.

621 {
622  LIB_PINS pinList;
623 
624  GetPins( pinList, aUnit, aConvert );
625 
626  for( size_t i = 0; i < pinList.size(); i++ )
627  {
628  wxASSERT( pinList[i]->Type() == LIB_PIN_T );
629 
630  if( aNumber == pinList[i]->GetNumber() )
631  return pinList[i];
632  }
633 
634  return NULL;
635 }
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
size_t i
Definition: json11.cpp:649
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210

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

◆ GetPinNameOffset()

int LIB_PART::GetPinNameOffset ( )
inline

◆ 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 597 of file class_libentry.cpp.

598 {
599  /* Notes:
600  * when aUnit == 0: no unit filtering
601  * when aConvert == 0: no convert (shape selection) filtering
602  * when .m_Unit == 0, the body item is common to units
603  * when .m_Convert == 0, the body item is common to shapes
604  */
605  for( LIB_ITEM& item : m_drawings[ LIB_PIN_T ] )
606  {
607  // Unit filtering:
608  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
609  continue;
610 
611  // Shape filtering:
612  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
613  continue;
614 
615  aList.push_back( (LIB_PIN*) &item );
616  }
617 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References LIB_PIN_T, and m_drawings.

Referenced by EE_INSPECTION_TOOL::checkPart(), KIGFX::SCH_PAINTER::draw(), LIB_PIN::EnableEditMode(), GetPin(), PinsConflictWith(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), LIB_PIN::SetLength(), LIB_PIN::SetName(), LIB_PIN::SetNameTextSize(), LIB_PIN::SetNumberTextSize(), LIB_PIN::SetOrientation(), LIB_PIN::SetPinPosition(), LIB_PIN::SetShape(), LIB_PIN::SetType(), and LIB_PIN::SetVisible().

◆ GetReferenceField()

LIB_FIELD & LIB_PART::GetReferenceField ( )

Return reference to the reference designator field.

Definition at line 853 of file class_libentry.cpp.

854 {
855  LIB_FIELD* field = GetField( REFERENCE );
856  wxASSERT( field != NULL );
857  return *field;
858 }
Field object used in symbol libraries.
Definition: lib_field.h:59
Field Reference of part, i.e. "IC21".
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.

References GetField(), and REFERENCE.

Referenced by LIB_EDIT_FRAME::CreateNewPart(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), and SCH_COMPONENT::SCH_COMPONENT().

◆ GetSearchText()

wxString LIB_PART::GetSearchText ( )
overridevirtual

Reimplemented from LIB_TREE_ITEM.

Definition at line 54 of file class_libentry.cpp.

55 {
56  // Matches are scored by offset from front of string, so inclusion of this spacer
57  // discounts matches found after it.
58  static const wxString discount( wxT( " " ) );
59 
60  wxString text = GetKeyWords() + discount + GetDescription();
61  wxString footprint = GetFootprintField().GetText();
62 
63  if( !footprint.IsEmpty() )
64  {
65  text += discount + footprint;
66  }
67 
68  return text;
69 }
LIB_FIELD & GetFootprintField()
Return reference to the footprint field.
wxString GetKeyWords() const
wxString GetDescription() override
virtual const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:124

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

◆ GetSelectMenuText()

wxString EDA_ITEM::GetSelectMenuText ( EDA_UNITS_T  aUnits) const
virtualinherited

Function GetSelectMenuText returns 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 D_PAD, ZONE_CONTAINER, SCH_COMPONENT, MODULE, BOARD, SCH_SHEET, LIB_PIN, SCH_HIERLABEL, WS_DRAW_ITEM_BITMAP, VIA, GERBER_DRAW_ITEM, WS_DRAW_ITEM_TEXT, SCH_GLOBALLABEL, WS_DRAW_ITEM_PAGE, DRAWSEGMENT, SCH_LABEL, DIMENSION, WS_DRAW_ITEM_RECT, TRACK, TEXTE_MODULE, SCH_BUS_BUS_ENTRY, SCH_LINE, SCH_TEXT, LIB_FIELD, SCH_SHEET_PIN, SCH_FIELD, WS_DRAW_ITEM_POLYPOLYGONS, SCH_BUS_WIRE_ENTRY, WS_DRAW_ITEM_LINE, SCH_BITMAP, EDGE_MODULE, LIB_ARC, TEXTE_PCB, MARKER_PCB, LIB_POLYLINE, PCB_TARGET, LIB_TEXT, SCH_NO_CONNECT, LIB_CIRCLE, LIB_RECTANGLE, SCH_JUNCTION, SCH_MARKER, SCH_PIN, and DELETED_BOARD_ITEM.

Definition at line 147 of file base_struct.cpp.

148 {
149  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
150  GetClass() );
151 
152  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
153 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass().

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_SUBGRAPH::ResolveDrivers(), DRC_ITEM::SetData(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 249 of file base_struct.h.

250  {
251  return m_Status & type;
252  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by SELECTION_TOOL::expandConnection(), TRACK::GetMsgPanelInfoBase_Common(), TRACK::IsLocked(), TRACK::Print(), and ZONE_CONTAINER::PrintFilledArea().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 262 of file base_struct.h.

262 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

◆ GetSubpartFirstId()

static int LIB_PART::GetSubpartFirstId ( )
inlinestatic

Definition at line 504 of file class_libentry.h.

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

References m_subpartFirstId.

Referenced by SCH_EDIT_FRAME::LoadProjectFile(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow(), and PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow().

◆ GetSubpartIdSeparator()

static int LIB_PART::GetSubpartIdSeparator ( )
inlinestatic

Definition at line 498 of file class_libentry.h.

498 { return m_subpartIdSeparator; }
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...

References m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::LoadProjectFile(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow(), and PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow().

◆ GetTimeStamp()

◆ 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 695 of file class_libentry.cpp.

696 {
697  EDA_RECT bBox;
698  bool initialized = false;
699 
700  for( const LIB_ITEM& item : m_drawings )
701  {
702  if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
703  && ( aUnit != item.m_Unit ) ) )
704  continue;
705 
706  if( item.m_Convert > 0 && ( ( aConvert > 0 ) && ( aConvert != item.m_Convert ) ) )
707  continue;
708 
709  if ( ( item.Type() == LIB_FIELD_T ) && !( ( LIB_FIELD& ) item ).IsVisible() )
710  continue;
711 
712  if( initialized )
713  bBox.Merge( item.GetBoundingBox() );
714  else
715  {
716  bBox = item.GetBoundingBox();
717  initialized = true;
718  }
719  }
720 
721  return bBox;
722 }
void Merge(const EDA_RECT &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
int m_unitCount
Number of units (parts) per package.
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

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

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

◆ GetUnitCount()

int LIB_PART::GetUnitCount ( ) const
overridevirtual

◆ 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 248 of file class_libentry.cpp.

249 {
250  return LIB_PART::SubReference( aUnit, false );
251 }
static wxString SubReference(int aUnit, bool aAddSeparator=true)

References SubReference().

◆ GetValueField()

LIB_FIELD & LIB_PART::GetValueField ( )

Return reference to the value field.

Definition at line 845 of file class_libentry.cpp.

846 {
847  LIB_FIELD* field = GetField( VALUE );
848  wxASSERT( field != NULL );
849  return *field;
850 }
Field object used in symbol libraries.
Definition: lib_field.h:59
#define VALUE
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.

References GetField(), and VALUE.

Referenced by 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 882 of file class_libentry.cpp.

883 {
884  for( const LIB_ITEM& item : m_drawings )
885  {
886  if( item.m_Convert > LIB_ITEM::LIB_CONVERT::BASE )
887  return true;
888  }
889 
890  if( PART_SPTR parent = m_parent.lock() )
891  {
892  for( const LIB_ITEM& item : parent->GetDrawItems() )
893  {
894  if( item.m_Convert > LIB_ITEM::LIB_CONVERT::BASE )
895  return true;
896  }
897  }
898 
899  return false;
900 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
PART_REF m_parent
Use for inherited symbols.
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART

References m_drawings, and m_parent.

Referenced by EE_INSPECTION_TOOL::checkPart(), SCH_EDIT_FRAME::ConvertPart(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnBrowseLibrary(), LIB_EDIT_FRAME::RollbackPartFromUndo(), SetConversion(), LIB_VIEW_FRAME::SyncToolbars(), DIALOG_LIB_EDIT_DRAW_ITEM::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::Validate().

◆ HasFlag()

bool EDA_ITEM::HasFlag ( STATUS_FLAGS  aFlag)
inlineinherited

◆ HitTest() [1/2]

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

Function HitTest tests if aPosition is contained within or on the bounding box of an item.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
aAccuracyIncrease the item bounding box by this amount.
Returns
True if aPosition is within the item bounding box.

Reimplemented in D_PAD, SCH_COMPONENT, SCH_SHEET, MODULE, WS_DRAW_ITEM_BITMAP, VIA, WS_DRAW_ITEM_TEXT, GERBER_DRAW_ITEM, WS_DRAW_ITEM_PAGE, ZONE_CONTAINER, DIMENSION, DRAWSEGMENT, WS_DRAW_ITEM_RECT, SCH_LINE, SCH_TEXT, TEXTE_MODULE, SCH_FIELD, SCH_SHEET_PIN, TRACK, LIB_ITEM, WS_DRAW_ITEM_POLYPOLYGONS, LIB_FIELD, SCH_BITMAP, WS_DRAW_ITEM_LINE, LIB_PIN, SCH_BUS_ENTRY_BASE, SCH_NO_CONNECT, SCH_JUNCTION, SCH_MARKER, MARKER_PCB, PCB_TARGET, WS_DRAW_ITEM_BASE, TEXTE_PCB, SCH_PIN, LIB_POLYLINE, LIB_BEZIER, LIB_ARC, LIB_TEXT, LIB_RECTANGLE, LIB_CIRCLE, and KIGFX::RATSNEST_VIEWITEM.

Definition at line 340 of file base_struct.h.

341  {
342  return false; // derived classes should override this function
343  }

Referenced by SCH_MOVE_TOOL::getConnectedDragItems(), PL_SELECTION_TOOL::guessSelectionCandidates(), EE_SELECTION_TOOL::GuessSelectionCandidates(), WS_DRAW_ITEM_BASE::HitTest(), LIB_ITEM::HitTest(), EE_COLLECTOR::Inspect(), GERBER_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), EE_SELECTION_TOOL::selectMultiple(), and SELECTION_TOOL::selectMultiple().

◆ HitTest() [2/2]

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

Function HitTest tests 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 D_PAD, SCH_COMPONENT, SCH_SHEET, MODULE, ZONE_CONTAINER, WS_DRAW_ITEM_BITMAP, VIA, WS_DRAW_ITEM_TEXT, GERBER_DRAW_ITEM, DIMENSION, DRAWSEGMENT, SCH_LINE, TEXTE_MODULE, SCH_TEXT, SCH_FIELD, TRACK, LIB_ITEM, WS_DRAW_ITEM_POLYPOLYGONS, SCH_BITMAP, SCH_BUS_ENTRY_BASE, SCH_NO_CONNECT, SCH_JUNCTION, WS_DRAW_ITEM_BASE, PCB_TARGET, TEXTE_PCB, LIB_POLYLINE, LIB_BEZIER, LIB_ARC, LIB_TEXT, and LIB_CIRCLE.

Definition at line 354 of file base_struct.h.

355  {
356  return false; // derived classes should override this function
357  }

◆ IsAlias()

◆ IsBrightened()

bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 231 of file base_struct.h.

231 { return m_Flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:122
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187

References IS_DRAGGED, and EDA_ITEM::m_Flags.

Referenced by DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), KIGFX::SCH_PAINTER::setDeviceColors(), and ShowClearance().

◆ IsHighlighted()

bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 235 of file base_struct.h.

235 { return m_Flags & HIGHLIGHTED; }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:142
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187

References HIGHLIGHTED, and EDA_ITEM::m_Flags.

Referenced by SCH_COMPONENT::ClearAllHighlightFlags(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), KIGFX::SCH_PAINTER::getRenderColor(), and KIGFX::SCH_VIEW::HighlightItem().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 229 of file base_struct.h.

229 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:116
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187

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 485 of file class_libentry.h.

485 { return m_unitCount > 1; }
int m_unitCount
Number of units (parts) per package.

References m_unitCount.

Referenced by SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), LIB_EDIT_FRAME::SetCurPart(), LIB_EDIT_FRAME::SynchronizePins(), and LIB_EDIT_FRAME::SyncToolbars().

◆ IsNew()

◆ IsNormal()

bool LIB_PART::IsNormal ( ) const
inline

Definition at line 228 of file class_libentry.h.

228 { return m_options == ENTRY_NORMAL; }
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)

References ENTRY_NORMAL, and m_options.

◆ IsPower()

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

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_FIELD, SCH_SHEET_PIN, and SCH_TEXT.

Definition at line 556 of file base_struct.h.

556 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 234 of file base_struct.h.

234 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:121

References IS_RESIZED, and EDA_ITEM::m_Flags.

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

◆ IsRoot()

bool LIB_PART::IsRoot ( ) const
inlineoverridevirtual

◆ IsSelected()

◆ IsType()

virtual bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[])
inlinevirtualinherited

Function IsType Checks whether the item is one of the listed types.

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

Reimplemented in SCH_LABEL, SCH_FIELD, and SCH_LINE.

Definition at line 294 of file base_struct.h.

295  {
296  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
297  return true;
298 
299  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
300  {
301  if( m_StructType == *p )
302  return true;
303  }
304 
305  return false;
306  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:172
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78

References EOT, EDA_ITEM::m_StructType, and SCH_LOCATE_ANY_T.

Referenced by SCH_SCREEN::GetItem(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), SCH_LINE::IsType(), SCH_FIELD::IsType(), SCH_LABEL::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 232 of file base_struct.h.

232 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:124
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

◆ IterateForward() [1/3]

static SEARCH_RESULT EDA_ITEM::IterateForward ( EDA_ITEM listStart,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes.

Parameters
listStartThe first in a list of EDA_ITEMs to iterate over.
inspectorIs an INSPECTOR to call on each object that is one of the requested scanTypes.
testDataIs an aid to testFunc, and should be sufficient to allow it to fully determine if an item meets the match criteria, but it may also be used to collect output.
scanTypesA KICAD_T array that is EOT terminated, and provides both the order and interest level of of the types of objects to be iterated over.
Returns
SEARCH_RESULT SEARCH_QUIT if the called INSPECTOR returned SEARCH_QUIT, else SCAN_CONTINUE;

Definition at line 418 of file base_struct.h.

423  {
424  for( EDA_ITEM* p = listStart; p; p = p->Pnext )
425  {
426  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
427  return SEARCH_QUIT;
428  }
429 
430  return SEARCH_CONTINUE;
431  }
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:176

References EDA_ITEM::Pnext, SEARCH_CONTINUE, and SEARCH_QUIT.

Referenced by EE_COLLECTOR::Collect(), EE_TYPE_COLLECTOR::Collect(), nextMatch(), EE_SELECTION_TOOL::RebuildSelection(), SCH_EDITOR_CONTROL::UpdateFind(), GERBER_FILE_IMAGE::Visit(), and BOARD::Visit().

◆ IterateForward() [2/3]

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

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

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

Definition at line 439 of file base_struct.h.

443  {
444  for( auto it : aList )
445  {
446  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes ) == SEARCH_QUIT )
447  return SEARCH_QUIT;
448  }
449 
450  return SEARCH_CONTINUE;
451  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...

References SEARCH_CONTINUE, SEARCH_QUIT, and EDA_ITEM::Visit().

◆ IterateForward() [3/3]

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

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use std::vector instead

Definition at line 459 of file base_struct.h.

461  {
462  for( auto it : aList )
463  {
464  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
465  == SEARCH_QUIT )
466  return SEARCH_QUIT;
467  }
468 
469  return SEARCH_CONTINUE;
470  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...

References SEARCH_CONTINUE, SEARCH_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 917 of file class_libentry.cpp.

919 {
920  for( LIB_ITEM& item : m_drawings )
921  {
922  if( ( aUnit && item.m_Unit && ( aUnit != item.m_Unit) )
923  || ( aConvert && item.m_Convert && ( aConvert != item.m_Convert ) )
924  || ( ( item.Type() != aType ) && ( aType != TYPE_NOT_INIT ) ) )
925  continue;
926 
927  if( item.HitTest( aPoint ) )
928  return &item;
929  }
930 
931  return NULL;
932 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References m_drawings, 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 935 of file class_libentry.cpp.

937 {
938  /* we use LocateDrawItem( int aUnit, int convert, KICAD_T type, const
939  * wxPoint& pt ) to search items.
940  * because this function uses DefaultTransform as orient/mirror matrix
941  * we temporary copy aTransform in DefaultTransform
942  */
943  LIB_ITEM* item;
944  TRANSFORM transform = DefaultTransform;
945  DefaultTransform = aTransform;
946 
947  item = LocateDrawItem( aUnit, aConvert, aType, aPoint );
948 
949  // Restore matrix
950  DefaultTransform = transform;
951 
952  return item;
953 }
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
Class for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
TRANSFORM DefaultTransform
Definition: eeschema.cpp:50
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 237 of file class_libentry.h.

237 { m_unitsLocked = aLockUnits; }
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.

References m_unitsLocked.

Referenced by LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData 
)
inlinevirtualinherited

Function Matches compares 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_FIELD, SCH_SHEET_PIN, SCH_TEXT, LIB_PIN, MARKER_PCB, SCH_PIN, SCH_MARKER, TEXTE_MODULE, and TEXTE_PCB.

Definition at line 512 of file base_struct.h.

513  {
514  return false;
515  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), TEXTE_PCB::Matches(), TEXTE_MODULE::Matches(), SCH_MARKER::Matches(), MARKER_PCB::Matches(), LIB_PIN::Matches(), SCH_TEXT::Matches(), SCH_SHEET_PIN::Matches(), SCH_FIELD::Matches(), SCH_SHEET::Matches(), nextMatch(), SCH_EDITOR_CONTROL::ReplaceAndFindNext(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Matches() [2/2]

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

Function Matches compares 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 156 of file base_struct.cpp.

157 {
158  wxString text = aText;
159  wxString searchText = aSearchData.GetFindString();
160 
161  // Don't match if searching for replaceable item and the item doesn't support text replace.
162  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
163  return false;
164 
165  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
166  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
167 
168  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
169  {
170  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
171  return text.Matches( searchText );
172 
173  return text.MakeUpper().Matches( searchText.MakeUpper() );
174  }
175 
176  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
177  return aText.Find( searchText ) != wxNOT_FOUND;
178 
179  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
180 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:556

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

◆ Next()

◆ 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 210 of file base_struct.cpp.

211 {
212  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
213  GetChars( GetClass() ) ) );
214 
215  return false;
216 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101
virtual wxString GetClass() const =0
Function GetClass returns the class name.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

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

◆ operator==() [1/2]

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

Definition at line 572 of file class_libentry.h.

572 { return this == aPart; }

◆ operator==() [2/2]

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

Definition at line 573 of file class_libentry.h.

573 { return Compare( aPart ) == 0; }
int Compare(const LIB_PART &aRhs) const
Comparison test that can be used for operators.

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 638 of file class_libentry.cpp.

640 {
641  LIB_PINS thisPinList;
642  GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 );
643 
644  for( LIB_PIN* eachThisPin : thisPinList )
645  {
646  wxASSERT( eachThisPin );
647  LIB_PINS otherPinList;
648  aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 );
649  bool foundMatch = false;
650 
651  for( LIB_PIN* eachOtherPin : otherPinList )
652  {
653  wxASSERT( eachOtherPin );
654  // Same position?
655  if( eachThisPin->GetPosition() != eachOtherPin->GetPosition() )
656  continue;
657 
658  // Same number?
659  if( aTestNums && ( eachThisPin->GetNumber() != eachOtherPin->GetNumber() ) )
660  continue;
661 
662  // Same name?
663  if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ) )
664  continue;
665 
666  // Same electrical type?
667  if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ) )
668  continue;
669 
670  // Same orientation?
671  if( aTestOrientation
672  && ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ) )
673  continue;
674 
675  // Same length?
676  if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ) )
677  continue;
678 
679  foundMatch = true;
680  }
681 
682  if( !foundMatch )
683  {
684  // This means there was not an identical (according to the arguments)
685  // pin at the same position in the other component.
686  return true;
687  }
688  }
689 
690  // The loop never gave up, so no conflicts were found.
691  return false;
692 }
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.

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 442 of file class_libentry.cpp.

444 {
445  wxASSERT( aPlotter != NULL );
446 
447  aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
448  bool fill = aPlotter->GetColorMode();
449 
450  // draw background for filled items using background option
451  // Solid lines will be drawn after the background
452  for( LIB_ITEM& item : m_drawings )
453  {
454  // Lib Fields are not plotted here, because this plot function
455  // is used to plot schematic items, which have they own fields
456  if( item.Type() == LIB_FIELD_T )
457  continue;
458 
459  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
460  continue;
461 
462  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
463  continue;
464 
465  if( item.m_Fill == FILLED_WITH_BG_BODYCOLOR )
466  item.Plot( aPlotter, aOffset, fill, aTransform );
467  }
468 
469  // Not filled items and filled shapes are now plotted
470  // Items that have BG fills only get re-stroked to ensure the edges are in the foreground
471  for( LIB_ITEM& item : m_drawings )
472  {
473  if( item.Type() == LIB_FIELD_T )
474  continue;
475 
476  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
477  continue;
478 
479  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
480  continue;
481 
482  item.Plot( aPlotter, aOffset, fill && ( item.m_Fill != FILLED_WITH_BG_BODYCOLOR ),
483  aTransform );
484  }
485 }
virtual void SetColor(COLOR4D color)=0
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:167
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
bool GetColorMode() const
Definition: plotter.h:131

References FILLED_WITH_BG_BODYCOLOR, PLOTTER::GetColorMode(), GetLayerColor(), LAYER_DEVICE, LIB_FIELD_T, m_drawings, and PLOTTER::SetColor().

Referenced by LIB_EDIT_FRAME::SVG_PlotComponent().

◆ 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 488 of file class_libentry.cpp.

490 {
491  wxASSERT( aPlotter != NULL );
492 
493  aPlotter->SetColor( GetLayerColor( LAYER_FIELDS ) );
494  bool fill = aPlotter->GetColorMode();
495 
496  for( LIB_ITEM& item : m_drawings )
497  {
498  if( item.Type() != LIB_FIELD_T )
499  continue;
500 
501  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
502  continue;
503 
504  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
505  continue;
506 
507  LIB_FIELD& field = (LIB_FIELD&) item;
508 
509  // The reference is a special case: we should change the basic text
510  // to add '?' and the part id
511  wxString tmp = field.GetShownText();
512 
513  if( field.GetId() == REFERENCE )
514  {
515  wxString text = field.GetFullText( aUnit );
516  field.SetText( text );
517  }
518 
519  item.Plot( aPlotter, aOffset, fill, aTransform );
520  field.SetText( tmp );
521  }
522 }
virtual void SetColor(COLOR4D color)=0
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
int GetId() const
Definition: lib_field.h:135
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:167
Field Reference of part, i.e. "IC21".
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:126
wxString GetFullText(int unit=1) const
Return the text of a field.
Definition: lib_field.cpp:300
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:129
bool GetColorMode() const
Definition: plotter.h:131

References PLOTTER::GetColorMode(), LIB_FIELD::GetFullText(), LIB_FIELD::GetId(), GetLayerColor(), EDA_TEXT::GetShownText(), LAYER_FIELDS, LIB_FIELD_T, m_drawings, REFERENCE, PLOTTER::SetColor(), and EDA_TEXT::SetText().

Referenced by LIB_EDIT_FRAME::SVG_PlotComponent().

◆ Print()

void LIB_PART::Print ( wxDC *  aDc,
const wxPoint &  aOffset,
int  aMulti,
int  aConvert,
const PART_DRAW_OPTIONS aOpts 
)

Print part.

Parameters
aDc- Device context to draw on.
aOffset- Position of part.
aMulti- unit if multiple units per part.
aConvert- Component conversion (DeMorgan) if available.
aOpts- Drawing options

Definition at line 375 of file class_libentry.cpp.

377 {
378  /* draw background for filled items using background option
379  * Solid lines will be drawn after the background
380  * Note also, background is not drawn when printing in black and white
381  */
382  if( !GetGRForceBlackPenState() )
383  {
384  for( LIB_ITEM& drawItem : m_drawings )
385  {
386  if( drawItem.m_Fill != FILLED_WITH_BG_BODYCOLOR )
387  continue;
388 
389  // Do not draw items not attached to the current part
390  if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
391  continue;
392 
393  if( aConvert && drawItem.m_Convert && ( drawItem.m_Convert != aConvert ) )
394  continue;
395 
396  if( drawItem.Type() == LIB_FIELD_T )
397  continue;
398 
399  // Now, draw only the background for items with
400  // m_Fill == FILLED_WITH_BG_BODYCOLOR:
401  drawItem.Print( aDc, aOffset, (void*) false, aOpts.transform );
402  }
403  }
404 
405  for( LIB_ITEM& drawItem : m_drawings )
406  {
407  // Do not draw items not attached to the current part
408  if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
409  continue;
410 
411  if( aConvert && drawItem.m_Convert && ( drawItem.m_Convert != aConvert ) )
412  continue;
413 
414  if( drawItem.Type() == LIB_FIELD_T )
415  {
416  LIB_FIELD& field = static_cast<LIB_FIELD&>( drawItem );
417 
418  if( field.IsVisible() && !aOpts.draw_visible_fields )
419  continue;
420 
421  if( !field.IsVisible() && !aOpts.draw_hidden_fields )
422  continue;
423  }
424 
425  if( drawItem.Type() == LIB_PIN_T )
426  {
427  drawItem.Print( aDc, aOffset, (void*) &aOpts, aOpts.transform );
428  }
429  else if( drawItem.Type() == LIB_FIELD_T )
430  {
431  drawItem.Print( aDc, aOffset, (void*) NULL, aOpts.transform );
432  }
433  else
434  {
435  bool forceNoFill = drawItem.m_Fill == FILLED_WITH_BG_BODYCOLOR;
436  drawItem.Print( aDc, aOffset, (void*) forceNoFill, aOpts.transform );
437  }
438  }
439 }
bool IsVisible() const
Definition: eda_text.h:170
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
bool draw_hidden_fields
Whether to draw "hidden" fields.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
bool draw_visible_fields
Whether to draw "visible" fields.
bool GetGRForceBlackPenState(void)
Function GetGRForceBlackPenState.
Definition: gr_basic.cpp:210
TRANSFORM transform
Coordinate adjustment settings.

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, and PART_DRAW_OPTIONS::transform.

Referenced by SCH_COMPONENT::Print(), and LIB_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 525 of file class_libentry.cpp.

526 {
527  wxASSERT( aItem != NULL );
528 
529  // none of the MANDATORY_FIELDS may be removed in RAM, but they may be
530  // omitted when saving to disk.
531  if( aItem->Type() == LIB_FIELD_T )
532  {
533  LIB_FIELD* field = (LIB_FIELD*) aItem;
534 
535  if( field->GetId() < MANDATORY_FIELDS )
536  {
537  wxLogWarning( _(
538  "An attempt was made to remove the %s field from component %s in library %s." ),
539  GetChars( field->GetName() ), GetChars( GetName() ),
540  GetChars( GetLibraryName() ) );
541  return;
542  }
543  }
544 
545  LIB_ITEMS& items = m_drawings[ aItem->Type() ];
546 
547  for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
548  {
549  if( *i == aItem )
550  {
551  items.erase( i );
552  SetModified();
553  break;
554  }
555  }
556 }
wxString GetName(bool aTranslate=true) const
Returns the field name.
Definition: lib_field.cpp:366
void SetModified()
Definition: base_struct.cpp:98
wxString GetName() const override
const wxString GetLibraryName() const
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
int GetId() const
Definition: lib_field.h:135
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
#define _(s)
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:174
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101
size_t i
Definition: json11.cpp:649
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210

References _, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::erase(), GetChars(), LIB_FIELD::GetId(), GetLibraryName(), LIB_FIELD::GetName(), GetName(), i, LIB_FIELD_T, m_drawings, MANDATORY_FIELDS, EDA_ITEM::SetModified(), and EDA_ITEM::Type().

Referenced by LIB_EDIT_TOOL::DoDelete(), LIB_PIN::SetConversion(), LIB_PIN::SetPartNumber(), and DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow().

◆ RemoveDuplicateDrawItems()

void LIB_PART::RemoveDuplicateDrawItems ( )

Remove duplicate draw items from list.

Definition at line 876 of file class_libentry.cpp.

877 {
878  m_drawings.unique();
879 }
void unique()
Remove duplicate elements in list.
Definition: multivector.h:238
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.

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

Referenced by LIB_EDIT_FRAME::LoadOneSymbol().

◆ Replace() [1/2]

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

Helper function used in search and replace dialog Function Replace performs 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 183 of file base_struct.cpp.

184 {
185  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
186 
187  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
188  aSearchData.GetFindString() :
189  aSearchData.GetFindString().Upper() );
190 
191  if( result == wxNOT_FOUND )
192  return false;
193 
194  wxString prefix = aText.Left( result );
195  wxString suffix;
196 
197  if( aSearchData.GetFindString().length() + result < aText.length() )
198  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
199 
200  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
201  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
202  GetChars( suffix ) );
203 
204  aText = prefix + aSearchData.GetReplaceString() + suffix;
205 
206  return true;
207 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101

References GetChars(), and traceFindReplace.

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

◆ Replace() [2/2]

virtual bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
void *  aAuxData = NULL 
)
inlinevirtualinherited

Function Replace performs 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_SHEET, SCH_FIELD, SCH_SHEET_PIN, and SCH_TEXT.

Definition at line 544 of file base_struct.h.

544 { return false; }

◆ SetBack()

void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 224 of file base_struct.h.

224 { Pback = aBack; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:177

References EDA_ITEM::Pback.

Referenced by DHEAD::append(), DHEAD::insert(), SCH_EDIT_FRAME::PutDataInPreviousState(), and DHEAD::remove().

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 241 of file base_struct.h.

241 { SetFlags( BRIGHTENED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:265
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:143

References BRIGHTENED, and EDA_ITEM::SetFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ SetConversion()

void LIB_PART::SetConversion ( bool  aSetConvert)

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.

Definition at line 1028 of file class_libentry.cpp.

1029 {
1030  if( aSetConvert == HasConversion() )
1031  return;
1032 
1033  // Duplicate items to create the converted shape
1034  if( aSetConvert )
1035  {
1036  std::vector< LIB_ITEM* > tmp; // Temporarily store the duplicated pins here.
1037 
1038  for( LIB_ITEM& item : m_drawings )
1039  {
1040  // Only pins are duplicated.
1041  if( item.Type() != LIB_PIN_T )
1042  continue;
1043 
1044  if( item.m_Convert == 1 )
1045  {
1046  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1047  newItem->m_Convert = 2;
1048  tmp.push_back( newItem );
1049  }
1050  }
1051 
1052  // Transfer the new pins to the LIB_PART.
1053  for( unsigned i = 0; i < tmp.size(); i++ )
1054  m_drawings.push_back( tmp[i] );
1055  }
1056  else
1057  {
1058  // Delete converted shape items because the converted shape does
1059  // not exist
1061 
1062  while( i != m_drawings.end() )
1063  {
1064  if( i->m_Convert > 1 )
1065  i = m_drawings.erase( i );
1066  else
1067  ++i;
1068  }
1069  }
1070 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:189
void push_back(T *aItem)
Definition: multivector.h:169
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:174
ITERATOR_BASE< LIB_ITEM, MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
The non-const iterator
Definition: multivector.h:160
size_t i
Definition: json11.cpp:649
int m_Convert
Shape identification for alternate body styles.
Definition: lib_item.h:88

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(), i, LIB_PIN_T, LIB_ITEM::m_Convert, m_drawings, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back().

Referenced by LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetDescription()

void LIB_PART::SetDescription ( const wxString &  aDescription)
inline

Definition at line 154 of file class_libentry.h.

155  {
156  m_description = aDescription;
157  }
wxString m_description
documentation for info

References m_description.

Referenced by SCH_LEGACY_PLUGIN_CACHE::loadDocs(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetDocFileName()

void LIB_PART::SetDocFileName ( const wxString &  aDocFileName)
inline

Definition at line 168 of file class_libentry.h.

169  {
170  m_docFileName = aDocFileName;
171  }
wxString m_docFileName
Associate doc file name.

References m_docFileName.

Referenced by SCH_LEGACY_PLUGIN_CACHE::loadDocs(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ 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 773 of file class_libentry.cpp.

774 {
775  deleteAllFields();
776 
777  for( unsigned i=0; i<aFields.size(); ++i )
778  {
779  // drawings is a ptr_vector, new and copy an object on the heap.
780  LIB_FIELD* field = new LIB_FIELD( aFields[i] );
781 
782  field->SetParent( this );
783  m_drawings.push_back( field );
784  }
785 }
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
void deleteAllFields()
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:225
void push_back(T *aItem)
Definition: multivector.h:169
size_t i
Definition: json11.cpp:649

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

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 265 of file base_struct.h.

265 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddModuleToBoard(), PCBNEW_CONTROL::AppendBoard(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::ConvertTextType(), SCH_EDIT_FRAME::CreateNewText(), LIB_PIN_TOOL::CreatePin(), SCH_EDIT_FRAME::CreateSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), LIB_DRAWING_TOOLS::DrawShape(), SCH_EDIT_TOOL::Duplicate(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_VIEW::HighlightItem(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), TRACKS_CLEANER::mergeCollinearSegments(), SCH_MOVE_TOOL::moveItem(), LIB_MOVE_TOOL::moveItem(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), WS_DATA_ITEM::SyncDrawItems(), WS_DATA_ITEM_TEXT::SyncDrawItems(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetFootprintFilters()

void LIB_PART::SetFootprintFilters ( const wxArrayString &  aFootprintFilters)
inline

Definition at line 191 of file class_libentry.h.

192  {
193  m_FootprintList = aFootprintFilters;
194  }
wxArrayString m_FootprintList
List of suitable footprint names for the part (wild card names accepted).

References m_FootprintList.

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Function SetForceVisible is used to set and cleag 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 316 of file base_struct.h.

316 { m_forceVisible = aEnable; }
bool m_forceVisible
Set to true to override the visibility setting of the item.
Definition: base_struct.h:184

References EDA_ITEM::m_forceVisible.

◆ SetHighlighted()

void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 240 of file base_struct.h.

240 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:265
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:142

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

◆ SetKeyWords()

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

Definition at line 161 of file class_libentry.h.

162  {
163  m_keyWords = aKeyWords;
164  }
wxString m_keyWords
keyword list (used for search for parts by keyword)

References m_keyWords.

Referenced by SCH_LEGACY_PLUGIN_CACHE::loadDocs(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetLib()

void LIB_PART::SetLib ( PART_LIB aLibrary)
inline

Definition at line 186 of file class_libentry.h.

186 { m_library = aLibrary; }
PART_LIB * m_library
Library the part belongs to if any.

References m_library.

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

◆ SetLibId()

◆ SetList()

void EDA_ITEM::SetList ( DHEAD aList)
inlineinherited

Definition at line 226 of file base_struct.h.

226 { m_List = aList; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:178

References EDA_ITEM::m_List.

Referenced by DHEAD::append(), DHEAD::insert(), and DHEAD::remove().

◆ SetModified()

◆ SetName()

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

Definition at line 254 of file class_libentry.cpp.

255 {
256  wxString validatedName = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
257 
258  m_name = validatedName;
259  m_libId.SetLibItemName( validatedName, false );
260 
261  GetValueField().SetText( validatedName );
262 }
LIB_FIELD & GetValueField()
Return reference to the value field.
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:126
wxString m_name
Symbol name.
LIB_ID m_libId
int SetLibItemName(const UTF8 &aLibItemName, bool aTestForRev=true)
Override the library item name portion of the LIB_ID to aLibItemName.
Definition: lib_id.cpp:206
static UTF8 FixIllegalChars(const UTF8 &aLibItemName, LIB_ID_TYPE aType, bool aLib=false)
Replace illegal LIB_ID item name characters with underscores '_'.
Definition: lib_id.cpp:352

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

Referenced by SCH_EDIT_FRAME::CreateArchiveLibrary(), LIB_EDIT_TOOL::editFieldProperties(), LIB_EDIT_FRAME::fixDuplicateAliases(), LIB_PART(), RESCUE_CACHE_CANDIDATE::PerformAction(), RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction(), LIB_EDIT_FRAME::savePartAs(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow(), LIB_EDIT_FRAME::UpdateAfterSymbolProperties(), DIALOG_LIB_EDIT_ONE_FIELD::UpdateField(), and LIB_MANAGER::UpdatePartAfterRename().

◆ SetNext()

void EDA_ITEM::SetNext ( EDA_ITEM aNext)
inlineinherited

Definition at line 223 of file base_struct.h.

223 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:176

References EDA_ITEM::Pnext.

Referenced by DHEAD::append(), DHEAD::insert(), SCH_EDIT_FRAME::PutDataInPreviousState(), and DHEAD::remove().

◆ SetNormal()

void LIB_PART::SetNormal ( )
inline

Definition at line 231 of file class_libentry.h.

231 { m_options = ENTRY_NORMAL; }
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)

References ENTRY_NORMAL, and m_options.

Referenced by LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetOffset()

void LIB_PART::SetOffset ( const wxPoint &  aOffset)

Move the part aOffset.

Parameters
aOffset- Offset displacement.

Definition at line 869 of file class_libentry.cpp.

870 {
871  for( LIB_ITEM& item : m_drawings )
872  item.Offset( aOffset );
873 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References m_drawings.

Referenced by LIB_DRAWING_TOOLS::PlaceAnchor().

◆ SetParent() [1/2]

void LIB_PART::SetParent ( LIB_PART aParent = nullptr)

Definition at line 265 of file class_libentry.cpp.

266 {
267  if( aParent )
268  {
269  m_parent = aParent->SharedPtr();
270 
271  // Inherit the parent mandatory field attributes.
272  for( int id=0; id<MANDATORY_FIELDS; ++id )
273  {
274  LIB_FIELD* field = GetField( id );
275 
276  // the MANDATORY_FIELDS are exactly that in RAM.
277  wxASSERT( field );
278 
279  LIB_FIELD* parentField = aParent->GetField( id );
280 
281  wxASSERT( parentField );
282 
283  wxString name = field->GetText();
284 
285  *field = *parentField;
286 
287  if( id == VALUE )
288  field->SetText( name );
289  else if( id == DATASHEET && !GetDocFileName().IsEmpty() )
290  field->SetText( GetDocFileName() );
291 
292  field->SetParent( this );
293  }
294  }
295  else
296  {
297  m_parent.reset();
298  }
299 }
name of datasheet
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
Field object used in symbol libraries.
Definition: lib_field.h:59
PART_REF m_parent
Use for inherited symbols.
#define VALUE
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:126
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:225
PART_SPTR SharedPtr()
wxString GetDocFileName() const
const char * name
Definition: DXF_plotter.cpp:61
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.
virtual const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:124

References DATASHEET, GetDocFileName(), GetField(), EDA_TEXT::GetText(), m_parent, MANDATORY_FIELDS, name, EDA_ITEM::SetParent(), EDA_TEXT::SetText(), SharedPtr(), and VALUE.

Referenced by LIB_EDIT_FRAME::CreateNewPart(), LIB_EDIT_FRAME::DuplicatePart(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), LIB_PART(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), LIB_MANAGER::LIB_BUFFER::SaveBuffer(), LIB_MANAGER::SaveLibrary(), and LIB_MANAGER::UpdatePart().

◆ SetParent() [2/2]

◆ 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 542 of file class_libentry.h.

542 { m_pinNameOffset = aOffset; }
int m_pinNameOffset
The offset in mils to draw the pin name.

References m_pinNameOffset.

Referenced by LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetPower()

void LIB_PART::SetPower ( )
inline

Definition at line 230 of file class_libentry.h.

230 { m_options = ENTRY_POWER; }
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)

References ENTRY_POWER, and m_options.

Referenced by LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetSelected()

void EDA_ITEM::SetSelected ( )
inlineinherited

◆ SetShowPinNames()

void LIB_PART::SetShowPinNames ( bool  aShow)
inline

Set or clear the pin name visibility flag.

Parameters
aShow- True to make the part pin names visible.

Definition at line 550 of file class_libentry.h.

550 { m_showPinNames = aShow; }
bool m_showPinNames
Determines if part pin names are visible.

References m_showPinNames.

Referenced by LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetShowPinNumbers()

void LIB_PART::SetShowPinNumbers ( bool  aShow)
inline

Set or clear the pin number visibility flag.

Parameters
aShow- True to make the part pin numbers visible.

Definition at line 558 of file class_libentry.h.

558 { m_showPinNumbers = aShow; }
bool m_showPinNumbers
Determines if part pin numbers are visible.

References m_showPinNumbers.

Referenced by LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetState()

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

Definition at line 254 of file base_struct.h.

255  {
256  if( state )
257  m_Status |= type; // state = ON or OFF
258  else
259  m_Status &= ~type;
260  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by LEGACY_PLUGIN::loadTrackList(), TRACKS_CLEANER::mergeCollinearSegments(), SELECTION_TOOL::selectConnectedTracks(), and TRACK::SetLocked().

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 263 of file base_struct.h.

263 { m_Status = aStatus; }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

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 1073 of file class_libentry.cpp.

1074 {
1075  m_subpartFirstId = 'A';
1077 
1078  if( aSep == '.' || aSep == '-' || aSep == '_' )
1079  m_subpartIdSeparator = aSep;
1080 
1081  if( aFirstId == '1' && aSep != 0 )
1082  m_subpartFirstId = aFirstId;
1083 }
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the part number: only 'A',...

References m_subpartFirstId, and m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::LoadProjectFile(), and PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow().

◆ SetTimeStamp()

void EDA_ITEM::SetTimeStamp ( timestamp_t  aNewTimeStamp)
inlineinherited

Definition at line 215 of file base_struct.h.

215 { m_TimeStamp = aNewTimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:181

References EDA_ITEM::m_TimeStamp.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_FRAME::AddModuleToBoard(), BOARD_NETLIST_UPDATER::addNewComponent(), PCAD2KICAD::PCB_TEXT::AddToBoard(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_ARC::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), PCAD2KICAD::PCB_MODULE::AddToBoard(), Diagnose(), SCH_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::FootprintSave(), EDA_ITEM::initVars(), BOARD::InsertArea(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), SCH_EDIT_FRAME::LoadSheetFromFile(), EAGLE_PLUGIN::loadSignals(), LEGACY_PLUGIN::loadTrackList(), EDA_ITEM::operator=(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageText(), PCB_PARSER::parseDIMENSION(), SCH_EDITOR_CONTROL::Paste(), PCB_EDITOR_CONTROL::PlaceModule(), SCH_EDIT_TOOL::RepeatDrawItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET::SCH_SHEET(), SCH_COMPONENT::SetTimeStamp(), SimilarLabelsDiagnose(), SwapItemData(), TestDuplicateSheetNames(), DIALOG_ERC::TestErc(), and TestMultiunitFootprints().

◆ SetUnitCount()

void LIB_PART::SetUnitCount ( int  count)

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
count- Number of units per package.

Definition at line 972 of file class_libentry.cpp.

973 {
974  if( m_unitCount == aCount )
975  return;
976 
977  if( aCount < m_unitCount )
978  {
980 
981  while( i != m_drawings.end() )
982  {
983  if( i->m_Unit > aCount )
984  i = m_drawings.erase( i );
985  else
986  ++i;
987  }
988  }
989  else
990  {
991  int prevCount = m_unitCount;
992 
993  // Temporary storage for new items, as adding new items directly to
994  // m_drawings may cause the buffer reallocation which invalidates the
995  // iterators
996  std::vector< LIB_ITEM* > tmp;
997 
998  for( LIB_ITEM& item : m_drawings )
999  {
1000  if( item.m_Unit != 1 )
1001  continue;
1002 
1003  for( int j = prevCount + 1; j <= aCount; j++ )
1004  {
1005  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1006  newItem->m_Unit = j;
1007  tmp.push_back( newItem );
1008  }
1009  }
1010 
1011  for( auto item : tmp )
1012  m_drawings.push_back( item );
1013  }
1014 
1015  m_unitCount = aCount;
1016 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
int m_unitCount
Number of units (parts) per package.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
int m_Unit
Unit identification for multiple parts per package.
Definition: lib_item.h:82
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:189
void push_back(T *aItem)
Definition: multivector.h:169
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:174
ITERATOR_BASE< LIB_ITEM, MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
The non-const iterator
Definition: multivector.h:160
size_t i
Definition: json11.cpp:649

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(), i, m_drawings, LIB_ITEM::m_Unit, m_unitCount, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back().

Referenced by LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 238 of file base_struct.h.

238 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:265
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:124

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ SharedPtr()

PART_SPTR LIB_PART::SharedPtr ( )
inline

Definition at line 136 of file class_libentry.h.

136 { return m_me; }
PART_SPTR m_me
< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared

References m_me.

Referenced by PART_LIB::AddPart(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), LIB_VIEW_FRAME::GetDocumentExtents(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), FOOTPRINT_INFO_GENERATOR::SetHtmlAliasOf(), and SetParent().

◆ ShowPinNames()

bool LIB_PART::ShowPinNames ( )
inline

◆ ShowPinNumbers()

bool LIB_PART::ShowPinNumbers ( )
inline

◆ Sort()

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

Function Sort is a 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 575 of file base_struct.h.

575 { 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 508 of file class_libentry.h.

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

References m_subpartFirstId.

Referenced by SCH_EDIT_FRAME::GetProjectFileParameters().

◆ SubpartIdSeparatorPtr()

static int* LIB_PART::SubpartIdSeparatorPtr ( )
inlinestatic

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

Definition at line 503 of file class_libentry.h.

503 { return &m_subpartIdSeparator; }
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...

References m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::GetProjectFileParameters().

◆ 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 343 of file class_libentry.cpp.

344 {
345  wxString subRef;
346 
347  if( m_subpartIdSeparator != 0 && aAddSeparator )
348  subRef << wxChar( m_subpartIdSeparator );
349 
350  if( m_subpartFirstId >= '0' && m_subpartFirstId <= '9' )
351  subRef << aUnit;
352  else
353  {
354  // use letters as notation. To allow more than 26 units, the sub ref
355  // use one letter if letter = A .. Z or a ... z, and 2 letters otherwise
356  // first letter is expected to be 'A' or 'a' (i.e. 26 letters are available)
357  int u;
358  aUnit -= 1; // Unit number starts to 1. now to 0.
359 
360  while( aUnit >= 26 ) // more than one letter are needed
361  {
362  u = aUnit / 26;
363  subRef << wxChar( m_subpartFirstId + u -1 );
364  aUnit %= 26;
365  }
366 
367  u = m_subpartFirstId + aUnit;
368  subRef << wxChar( u );
369  }
370 
371  return subRef;
372 }
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the part number: only 'A',...

References m_subpartFirstId, and m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), SCH_REFERENCE_LIST::CheckAnnotation(), LIB_FIELD::GetFullText(), SCH_FIELD::GetFullyQualifiedText(), GetUnitReference(), SCH_FIELD::Matches(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnBrowseLibrary(), LIB_EDIT_FRAME::RebuildSymbolUnitsList(), TestMultiunitFootprints(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), and SYMBOL_UNIT_MENU::update().

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Function Type()

returns the type of object. This attribute should never be changed after a constructor sets it, so there is no public "setter" method.

Returns
KICAD_T - the type of object.

Definition at line 210 of file base_struct.h.

211  {
212  return m_StructType;
213  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:172

References EDA_ITEM::m_StructType.

Referenced by MODULE::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), 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(), CONNECTION_GRAPH::buildConnectionGraph(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), calcArea(), calcMaxArea(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_NO_CONNECT::ClassOf(), TEXTE_PCB::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), SCH_PIN::ClassOf(), EDGE_MODULE::ClassOf(), PCB_TARGET::ClassOf(), SCH_LINE::ClassOf(), SCH_FIELD::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), MARKER_PCB::ClassOf(), TRACK::ClassOf(), SCH_BITMAP::ClassOf(), ZONE_CONTAINER::ClassOf(), DIMENSION::ClassOf(), NETINFO_ITEM::ClassOf(), SCH_SHEET_PIN::ClassOf(), SCH_TEXT::ClassOf(), SCH_SCREEN::ClassOf(), MODULE::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_COMPONENT::ClassOf(), D_PAD::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), BOARD::ClassOf(), SCH_LABEL::ClassOf(), SCH_SHEET::ClassOf(), SCH_GLOBALLABEL::ClassOf(), VIA::ClassOf(), SCH_HIERLABEL::ClassOf(), TRACKS_CLEANER::cleanupSegments(), SCH_SHEET::CleanupSheet(), EE_COLLECTOR::Collect(), LIB_RECTANGLE::compare(), LIB_CIRCLE::compare(), LIB_BEZIER::compare(), LIB_TEXT::compare(), LIB_POLYLINE::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), SCH_SHEET::ComponentCount(), GRID_HELPER::computeAnchors(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), SCH_EDIT_FRAME::ConvertTextType(), SCH_SCREEN::CountConnectedItems(), SCH_SHEET::CountSheets(), MODULE::CoverageRatio(), CINFO3D_VISU::createLayers(), SCH_EDIT_FRAME::CreateNewText(), CINFO3D_VISU::createNewTrack(), D_PAD::D_PAD(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_ERC::DisplayERC_MarkersList(), 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(), DRC::doTrackDrc(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), CN_ITEM::Dump(), SCH_ITEM::Duplicate(), BOARD::Duplicate(), MODULE::Duplicate(), SCH_EDIT_TOOL::EditField(), LIB_EDIT_TOOL::editTextProperties(), EditToolSelectionFilter(), CONNECTION_GRAPH::ercCheckLabels(), SCH_EDITOR_CONTROL::FindComponentAndItem(), NETLIST_EXPORTER::findNextComponent(), NETLIST_EXPORTER::findNextComponentAndCreatePinList(), SCH_SHEET_PATH::FindNextItem(), SCH_SHEET_LIST::FindNextItem(), SCH_SHEET_PATH::FindPreviousItem(), SCH_SHEET_LIST::FindPreviousItem(), EDIT_TOOL::FootprintFilter(), SCH_LEGACY_PLUGIN::Format(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), NETLIST_OBJECT::GetComponentParent(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_TEXT::GetEndPoints(), SCH_SHEET::GetEndPoints(), SCH_SCREEN::GetHierarchicalItems(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_SCREENS::GetLibNicknames(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), CONNECTION_SUBGRAPH::GetNameForDriver(), CONNECTIVITY_DATA::GetNetItems(), GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), SCH_SCREEN::GetPin(), GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), getRect(), KIGFX::SCH_PAINTER::getRenderColor(), PCBNEW_SELECTION::GetTopLeftItem(), SELECTION_TOOL::GuessSelectionCandidates(), EE_SELECTION_TOOL::GuessSelectionCandidates(), hash_eda(), SCH_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), KIGFX::SCH_VIEW::HighlightItem(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), TRACK::IsNull(), SCH_LINE::IsParallel(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), SCH_SHEET::LocatePathOfScreen(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), SCH_MOVE_TOOL::moveItem(), SCH_CONNECTION::Name(), nextMatch(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), POINT_EDITOR::OnSelectionChange(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), LIB_ITEM::operator==(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SELECTION_TOOL::RebuildSelection(), EE_SELECTION_TOOL::RebuildSelection(), SCH_BASE_FRAME::RefreshItem(), SCH_BASE_FRAME::RefreshSelection(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), CN_CONNECTIVITY_ALGO::Remove(), BOARD::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_SCREEN::ReplaceWires(), CONNECTION_SUBGRAPH::ResolveDrivers(), WS_PROXY_UNDO_ITEM::Restore(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), SCH_TEXT::Rotate(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_EDIT_FRAME::SaveUndoItemInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), SELECTION_TOOL::selectConnectedTracks(), ITEM_PICKER::SetItem(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), ShowClearance(), BOARD_COMMIT::Stage(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_SHEET_PIN::SwapData(), TEXTE_PCB::SwapData(), SCH_FIELD::SwapData(), TRACK::SwapData(), DIMENSION::SwapData(), VIA::SwapData(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), MODULE::SwapData(), ZONE_CONTAINER::SwapData(), D_PAD::SwapData(), SwapItemData(), TestDuplicateSheetNames(), TEXTE_MODULE::TEXTE_MODULE(), AR_MATRIX::TraceSegmentPcb(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), LIB_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), SCH_SHEET_PATH::UpdateAllScreenReferences(), SCH_TEXT::UpdateDanglingState(), EE_POINT_EDITOR::updateItem(), PL_POINT_EDITOR::updateItem(), POINT_EDITOR::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), SCH_SHEET::Visit(), SCH_COMPONENT::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ UnitsLocked()

bool LIB_PART::UnitsLocked ( ) const
inline

Check whether part units are interchangeable.

Returns
False when interchangeable, true otherwise.

Definition at line 243 of file class_libentry.h.

243 { return m_unitsLocked; }
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.

References m_unitsLocked.

Referenced by LIB_EDIT_TOOL::editSymbolProperties(), SCH_REFERENCE::IsUnitsLocked(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), LIB_EDIT_FRAME::LoadPart(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), LIB_EDIT_FRAME::SetCurPart(), LIB_EDIT_FRAME::SynchronizePins(), LIB_EDIT_FRAME::SyncToolbars(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

Function ViewBBox() returns the bounding box of the item covering all its layers.

Returns
BOX2I - the current bounding box

Implements KIGFX::VIEW_ITEM.

Reimplemented in D_PAD, MODULE, EDIT_POINTS, GERBER_DRAW_ITEM, DRAWSEGMENT, DIMENSION, TRACK, TEXTE_MODULE, MARKER_PCB, KIGFX::WS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::POLYGON_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, BRIGHT_BOX, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 236 of file base_struct.cpp.

237 {
238  // Basic fallback
239  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
240  VECTOR2I( GetBoundingBox().GetSize() ) );
241 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:520
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.

References EDA_ITEM::GetBoundingBox().

Referenced by GERBVIEW_FRAME::GetDocumentExtents(), BRIGHT_BOX::ViewBBox(), DIMENSION::ViewBBox(), DRAWSEGMENT::ViewBBox(), and BRIGHT_BOX::ViewDraw().

◆ ViewDraw()

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

Function ViewDraw() Draws the parts of the object belonging to layer aLayer.

viewDraw() is an alternative way for drawing objects if 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
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on

Reimplemented in EDIT_POINTS, KIGFX::WS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, KIGFX::VIEW_GROUP, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::VIEW_OVERLAY, KIGFX::ORIGIN_VIEWITEM, BRIGHT_BOX, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, and PCB_BRIGHT_BOX.

Definition at line 116 of file view_item.h.

117  {}

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

◆ ViewGetLayers()

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

Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.

For instance, a D_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[]output layer index array
aCountnumber of layer indices in aLayers[]

Reimplemented from EDA_ITEM.

Definition at line 725 of file class_libentry.cpp.

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

◆ ViewGetLOD()

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

Function ViewGetLOD() Returns 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
aLayercurrent drawing layer
aViewpointer 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 MODULE_ZONE_CONTAINER, D_PAD, MODULE, VIA, GERBER_DRAW_ITEM, TEXTE_MODULE, TRACK, and EDGE_MODULE.

Definition at line 140 of file view_item.h.

141  {
142  // By default always show the item
143  return 0;
144  }

Referenced by KIGFX::VIEW::drawItem::operator()(), GRID_HELPER::queryVisible(), and SELECTION_TOOL::Selectable().

◆ viewPrivData()

◆ Visit()

SEARCH_RESULT LIB_PART::Visit ( INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
overridevirtual

Function Visit 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 956 of file class_libentry.cpp.

957 {
958  // The part itself is never inspected, only its children
959  for( LIB_ITEM& item : m_drawings )
960  {
961  if( item.IsType( aFilterTypes ) )
962  {
963  if( aInspector( &item, aTestData ) == SEARCH_QUIT )
964  return SEARCH_QUIT;
965  }
966  }
967 
968  return SEARCH_CONTINUE;
969 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References m_drawings, SEARCH_CONTINUE, and SEARCH_QUIT.

Member Data Documentation

◆ m_dateLastEdition

timestamp_t LIB_PART::m_dateLastEdition
private

Date of the last modification.

Definition at line 105 of file class_libentry.h.

Referenced by GetDateLastEdition(), and LIB_PART().

◆ m_description

wxString LIB_PART::m_description
private

documentation for info

Definition at line 113 of file class_libentry.h.

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

◆ m_docFileName

wxString LIB_PART::m_docFileName
private

Associate doc file name.

Definition at line 115 of file class_libentry.h.

Referenced by Compare(), Flatten(), GetDocFileName(), LIB_PART(), and SetDocFileName().

◆ m_drawings

◆ m_Flags

◆ m_FootprintList

wxArrayString LIB_PART::m_FootprintList
private

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

Definition at line 109 of file class_libentry.h.

Referenced by Compare(), GetFootprints(), LIB_PART(), and SetFootprintFilters().

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

Set to true to override the visibility setting of the item.

Definition at line 184 of file base_struct.h.

Referenced by EDA_ITEM::initVars(), EDA_ITEM::operator=(), SCH_FIELD::Print(), and EDA_ITEM::SetForceVisible().

◆ m_keyWords

wxString LIB_PART::m_keyWords
private

keyword list (used for search for parts by keyword)

Definition at line 114 of file class_libentry.h.

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

◆ m_libId

LIB_ID LIB_PART::m_libId
private

Definition at line 97 of file class_libentry.h.

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

◆ m_library

PART_LIB* LIB_PART::m_library
private

Library the part belongs to if any.

Definition at line 111 of file class_libentry.h.

Referenced by GetLib(), GetLibraryName(), LIB_PART(), and SetLib().

◆ m_List

DHEAD* EDA_ITEM::m_List
protectedinherited

which DLIST I am on.

Definition at line 178 of file base_struct.h.

Referenced by EDA_ITEM::GetList(), EDA_ITEM::initVars(), and EDA_ITEM::SetList().

◆ m_me

◆ m_name

wxString LIB_PART::m_name
private

Symbol name.

Definition at line 112 of file class_libentry.h.

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

◆ m_options

LIBRENTRYOPTIONS LIB_PART::m_options
private

Special part features such as POWER or NORMAL.)

Definition at line 106 of file class_libentry.h.

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

◆ m_parent

PART_REF LIB_PART::m_parent
private

Use for inherited symbols.

Definition at line 95 of file class_libentry.h.

Referenced by Compare(), Flatten(), GetParent(), GetUnitCount(), HasConversion(), IsRoot(), LIB_PART(), and SetParent().

◆ 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 99 of file class_libentry.h.

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

◆ m_showPinNames

bool LIB_PART::m_showPinNames
private

Determines if part pin names are visible.

Definition at line 103 of file class_libentry.h.

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

◆ m_showPinNumbers

bool LIB_PART::m_showPinNumbers
private

Determines if part pin numbers are visible.

Definition at line 104 of file class_libentry.h.

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

◆ 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 120 of file class_libentry.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 117 of file class_libentry.h.

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

◆ m_TimeStamp

timestamp_t EDA_ITEM::m_TimeStamp
protectedinherited

◆ m_unitCount

int LIB_PART::m_unitCount
private

Number of units (parts) per package.

Definition at line 107 of file class_libentry.h.

Referenced by Compare(), GetBodyBoundingBox(), GetUnitBoundingBox(), GetUnitCount(), IsMulti(), LIB_PART(), 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 101 of file class_libentry.h.

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

◆ Pback

EDA_ITEM* EDA_ITEM::Pback
protectedinherited

◆ Pnext


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