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 KIGFX::VIEW_ITEM

Public Member Functions

 LIB_PART (const wxString &aName, PART_LIB *aLibrary=NULL)
 
 LIB_PART (LIB_PART &aPart, PART_LIB *aLibrary=NULL)
 
virtual ~LIB_PART ()
 
PART_SPTR SharedPtr ()
 
virtual wxString GetClass () const override
 Function GetClass returns the class name. More...
 
virtual void SetName (const wxString &aName)
 
const wxString & GetName () const
 
const LIB_IDGetLibId () const
 
void SetLibId (const LIB_ID &aLibId)
 
const wxString GetLibraryName ()
 
PART_LIBGetLib ()
 
void SetLib (PART_LIB *aLibrary)
 
wxArrayString GetAliasNames (bool aIncludeRoot=true) const
 
LIB_ALIASES GetAliases () const
 
size_t GetAliasCount () const
 
LIB_ALIASGetAlias (size_t aIndex)
 
LIB_ALIASGetAlias (const wxString &aName)
 
timestamp_t GetDateLastEdition () const
 
void AddAlias (const wxString &aName)
 Add an alias aName to the part. More...
 
void AddAlias (LIB_ALIAS *aAlias)
 
bool HasAlias (const wxString &aName) const
 Test if alias aName is in part alias list. More...
 
void RemoveAlias (const wxString &aName)
 
LIB_ALIASRemoveAlias (LIB_ALIAS *aAlias)
 
void RemoveAllAliases ()
 
wxArrayString & GetFootprints ()
 
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 SaveDateAndTime (OUTPUTFORMATTER &aFormatter)
 Write the date and time of part to aFile in the format: "Ti yy/mm/jj hh:mm:ss". More...
 
bool LoadDateAndTime (char *aLine)
 
bool Save (OUTPUTFORMATTER &aFormatter)
 Write the data structures out to aFormatter in the part library "*.lib" format. 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)
 Findd a field within this part matching aFieldName and returns it or NULL if not found. More...
 
LIB_FIELDGetField (int aId)
 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 Draw (EDA_DRAW_PANEL *aPanel, wxDC *aDc, const wxPoint &aOffset, int aMulti, int aConvert, const PART_DRAW_OPTIONS &aOpts)
 Draw 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, EDA_DRAW_PANEL *aPanel=NULL, wxDC *aDc=NULL)
 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 ClearStatus ()
 Clears the status flag all draw objects in this part. More...
 
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...
 
void SetUnitCount (int count)
 Set the units per part count. More...
 
int GetUnitCount () const
 
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 ()
 
bool operator== (const LIB_PART *aPart) const
 
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 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) const
 Function HitTest tests if aPosition is contained within or on the bounding area 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 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 its member data. 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, wxPoint *aFindLocation)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
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...
 
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...
 
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...
 
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...
 
LIB_ALIASES m_aliases
 List of alias object pointers associated with the part. More...
 
PART_LIBm_library
 Library the part belongs to if any. 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 246 of file class_libentry.h.

Constructor & Destructor Documentation

◆ LIB_PART() [1/2]

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

Definition at line 226 of file class_libentry.cpp.

226  :
227  EDA_ITEM( LIB_PART_T ),
228  m_me( this, null_deleter() )
229 {
230  m_dateLastEdition = 0;
231  m_unitCount = 1;
232  m_pinNameOffset = 40;
234  m_unitsLocked = false;
235  m_showPinNumbers = true;
236  m_showPinNames = true;
237 
238  // Add the MANDATORY_FIELDS in RAM only. These are assumed to be present
239  // when the field editors are invoked.
240  m_drawings[LIB_FIELD_T].reserve( 4 );
245 
246  SetLib( aLibrary );
247  SetName( aName );
248 }
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
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: base_struct.cpp:64
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(), and VALUE.

Referenced by LIB_EDIT_FRAME::TempCopyComponent().

◆ LIB_PART() [2/2]

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

Definition at line 251 of file class_libentry.cpp.

251  :
252  EDA_ITEM( aPart ),
253  m_me( this, null_deleter() )
254 {
255  LIB_ITEM* newItem;
256 
257  m_library = aLibrary;
259  m_unitCount = aPart.m_unitCount;
265  m_options = aPart.m_options;
266  m_libId = aPart.m_libId;
267 
268  for( LIB_ITEM& oldItem : aPart.m_drawings )
269  {
270  if( oldItem.IsNew() )
271  continue;
272 
273  newItem = (LIB_ITEM*) oldItem.Clone();
274  newItem->SetParent( this );
275  m_drawings.push_back( newItem );
276  }
277 
278  for( size_t i = 0; i < aPart.m_aliases.size(); i++ )
279  {
280  LIB_ALIAS* alias = new LIB_ALIAS( *aPart.m_aliases[i], this );
281  m_aliases.push_back( alias );
282  }
283 }
timestamp_t m_dateLastEdition
Date of the last modification.
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.
Part library alias object definition.
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.
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_draw_item.h:67
bool IsNew() const
Definition: base_struct.h:219
int m_pinNameOffset
The offset in mils to draw the pin name.
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:216
void push_back(T *aItem)
Definition: multivector.h:169
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:64
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
size_t i
Definition: json11.cpp:597
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 EDA_ITEM::Clone(), i, EDA_ITEM::IsNew(), m_aliases, m_dateLastEdition, m_drawings, m_FootprintList, m_libId, m_library, m_options, m_pinNameOffset, m_showPinNames, m_showPinNumbers, m_unitCount, m_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), and EDA_ITEM::SetParent().

◆ ~LIB_PART()

LIB_PART::~LIB_PART ( )
virtual

Definition at line 286 of file class_libentry.cpp.

287 {
288  wxLogTrace( traceSchLibMem,
289  wxT( "%s: destroying symbol with alias list count of %llu" ),
290  GetChars( wxString::FromAscii( __WXFUNCTION__ ) ),
291  (long long unsigned) m_aliases.size() );
292 
293  // If the part is being deleted directly rather than through the library,
294  // delete all of the aliases.
295  while( m_aliases.size() )
296  {
297  LIB_ALIAS* alias = m_aliases.back();
298  m_aliases.pop_back();
299  delete alias;
300  }
301 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.
Part library alias object definition.
const wxChar *const traceSchLibMem
Flag to enable schematic library memory deletion debug output.
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:92

References GetChars(), m_aliases, and traceSchLibMem.

Member Function Documentation

◆ AddAlias() [1/2]

void LIB_PART::AddAlias ( const wxString &  aName)

Add an alias aName to the part.

Duplicate alias names are not added to the alias list. Debug builds will raise an assertion. Release builds will fail silently.

Parameters
aName- Name of alias to add.

Definition at line 1247 of file class_libentry.cpp.

1248 {
1249  m_aliases.push_back( new LIB_ALIAS( aName, this ) );
1250 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.
Part library alias object definition.

References m_aliases.

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ AddAlias() [2/2]

void LIB_PART::AddAlias ( LIB_ALIAS aAlias)

Definition at line 1253 of file class_libentry.cpp.

1254 {
1255  m_aliases.push_back( aAlias );
1256 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.

References m_aliases.

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

628 {
629  wxASSERT( aItem != NULL );
630 
631  m_drawings.push_back( aItem );
632 }
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_EDIT_FRAME::CreateImagePins(), dummy(), KIGFX::dummy(), LIB_EDIT_FRAME::LoadOneSymbol(), LIB_EDIT_FRAME::pasteClipboard(), LIB_EDIT_FRAME::PlacePin(), and DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow().

◆ Back()

EDA_ITEM* EDA_ITEM::Back ( ) const
inlineinherited

Definition at line 210 of file base_struct.h.

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

References EDA_ITEM::Pback.

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

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 236 of file base_struct.h.

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

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), and SELECTION_TOOL::unhighlight().

◆ ClearFlags()

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

Definition at line 257 of file base_struct.h.

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

References EDA_ITEM::m_Flags.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_Move_Pad(), Abort_MoveOrCopyModule(), Abort_MoveTrack(), Abort_Zone_Create_Outline(), Abort_Zone_Move_Corner_Or_Outlines(), AbortMoveAndEditTarget(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), AbortPinMove(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_EDIT_FRAME::addCurrentItemToScreen(), PNS_KICAD_IFACE::AddItem(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), LIB_EDIT_FRAME::BlockCopySelectedItems(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_COMPONENT::ClearAllHighlightFlags(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearHighlighted(), ClearMarkItems(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), MWAVE::CreateMicrowaveInductor(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment_Edge(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::Exchange_Module(), ExitSheet(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), MarkItemsInBloc(), MirrorX(), MirrorY(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnOrient(), LIB_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_FIELD::Place(), PCB_EDIT_FRAME::Place_DrawItem(), FOOTPRINT_EDIT_FRAME::Place_EdgeMod(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_EDIT_FRAME::PlaceDimensionText(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlacePad(), PCB_EDIT_FRAME::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_BASE_FRAME::PlaceTexteModule(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), BOARD_COMMIT::Revert(), PCB_BASE_FRAME::Rotate_Module(), RotateListOfItems(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SetRepeatItem(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ ClearHighlighted()

void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 235 of file base_struct.h.

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

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

◆ ClearSelected()

void EDA_ITEM::ClearSelected ( )
inlineinherited

Definition at line 234 of file base_struct.h.

234 { ClearFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257

References EDA_ITEM::ClearFlags(), and SELECTED.

Referenced by POINT_EDITOR::addCorner(), EDIT_TOOL::Duplicate(), GAL_ARRAY_CREATOR::prePushAction(), SELECTION_TOOL::unhighlight(), and GERBVIEW_SELECTION_TOOL::unselectVisually().

◆ ClearStatus()

void LIB_PART::ClearStatus ( )

Clears the status flag all draw objects in this part.

Definition at line 996 of file class_libentry.cpp.

997 {
998  for( LIB_ITEM& item : m_drawings )
999  {
1000  item.m_Flags = 0;
1001  }
1002 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67

References m_drawings.

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

Definition at line 123 of file base_struct.cpp.

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

References EDA_ITEM::GetClass().

Referenced by PCB_EDIT_FRAME::Block_Duplicate(), LIB_EDIT_FRAME::BlockCopySelectedItems(), CopyMarkedItems(), LIB_EDIT_FRAME::copySelectedItems(), DrawMovingBlockOutlines(), BOARD::Duplicate(), DuplicateStruct(), LIB_PART(), LIB_EDIT_FRAME::LoadOneSymbol(), moveItemWithMouseCursor(), new_clone(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::pasteClipboard(), RedrawWhileMovingCursor(), SCH_EDIT_FRAME::RepeatDrawItem(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveWireImage(), SetConversion(), SCH_EDIT_FRAME::SetRepeatItem(), SCH_EDIT_FRAME::SetUndoItem(), SetUnitCount(), and COMMIT::Stage().

◆ deleteAllFields()

void LIB_PART::deleteAllFields ( )
private

Definition at line 831 of file class_libentry.cpp.

832 {
833  m_drawings[ LIB_FIELD_T ].clear();
834 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.

References LIB_FIELD_T, and m_drawings.

Referenced by SetFields().

◆ Draw()

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

Draw part.

Parameters
aPanel- Window to draw on. Can be NULL if not available.
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 370 of file class_libentry.cpp.

372 {
373  BASE_SCREEN* screen = aPanel ? aPanel->GetScreen() : NULL;
374  GRSetDrawMode( aDc, aOpts.draw_mode );
375 
376  /* draw background for filled items using background option
377  * Solid lines will be drawn after the background
378  * Note also, background is not drawn when:
379  * printing in black and white
380  * If the color is not the default color (aColor != -1 )
381  */
382  if( ! ( screen && screen->m_IsPrinting && GetGRForceBlackPenState() )
383  && ( aOpts.color == COLOR4D::UNSPECIFIED ) )
384  {
385  for( LIB_ITEM& drawItem : m_drawings )
386  {
387  if( drawItem.m_Fill != FILLED_WITH_BG_BODYCOLOR )
388  continue;
389 
390  if( aOpts.only_selected && !drawItem.IsSelected() )
391  continue;
392 
393  // Do not draw an item while moving (the cursor handler does that)
394  if( drawItem.m_Flags & IS_MOVED )
395  continue;
396 
397  // Do not draw items not attached to the current part
398  if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
399  continue;
400 
401  if( aConvert && drawItem.m_Convert && ( drawItem.m_Convert != aConvert ) )
402  continue;
403 
404  if( drawItem.Type() == LIB_FIELD_T )
405  continue;
406 
407  if( drawItem.Type() == LIB_FIELD_T ) // TODO dead code?
408  {
409  drawItem.Draw( aPanel, aDc, aOffset, aOpts.color,
410  aOpts.draw_mode, (void*) NULL, aOpts.transform );
411  }
412 
413  // Now, draw only the background for items with
414  // m_Fill == FILLED_WITH_BG_BODYCOLOR:
415  drawItem.Draw( aPanel, aDc, aOffset, aOpts.color,
416  aOpts.draw_mode, (void*) false, aOpts.transform );
417  }
418  }
419 
420  // Track the index into the dangling pins list
421  size_t pin_index = 0;
422 
423  for( LIB_ITEM& drawItem : m_drawings )
424  {
425  if( aOpts.only_selected && !drawItem.IsSelected() )
426  continue;
427 
428  // Do not draw an item while moving (the cursor handler does that)
429  if( drawItem.m_Flags & IS_MOVED )
430  continue;
431 
432  // Do not draw items not attached to the current part
433  if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
434  continue;
435 
436  if( aConvert && drawItem.m_Convert && ( drawItem.m_Convert != aConvert ) )
437  continue;
438 
439  if( drawItem.Type() == LIB_FIELD_T )
440  {
441  LIB_FIELD& field = static_cast<LIB_FIELD&>( drawItem );
442 
443  if( field.IsVisible() && !aOpts.draw_visible_fields )
444  continue;
445 
446  if( !field.IsVisible() && !aOpts.draw_hidden_fields )
447  continue;
448  }
449 
450  if( drawItem.Type() == LIB_PIN_T )
451  {
452  LIB_PIN& pin = static_cast<LIB_PIN&>( drawItem );
453 
454  uintptr_t flags = 0;
455  if( aOpts.show_pin_text )
456  flags |= PIN_DRAW_TEXTS;
457 
458  if( aOpts.show_elec_type )
460 
461  if( aOpts.PinIsDangling( pin_index ) )
462  flags |= PIN_DRAW_DANGLING;
463 
464  if( pin.IsPowerConnection() && IsPower() )
465  flags |= PIN_DANGLING_HIDDEN;
466 
467  drawItem.Draw( aPanel, aDc, aOffset, aOpts.color,
468  aOpts.draw_mode, (void*) flags, aOpts.transform );
469 
470  ++pin_index;
471  }
472  else if( drawItem.Type() == LIB_FIELD_T )
473  {
474  drawItem.Draw( aPanel, aDc, aOffset, aOpts.color,
475  aOpts.draw_mode, (void*) NULL, aOpts.transform );
476  }
477  else
478  {
479  bool forceNoFill = drawItem.m_Fill == FILLED_WITH_BG_BODYCOLOR;
480  drawItem.Draw( aPanel, aDc, aOffset, aOpts.color,
481  aOpts.draw_mode, (void*) forceNoFill,
482  aOpts.transform );
483  }
484  }
485 
486  // Enable this to draw the anchor of the component.
487 #if 0
488  int len = aDc->DeviceToLogicalXRel( 3 );
489  EDA_RECT* const clipbox = aPanel ? aPanel->GetClipBox() : NULL;
490 
491  GRLine( clipbox, aDc, aOffset.x, aOffset.y - len, aOffset.x,
492  aOffset.y + len, 0, aOpts.color );
493  GRLine( clipbox, aDc, aOffset.x - len, aOffset.y, aOffset.x + len,
494  aOffset.y, 0, aOpts.color );
495 #endif
496 
497  /* Enable this to draw the bounding box around the component to validate
498  * the bounding box calculations. */
499 #if 0
500  EDA_RECT bBox = GetUnitBoundingBox( aMulti, aConvert );
501  bBox.RevertYAxis();
502  bBox = aOpts.transform.TransformCoordinate( bBox );
503  bBox.Move( aOffset );
504  GRRect( aPanel ? aPanel->GetClipBox() : NULL, aDc, bBox, 0, LIGHTMAGENTA );
505 #endif
506 }
virtual BASE_SCREEN * GetScreen()=0
void Move(const wxPoint &aMoveVector)
Function Move moves the rectangle by the aMoveVector.
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
virtual EDA_RECT * GetClipBox()
void RevertYAxis()
Function RevertYAxis Mirror the rectangle from the X axis (negate Y pos and size)
Definition: eda_rect.h:144
bool draw_hidden_fields
Whether to draw "hidden" fields.
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:41
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
bool IsPowerConnection() const
Return whether this pin forms an implicit power connection: i.e., is hidden and of type POWER_IN.
Definition: lib_pin.h:368
bool IsVisible() const
Definition: lib_field.h:166
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:1003
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:285
bool m_IsPrinting
Definition: base_screen.h:220
bool PinIsDangling(size_t aPin) const
bool IsPower() const
GR_DRAWMODE draw_mode
Device context drawing mode, see wxDC.
COLOR4D color
Color to draw part in.
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool show_pin_text
Whether to show pin texts.
bool only_selected
Draws only the body items that are selected, for block moves.
bool show_elec_type
Whether to show the pin electrical type.
bool draw_visible_fields
Whether to draw "visible" fields.
bool GetGRForceBlackPenState(void)
Function GetGRForceBlackPenState.
Definition: gr_basic.cpp:214
TRANSFORM transform
Coordinate adjustment settings.
#define IS_MOVED
Item being moved.
Definition: base_struct.h:113

References PART_DRAW_OPTIONS::color, PART_DRAW_OPTIONS::draw_hidden_fields, PART_DRAW_OPTIONS::draw_mode, PART_DRAW_OPTIONS::draw_visible_fields, FILLED_WITH_BG_BODYCOLOR, EDA_DRAW_PANEL::GetClipBox(), GetGRForceBlackPenState(), EDA_DRAW_PANEL::GetScreen(), GetUnitBoundingBox(), GRLine(), GRRect(), GRSetDrawMode(), IS_MOVED, IsPower(), LIB_PIN::IsPowerConnection(), LIB_FIELD::IsVisible(), LIB_FIELD_T, LIB_PIN_T, LIGHTMAGENTA, m_drawings, BASE_SCREEN::m_IsPrinting, EDA_RECT::Move(), PART_DRAW_OPTIONS::only_selected, PIN_DANGLING_HIDDEN, PIN_DRAW_DANGLING, PIN_DRAW_ELECTRICAL_TYPE_NAME, PIN_DRAW_TEXTS, PART_DRAW_OPTIONS::PinIsDangling(), EDA_RECT::RevertYAxis(), PART_DRAW_OPTIONS::show_elec_type, PART_DRAW_OPTIONS::show_pin_text, PART_DRAW_OPTIONS::transform, and TRANSFORM::TransformCoordinate().

Referenced by SCH_COMPONENT::Draw(), LIB_EDIT_FRAME::PrintPage(), and LIB_EDIT_FRAME::RedrawComponent().

◆ FindField()

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

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

Definition at line 895 of file class_libentry.cpp.

896 {
897  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
898  {
899  LIB_FIELD* field = ( LIB_FIELD* ) &item;
900 
901  if( field->GetName() == aFieldName )
902  return field;
903  }
904 
905  return NULL;
906 }
wxString GetName(bool aTranslate=true) const
Returns the field name.
Definition: lib_field.cpp:448
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_draw_item.h:67

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

◆ GetAlias() [1/2]

LIB_ALIAS * LIB_PART::GetAlias ( size_t  aIndex)

◆ GetAlias() [2/2]

LIB_ALIAS * LIB_PART::GetAlias ( const wxString &  aName)

Definition at line 1223 of file class_libentry.cpp.

1224 {
1225  wxCHECK2_MSG( !aName.IsEmpty(), return NULL,
1226  wxT( "Cannot get alias with an empty name. Bad programmer!" ) );
1227 
1228  for( size_t i = 0; i < m_aliases.size(); i++ )
1229  {
1230  if( aName == m_aliases[i]->GetName() )
1231  return m_aliases[i];
1232  }
1233 
1234  return NULL;
1235 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.
const wxString & GetName() const
size_t i
Definition: json11.cpp:597

References GetName(), i, and m_aliases.

◆ GetAliasCount()

◆ GetAliases()

LIB_ALIASES LIB_PART::GetAliases ( ) const
inline

Definition at line 310 of file class_libentry.h.

310 { return m_aliases; }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.

References m_aliases.

Referenced by LIB_EDIT_FRAME::OnViewEntryDoc(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ GetAliasNames()

wxArrayString LIB_PART::GetAliasNames ( bool  aIncludeRoot = true) const

Definition at line 1135 of file class_libentry.cpp.

1136 {
1137  wxArrayString names;
1138 
1139  LIB_ALIASES::const_iterator it;
1140 
1141  for( it=m_aliases.begin(); it != m_aliases.end(); ++it )
1142  {
1143  if( !aIncludeRoot && (*it)->IsRoot() )
1144  continue;
1145 
1146  names.Add( (*it)->GetName() );
1147  }
1148 
1149  return names;
1150 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.

References m_aliases.

Referenced by SCH_LEGACY_PLUGIN_CACHE::AddSymbol(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), NETLIST_EXPORTER_GENERIC::makeLibParts(), LIB_EDIT_FRAME::OnEditComponentProperties(), and SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().

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

802 {
803  EDA_RECT bBox;
804  bool initialized = false;
805 
806  for( const LIB_ITEM& item : m_drawings )
807  {
808  if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
809  && ( aUnit != item.m_Unit ) ) )
810  continue;
811 
812  if( item.m_Convert > 0 && ( ( aConvert > 0 ) && ( aConvert != item.m_Convert ) ) )
813  continue;
814 
815  if( item.Type() == LIB_FIELD_T )
816  continue;
817 
818  if( initialized )
819  bBox.Merge( item.GetBoundingBox() );
820  else
821  {
822  bBox = item.GetBoundingBox();
823  initialized = true;
824  }
825  }
826 
827  return bBox;
828 }
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_draw_item.h:67
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 375 of file class_libentry.h.

376  {
377  return GetUnitBoundingBox( 0, 0 );
378  }
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 290 of file class_libentry.h.

291  {
292  return wxT( "LIB_PART" );
293  }

◆ GetDateLastEdition()

timestamp_t LIB_PART::GetDateLastEdition ( ) const
inline

Definition at line 318 of file class_libentry.h.

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

References m_dateLastEdition.

Referenced by SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().

◆ GetDrawItems()

◆ GetField()

LIB_FIELD * LIB_PART::GetField ( int  aId)

Return pointer to the requested field.

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

Definition at line 881 of file class_libentry.cpp.

882 {
883  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
884  {
885  LIB_FIELD* field = ( LIB_FIELD* ) &item;
886 
887  if( field->GetId() == aId )
888  return field;
889  }
890 
891  return NULL;
892 }
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:140
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67

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

Referenced by GetFields(), GetFootprintField(), GetReferenceField(), GetValueField(), SCH_EAGLE_PLUGIN::loadInstance(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), LIB_EDIT_FRAME::RedrawComponent(), 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 852 of file class_libentry.cpp.

853 {
854  LIB_FIELD* field;
855 
856  // Grab the MANDATORY_FIELDS first, in expected order given by
857  // enum NumFieldType
858  for( int id=0; id<MANDATORY_FIELDS; ++id )
859  {
860  field = GetField( id );
861 
862  // the MANDATORY_FIELDS are exactly that in RAM.
863  wxASSERT( field );
864 
865  aList.push_back( *field );
866  }
867 
868  // Now grab all the rest of fields.
869  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
870  {
871  field = ( LIB_FIELD* ) &item;
872 
873  if( (unsigned) field->GetId() < MANDATORY_FIELDS )
874  continue; // was added above
875 
876  aList.push_back( *field );
877  }
878 }
LIB_FIELD * GetField(int aId)
Return pointer to the requested field.
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:140
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67

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

Referenced by KIGFX::SCH_PAINTER::draw(), SCH_EAGLE_PLUGIN::loadInstance(), NETLIST_EXPORTER_GENERIC::makeLibParts(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ GetFlags()

STATUS_FLAGS EDA_ITEM::GetFlags ( ) const
inlineinherited

Definition at line 258 of file base_struct.h.

258 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References EDA_ITEM::m_Flags.

Referenced by AbortMoveAndEditTarget(), SCH_SCREEN::addConnectedItemsToBlock(), AddMenusForBitmap(), AddMenusForBusEntry(), AddMenusForComponent(), AddMenusForComponentField(), AddMenusForEditComponent(), AddMenusForGLabel(), AddMenusForHierchicalSheet(), AddMenusForHLabel(), AddMenusForLabel(), AddMenusForSheetPin(), AddMenusForText(), SCH_EDIT_FRAME::BeginSegment(), SCH_EDIT_FRAME::ChangeTextOrient(), Collect_TrackSegmentsToDrag(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), LIB_EDIT_FRAME::copySelectedItems(), LIB_EDIT_FRAME::CreatePin(), PCB_EDIT_FRAME::createPopUpMenuForFootprints(), PCB_EDIT_FRAME::createPopUpMenuForFpPads(), PCB_EDIT_FRAME::createPopUpMenuForFpTexts(), PCB_EDIT_FRAME::createPopUpMenuForTexts(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::createPopUpMenuForZones(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteItem(), SCH_EDIT_FRAME::DeleteItemsInList(), SCH_EDIT_FRAME::DeleteJunction(), PCB_BASE_FRAME::DeleteTextModule(), BOARD::Draw(), PCB_EDIT_FRAME::Edit_TrackSegm_Width(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditImage(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_VIEW_FRAME::GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), InitialiseDragParameters(), EDA_DRAW_FRAME::isBusy(), Magnetize(), SCH_EDIT_FRAME::MirrorImage(), SCH_EDIT_FRAME::MirrorSheet(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnMouseEvent(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_EDIT_FRAME::OrientComponent(), PCB_EDIT_FRAME::PlaceTarget(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), LIB_EDIT_FRAME::Process_Special_Functions(), TRACKS_CLEANER::removeDuplicatesOfTrack(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_EDIT_FRAME::RotateField(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), SCH_EDIT_FRAME::RotateImage(), PCB_BASE_FRAME::RotateTextModule(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SCREEN::SelectBlockItems(), SCH_EDIT_FRAME::SetBusEntryShape(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ GetFootprintField()

LIB_FIELD & LIB_PART::GetFootprintField ( )

Return reference to the footprint field.

Definition at line 925 of file class_libentry.cpp.

926 {
927  LIB_FIELD* field = GetField( FOOTPRINT );
928  wxASSERT( field != NULL );
929  return *field;
930 }
LIB_FIELD * GetField(int aId)
Return pointer to the requested field.
Field object used in symbol libraries.
Definition: lib_field.h:59
Field Name Module PCB, i.e. "16DIP300".

References FOOTPRINT, and GetField().

Referenced by LIB_ALIAS::GetSearchText().

◆ GetFootprints()

wxArrayString& LIB_PART::GetFootprints ( )
inline

◆ GetLib()

PART_LIB* LIB_PART::GetLib ( )
inline

Definition at line 304 of file class_libentry.h.

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

References m_library.

Referenced by LIB_MANAGER::LIB_BUFFER::CreateBuffer(), PART_LIB::FindAlias(), and LIB_ALIAS::GetLib().

◆ GetLibId()

◆ GetLibraryName()

const wxString LIB_PART::GetLibraryName ( )

Definition at line 304 of file class_libentry.cpp.

305 {
306  if( m_library )
307  return m_library->GetName();
308 
309  return m_libId.GetLibNickname();
310 }
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 LIB_ALIAS::GetLibNickname(), and RemoveDrawItem().

◆ GetList()

DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited

◆ 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, VIA, SEGZONE, SCH_HIERLABEL, GERBER_DRAW_ITEM, TRACK, SCH_GLOBALLABEL, DRAWSEGMENT, DIMENSION, SCH_LABEL, LIB_FIELD, TEXTE_MODULE, SCH_BUS_BUS_ENTRY, SCH_SHEET_PIN, SCH_TEXT, SCH_FIELD, SCH_LINE, LIB_ARC, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, LIB_TEXT, EDGE_MODULE, TEXTE_PCB, LIB_POLYLINE, LIB_RECTANGLE, MARKER_PCB, PCB_TARGET, LIB_CIRCLE, SCH_NO_CONNECT, SCH_JUNCTION, and SCH_MARKER.

Definition at line 280 of file base_struct.cpp.

281 {
282  return dummy_xpm;
283 }
static const BITMAP_OPAQUE dummy_xpm[1]
Definition: base_struct.cpp:56

References dummy_xpm.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SELECTION_TOOL::doSelectionMenu(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), and PCB_BASE_FRAME::PcbGeneralLocateAndDisplay().

◆ 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, NETINFO_ITEM, GERBER_DRAW_ITEM, LIB_ITEM, DIMENSION, TRACK, DRAWSEGMENT, SCH_TEXT, TEXTE_MODULE, LIB_FIELD, LIB_PIN, EDGE_MODULE, LIB_BEZIER, MARKER_PCB, LIB_ARC, ZONE_CONTAINER, LIB_TEXT, SCH_MARKER, LIB_POLYLINE, TEXTE_PCB, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 297 of file base_struct.h.

298  {
299  }

Referenced by SCH_EDIT_FRAME::LocateItem(), EDA_DRAW_FRAME::SetMsgPanel(), FOOTPRINT_VIEWER_FRAME::UpdateMsgPanel(), FOOTPRINT_WIZARD_FRAME::UpdateMsgPanel(), PCB_BASE_FRAME::UpdateMsgPanel(), and FOOTPRINT_EDIT_FRAME::UpdateMsgPanel().

◆ GetName()

const wxString & LIB_PART::GetName ( ) const

Definition at line 345 of file class_libentry.cpp.

346 {
347  static wxString dummy;
348 
349  wxCHECK_MSG( m_aliases.size(), dummy, "no aliases defined for symbol" );
350 
351  return m_aliases[0]->GetName();
352 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...

References dummy(), and m_aliases.

Referenced by SCH_LEGACY_PLUGIN_CACHE::AddSymbol(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName(), SCH_EDIT_FRAME::CreateArchiveLibrary(), LIB_MANAGER::LIB_BUFFER::CreateBuffer(), LIB_EDIT_FRAME::DisplayCmpDoc(), GetAlias(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), HasAlias(), LIB_ALIAS::IsRoot(), LIB_EDIT_FRAME::LoadOneLibraryPartAux(), NETLIST_EXPORTER_GENERIC::makeLibParts(), LIB_EDIT_FRAME::OnEditComponentProperties(), LIB_EDIT_FRAME::OnExportPart(), LIB_EDIT_FRAME::OnPasteDuplicatePart(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), RemoveAlias(), RemoveDrawItem(), PART_LIB::ReplacePart(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), LIB_EDIT_FRAME::SetCurPart(), FOOTPRINT_INFO_GENERATOR::SetHtmlAliasOf(), LIB_EDIT_FRAME::SyncLibraries(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow(), FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary(), LIB_MANAGER::UpdatePart(), and LIB_MANAGER::UpdatePartAfterRename().

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

636 {
637  if( m_drawings.empty( aType ) )
638  return NULL;
639 
640  if( aItem == NULL )
641  return &( *( m_drawings.begin( aType ) ) );
642 
643  // Search for the last item, assume aItem is of type aType
644  wxASSERT( ( aType == TYPE_NOT_INIT ) || ( aType == aItem->Type() ) );
646 
647  while( ( it != m_drawings.end( aType ) ) && ( aItem != &( *it ) ) )
648  ++it;
649 
650  // Search the next item
651  if( it != m_drawings.end( aType ) )
652  {
653  ++it;
654 
655  if( it != m_drawings.end( aType ) )
656  return &( *it );
657  }
658 
659  return NULL;
660 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
bool empty(int aType=UNDEFINED_TYPE)
Definition: multivector.h:224
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:201

References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::empty(), 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 535 of file class_libentry.h.

536  {
537  return (LIB_PIN*) GetNextDrawItem( (LIB_ITEM*) aItem, LIB_PIN_T );
538  }
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_draw_item.h:67

References GetNextDrawItem(), and LIB_PIN_T.

Referenced by LIB_EDIT_FRAME::deleteItem(), NETLIST_EXPORTER::findAllUnitsOfComponent(), LIB_EDIT_FRAME::GlobalSetPins(), LIB_EDIT_FRAME::PlacePin(), LIB_PIN::SetConversion(), LIB_PIN::SetPartNumber(), LIB_EDIT_FRAME::StartMovePin(), DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow(), and DIALOG_LIB_EDIT_PIN_TABLE::TransferDataToWindow().

◆ GetParent()

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

690 {
691  LIB_PINS pinList;
692 
693  GetPins( pinList, aUnit, aConvert );
694 
695  for( size_t i = 0; i < pinList.size(); i++ )
696  {
697  wxASSERT( pinList[i]->Type() == LIB_PIN_T );
698 
699  if( aNumber == pinList[i]->GetNumber() )
700  return pinList[i];
701  }
702 
703  return NULL;
704 }
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
size_t i
Definition: json11.cpp:597
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201

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

664 {
665  if( m_drawings.empty( LIB_PIN_T ) )
666  return;
667 
668  /* Notes:
669  * when aUnit == 0: no unit filtering
670  * when aConvert == 0: no convert (shape selection) filtering
671  * when .m_Unit == 0, the body item is common to units
672  * when .m_Convert == 0, the body item is common to shapes
673  */
674  for( LIB_ITEM& item : m_drawings[ LIB_PIN_T ] )
675  {
676  // Unit filtering:
677  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
678  continue;
679 
680  // Shape filtering:
681  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
682  continue;
683 
684  aList.push_back( (LIB_PIN*) &item );
685  }
686 }
bool empty(int aType=UNDEFINED_TYPE)
Definition: multivector.h:224
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67

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

Referenced by LIB_PIN::EnableEditMode(), NETLIST_EXPORTER::findNextComponentAndCreatePinList(), GetPin(), NETLIST_EXPORTER_GENERIC::makeLibParts(), LIB_EDIT_FRAME::OnCheckComponent(), 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 917 of file class_libentry.cpp.

918 {
919  LIB_FIELD* field = GetField( REFERENCE );
920  wxASSERT( field != NULL );
921  return *field;
922 }
LIB_FIELD * GetField(int aId)
Return pointer to the requested field.
Field object used in symbol libraries.
Definition: lib_field.h:59
Field Reference of part, i.e. "IC21".

References GetField(), and REFERENCE.

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

◆ 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, VIA, SEGZONE, DELETED_SCH_ITEM, SCH_HIERLABEL, GERBER_DRAW_ITEM, TRACK, SCH_GLOBALLABEL, DRAWSEGMENT, DIMENSION, SCH_LABEL, LIB_FIELD, TEXTE_MODULE, SCH_SHEET_PIN, SCH_BUS_BUS_ENTRY, SCH_TEXT, SCH_FIELD, SCH_LINE, LIB_ARC, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, LIB_TEXT, EDGE_MODULE, TEXTE_PCB, LIB_POLYLINE, LIB_RECTANGLE, MARKER_PCB, PCB_TARGET, LIB_CIRCLE, SCH_NO_CONNECT, SCH_JUNCTION, SCH_MARKER, and DELETED_BOARD_ITEM.

Definition at line 173 of file base_struct.cpp.

174 {
175  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
176  GetClass() );
177 
178  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
179 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SELECTION_TOOL::doSelectionMenu(), SCH_FIND_COLLECTOR::GetText(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), DRC_ITEM::SetData(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

◆ GetState()

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 253 of file base_struct.h.

253 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:164

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

◆ GetSubpartFirstId()

static int LIB_PART::GetSubpartFirstId ( )
inlinestatic

Definition at line 679 of file class_libentry.h.

679 { 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 672 of file class_libentry.h.

672 { 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 763 of file class_libentry.cpp.

764 {
765  EDA_RECT bBox;
766  bool initialized = false;
767 
768  for( const LIB_ITEM& item : m_drawings )
769  {
770  if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
771  && ( aUnit != item.m_Unit ) ) )
772  continue;
773 
774  if( item.m_Convert > 0 && ( ( aConvert > 0 ) && ( aConvert != item.m_Convert ) ) )
775  continue;
776 
777  if ( ( item.Type() == LIB_FIELD_T ) && !( ( LIB_FIELD& ) item ).IsVisible() )
778  continue;
779 
780  if( initialized )
781  bBox.Merge( item.GetBoundingBox() );
782  else
783  {
784  bBox = item.GetBoundingBox();
785  initialized = true;
786  }
787  }
788 
789  return bBox;
790 }
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_draw_item.h:67
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 LIB_VIEW_FRAME::BestZoom(), LIB_EDIT_FRAME::BestZoom(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), Draw(), GetBoundingBox(), LIB_VIEW_FRAME::GetDocumentExtents(), LIB_EDIT_FRAME::GetDocumentExtents(), and LIB_EDIT_FRAME::OnPlotCurrentComponent().

◆ GetUnitCount()

◆ GetValueField()

LIB_FIELD & LIB_PART::GetValueField ( )

Return reference to the value field.

Definition at line 909 of file class_libentry.cpp.

910 {
911  LIB_FIELD* field = GetField( VALUE );
912  wxASSERT( field != NULL );
913  return *field;
914 }
LIB_FIELD * GetField(int aId)
Return pointer to the requested field.
Field object used in symbol libraries.
Definition: lib_field.h:59
#define VALUE

References GetField(), and VALUE.

Referenced by SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), SetName(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ HasAlias()

bool LIB_PART::HasAlias ( const wxString &  aName) const

Test if alias aName is in part alias list.

Alias name comparisons are case insensitive.

Parameters
aName- Name of alias.
Returns
True if alias name in alias list.

Definition at line 1153 of file class_libentry.cpp.

1154 {
1155  wxCHECK2_MSG( !aName.IsEmpty(), return false,
1156  wxT( "Cannot get alias with an empty name, bad programmer." ) );
1157 
1158  for( size_t i = 0; i < m_aliases.size(); i++ )
1159  {
1160  if( aName == m_aliases[i]->GetName() )
1161  return true;
1162  }
1163 
1164  return false;
1165 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.
const wxString & GetName() const
size_t i
Definition: json11.cpp:597

References GetName(), i, and m_aliases.

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddAlias().

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

986 {
987  for( const LIB_ITEM& item : m_drawings )
988  {
989  if( item.m_Convert > 1 )
990  return true;
991  }
992 
993  return false;
994 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67

References m_drawings.

Referenced by AddMenusForEditComponent(), SCH_EDIT_FRAME::ConvertPart(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), LIB_VIEW_FRAME::onUpdateAltBodyStyleButton(), LIB_EDIT_FRAME::OnUpdateDeMorganConvert(), LIB_EDIT_FRAME::OnUpdateDeMorganNormal(), LIB_VIEW_FRAME::onUpdateNormalBodyStyleButton(), SetConversion(), 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().

◆ HitTest()

virtual bool EDA_ITEM::HitTest ( const wxPoint &  aPosition) const
inlinevirtualinherited

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

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
Returns
True if aPosition is within or on the item bounding area.

Reimplemented in D_PAD, MODULE, VIA, SCH_ITEM, BOARD_ITEM, GERBER_DRAW_ITEM, ZONE_CONTAINER, DIMENSION, TRACK, LIB_ITEM, DRAWSEGMENT, TEXTE_MODULE, LIB_FIELD, LIB_PIN, MARKER_PCB, LIB_ARC, PCB_TARGET, LIB_TEXT, TEXTE_PCB, LIB_BEZIER, LIB_POLYLINE, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 308 of file base_struct.h.

309  {
310  return false; // derived classes should override this function
311  }

Referenced by LIB_ITEM::HitTest(), BOARD_ITEM::HitTest(), GERBER_COLLECTOR::Inspect(), and SCH_COLLECTOR::Inspect().

◆ IsBrightened()

bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

Definition at line 227 of file base_struct.h.

227 { return m_Flags & BRIGHTENED; }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:138
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References BRIGHTENED, and EDA_ITEM::m_Flags.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), KIGFX::GERBVIEW_PAINTER::draw(), and KIGFX::PCB_RENDER_SETTINGS::GetColor().

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

◆ IsHighlighted()

bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 226 of file base_struct.h.

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

References HIGHLIGHTED, and EDA_ITEM::m_Flags.

Referenced by KIGFX::SCH_PAINTER::draw(), and KIGFX::getOverlayColor().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 220 of file base_struct.h.

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

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by LIB_EDIT_FRAME::OnEditPin().

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

659 { 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::OnUpdateSyncPinEdit(), LIB_EDIT_FRAME::SetCurPart(), and LIB_EDIT_FRAME::SynchronizePins().

◆ IsNew()

bool EDA_ITEM::IsNew ( ) const
inlineinherited

Definition at line 219 of file base_struct.h.

219 { return m_Flags & IS_NEW; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References IS_NEW, and EDA_ITEM::m_Flags.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_MoveOrCopyModule(), Abort_Zone_Create_Outline(), AbortBuildDimension(), AbortMoveAndEditTarget(), abortMoveItem(), AbortPinMove(), AbortSymbolTraceOn(), SCH_EDIT_FRAME::addCurrentItemToScreen(), SCH_EDIT_FRAME::addJunctionMenuEntries(), AddMenusForBus(), AddMenusForWire(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteCurrentSegment(), LIB_ARC::drawEditGraphics(), LIB_ARC::drawGraphic(), LIB_PIN::EnableEditMode(), LIB_EDIT_FRAME::EndDrawGraphicItem(), SCH_EDIT_FRAME::EndSegment(), ExitSheet(), LIB_PART(), EDIT_TOOL::MoveExact(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_BASE_FRAME::PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PCB_EDIT_FRAME::PlaceTarget(), SCH_EDIT_FRAME::PrepareMoveItem(), SCH_EDIT_FRAME::ReSizeSheet(), ShowClearance(), PCB_EDIT_FRAME::StartMoveTextePcb(), PCB_EDIT_FRAME::SwitchLayer(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataFromWindow(), and DIALOG_LABEL_EDITOR::TransferDataFromWindow().

◆ IsNormal()

bool LIB_PART::IsNormal ( ) const
inline

Definition at line 401 of file class_libentry.h.

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

References ENTRY_NORMAL, and m_options.

Referenced by AddMenusForEditComponent().

◆ 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 464 of file base_struct.h.

464 { return false; }

Referenced by EDA_ITEM::Matches(), and EDA_ITEM::Replace().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 225 of file base_struct.h.

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

References IS_RESIZED, and EDA_ITEM::m_Flags.

Referenced by ExitSheet(), and KIGFX::SCH_PAINTER::setColors().

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 224 of file base_struct.h.

224 { return m_Flags & SELECTED; }
#define SELECTED
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References EDA_ITEM::m_Flags, and SELECTED.

Referenced by SCH_SCREEN::addConnectedItemsToBlock(), AddMenusForPin(), LIB_EDIT_FRAME::BlockCopySelectedItems(), KIGFX::PCB_PAINTER::draw(), LIB_CIRCLE::drawGraphic(), LIB_POLYLINE::drawGraphic(), LIB_RECTANGLE::drawGraphic(), LIB_BEZIER::drawGraphic(), LIB_TEXT::drawGraphic(), LIB_ARC::drawGraphic(), LIB_FIELD::drawGraphic(), DrawMovingBlockOutlines(), LIB_PIN::DrawPinElectricalTypeName(), LIB_PIN::DrawPinSymbol(), LIB_PIN::DrawPinTexts(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), LIB_EDIT_FRAME::GlobalSetPins(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), MirrorMarkedItems(), MoveMarkedItems(), MoveMarkedItemsExactly(), LIB_TEXT::Plot(), RotateMarkedItems(), GERBVIEW_SELECTION_TOOL::select(), SELECTION_TOOL::select(), SCH_SCREEN::SelectBlockItems(), GERBVIEW_SELECTION_TOOL::toggleSelection(), SELECTION_TOOL::toggleSelection(), and GERBVIEW_SELECTION_TOOL::unselect().

◆ IsType()

bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[])
inlineinherited

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

Definition at line 266 of file base_struct.h.

267  {
268  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
269  {
270  if( m_StructType == *p )
271  return true;
272  }
273 
274  return false;
275  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:163
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, and EDA_ITEM::m_StructType.

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 223 of file base_struct.h.

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

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

Referenced by SCH_FIELD::Draw().

◆ IterateForward()

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

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

134 {
135  EDA_ITEM* p = listStart;
136 
137  for( ; p; p = p->Pnext )
138  {
139  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
140  return SEARCH_QUIT;
141  }
142 
143  return SEARCH_CONTINUE;
144 }
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...
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167

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

Referenced by SCH_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::Collect(), SCH_TYPE_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::GetItem(), GERBER_FILE_IMAGE::Visit(), MODULE::Visit(), and BOARD::Visit().

◆ LoadDateAndTime()

bool LIB_PART::LoadDateAndTime ( char *  aLine)

Definition at line 953 of file class_libentry.cpp.

954 {
955  int year, mon, day, hour, min, sec;
956 
957  year = mon = day = hour = min = sec = 0;
958  strtok( aLine, " \r\t\n" );
959  strtok( NULL, " \r\t\n" );
960 
961  if( sscanf( aLine, "%d/%d/%d %d:%d:%d", &year, &mon, &day, &hour, &min, &sec ) != 6 )
962  return false;
963 
964  m_dateLastEdition = ( sec & 63 ) + ( ( min & 63 ) << 6 ) +
965  ( ( hour & 31 ) << 12 ) + ( ( day & 31 ) << 17 ) +
966  ( ( mon & 15 ) << 22 ) + ( ( year - 1990 ) << 26 );
967 
968  return true;
969 }
timestamp_t m_dateLastEdition
Date of the last modification.
#define min(a, b)
Definition: auxiliary.h:85

References m_dateLastEdition, and min.

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

1006 {
1007  for( LIB_ITEM& item : m_drawings )
1008  {
1009  if( ( aUnit && item.m_Unit && ( aUnit != item.m_Unit) )
1010  || ( aConvert && item.m_Convert && ( aConvert != item.m_Convert ) )
1011  || ( ( item.Type() != aType ) && ( aType != TYPE_NOT_INIT ) ) )
1012  continue;
1013 
1014  if( item.HitTest( aPoint ) )
1015  return &item;
1016  }
1017 
1018  return NULL;
1019 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67

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

1024 {
1025  /* we use LocateDrawItem( int aUnit, int convert, KICAD_T type, const
1026  * wxPoint& pt ) to search items.
1027  * because this function uses DefaultTransform as orient/mirror matrix
1028  * we temporary copy aTransform in DefaultTransform
1029  */
1030  LIB_ITEM* item;
1031  TRANSFORM transform = DefaultTransform;
1032  DefaultTransform = aTransform;
1033 
1034  item = LocateDrawItem( aUnit, aConvert, aType, aPoint );
1035 
1036  // Restore matrix
1037  DefaultTransform = transform;
1038 
1039  return item;
1040 }
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
Class for tranforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
TRANSFORM DefaultTransform
Definition: eeschema.cpp:59
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 410 of file class_libentry.h.

410 { 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::OnCreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData,
wxPoint *  aFindLocation 
)
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.
aFindLocationA pointer to a wxPoint object to store the location of matched item. The pointer can be NULL if it is not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_SHEET_PIN, SCH_FIELD, SCH_TEXT, LIB_PIN, and SCH_MARKER.

Definition at line 420 of file base_struct.h.

421  {
422  return false;
423  }

Referenced by SCH_FIND_COLLECTOR::Inspect(), SCH_MARKER::Matches(), LIB_PIN::Matches(), SCH_TEXT::Matches(), SCH_FIELD::Matches(), SCH_SHEET_PIN::Matches(), and SCH_SHEET::Matches().

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

183 {
184  wxString text = aText;
185  wxString searchText = aSearchData.GetFindString();
186 
187  // Don't match if searching for replaceable item and the item doesn't support text replace.
188  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
189  return false;
190 
191  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
192  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
193 
194  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
195  {
196  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
197  return text.Matches( searchText );
198 
199  return text.MakeUpper().Matches( searchText.MakeUpper() );
200  }
201 
202  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
203  return aText.Find( searchText ) != wxNOT_FOUND;
204 
205  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
206 }
Perform search using simple wild card matching (* & ?).
Perform a search for a item that has replaceable text.
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:464

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

240 {
241  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
242  GetChars( GetClass() ) ) );
243 
244  return false;
245 }
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:92
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==()

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

Definition at line 739 of file class_libentry.h.

739 { return this == aPart; }

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

709 {
710  LIB_PINS thisPinList;
711  GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 );
712 
713  for( LIB_PIN* eachThisPin : thisPinList )
714  {
715  wxASSERT( eachThisPin );
716  LIB_PINS otherPinList;
717  aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 );
718  bool foundMatch = false;
719 
720  for( LIB_PIN* eachOtherPin : otherPinList )
721  {
722  wxASSERT( eachOtherPin );
723  // Same position?
724  if( eachThisPin->GetPosition() != eachOtherPin->GetPosition() )
725  continue;
726 
727  // Same number?
728  if( aTestNums && ( eachThisPin->GetNumber() != eachOtherPin->GetNumber() ))
729  continue;
730 
731  // Same name?
732  if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ))
733  continue;
734 
735  // Same electrical type?
736  if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ))
737  continue;
738 
739  // Same orientation?
740  if( aTestOrientation && ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ))
741  continue;
742 
743  // Same length?
744  if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ))
745  continue;
746 
747  foundMatch = true;
748  }
749 
750  if( !foundMatch )
751  {
752  // This means there was not an identical (according to the arguments)
753  // pin at the same position in the other component.
754  return true;
755  }
756  }
757 
758  // The loop never gave up, so no conflicts were found.
759  return false;
760 }
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61

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

511 {
512  wxASSERT( aPlotter != NULL );
513 
514  aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
515  bool fill = aPlotter->GetColorMode();
516 
517  // draw background for filled items using background option
518  // Solid lines will be drawn after the background
519  for( LIB_ITEM& item : m_drawings )
520  {
521  // Lib Fields are not plotted here, because this plot function
522  // is used to plot schematic items, which have they own fields
523  if( item.Type() == LIB_FIELD_T )
524  continue;
525 
526  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
527  continue;
528 
529  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
530  continue;
531 
532  if( item.m_Fill == FILLED_WITH_BG_BODYCOLOR )
533  item.Plot( aPlotter, aOffset, fill, aTransform );
534  }
535 
536  // Not filled items and filled shapes are now plotted
537  // (plot only items which are not already plotted)
538  for( LIB_ITEM& item : m_drawings )
539  {
540  if( item.Type() == LIB_FIELD_T )
541  continue;
542 
543  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
544  continue;
545 
546  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
547  continue;
548 
549  if( item.m_Fill != FILLED_WITH_BG_BODYCOLOR )
550  item.Plot( aPlotter, aOffset, fill, aTransform );
551  }
552 }
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:174
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
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 555 of file class_libentry.cpp.

557 {
558  wxASSERT( aPlotter != NULL );
559 
560  aPlotter->SetColor( GetLayerColor( LAYER_FIELDS ) );
561  bool fill = aPlotter->GetColorMode();
562 
563  for( LIB_ITEM& item : m_drawings )
564  {
565  if( item.Type() != LIB_FIELD_T )
566  continue;
567 
568  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
569  continue;
570 
571  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
572  continue;
573 
574  // The reference is a special case: we should change the basic text
575  // to add '?' and the part id
576  LIB_FIELD& field = (LIB_FIELD&) item;
577  wxString tmp = field.GetShownText();
578  if( field.GetId() == REFERENCE )
579  {
580  wxString text = field.GetFullText( aUnit );
581  field.SetText( text );
582  }
583  item.Plot( aPlotter, aOffset, fill, aTransform );
584  field.SetText( tmp );
585  }
586 }
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:140
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
Field Reference of part, i.e. "IC21".
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
void SetText(const wxString &aText) override
Sets the field text to aText.
Definition: lib_field.cpp:518
wxString GetFullText(int unit=1) const
Return the text of a field.
Definition: lib_field.cpp:371
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:148
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 LIB_FIELD::SetText().

Referenced by LIB_EDIT_FRAME::SVG_PlotComponent().

◆ RemoveAlias() [1/2]

void LIB_PART::RemoveAlias ( const wxString &  aName)

Definition at line 1168 of file class_libentry.cpp.

1169 {
1170  LIB_ALIAS* a = GetAlias( aName );
1171 
1172  if( a )
1173  RemoveAlias( a );
1174 }
Part library alias object definition.
LIB_ALIAS * GetAlias(size_t aIndex)
void RemoveAlias(const wxString &aName)

References GetAlias().

Referenced by SCH_LEGACY_PLUGIN_CACHE::DeleteAlias(), SCH_LEGACY_PLUGIN_CACHE::removeAlias(), and LIB_ALIAS::~LIB_ALIAS().

◆ RemoveAlias() [2/2]

LIB_ALIAS * LIB_PART::RemoveAlias ( LIB_ALIAS aAlias)

Definition at line 1177 of file class_libentry.cpp.

1178 {
1179  wxCHECK_MSG( aAlias, NULL, wxT( "Cannot remove alias by NULL pointer." ) );
1180 
1181  LIB_ALIAS* nextAlias = NULL;
1182 
1183  LIB_ALIASES::iterator it = find( m_aliases.begin(), m_aliases.end(), aAlias );
1184 
1185  if( it != m_aliases.end() )
1186  {
1187  bool rename = aAlias->IsRoot();
1188 
1189  wxLogTrace( traceSchLibMem,
1190  wxT( "%s: symbol:'%s', alias:'%s', alias count %llu, reference count %ld." ),
1191  GetChars( wxString::FromAscii( __WXFUNCTION__ ) ),
1192  GetChars( GetName() ),
1193  GetChars( aAlias->GetName() ),
1194  (long long unsigned) m_aliases.size(),
1195  m_me.use_count() );
1196 
1197  it = m_aliases.erase( it );
1198 
1199  if( !m_aliases.empty() )
1200  {
1201  if( it == m_aliases.end() )
1202  it = m_aliases.begin();
1203 
1204  nextAlias = *it;
1205 
1206  if( rename )
1207  SetName( nextAlias->GetName() );
1208  }
1209  }
1210 
1211  return nextAlias;
1212 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.
Part library alias object definition.
bool IsRoot() const override
For symbols having aliases, IsRoot() indicates the principal item.
const wxChar *const traceSchLibMem
Flag to enable schematic library memory deletion debug output.
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:92
const wxString & GetName() const override
const wxString & GetName() const
virtual void SetName(const wxString &aName)
PART_SPTR m_me
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared

References GetChars(), LIB_ALIAS::GetName(), GetName(), LIB_ALIAS::IsRoot(), m_aliases, m_me, SetName(), and traceSchLibMem.

◆ RemoveAllAliases()

void LIB_PART::RemoveAllAliases ( )

Definition at line 1215 of file class_libentry.cpp.

1216 {
1217  // Remove all of the aliases except the root alias.
1218  while( m_aliases.size() > 1 )
1219  m_aliases.pop_back();
1220 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.

References m_aliases.

Referenced by RESCUE_CACHE_CANDIDATE::PerformAction(), RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction(), LIB_EDIT_FRAME::SaveOneSymbol(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ RemoveDrawItem()

void LIB_PART::RemoveDrawItem ( LIB_ITEM aItem,
EDA_DRAW_PANEL aPanel = NULL,
wxDC *  aDc = NULL 
)

Remove draw aItem from list.

Parameters
aItem- Draw item to remove from list.
aPanel- Panel to remove part from.
aDc- Device context to remove part from.

Definition at line 589 of file class_libentry.cpp.

590 {
591  wxASSERT( aItem != NULL );
592 
593  // none of the MANDATORY_FIELDS may be removed in RAM, but they may be
594  // omitted when saving to disk.
595  if( aItem->Type() == LIB_FIELD_T )
596  {
597  LIB_FIELD* field = (LIB_FIELD*) aItem;
598 
599  if( field->GetId() < MANDATORY_FIELDS )
600  {
601  wxLogWarning( _(
602  "An attempt was made to remove the %s field from component %s in library %s." ),
603  GetChars( field->GetName() ), GetChars( GetName() ),
604  GetChars( GetLibraryName() ) );
605  return;
606  }
607  }
608 
609  LIB_ITEMS& items = m_drawings[ aItem->Type() ];
610 
611  for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
612  {
613  if( *i == aItem )
614  {
615  if( aDc != NULL )
616  aItem->Draw( aPanel, aDc, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED,
617  g_XorMode, NULL, DefaultTransform );
618 
619  items.erase( i );
620  SetModified();
621  break;
622  }
623  }
624 }
GR_DRAWMODE g_XorMode
Definition: gr_basic.cpp:74
wxString GetName(bool aTranslate=true) const
Returns the field name.
Definition: lib_field.cpp:448
void SetModified()
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:140
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
const wxString GetLibraryName()
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:92
TRANSFORM DefaultTransform
Definition: eeschema.cpp:59
virtual void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void *aData, const TRANSFORM &aTransform)
Draw an item.
const wxString & GetName() const
size_t i
Definition: json11.cpp:597
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201

References DefaultTransform, LIB_ITEM::Draw(), g_XorMode, 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_FRAME::deleteItem(), 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 979 of file class_libentry.cpp.

980 {
981  m_drawings.unique();
982 }
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 
)
inherited

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

210 {
211  wxCHECK_MSG( IsReplaceable(), false,
212  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
213 
214  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
215 
216  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
217  aSearchData.GetFindString() :
218  aSearchData.GetFindString().Upper() );
219 
220  if( result == wxNOT_FOUND )
221  return false;
222 
223  wxString prefix = aText.Left( result );
224  wxString suffix;
225 
226  if( aSearchData.GetFindString().length() + result < aText.length() )
227  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
228 
229  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
230  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
231  GetChars( suffix ) );
232 
233  aText = prefix + aSearchData.GetReplaceString() + suffix;
234 
235  return true;
236 }
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:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:464

References GetChars(), EDA_ITEM::GetClass(), EDA_ITEM::IsReplaceable(), and traceFindReplace.

Referenced by FOOTPRINT_INFO_GENERATOR::GetHtmlFieldRow(), SCH_TEXT::Replace(), SCH_FIELD::Replace(), SCH_SHEET_PIN::Replace(), SCH_SHEET::Replace(), and SCH_FIND_COLLECTOR::ReplaceItem().

◆ 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_SHEET_PIN, SCH_FIELD, and SCH_TEXT.

Definition at line 452 of file base_struct.h.

452 { return false; }

◆ Save()

bool LIB_PART::Save ( OUTPUTFORMATTER aFormatter)

Write the data structures out to aFormatter in the part library "*.lib" format.

Parameters
aFormatterA reference to an OUTPUTFORMATTER to write to.
Returns
True if success writing else false.

◆ SaveDateAndTime()

bool LIB_PART::SaveDateAndTime ( OUTPUTFORMATTER aFormatter)

Write the date and time of part to aFile in the format: "Ti yy/mm/jj hh:mm:ss".

Parameters
aFormatterA reference to an OUTPUTFORMATTER object containing the output format to write to.
Returns
True if the date and time were successfully written to aFormatter.

Definition at line 933 of file class_libentry.cpp.

934 {
935  int year, mon, day, hour, min, sec;
936 
937  if( m_dateLastEdition == 0 )
938  return true;
939 
940  sec = m_dateLastEdition & 63;
941  min = ( m_dateLastEdition >> 6 ) & 63;
942  hour = ( m_dateLastEdition >> 12 ) & 31;
943  day = ( m_dateLastEdition >> 17 ) & 31;
944  mon = ( m_dateLastEdition >> 22 ) & 15;
945  year = ( m_dateLastEdition >> 26 ) + 1990;
946 
947  aFormatter.Print( 0, "Ti %d/%d/%d %d:%d:%d\n", year, mon, day, hour, min, sec );
948 
949  return true;
950 }
timestamp_t m_dateLastEdition
Date of the last modification.
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:404
#define min(a, b)
Definition: auxiliary.h:85

References m_dateLastEdition, min, and OUTPUTFORMATTER::Print().

◆ SetBack()

void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 215 of file base_struct.h.

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

References EDA_ITEM::Pback.

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

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 232 of file base_struct.h.

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

References BRIGHTENED, and EDA_ITEM::SetFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), and SELECTION_TOOL::highlight().

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

1091 {
1092  if( aSetConvert == HasConversion() )
1093  return;
1094 
1095  // Duplicate items to create the converted shape
1096  if( aSetConvert )
1097  {
1098  std::vector< LIB_ITEM* > tmp; // Temporarily store the duplicated pins here.
1099 
1100  for( LIB_ITEM& item : m_drawings )
1101  {
1102  // Only pins are duplicated.
1103  if( item.Type() != LIB_PIN_T )
1104  continue;
1105 
1106  if( item.m_Convert == 1 )
1107  {
1108  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1109  newItem->m_Convert = 2;
1110  tmp.push_back( newItem );
1111  }
1112  }
1113 
1114  // Transfer the new pins to the LIB_PART.
1115  for( unsigned i = 0; i < tmp.size(); i++ )
1116  m_drawings.push_back( tmp[i] );
1117  }
1118  else
1119  {
1120  // Delete converted shape items because the converted shape does
1121  // not exist
1123 
1124  while( i != m_drawings.end() )
1125  {
1126  if( i->m_Convert > 1 )
1127  i = m_drawings.erase( i );
1128  else
1129  ++i;
1130  }
1131  }
1132 }
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_draw_item.h:67
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:597
int m_Convert
Shape identification for alternate body styles.

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::OnCreateNewPart(), 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 837 of file class_libentry.cpp.

838 {
839  deleteAllFields();
840 
841  for( unsigned i=0; i<aFields.size(); ++i )
842  {
843  // drawings is a ptr_vector, new and copy an object on the heap.
844  LIB_FIELD* field = new LIB_FIELD( aFields[i] );
845 
846  field->SetParent( this );
847  m_drawings.push_back( field );
848  }
849 }
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:216
void push_back(T *aItem)
Definition: multivector.h:169
size_t i
Definition: json11.cpp:597

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 256 of file base_struct.h.

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

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_SCREEN::addConnectedItemsToBlock(), PCB_BASE_FRAME::AddModuleToBoard(), AddSegmentToDragList(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), SCH_EDIT_FRAME::BeginSegment(), LIB_EDIT_FRAME::BlockCopySelectedItems(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), LIB_EDIT_FRAME::copySelectedItems(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), SCH_EDIT_FRAME::DeleteItem(), DrawMovingBlockOutlines(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), SCH_EDIT_FRAME::HandleBlockPlace(), KIGFX::SCH_VIEW::HighlightItem(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_EDIT_FRAME::ImportSheetPin(), InvokeDialogImportGfxBoard(), InvokeDialogImportGfxModule(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), SCH_EDIT_FRAME::Load_Component(), SCH_SCREEN::MarkConnections(), MarkItemsInBloc(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnSelectUnit(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), PCB_EDIT_FRAME::Other_Layer_Route(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PrepareMoveItem(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_EDIT_FRAME::ReSizeSheet(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_SCREEN::SelectBlockItems(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), BLOCK_SELECTOR::SetFlags(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), LIB_EDIT_FRAME::StartMovePin(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_EDIT_FRAME::StartMoveTextePcb(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and UndrawAndMarkSegmentsToDrag().

◆ 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 285 of file base_struct.h.

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

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDIT_FRAME::OnFindSchematicItem(), and SCH_EDIT_FRAME::updateFindReplaceView().

◆ SetHighlighted()

void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 231 of file base_struct.h.

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

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

◆ SetLib()

void LIB_PART::SetLib ( PART_LIB aLibrary)
inline

Definition at line 306 of file class_libentry.h.

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

References m_library.

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

◆ SetLibId()

void LIB_PART::SetLibId ( const LIB_ID aLibId)
inline

◆ SetList()

void EDA_ITEM::SetList ( DHEAD aList)
inlineinherited

Definition at line 217 of file base_struct.h.

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

References EDA_ITEM::m_List.

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

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

◆ SetName()

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

Definition at line 355 of file class_libentry.cpp.

356 {
357  // The LIB_ALIAS that is the LIB_PART name has to be created so create it.
358  if( m_aliases.empty() )
359  m_aliases.push_back( new LIB_ALIAS( aName, this ) );
360  else
361  m_aliases[0]->SetName( aName );
362 
363  wxString validatedName = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
364  m_libId.SetLibItemName( validatedName, false );
365 
366  GetValueField().SetText( validatedName );
367 }
LIB_ALIASES m_aliases
List of alias object pointers associated with the part.
Part library alias object definition.
LIB_FIELD & GetValueField()
Return reference to the value field.
void SetText(const wxString &aText) override
Sets the field text to aText.
Definition: lib_field.cpp:518
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_aliases, m_libId, LIB_ID::SetLibItemName(), and LIB_FIELD::SetText().

Referenced by SCH_EDIT_FRAME::CreateArchiveLibrary(), LIB_EDIT_FRAME::EditField(), LIB_EDIT_FRAME::fixDuplicateAliases(), LIB_PART(), SCH_LEGACY_PLUGIN_CACHE::Load(), RESCUE_CACHE_CANDIDATE::PerformAction(), RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction(), RemoveAlias(), LIB_EDIT_FRAME::savePartAs(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow(), and DIALOG_LIB_EDIT_ONE_FIELD::UpdateField().

◆ SetNext()

void EDA_ITEM::SetNext ( EDA_ITEM aNext)
inlineinherited

Definition at line 214 of file base_struct.h.

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

References EDA_ITEM::Pnext.

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

◆ SetNormal()

void LIB_PART::SetNormal ( )
inline

Definition at line 404 of file class_libentry.h.

404 { 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::OnCreateNewPart(), 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 972 of file class_libentry.cpp.

973 {
974  for( LIB_ITEM& item : m_drawings )
975  item.SetOffset( aOffset );
976 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67

References m_drawings.

◆ SetParent()

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

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

References m_pinNameOffset.

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

◆ SetPower()

void LIB_PART::SetPower ( )
inline

Definition at line 403 of file class_libentry.h.

403 { 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::OnCreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetSelected()

void EDA_ITEM::SetSelected ( )
inlineinherited

Definition at line 230 of file base_struct.h.

230 { SetFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256

References SELECTED, and EDA_ITEM::SetFlags().

Referenced by SELECTION_TOOL::highlight(), LIB_EDIT_FRAME::pasteClipboard(), and GERBVIEW_SELECTION_TOOL::selectVisually().

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

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

References m_showPinNames.

Referenced by LIB_EDIT_FRAME::OnCreateNewPart(), 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 735 of file class_libentry.h.

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

References m_showPinNumbers.

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

◆ SetState()

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

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

1260 {
1261  m_subpartFirstId = 'A';
1263 
1264  if( aSep == '.' || aSep == '-' || aSep == '_' )
1265  m_subpartIdSeparator = aSep;
1266 
1267  if( aFirstId == '1' && aSep != 0 )
1268  m_subpartFirstId = aFirstId;
1269 }
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 206 of file base_struct.h.

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

References EDA_ITEM::m_TimeStamp.

Referenced by 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(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::CreateSheet(), Diagnose(), SCH_EDIT_FRAME::DuplicateItemsInList(), DuplicateStruct(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), EDIT_TOOL::editFootprintInFpEditor(), 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(), 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_EDIT_FRAME::PasteListOfItems(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDIT_FRAME::Process_Special_Functions(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), BOARD::ReplaceNetlist(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET::SCH_SHEET(), SCH_COMPONENT::SetTimeStamp(), SimilarLabelsDiagnose(), SwapItemData(), TestDuplicateSheetNames(), and DIALOG_ERC::TestErc().

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

1044 {
1045  if( m_unitCount == aCount )
1046  return;
1047 
1048  if( aCount < m_unitCount )
1049  {
1051 
1052  while( i != m_drawings.end() )
1053  {
1054  if( i->m_Unit > aCount )
1055  i = m_drawings.erase( i );
1056  else
1057  ++i;
1058  }
1059  }
1060  else
1061  {
1062  int prevCount = m_unitCount;
1063 
1064  // Temporary storage for new items, as adding new items directly to
1065  // m_drawings may cause the buffer reallocation which invalidates the
1066  // iterators
1067  std::vector< LIB_ITEM* > tmp;
1068 
1069  for( LIB_ITEM& item : m_drawings )
1070  {
1071  if( item.m_Unit != 1 )
1072  continue;
1073 
1074  for( int j = prevCount + 1; j <= aCount; j++ )
1075  {
1076  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1077  newItem->m_Unit = j;
1078  tmp.push_back( newItem );
1079  }
1080  }
1081 
1082  for( auto item : tmp )
1083  m_drawings.push_back( item );
1084  }
1085 
1086  m_unitCount = aCount;
1087 }
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.
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_draw_item.h:67
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:597

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::OnCreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 229 of file base_struct.h.

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

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ SharedPtr()

PART_SPTR LIB_PART::SharedPtr ( )
inline

Definition at line 284 of file class_libentry.h.

285  {
286  // clone a shared pointer
287  return m_me;
288  }
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 SCH_COMPONENT::Resolve(), SCH_COMPONENT::SCH_COMPONENT(), and SCH_COMPONENT::SetLibId().

◆ 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 483 of file base_struct.h.

483 { return *aLeft < *aRight; }

Referenced by PART_LIB::GetEntryTypePowerNames().

◆ SubpartFirstIdPtr()

static int* LIB_PART::SubpartFirstIdPtr ( )
inlinestatic

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

Definition at line 683 of file class_libentry.h.

683 { 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::GetProjectFileParametersList().

◆ SubpartIdSeparatorPtr()

static int* LIB_PART::SubpartIdSeparatorPtr ( )
inlinestatic

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

Definition at line 677 of file class_libentry.h.

677 { 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::GetProjectFileParametersList().

◆ 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 prpebd the sub ref by the separator symbol (if any) Note: this is a static function.

Definition at line 313 of file class_libentry.cpp.

314 {
315  wxString subRef;
316 
317  if( m_subpartIdSeparator != 0 && aAddSeparator )
318  subRef << wxChar( m_subpartIdSeparator );
319 
320  if( m_subpartFirstId >= '0' && m_subpartFirstId <= '9' )
321  subRef << aUnit;
322  else
323  {
324  // use letters as notation. To allow more than 26 units, the sub ref
325  // use one letter if letter = A .. Z or a ... z, and 2 letters otherwise
326  // first letter is expected to be 'A' or 'a' (i.e. 26 letters are available)
327  int u;
328  aUnit -= 1; // Unit number starts to 1. now to 0.
329 
330  while( aUnit >= 26 ) // more than one letter are needed
331  {
332  u = aUnit / 26;
333  subRef << wxChar( m_subpartFirstId + u -1 );
334  aUnit %= 26;
335  }
336 
337  u = m_subpartFirstId + aUnit;
338  subRef << wxChar( u );
339  }
340 
341  return subRef;
342 }
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 AddMenusForEditComponent(), SCH_EDIT_FRAME::AnnotateComponents(), SCH_REFERENCE_LIST::CheckAnnotation(), LIB_FIELD::GetFullText(), SCH_FIELD::GetFullyQualifiedText(), LIB_ALIAS::GetUnitReference(), SCH_FIELD::Matches(), TestMultiunitFootprints(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), and LIB_EDIT_FRAME::UpdatePartSelectList().

◆ 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 201 of file base_struct.h.

202  {
203  return m_StructType;
204  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:163

References EDA_ITEM::m_StructType.

Referenced by Abort_Move_ModuleOutline(), abortMoveItem(), AbortPinMove(), MODULE::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), PCB_EDIT_FRAME::Add45DegreeSegment(), SCH_SCREEN::addConnectedItemsToBlock(), POINT_EDITOR::addCorner(), SCH_EDIT_FRAME::addCurrentItemToScreen(), AddMenusForComponent(), AddMenusForEditComponent(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::Begin_Route(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), LIB_EDIT_FRAME::BlockCopySelectedItems(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), calcArea(), calcMaxArea(), 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_EDIT_FRAME::CheckListConnections(), CN_VISITOR::checkZoneItemConnection(), TEXTE_PCB::ClassOf(), EDGE_MODULE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), PCB_TARGET::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), ZONE_CONTAINER::ClassOf(), MARKER_PCB::ClassOf(), DIMENSION::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), MODULE::ClassOf(), SCH_COMPONENT::ClassOf(), D_PAD::ClassOf(), BOARD::ClassOf(), VIA::ClassOf(), SCH_SHEET::CleanupSheet(), Collect_TrackSegmentsToDrag(), LIB_CIRCLE::compare(), LIB_BEZIER::compare(), LIB_RECTANGLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), SCH_SHEET::ComponentCount(), GRID_HELPER::computeAnchors(), SCH_SCREEN::CountConnectedItems(), SCH_SHEET::CountSheets(), MODULE::CoverageRatio(), LIB_EDIT_FRAME::CreateGraphicItem(), CINFO3D_VISU::createLayers(), BOARD::CreateLockPoint(), SCH_EDIT_FRAME::CreateNewText(), CINFO3D_VISU::createNewTrack(), PCB_EDIT_FRAME::createPopupMenuForTracks(), CreateRoutesSection(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), D_PAD::D_PAD(), FOOTPRINT_EDIT_FRAME::Delete_Edge_Module(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), LIB_EDIT_FRAME::deleteItem(), SCH_EDIT_FRAME::DeleteItem(), DeleteNullTrackSegments(), 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(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), DRC::doTrackDrc(), DRC::doTrackKeepoutDrc(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), DrawMovePin(), DrawMovingBlockOutlines(), drawPickedItems(), CN_ITEM::Dump(), BOARD::Duplicate(), MODULE::Duplicate(), PCB_EDIT_FRAME::duplicateItems(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditSymbolText(), EditToolSelectionFilter(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::EraseRedundantTrack(), ExitSheet(), find_vias_and_tracks_at(), SCH_EDIT_FRAME::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(), FootprintWriteShape(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), TRACK::GetBestInsertPoint(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetClearance(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), NETLIST_OBJECT::GetComponentParent(), SCH_SCREEN::GetConnection(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetEndPoints(), SCH_SHEET::GetEndPoints(), GetFirstTrack(), GetFirstVia(), SCH_SCREEN::GetHierarchicalItems(), SCH_SCREENS::GetLibNicknames(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), BOARD_CONNECTED_ITEM::GetNetClass(), CONNECTIVITY_DATA::GetNetItems(), GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), SCH_SCREEN::GetPin(), GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), getRect(), SELECTION::GetTopLeftItem(), LIB_EDIT_FRAME::GlobalSetPins(), SELECTION_TOOL::guessSelectionCandidates(), hash_eda(), SCH_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), SELECTION_TOOL::highlight(), KIGFX::SCH_VIEW::HighlightItem(), SCH_EDIT_FRAME::ImportSheetPin(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), SCH_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), SCH_FIND_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), SCH_COLLECTOR::IsNode(), TRACK::IsNull(), SCH_LINE::IsParallel(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), SCH_EDIT_FRAME::LocateAndShowItem(), SCH_EDIT_FRAME::LocateItem(), SCH_SHEET::LocatePathOfScreen(), Magnetize(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), MarkItemsInBloc(), BOARD::MarkTrace(), TRACKS_CLEANER::mergeCollinearSegmentIfPossible(), TRACKS_CLEANER::MergeCollinearTracks(), SCH_LINE::MergeOverlap(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), moveItemWithMouseCursor(), MoveMarkedItems(), MoveMarkedItemsExactly(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), LIB_EDIT_FRAME::OnEditComponentProperties(), SCH_EDIT_FRAME::OnEditItem(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), SCH_EDIT_FRAME::OnHotKey(), LIB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), 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==(), OrCell_Trace(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::PasteItemsFromClipboard(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), DRAWING_TOOL::PlaceImportedGraphics(), LIB_EDIT_FRAME::PlacePin(), SCH_FIELD::Plot(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), SCH_EDIT_FRAME::PrepareMoveItem(), GAL_ARRAY_CREATOR::prePushAction(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), DIALOG_EXCHANGE_FOOTPRINTS::processMatchingModules(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_BASE_FRAME::RefreshItem(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), CN_CONNECTIVITY_ALGO::Remove(), BOARD::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), RemoveDrawItem(), TRACKS_CLEANER::removeDuplicatesOfTrack(), SCH_SHEET::RemovePin(), FOOTPRINT_EDIT_FRAME::RemoveStruct(), PCB_EDIT_FRAME::RemoveStruct(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SCREEN::ReplaceWires(), PCB_BASE_FRAME::ResetTextSize(), SCH_EDIT_FRAME::ReSizeSheet(), BOARD_COMMIT::Revert(), SCH_TEXT::Rotate(), SCH_EDIT_FRAME::RotateField(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_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::SaveWireImage(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SELECTION_TOOL::select(), SELECTION_TOOL::selectable(), SCH_SCREEN::SelectBlockItems(), PCB_EDIT_FRAME::SelectHighLight(), ITEM_PICKER::SetItem(), SetSchItemParent(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), PCB_EDIT_FRAME::Show_1_Ratsnest(), Show_MoveNode(), ShowClearance(), ShowNewTrackWhenMovingCursor(), SortByTimeStamp(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), PCB_TARGET::SwapData(), SCH_BITMAP::SwapData(), SCH_FIELD::SwapData(), SCH_SHEET_PIN::SwapData(), TEXTE_PCB::SwapData(), DIMENSION::SwapData(), DRAWSEGMENT::SwapData(), TRACK::SwapData(), SCH_SHEET::SwapData(), VIA::SwapData(), SCH_COMPONENT::SwapData(), ZONE_CONTAINER::SwapData(), MODULE::SwapData(), D_PAD::SwapData(), SwapItemData(), PCB_EDIT_FRAME::SwitchLayer(), TestDuplicateSheetNames(), TRACKS_CLEANER::testTrackEndpointDangling(), TEXTE_MODULE::TEXTE_MODULE(), AR_MATRIX::TraceSegmentPcb(), TraceSegmentPcb(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), SELECTION_TOOL::unhighlight(), SCH_SHEET_PATH::UpdateAllScreenReferences(), SCH_TEXT::UpdateDanglingState(), POINT_EDITOR::updateItem(), POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), EDA_ITEM::Visit(), SCH_SHEET::Visit(), and SCH_COMPONENT::Visit().

◆ UnitsLocked()

bool LIB_PART::UnitsLocked ( ) const
inline

Check whether part units are interchangeable.

Returns
False when interchangeable, true otherwise.

Definition at line 416 of file class_libentry.h.

416 { 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_FRAME::BlockSelectItems(), SCH_REFERENCE::IsUnitsLocked(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), LIB_EDIT_FRAME::OnEditComponentProperties(), LIB_EDIT_FRAME::OnUpdateSyncPinEdit(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), LIB_EDIT_FRAME::SetCurPart(), LIB_EDIT_FRAME::SynchronizePins(), 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, TRACK, DRAWSEGMENT, DIMENSION, TEXTE_MODULE, LIB_ALIAS, KIGFX::WORKSHEET_VIEWITEM, MARKER_PCB, 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 265 of file base_struct.cpp.

266 {
267  // Basic fallback
268  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
269  VECTOR2I( GetBoundingBox().GetSize() ) );
270 }
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 BRIGHT_BOX::ViewBBox(), DIMENSION::ViewBBox(), DRAWSEGMENT::ViewBBox(), BRIGHT_BOX::ViewDraw(), and COMMON_TOOLS::ZoomFitScreen().

◆ 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::WORKSHEET_VIEWITEM, 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 793 of file class_libentry.cpp.

794 {
795  aCount = 2;
796  aLayers[0] = LAYER_DEVICE;
797  aLayers[1] = LAYER_DEVICE_BACKGROUND;
798 }

References LAYER_DEVICE, and LAYER_DEVICE_BACKGROUND.

◆ 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 D_PAD, MODULE, VIA, GERBER_DRAW_ITEM, TRACK, TEXTE_MODULE, 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()().

◆ viewPrivData()

◆ Visit()

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

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 in BOARD, SCH_COMPONENT, MODULE, SCH_SHEET, GERBER_FILE_IMAGE, GERBER_DRAW_ITEM, TRACK, and GBR_LAYOUT.

Definition at line 149 of file base_struct.cpp.

150 {
151  KICAD_T stype;
152 
153 #if 0 && defined(DEBUG)
154  std::cout << GetClass().mb_str() << ' ';
155 #endif
156 
157  for( const KICAD_T* p = scanTypes; (stype = *p) != EOT; ++p )
158  {
159  // If caller wants to inspect my type
160  if( stype == Type() )
161  {
162  if( SEARCH_QUIT == inspector( this, testData ) )
163  return SEARCH_QUIT;
164 
165  break;
166  }
167  }
168 
169  return SEARCH_CONTINUE;
170 }
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
virtual wxString GetClass() const =0
Function GetClass returns the class name.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201

References EOT, EDA_ITEM::GetClass(), SEARCH_CONTINUE, SEARCH_QUIT, and EDA_ITEM::Type().

Referenced by GERBER_COLLECTOR::Collect(), GENERAL_COLLECTOR::Collect(), PCB_TYPE_COLLECTOR::Collect(), PCB_LAYER_COLLECTOR::Collect(), and EDA_ITEM::IterateForward().

Member Data Documentation

◆ m_aliases

LIB_ALIASES LIB_PART::m_aliases
private

List of alias object pointers associated with the part.

Definition at line 262 of file class_libentry.h.

Referenced by AddAlias(), GetAlias(), GetAliasCount(), GetAliases(), GetAliasNames(), GetName(), HasAlias(), LIB_PART(), RemoveAlias(), RemoveAllAliases(), SetName(), and ~LIB_PART().

◆ m_dateLastEdition

timestamp_t LIB_PART::m_dateLastEdition
private

Date of the last modification.

Definition at line 256 of file class_libentry.h.

Referenced by GetDateLastEdition(), LIB_PART(), LoadDateAndTime(), and SaveDateAndTime().

◆ m_drawings

◆ m_Flags

STATUS_FLAGS EDA_ITEM::m_Flags
protectedinherited

Flag bits for editing and other uses.

Definition at line 178 of file base_struct.h.

Referenced by LIB_CIRCLE::BeginEdit(), LIB_RECTANGLE::BeginEdit(), LIB_POLYLINE::BeginEdit(), LIB_TEXT::BeginEdit(), LIB_ARC::BeginEdit(), LIB_FIELD::BeginEdit(), LIB_CIRCLE::CalcEdit(), LIB_POLYLINE::CalcEdit(), LIB_RECTANGLE::CalcEdit(), LIB_TEXT::CalcEdit(), LIB_ARC::CalcEdit(), LIB_FIELD::CalcEdit(), LIB_PIN::CalcEdit(), EDA_ITEM::ClearFlags(), LIB_TEXT::Clone(), LIB_CIRCLE::ContinueEdit(), LIB_RECTANGLE::ContinueEdit(), LIB_POLYLINE::ContinueEdit(), LIB_TEXT::ContinueEdit(), LIB_ARC::ContinueEdit(), LIB_FIELD::ContinueEdit(), SCH_LINE::Draw(), TRACK::Draw(), DRAWSEGMENT::Draw(), MODULE::Draw(), SEGZONE::Draw(), D_PAD::Draw(), LIB_CIRCLE::drawGraphic(), LIB_POLYLINE::drawGraphic(), LIB_RECTANGLE::drawGraphic(), LIB_BEZIER::drawGraphic(), LIB_ARC::drawGraphic(), DRAWSEGMENT::DRAWSEGMENT(), LIB_CIRCLE::EndEdit(), LIB_RECTANGLE::EndEdit(), LIB_POLYLINE::EndEdit(), LIB_TEXT::EndEdit(), LIB_ARC::EndEdit(), LIB_ITEM::EndEdit(), LIB_FIELD::EndEdit(), EDA_ITEM::GetFlags(), TRACK::GetMsgPanelInfoBase_Common(), SCH_JUNCTION::HitTest(), SCH_LINE::HitTest(), SCH_COMPONENT::HitTest(), LIB_ITEM::InEditMode(), EDA_ITEM::initVars(), EDA_ITEM::IsBrightened(), SCH_ITEM::IsConnected(), EDA_ITEM::IsDragging(), EDA_ITEM::IsHighlighted(), EDA_ITEM::IsModified(), EDA_ITEM::IsMoving(), EDA_ITEM::IsNew(), EDA_ITEM::IsResized(), EDA_ITEM::IsSelected(), EDA_ITEM::IsWireImage(), SCH_LINE::Move(), EDA_ITEM::operator=(), SCH_COMPONENT::SCH_COMPONENT(), LIB_PIN::SetConversion(), EDA_ITEM::SetFlags(), LIB_PIN::SetLength(), LIB_PIN::SetName(), LIB_PIN::SetNameTextSize(), LIB_PIN::SetNumberTextSize(), LIB_PIN::SetOrientation(), LIB_PIN::SetPartNumber(), LIB_PIN::SetPinPosition(), LIB_PIN::SetShape(), LIB_PIN::SetType(), and LIB_PIN::SetVisible().

◆ m_FootprintList

wxArrayString LIB_PART::m_FootprintList
private

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

Definition at line 260 of file class_libentry.h.

Referenced by GetFootprints(), and LIB_PART().

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

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

Definition at line 175 of file base_struct.h.

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

◆ m_libId

LIB_ID LIB_PART::m_libId
private

Definition at line 249 of file class_libentry.h.

Referenced by 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 264 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 169 of file base_struct.h.

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

◆ m_me

◆ m_options

LIBRENTRYOPTIONS LIB_PART::m_options
private

Special part features such as POWER or NORMAL.)

Definition at line 257 of file class_libentry.h.

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

◆ m_Parent

◆ m_pinNameOffset

int LIB_PART::m_pinNameOffset
private

The offset in mils to draw the pin name.

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

Definition at line 250 of file class_libentry.h.

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

◆ m_showPinNames

bool LIB_PART::m_showPinNames
private

Determines if part pin names are visible.

Definition at line 254 of file class_libentry.h.

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

◆ m_showPinNumbers

bool LIB_PART::m_showPinNumbers
private

Determines if part pin numbers are visible.

Definition at line 255 of file class_libentry.h.

Referenced by 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 269 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 266 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 258 of file class_libentry.h.

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

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

◆ Pback

◆ Pnext


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