KiCad PCB EDA Suite
LIB_PART Class Reference

Define a library symbol object. More...

#include <class_libentry.h>

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

Public Member Functions

 LIB_PART (const wxString &aName, LIB_PART *aParent=nullptr, PART_LIB *aLibrary=nullptr)
 
 LIB_PART (const LIB_PART &aPart, PART_LIB *aLibrary=NULL)
 Copy constructor. More...
 
virtual ~LIB_PART ()
 
PART_SPTR SharedPtr ()
 
void SetParent (LIB_PART *aParent=nullptr)
 
PART_REFGetParent ()
 
virtual wxString GetClass () const override
 Function GetClass returns the class name. More...
 
virtual void SetName (const wxString &aName)
 
wxString GetName () const override
 
LIB_ID GetLibId () const override
 
void SetLibId (const LIB_ID &aLibId)
 
wxString GetLibNickname () const override
 
void SetDescription (const wxString &aDescription)
 
wxString GetDescription () override
 
void SetKeyWords (const wxString &aKeyWords)
 
wxString GetKeyWords () const
 
wxString GetSearchText () override
 
bool IsRoot () const override
 For symbols derived from other symbols, IsRoot() indicates no derivation. More...
 
bool IsAlias () const
 
const wxString GetLibraryName () const
 
PART_LIBGetLib ()
 
void SetLib (PART_LIB *aLibrary)
 
timestamp_t GetDateLastEdition () const
 
wxArrayString GetFootprints () const
 
void SetFootprintFilters (const wxArrayString &aFootprintFilters)
 
void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. More...
 
const EDA_RECT GetUnitBoundingBox (int aUnit, int aConvert) const
 Get the bounding box for the symbol. More...
 
const EDA_RECT GetBodyBoundingBox (int aUnit, int aConvert) const
 Get the symbol bounding box excluding fields. More...
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes. More...
 
bool IsPower () const
 
bool IsNormal () const
 
void SetPower ()
 
void SetNormal ()
 
void LockUnits (bool aLockUnits)
 Set interchangeable the property for part units. More...
 
bool UnitsLocked () const
 Check whether part units are interchangeable. More...
 
void SetFields (const std::vector< LIB_FIELD > &aFieldsList)
 Overwrite all the existing fields in this symbol with fields supplied in aFieldsList. More...
 
void GetFields (LIB_FIELDS &aList)
 Return a list of fields within this part. More...
 
LIB_FIELDFindField (const wxString &aFieldName)
 Find a field within this part matching aFieldName and returns it or NULL if not found. More...
 
const LIB_FIELDFindField (const wxString &aFieldName) const
 
LIB_FIELDGetField (int aId) const
 Return pointer to the requested field. More...
 
LIB_FIELDGetValueField ()
 Return reference to the value field. More...
 
LIB_FIELDGetReferenceField ()
 Return reference to the reference designator field. More...
 
LIB_FIELDGetFootprintField ()
 Return reference to the footprint field. More...
 
LIB_FIELDGetDatasheetField ()
 Return reference to the datasheet field. More...
 
void Print (RENDER_SETTINGS *aSettings, const wxPoint &aOffset, int aMulti, int aConvert, const PART_DRAW_OPTIONS &aOpts)
 Print part. More...
 
void Plot (PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform)
 Plot lib part to plotter. More...
 
void PlotLibFields (PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform)
 Plot Lib Fields only of the part to plotter. More...
 
void AddDrawItem (LIB_ITEM *aItem)
 Add a new draw aItem to the draw object list. More...
 
void RemoveDrawItem (LIB_ITEM *aItem)
 Remove draw aItem from list. More...
 
LIB_ITEMGetNextDrawItem (LIB_ITEM *aItem=NULL, KICAD_T aType=TYPE_NOT_INIT)
 Return the next draw object pointer. More...
 
size_t GetPinCount () const
 
LIB_PINGetNextPin (LIB_PIN *aItem=NULL)
 Return the next pin object from the draw list. More...
 
void GetPins (LIB_PINS &aList, int aUnit=0, int aConvert=0)
 Return a list of pin object pointers from the draw item list. More...
 
LIB_PINGetPin (const wxString &aNumber, int aUnit=0, int aConvert=0)
 Return pin object with the requested pin aNumber. More...
 
bool PinsConflictWith (LIB_PART &aOtherPart, bool aTestNums, bool aTestNames, bool aTestType, bool aTestOrientation, bool aTestLength)
 Return true if this part's pins do not match another part's pins. More...
 
void SetOffset (const wxPoint &aOffset)
 Move the part aOffset. More...
 
void RemoveDuplicateDrawItems ()
 Remove duplicate draw items from list. More...
 
bool HasConversion () const
 Test if part has more than one body conversion type (DeMorgan). More...
 
void ClearTempFlags ()
 Clears the status flag all draw objects in this part. More...
 
void ClearEditFlags ()
 
LIB_ITEMLocateDrawItem (int aUnit, int aConvert, KICAD_T aType, const wxPoint &aPoint)
 Locate a draw object. More...
 
LIB_ITEMLocateDrawItem (int aUnit, int aConvert, KICAD_T aType, const wxPoint &aPoint, const TRANSFORM &aTransform)
 Locate a draw object (overlaid) More...
 
LIB_ITEMS_CONTAINERGetDrawItems ()
 Return a reference to the draw item list. More...
 
SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
 Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
void SetUnitCount (int aCount, bool aDuplicateDrawItems=true)
 Set the units per part count. More...
 
int GetUnitCount () const override
 For items with units, return the number of units. More...
 
wxString GetUnitReference (int aUnit) override
 Return an identifier for aUnit for symbols with units. More...
 
bool IsMulti () const
 
void SetConversion (bool aSetConvert, bool aDuplicatePins=true)
 Set or clear the alternate body style (DeMorgan) for the part. More...
 
void SetPinNameOffset (int aOffset)
 Set the offset in mils of the pin name text from the pin symbol. More...
 
int GetPinNameOffset ()
 
void SetShowPinNames (bool aShow)
 Set or clear the pin name visibility flag. More...
 
bool ShowPinNames ()
 
void SetShowPinNumbers (bool aShow)
 Set or clear the pin number visibility flag. More...
 
bool ShowPinNumbers ()
 
void SetIncludeInBom (bool aIncludeInBom)
 Set or clear the include in schematic bill of materials flag. More...
 
bool GetIncludeInBom () const
 
void SetIncludeOnBoard (bool aIncludeOnBoard)
 Set or clear include in board netlist flag. More...
 
bool GetIncludeOnBoard () const
 
int Compare (const LIB_PART &aRhs) const
 Comparison test that can be used for operators. More...
 
bool operator== (const LIB_PART *aPart) const
 
bool operator== (const LIB_PART &aPart) const
 
bool operator!= (const LIB_PART &aPart) const
 
const LIB_PARToperator= (const LIB_PART &aPart)
 
std::unique_ptr< LIB_PARTFlatten () const
 Return a flattened symbol inheritance to the caller. More...
 
std::vector< struct PART_UNITSGetUnitDrawItems ()
 Return a list of LIB_ITEM objects separated by unit and convert number. More...
 
std::vector< struct PART_UNITSGetUniqueUnits ()
 Return a list of unit numbers that are unique to this symbol. More...
 
std::vector< LIB_ITEM * > GetUnitItems (int aUnit, int aConvert)
 Return a list of item pointers for aUnit and aConvert for this symbol. More...
 
KICAD_T Type () const
 Function Type() More...
 
EDA_ITEMGetParent () const
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag)
 
STATUS_FLAGS GetEditFlags () const
 
virtual bool IsType (const KICAD_T aScanTypes[]) const
 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...
 
bool IsForceVisible () const
 
virtual void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
virtual bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const
 Function HitTest tests if aPosition is contained within or on the bounding box of an item. More...
 
virtual bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const
 Function HitTest tests if aRect intersects or is contained within the bounding box of an item. More...
 
virtual wxPoint GetPosition () const
 
virtual void SetPosition (const wxPoint &aPos)
 
virtual const wxPoint GetFocusPosition () const
 Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual EDA_ITEMClone () const
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
virtual wxString GetSelectMenuText (EDA_UNITS aUnits) const
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
virtual BITMAP_DEF GetMenuImage () const
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
virtual double 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 ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Static Public Member Functions

static wxString SubReference (int aUnit, bool aAddSeparator=true)
 
static int GetSubpartIdSeparator ()
 
static int * SubpartIdSeparatorPtr ()
 return a reference to m_subpartIdSeparator, only for read/save setting functions More...
 
static int GetSubpartFirstId ()
 
static int * SubpartFirstIdPtr ()
 return a reference to m_subpartFirstId, only for read/save setting functions More...
 
static void SetSubpartIdNotation (int aSep, int aFirstId)
 Set the separator char between the subpart id and the reference 0 (no separator) or '. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
static bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

const KIID m_Uuid
 

Protected Member Functions

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

Protected Attributes

STATUS_FLAGS m_Status
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
STATUS_FLAGS m_Flags
 

Private Member Functions

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

Private Attributes

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

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

Constructor & Destructor Documentation

◆ LIB_PART() [1/2]

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

Definition at line 88 of file class_libentry.cpp.

88  :
90  m_me( this, null_deleter() ),
91  m_includeInBom( true ),
92  m_includeOnBoard( true )
93 {
95  m_unitCount = 1;
98  m_unitsLocked = false;
99  m_showPinNumbers = true;
100  m_showPinNames = true;
101 
102  // Add the MANDATORY_FIELDS in RAM only. These are assumed to be present
103  // when the field editors are invoked.
104  m_drawings[LIB_FIELD_T].reserve( 4 );
109 
110  SetName( aName );
111 
112  if( aParent )
113  SetParent( aParent );
114 
115  SetLib( aLibrary );
116 }
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
bool m_includeOnBoard
Determines if symbol should be excluded from.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
bool m_includeInBom
Determines if symbol should be included in schematic BOM.
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.
void push_back(T *aItem)
Definition: multivector.h:169
void SetParent(LIB_PART *aParent=nullptr)
#define DEFAULT_PIN_NAME_OFFSET
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: base_struct.cpp:59
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Field Value of part, i.e. "3.3K".
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, DEFAULT_PIN_NAME_OFFSET, ENTRY_NORMAL, FOOTPRINT, LIB_FIELD_T, m_dateLastEdition, m_drawings, m_options, m_pinNameOffset, m_showPinNames, m_showPinNumbers, m_unitCount, m_unitsLocked, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), REFERENCE, SetLib(), SetName(), SetParent(), and VALUE.

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

◆ LIB_PART() [2/2]

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

Copy constructor.

Definition at line 119 of file class_libentry.cpp.

119  :
120  EDA_ITEM( aPart ),
121  m_me( this, null_deleter() )
122 {
123  LIB_ITEM* newItem;
124 
125  m_library = aLibrary;
126  m_name = aPart.m_name;
127  m_FootprintList = wxArrayString( aPart.m_FootprintList );
128  m_unitCount = aPart.m_unitCount;
136  m_options = aPart.m_options;
137  m_libId = aPart.m_libId;
139  m_keyWords = aPart.m_keyWords;
140 
141  ClearSelected();
142 
143  for( const LIB_ITEM& oldItem : aPart.m_drawings )
144  {
145  if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 )
146  continue;
147 
148  try
149  {
150  newItem = (LIB_ITEM*) oldItem.Clone();
151  newItem->ClearSelected();
152  newItem->SetParent( this );
153  m_drawings.push_back( newItem );
154  }
155  catch( ... )
156  {
157  wxFAIL_MSG( "Failed to clone LIB_ITEM." );
158  }
159  }
160 
161  PART_SPTR parent = aPart.m_parent.lock();
162 
163  if( parent )
164  SetParent( parent.get() );
165 }
timestamp_t m_dateLastEdition
Date of the last modification.
bool m_showPinNumbers
Determines if part pin numbers are visible.
void ClearSelected()
Definition: base_struct.h:211
int m_unitCount
Number of units (parts) per package.
PART_LIB * m_library
Library the part belongs to if any.
bool m_includeOnBoard
Determines if symbol should be excluded from.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
bool m_includeInBom
Determines if symbol should be included in schematic BOM.
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define IS_NEW
New item, just created.
Definition: base_struct.h:117
int m_pinNameOffset
The offset in mils to draw the pin name.
PART_REF m_parent
Use for inherited symbols.
wxString m_name
Symbol name.
void push_back(T *aItem)
Definition: multivector.h:169
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
void SetParent(LIB_PART *aParent=nullptr)
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
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:59
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
wxString m_keyWords
keyword list (used for search for parts by keyword)
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:234
bool m_showPinNames
Determines if part pin names are visible.
wxString m_description
documentation for info
PART_SPTR m_me
< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared

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

◆ ~LIB_PART()

LIB_PART::~LIB_PART ( )
virtual

Definition at line 168 of file class_libentry.cpp.

169 {
170 }

Member Function Documentation

◆ AddDrawItem()

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearEditFlags()

void LIB_PART::ClearEditFlags ( )

Definition at line 989 of file class_libentry.cpp.

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

References m_drawings.

Referenced by LIB_EDIT_FRAME::SaveCopyInUndoList().

◆ ClearFlags()

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

Definition at line 233 of file base_struct.h.

233 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References EDA_ITEM::m_Flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), LIB_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceModule(), LIB_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::RollbackPartFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearSelected()

◆ ClearTempFlags()

void LIB_PART::ClearTempFlags ( )

Clears the status flag all draw objects in this part.

Definition at line 982 of file class_libentry.cpp.

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

References m_drawings.

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

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 154 of file view_item.h.

155  {
157  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:162
#define NULL

References KIGFX::VIEW_ITEM::m_viewPrivData, and NULL.

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

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Function Clone creates a duplicate of this item with linked list members set to NULL.

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

Returns
A clone of the item.

Reimplemented in MODULE_ZONE_CONTAINER, ZONE_CONTAINER, SCH_COMPONENT, MODULE, D_PAD, SCH_SHEET, CENTER_DIMENSION, LEADER, SCH_HIERLABEL, ORTHOGONAL_DIMENSION, VIA, SCH_GLOBALLABEL, ALIGNED_DIMENSION, SCH_LABEL, ARC, DRAWSEGMENT, SCH_TEXT, LIB_PIN, TRACK, TEXTE_MODULE, SCH_LINE, SCH_BUS_BUS_ENTRY, SCH_SHEET_PIN, SCH_FIELD, LIB_FIELD, SCH_BUS_WIRE_ENTRY, EDGE_MODULE, SCH_BITMAP, TEXTE_PCB, LIB_ARC, PCB_GROUP, SCH_NO_CONNECT, LIB_POLYLINE, SCH_JUNCTION, SCH_MARKER, LIB_TEXT, PCB_TARGET, LIB_CIRCLE, LIB_BEZIER, LIB_RECTANGLE, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 105 of file base_struct.cpp.

106 {
107  wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
108  wxT( ". Bad programmer!" ) );
109 }
#define NULL
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass(), and NULL.

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

◆ Compare()

int LIB_PART::Compare ( const LIB_PART aRhs) const

Comparison test that can be used for operators.

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

Definition at line 217 of file class_libentry.cpp.

218 {
219  if( m_me == aRhs.m_me )
220  return 0;
221 
222  int retv = m_name.Cmp( aRhs.m_name );
223 
224  if( retv )
225  return retv;
226 
227  retv = m_libId.compare( aRhs.m_libId );
228 
229  if( retv )
230  return retv;
231 
232  if( m_parent.lock() < aRhs.m_parent.lock() )
233  return -1;
234 
235  if( m_parent.lock() > aRhs.m_parent.lock() )
236  return 1;
237 
238  if( m_options != aRhs.m_options )
239  return ( m_options == ENTRY_NORMAL ) ? -1 : 1;
240 
241  if( m_unitCount != aRhs.m_unitCount )
242  return m_unitCount - aRhs.m_unitCount;
243 
244  if( m_drawings.size() != aRhs.m_drawings.size() )
245  return m_drawings.size() - aRhs.m_drawings.size();
246 
249 
250  while( lhsItem != m_drawings.end() )
251  {
252  if( lhsItem->Type() != rhsItem->Type() )
253  return lhsItem->Type() - rhsItem->Type();
254 
255  retv = lhsItem->compare( *rhsItem );
256 
257  if( retv )
258  return retv;
259 
260  ++lhsItem;
261  ++rhsItem;
262  }
263 
264  if( m_FootprintList.GetCount() != aRhs.m_FootprintList.GetCount() )
265  return m_FootprintList.GetCount() - aRhs.m_FootprintList.GetCount();
266 
267  for( size_t i = 0; i < m_FootprintList.GetCount(); i++ )
268  {
269  retv = m_FootprintList[i].Cmp( aRhs.m_FootprintList[i] );
270 
271  if( retv )
272  return retv;
273  }
274 
275  retv = m_description.Cmp( aRhs.m_description );
276 
277  if( retv )
278  return retv;
279 
280  retv = m_keyWords.Cmp( aRhs.m_keyWords );
281 
282  if( retv )
283  return retv;
284 
285  if( m_pinNameOffset != aRhs.m_pinNameOffset )
286  return m_pinNameOffset - aRhs.m_pinNameOffset;
287 
288  if( m_unitsLocked != aRhs.m_unitsLocked )
289  return ( m_unitsLocked ) ? 1 : -1;
290 
291  if( m_showPinNames != aRhs.m_showPinNames )
292  return ( m_showPinNames ) ? 1 : -1;
293 
294  if( m_showPinNumbers != aRhs.m_showPinNumbers )
295  return ( m_showPinNumbers ) ? 1 : -1;
296 
297  if( m_includeInBom != aRhs.m_includeInBom )
298  return ( m_includeInBom ) ? 1 : -1;
299 
300  if( m_includeOnBoard != aRhs.m_includeOnBoard )
301  return ( m_includeOnBoard ) ? 1 : -1;
302 
303  return 0;
304 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
bool m_showPinNumbers
Determines if part pin numbers are visible.
int m_unitCount
Number of units (parts) per package.
bool m_includeOnBoard
Determines if symbol should be excluded from.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
bool m_includeInBom
Determines if symbol should be included in schematic BOM.
int compare(const LIB_ID &aLibId) const
Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname...
Definition: lib_id.cpp:316
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:189
int m_pinNameOffset
The offset in mils to draw the pin name.
PART_REF m_parent
Use for inherited symbols.
wxString m_name
Symbol name.
wxArrayString m_FootprintList
List of suitable footprint names for the part (wild card names accepted).
LIB_ID m_libId
ITERATOR_BASE< const LIB_ITEM, const MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::const_iterator > CONST_ITERATOR
The const iterator
Definition: multivector.h:162
wxString m_keyWords
keyword list (used for search for parts by keyword)
bool m_showPinNames
Determines if part pin names are visible.
wxString m_description
documentation for info
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:220
PART_SPTR m_me
< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared

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

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

◆ deleteAllFields()

void LIB_PART::deleteAllFields ( )
private

Definition at line 828 of file class_libentry.cpp.

829 {
831 }
void clear(int aType=UNDEFINED_TYPE)
Definition: multivector.h:207
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.

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

Referenced by SetFields().

◆ FindField() [1/2]

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

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

Definition at line 892 of file class_libentry.cpp.

893 {
894  for( LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
895  {
896  if( static_cast<LIB_FIELD*>( &item )->GetCanonicalName() == aFieldName )
897  return static_cast<LIB_FIELD*>( &item );
898  }
899 
900  return NULL;
901 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define NULL

References LIB_FIELD_T, m_drawings, and NULL.

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

◆ FindField() [2/2]

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

Definition at line 904 of file class_libentry.cpp.

905 {
906  for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
907  {
908  if( static_cast<const LIB_FIELD*>( &item )->GetCanonicalName() == aFieldName )
909  return static_cast<const LIB_FIELD*>( &item );
910  }
911 
912  return NULL;
913 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define NULL

References LIB_FIELD_T, m_drawings, and NULL.

◆ Flatten()

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

Return a flattened symbol inheritance to the caller.

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

Returns
a flattened symbol on the heap

Definition at line 333 of file class_libentry.cpp.

334 {
335  std::unique_ptr< LIB_PART > retv;
336 
337  if( IsAlias() )
338  {
339  PART_SPTR parent = m_parent.lock();
340 
341  wxCHECK_MSG( parent, retv,
342  wxString::Format( "Parent of derived symbol '%s' undefined", m_name ) );
343 
344  // Copy the parent.
345  retv.reset( new LIB_PART( *parent.get() ) );
346 
347  retv->SetName( m_name );
348 
349  // Now add the inherited part mandatory field (this) information.
350  for( int i = 0; i < MANDATORY_FIELDS; i++ )
351  {
352  wxString tmp = GetField( i )->GetText();
353 
354  // If the field isn't defined then inherit the parent field value.
355  if( tmp.IsEmpty() )
356  retv->GetField( i )->SetText( parent->GetField( i )->GetText() );
357  else
358  *retv->GetField( i ) = *GetField( i );
359  }
360 
361  // Grab all the rest of derived symbol fields.
362  for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
363  {
364  const LIB_FIELD* aliasField = dynamic_cast<const LIB_FIELD*>( &item );
365 
366  wxCHECK2( aliasField, continue );
367 
368  // Mandatory fields were already resolved.
369  if( aliasField->IsMandatory() )
370  continue;
371 
372  LIB_FIELD* newField = new LIB_FIELD( *aliasField );
373  newField->SetParent( retv.get() );
374 
375  LIB_FIELD* parentField = retv->FindField( aliasField->GetName() );
376 
377  if( !parentField ) // Derived symbol field does not exist in parent symbol.
378  {
379  retv->AddDrawItem( newField );
380  }
381  else // Derived symbol field overrides the parent symbol field.
382  {
383  retv->RemoveDrawItem( parentField );
384  retv->AddDrawItem( newField );
385  }
386  }
387 
388  retv->SetKeyWords( m_keyWords );
389  retv->SetDescription( m_description );
390  }
391  else
392  {
393  retv.reset( new LIB_PART( *this ) );
394  }
395 
396  return retv;
397 }
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.
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
wxString GetName(bool aUseDefaultName=true) const
Returns the field name.
Definition: lib_field.cpp:366
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
PART_REF m_parent
Use for inherited symbols.
wxString m_name
Symbol name.
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
LIB_PART(const wxString &aName, LIB_PART *aParent=nullptr, PART_LIB *aLibrary=nullptr)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
bool IsAlias() const
wxString m_keyWords
keyword list (used for search for parts by keyword)
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.
wxString m_description
documentation for info
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:127
bool IsMandatory() const
Definition: lib_field.cpp:456

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

Referenced by LIB_EDIT_FRAME::CopyPartToClipboard(), SCH_EDIT_FRAME::CreateArchiveLibrary(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_FRAME::ExportPart(), LIB_EDIT_FRAME::GetDocumentExtents(), RESCUE_CACHE_CANDIDATE::PerformAction(), RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction(), DIALOG_CHANGE_SYMBOLS::processSymbol(), SCH_EDIT_TOOL::RefreshSymbolFromLibrary(), SCH_COMPONENT::SCH_COMPONENT(), DIALOG_EDIT_COMPONENTS_LIBID::TransferDataFromWindow(), SCH_EDIT_FRAME::UpdateSymbolFromEditor(), and SCH_SCREEN::UpdateSymbolLinks().

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 84 of file inspectable.h.

85  {
87  TYPE_ID thisType = TYPE_HASH( *this );
88  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
89  return object ? aProperty->getter( object ) : wxAny();
90  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual wxAny getter(void *aObject) const =0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

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

◆ Get() [2/3]

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

Definition at line 93 of file inspectable.h.

94  {
96  TYPE_ID thisType = TYPE_HASH( *this );
97  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
98  return object ? aProperty->get<T>( object ) : T();
99  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ Get() [3/3]

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

Definition at line 102 of file inspectable.h.

103  {
105  TYPE_ID thisType = TYPE_HASH( *this );
106  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
107  boost::optional<T> ret;
108 
109  if( prop )
110  {
111  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
112 
113  if( object )
114  ret = prop->get<T>( object );
115  }
116 
117  return ret;
118  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ GetBodyBoundingBox()

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

Get the symbol bounding box excluding fields.

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

Definition at line 805 of file class_libentry.cpp.

806 {
807  EDA_RECT bbox;
808 
809  for( const LIB_ITEM& item : m_drawings )
810  {
811  if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
812  && ( aUnit != item.m_Unit ) ) )
813  continue;
814 
815  if( item.m_Convert > 0 && ( ( aConvert > 0 ) && ( aConvert != item.m_Convert ) ) )
816  continue;
817 
818  if( item.Type() == LIB_FIELD_T )
819  continue;
820 
821  bbox.Merge( item.GetBoundingBox() );
822  }
823 
824  return bbox;
825 }
void Merge(const EDA_RECT &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
int m_unitCount
Number of units (parts) per package.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
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 231 of file class_libentry.h.

232  {
233  return GetUnitBoundingBox( 0, 0 );
234  }
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 157 of file class_libentry.h.

158  {
159  return wxT( "LIB_PART" );
160  }

◆ GetDatasheetField()

LIB_FIELD & LIB_PART::GetDatasheetField ( )

Return reference to the datasheet field.

Definition at line 940 of file class_libentry.cpp.

941 {
942  LIB_FIELD* field = GetField( DATASHEET );
943  wxASSERT( field != NULL );
944  return *field;
945 }
name of datasheet
Field object used in symbol libraries.
Definition: lib_field.h:59
#define NULL
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.

References DATASHEET, GetField(), and NULL.

Referenced by LIB_EDIT_FRAME::DisplayCmpDoc(), FOOTPRINT_INFO_GENERATOR::GetHtmlFieldRow(), LIB_VIEW_FRAME::setupUIConditions(), LIB_EDIT_FRAME::setupUIConditions(), EE_INSPECTION_TOOL::ShowDatasheet(), and DIALOG_UPDATE_FIELDS::updateFields().

◆ GetDateLastEdition()

timestamp_t LIB_PART::GetDateLastEdition ( ) const
inline

Definition at line 197 of file class_libentry.h.

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

References m_dateLastEdition.

Referenced by SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().

◆ GetDescription()

◆ GetDrawItems()

LIB_ITEMS_CONTAINER& LIB_PART::GetDrawItems ( )
inline

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 237 of file base_struct.h.

238  {
239  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
241 
242  return m_Flags & mask;
243  }
#define IS_NEW
New item, just created.
Definition: base_struct.h:117
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:119
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:118
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: base_struct.h:130
#define IS_MOVED
Item being moved.
Definition: base_struct.h:116

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, IS_WIRE_IMAGE, EDA_ITEM::m_Flags, and STRUCT_DELETED.

Referenced by SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), LIB_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_COMPONENT::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), LIB_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), PAD_TOOL::recombinePad(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), and SCH_EDIT_FRAME::TrimWire().

◆ GetField()

LIB_FIELD * LIB_PART::GetField ( int  aId) const

Return pointer to the requested field.

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

Definition at line 878 of file class_libentry.cpp.

879 {
880  for( const LIB_ITEM& item : m_drawings[ LIB_FIELD_T ] )
881  {
882  LIB_FIELD* field = ( LIB_FIELD* ) &item;
883 
884  if( field->GetId() == aId )
885  return field;
886  }
887 
888  return NULL;
889 }
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:138
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define NULL

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

Referenced by LIB_EDIT_FRAME::CreateNewPart(), Flatten(), GetDatasheetField(), GetFields(), GetFootprintField(), GetReferenceField(), GetValueField(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), SCH_LEGACY_PLUGIN_CACHE::loadDocs(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), DIALOG_CHANGE_SYMBOLS::processSymbol(), 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 849 of file class_libentry.cpp.

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

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

Referenced by DIALOG_CHANGE_SYMBOLS::processSymbol(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), FOOTPRINT_INFO_GENERATOR::SetHtmlFieldTable(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in DRAWSEGMENT, and TRACK.

Definition at line 345 of file base_struct.h.

345 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: base_struct.h:337

References EDA_ITEM::GetPosition().

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

◆ GetFootprintField()

LIB_FIELD & LIB_PART::GetFootprintField ( )

Return reference to the footprint field.

Definition at line 932 of file class_libentry.cpp.

933 {
934  LIB_FIELD* field = GetField( FOOTPRINT );
935  wxASSERT( field != NULL );
936  return *field;
937 }
Field object used in symbol libraries.
Definition: lib_field.h:59
Field Name Module PCB, i.e. "16DIP300".
#define NULL
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.

References FOOTPRINT, GetField(), and NULL.

Referenced by GetSearchText().

◆ GetFootprints()

wxArrayString LIB_PART::GetFootprints ( ) const
inline

Definition at line 199 of file class_libentry.h.

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

References m_FootprintList.

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

◆ GetIncludeInBom()

bool LIB_PART::GetIncludeInBom ( ) const
inline

Definition at line 585 of file class_libentry.h.

585 { return m_includeInBom; }
bool m_includeInBom
Determines if symbol should be included in schematic BOM.

References m_includeInBom.

Referenced by SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_COMPONENT::SCH_COMPONENT(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ GetIncludeOnBoard()

bool LIB_PART::GetIncludeOnBoard ( ) const
inline

Definition at line 593 of file class_libentry.h.

593 { return m_includeOnBoard; }
bool m_includeOnBoard
Determines if symbol should be excluded from.

References m_includeOnBoard.

Referenced by SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_COMPONENT::SCH_COMPONENT(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ GetKeyWords()

wxString LIB_PART::GetKeyWords ( ) const
inline

◆ GetLib()

PART_LIB* LIB_PART::GetLib ( )
inline

Definition at line 194 of file class_libentry.h.

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

References m_library.

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

◆ GetLibId()

◆ GetLibNickname()

wxString LIB_PART::GetLibNickname ( ) const
inlineoverridevirtual

Implements LIB_TREE_ITEM.

Definition at line 168 of file class_libentry.h.

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

References GetLibraryName().

◆ GetLibraryName()

const wxString LIB_PART::GetLibraryName ( ) const

Definition at line 400 of file class_libentry.cpp.

401 {
402  if( m_library )
403  return m_library->GetName();
404 
405  return m_libId.GetLibNickname();
406 }
const wxString GetName() const
Return the file name without path or extension.
PART_LIB * m_library
Library the part belongs to if any.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
LIB_ID m_libId

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

Referenced by GetLibNickname().

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

Definition at line 230 of file base_struct.cpp.

231 {
232  return dummy_xpm;
233 }
static const BITMAP_OPAQUE dummy_xpm[1]
Definition: base_struct.cpp:56

References dummy_xpm.

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

◆ GetMsgPanelInfo()

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

◆ GetName()

wxString LIB_PART::GetName ( void  ) const
inlineoverridevirtual

Implements LIB_TREE_ITEM.

Definition at line 163 of file class_libentry.h.

163 { return m_name; }
wxString m_name
Symbol name.

References m_name.

Referenced by SCH_SEXPR_PLUGIN_CACHE::AddSymbol(), SCH_LEGACY_PLUGIN_CACHE::AddSymbol(), LIB_EDIT_FRAME::DisplayCmpDoc(), LIB_EDIT_FRAME::DuplicatePart(), LIB_EDIT_TOOL::editSymbolProperties(), LIB_EDIT_FRAME::ensureUniqueName(), LIB_EDIT_FRAME::ExportPart(), LIB_CONTROL::ExportSymbolAsSVG(), LIB_CONTROL::ExportView(), LIB_MANAGER::GetBufferedPart(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), PART_LIB::GetParts(), SCH_LEGACY_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), LIB_EDIT_FRAME::LoadOneLibraryPartAux(), operator<(), SCH_SEXPR_PARSER::ParseLib(), PART_LIB::RemovePart(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), PART_LIB::ReplacePart(), LIB_MANAGER::LIB_BUFFER::SaveBuffer(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), LIB_EDIT_FRAME::SetCurPart(), FOOTPRINT_INFO_GENERATOR::SetHtmlName(), LIB_EDIT_FRAME::SyncLibraries(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow(), LIB_EDIT_FRAME::UpdateAfterSymbolProperties(), DIALOG_UPDATE_FIELDS::updateFields(), FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary(), LIB_MANAGER::UpdatePart(), LIB_MANAGER::UpdatePartAfterRename(), and LIB_VIEW_FRAME::updatePreviewSymbol().

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

627 {
628  if( aItem == NULL )
629  {
631 
632  return (it1 != m_drawings.end( aType ) ) ? &( *( m_drawings.begin( aType ) ) ) : nullptr;
633  }
634 
635  // Search for the last item, assume aItem is of type aType
636  wxASSERT( ( aType == TYPE_NOT_INIT ) || ( aType == aItem->Type() ) );
638 
639  while( ( it != m_drawings.end( aType ) ) && ( aItem != &( *it ) ) )
640  ++it;
641 
642  // Search the next item
643  if( it != m_drawings.end( aType ) )
644  {
645  ++it;
646 
647  if( it != m_drawings.end( aType ) )
648  return &( *it );
649  }
650 
651  return NULL;
652 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:189
#define NULL
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:193

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

Referenced by BOOST_AUTO_TEST_CASE(), and GetNextPin().

◆ GetNextPin()

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

Return the next pin object from the draw list.

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

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

Definition at line 374 of file class_libentry.h.

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

References GetNextDrawItem(), and LIB_PIN_T.

Referenced by LIB_EDIT_TOOL::DoDelete(), LIB_MOVE_TOOL::Main(), LIB_PIN_TOOL::PlacePin(), LIB_PIN_TOOL::PushPinProperties(), DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow(), and DIALOG_LIB_EDIT_PIN_TABLE::TransferDataToWindow().

◆ GetParent() [1/2]

◆ GetParent() [2/2]

◆ GetPin()

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

Return pin object with the requested pin aNumber.

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

Definition at line 678 of file class_libentry.cpp.

679 {
680  LIB_PINS pinList;
681 
682  GetPins( pinList, aUnit, aConvert );
683 
684  for( size_t i = 0; i < pinList.size(); i++ )
685  {
686  wxASSERT( pinList[i]->Type() == LIB_PIN_T );
687 
688  if( aNumber == pinList[i]->GetNumber() )
689  return pinList[i];
690  }
691 
692  return NULL;
693 }
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

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

◆ GetPinCount()

size_t LIB_PART::GetPinCount ( ) const
inline

Definition at line 363 of file class_libentry.h.

363 { return m_drawings.size( LIB_PIN_T ); }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:220

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

◆ GetPinNameOffset()

◆ GetPins()

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

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

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

Parameters
aList- Pin list to place pin object pointers into.
aUnit- Unit number of pin to add to list. Set to 0 to get pins from any part unit.
aConvert- Convert number of pin to add to list. Set to 0 to get pins from any convert of part.

Definition at line 655 of file class_libentry.cpp.

656 {
657  /* Notes:
658  * when aUnit == 0: no unit filtering
659  * when aConvert == 0: no convert (shape selection) filtering
660  * when .m_Unit == 0, the body item is common to units
661  * when .m_Convert == 0, the body item is common to shapes
662  */
663  for( LIB_ITEM& item : m_drawings[ LIB_PIN_T ] )
664  {
665  // Unit filtering:
666  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
667  continue;
668 
669  // Shape filtering:
670  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
671  continue;
672 
673  aList.push_back( (LIB_PIN*) &item );
674  }
675 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References LIB_PIN_T, and m_drawings.

Referenced by EE_INSPECTION_TOOL::checkPart(), KIGFX::SCH_PAINTER::draw(), LIB_PIN_TOOL::EditPinProperties(), GetPin(), PinsConflictWith(), and DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector().

◆ GetPosition()

virtual wxPoint EDA_ITEM::GetPosition ( ) const
inlinevirtualinherited

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

Definition at line 337 of file base_struct.h.

337 { return wxPoint(); }

Referenced by EE_GRID_HELPER::computeAnchors(), GRID_HELPER::computeAnchors(), SCH_EDIT_FRAME::DeleteJunction(), KIGFX::PCB_PAINTER::draw(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckNoConnects(), SELECTION_TOOL::findCallback(), GERBVIEW_SELECTION::GetCenter(), BOARD_ITEM::GetCenter(), EDA_ITEM::GetFocusPosition(), SCH_FIELD::GetParentPosition(), POSITION_RELATIVE_TOOL::GetSelectionAnchorPosition(), SCH_SCREEN::GetSheets(), PCBNEW_SELECTION::GetTopLeftItem(), BOARD_ITEM::GetX(), BOARD_ITEM::GetY(), LIB_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_ITEM::operator<(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PCBNEW_CONTROL::placeBoardItems(), DRAWING_TOOL::PlaceImportedGraphics(), DRAWING_TOOL::PlaceText(), BACK_ANNOTATE::processNetNameChange(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), SELECTION_TOOL::selectConnectedTracks(), RC_ITEM::ShowReport(), TransformItem(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), LIB_MOVE_TOOL::updateModificationPoint(), PL_EDIT_TOOL::updateModificationPoint(), and EE_POINT_EDITOR::updatePoints().

◆ GetReferenceField()

LIB_FIELD & LIB_PART::GetReferenceField ( )

Return reference to the reference designator field.

Definition at line 924 of file class_libentry.cpp.

925 {
926  LIB_FIELD* field = GetField( REFERENCE );
927  wxASSERT( field != NULL );
928  return *field;
929 }
Field object used in symbol libraries.
Definition: lib_field.h:59
Field Reference of part, i.e. "IC21".
#define NULL
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.

References GetField(), NULL, and REFERENCE.

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

◆ GetSearchText()

wxString LIB_PART::GetSearchText ( )
overridevirtual

Reimplemented from LIB_TREE_ITEM.

Definition at line 55 of file class_libentry.cpp.

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

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

◆ GetSelectMenuText()

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

Definition at line 131 of file base_struct.cpp.

132 {
133  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
134  GetClass() );
135 
136  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
137 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass().

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRC_ENGINE::EvalRulesForItems(), MARKER_PCB::GetMsgPanelInfo(), RC_TREE_MODEL::GetValue(), BOARD::GroupsSanityCheckInternal(), SELECTION_TOOL::highlightInternal(), PCB_INSPECTION_TOOL::InspectClearance(), RC_ITEM::ShowReport(), SELECTION_TOOL::unhighlightInternal(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 216 of file base_struct.h.

217  {
218  return m_Status & type;
219  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by TRACK::GetMsgPanelInfoBase_Common(), and TRACK::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 229 of file base_struct.h.

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

References EDA_ITEM::m_Status.

◆ GetSubpartFirstId()

static int LIB_PART::GetSubpartFirstId ( )
inlinestatic

Definition at line 521 of file class_libentry.h.

521 { 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::LoadProjectSettings(), PANEL_SETUP_FORMATTING::TransferDataFromWindow(), and PANEL_SETUP_FORMATTING::TransferDataToWindow().

◆ GetSubpartIdSeparator()

static int LIB_PART::GetSubpartIdSeparator ( )
inlinestatic

Definition at line 515 of file class_libentry.h.

515 { 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::LoadProjectSettings(), PANEL_SETUP_FORMATTING::TransferDataFromWindow(), and PANEL_SETUP_FORMATTING::TransferDataToWindow().

◆ GetUniqueUnits()

std::vector< struct PART_UNITS > LIB_PART::GetUniqueUnits ( )

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

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

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

Definition at line 1222 of file class_libentry.cpp.

1223 {
1224  int unitNum;
1225  size_t i;
1226  struct PART_UNITS unit;
1227  std::vector<LIB_ITEM*> compareDrawItems;
1228  std::vector<LIB_ITEM*> currentDrawItems;
1229  std::vector<struct PART_UNITS> uniqueUnits;
1230 
1231  // The first unit is guarenteed to be unique so always include it.
1232  unit.m_unit = 1;
1233  unit.m_convert = 1;
1234  unit.m_items = GetUnitItems( 1, 1 );
1235 
1236  // There are no unique units if there are no draw items other than fields.
1237  if( unit.m_items.size() == 0 )
1238  return uniqueUnits;
1239 
1240  uniqueUnits.emplace_back( unit );
1241 
1242  if( ( GetUnitCount() == 1 || UnitsLocked() ) && !HasConversion() )
1243  return uniqueUnits;
1244 
1245  currentDrawItems = unit.m_items;
1246 
1247  for( unitNum = 2; unitNum <= GetUnitCount(); unitNum++ )
1248  {
1249  compareDrawItems = GetUnitItems( unitNum, 1 );
1250 
1251  wxCHECK2_MSG( compareDrawItems.size() != 0, continue,
1252  "Multiple unit symbol defined with empty units." );
1253 
1254  if( currentDrawItems.size() != compareDrawItems.size() )
1255  {
1256  unit.m_unit = unitNum;
1257  unit.m_convert = 1;
1258  unit.m_items = compareDrawItems;
1259  uniqueUnits.emplace_back( unit );
1260  }
1261  else
1262  {
1263  for( i = 0; i < currentDrawItems.size(); i++ )
1264  {
1265  if( currentDrawItems[i]->compare( *compareDrawItems[i],
1266  LIB_ITEM::COMPARE_FLAGS::UNIT ) != 0 )
1267  {
1268  unit.m_unit = unitNum;
1269  unit.m_convert = 1;
1270  unit.m_items = compareDrawItems;
1271  uniqueUnits.emplace_back( unit );
1272  }
1273  }
1274  }
1275  }
1276 
1277  if( HasConversion() )
1278  {
1279  currentDrawItems = GetUnitItems( 1, 2 );
1280 
1281  if( ( GetUnitCount() == 1 || UnitsLocked() ) )
1282  {
1283  unit.m_unit = 1;
1284  unit.m_convert = 2;
1285  unit.m_items = currentDrawItems;
1286  uniqueUnits.emplace_back( unit );
1287 
1288  return uniqueUnits;
1289  }
1290 
1291  for( unitNum = 2; unitNum <= GetUnitCount(); unitNum++ )
1292  {
1293  compareDrawItems = GetUnitItems( unitNum, 2 );
1294 
1295  wxCHECK2_MSG( compareDrawItems.size() != 0, continue,
1296  "Multiple unit symbol defined with empty units." );
1297 
1298  if( currentDrawItems.size() != compareDrawItems.size() )
1299  {
1300  unit.m_unit = unitNum;
1301  unit.m_convert = 2;
1302  unit.m_items = compareDrawItems;
1303  uniqueUnits.emplace_back( unit );
1304  }
1305  else
1306  {
1307  for( i = 0; i < currentDrawItems.size(); i++ )
1308  {
1309  if( currentDrawItems[i]->compare( *compareDrawItems[i],
1310  LIB_ITEM::COMPARE_FLAGS::UNIT ) != 0 )
1311  {
1312  unit.m_unit = unitNum;
1313  unit.m_convert = 2;
1314  unit.m_items = compareDrawItems;
1315  uniqueUnits.emplace_back( unit );
1316  }
1317  }
1318  }
1319  }
1320  }
1321 
1322  return uniqueUnits;
1323 }
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
int m_unit
The unit number.
std::vector< LIB_ITEM * > GetUnitItems(int aUnit, int aConvert)
Return a list of item pointers for aUnit and aConvert for this symbol.
int GetUnitCount() const override
For items with units, return the number of units.
bool UnitsLocked() const
Check whether part units are interchangeable.

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

◆ GetUnitBoundingBox()

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

Get the bounding box for the symbol.

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

Definition at line 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_item.h:61
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

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

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

◆ GetUnitCount()

int LIB_PART::GetUnitCount ( ) const
overridevirtual

◆ GetUnitDrawItems()

std::vector< struct PART_UNITS > LIB_PART::GetUnitDrawItems ( )

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

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

Definition at line 1187 of file class_libentry.cpp.

1188 {
1189  std::vector<struct PART_UNITS> units;
1190 
1191  for( LIB_ITEM& item : m_drawings )
1192  {
1193  if( item.Type() == LIB_FIELD_T )
1194  continue;
1195 
1196  int unit = item.GetUnit();
1197  int convert = item.GetConvert();
1198 
1199  auto it = std::find_if( units.begin(), units.end(),
1200  [unit, convert] ( const auto& a ) {
1201  return a.m_unit == unit && a.m_convert == convert;
1202  } );
1203 
1204  if( it == units.end() )
1205  {
1206  struct PART_UNITS newUnit;
1207  newUnit.m_unit = item.GetUnit();
1208  newUnit.m_convert = item.GetConvert();
1209  newUnit.m_items.push_back( &item );
1210  units.emplace_back( newUnit );
1211  }
1212  else
1213  {
1214  it->m_items.push_back( &item );
1215  }
1216  }
1217 
1218  return units;
1219 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
int m_unit
The unit number.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

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

Referenced by SCH_SEXPR_PLUGIN_CACHE::SaveSymbol().

◆ GetUnitItems()

std::vector< LIB_ITEM * > LIB_PART::GetUnitItems ( int  aUnit,
int  aConvert 
)

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

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

Definition at line 1168 of file class_libentry.cpp.

1169 {
1170  std::vector<LIB_ITEM*> unitItems;
1171 
1172  for( LIB_ITEM& item : m_drawings )
1173  {
1174  if( item.Type() == LIB_FIELD_T )
1175  continue;
1176 
1177  if( ( aConvert == -1 && item.GetUnit() == aUnit )
1178  || ( aUnit == -1 && item.GetConvert() == aConvert )
1179  || ( aUnit == item.GetUnit() && aConvert == item.GetConvert() ) )
1180  unitItems.push_back( &item );
1181  }
1182 
1183  return unitItems;
1184 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References LIB_FIELD_T, and m_drawings.

Referenced by GetUniqueUnits().

◆ GetUnitReference()

wxString LIB_PART::GetUnitReference ( int  aUnit)
overridevirtual

Return an identifier for aUnit for symbols with units.

Reimplemented from LIB_TREE_ITEM.

Definition at line 307 of file class_libentry.cpp.

308 {
309  return LIB_PART::SubReference( aUnit, false );
310 }
static wxString SubReference(int aUnit, bool aAddSeparator=true)

References SubReference().

◆ GetValueField()

LIB_FIELD & LIB_PART::GetValueField ( )

Return reference to the value field.

Definition at line 916 of file class_libentry.cpp.

917 {
918  LIB_FIELD* field = GetField( VALUE );
919  wxASSERT( field != NULL );
920  return *field;
921 }
Field object used in symbol libraries.
Definition: lib_field.h:59
#define NULL
Field Value of part, i.e. "3.3K".
LIB_FIELD * GetField(int aId) const
Return pointer to the requested field.

References GetField(), NULL, and VALUE.

Referenced by PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), and SetName().

◆ HasConversion()

bool LIB_PART::HasConversion ( ) const

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

Returns
True if part has more than one conversion.

Definition at line 961 of file class_libentry.cpp.

962 {
963  for( const LIB_ITEM& item : m_drawings )
964  {
965  if( item.m_Convert > LIB_ITEM::LIB_CONVERT::BASE )
966  return true;
967  }
968 
969  if( PART_SPTR parent = m_parent.lock() )
970  {
971  for( const LIB_ITEM& item : parent->GetDrawItems() )
972  {
973  if( item.m_Convert > LIB_ITEM::LIB_CONVERT::BASE )
974  return true;
975  }
976  }
977 
978  return false;
979 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
PART_REF m_parent
Use for inherited symbols.
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART

References m_drawings, and m_parent.

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

◆ HasFlag()

◆ HitTest() [1/2]

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

◆ HitTest() [2/2]

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

Function HitTest tests if aRect intersects or is contained within the bounding box of an item.

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

Reimplemented in SCH_COMPONENT, SCH_SHEET, D_PAD, MODULE, ZONE_CONTAINER, VIA, WS_DRAW_ITEM_BITMAP, SCH_TEXT, ARC, WS_DRAW_ITEM_TEXT, DRAWSEGMENT, GERBER_DRAW_ITEM, DIMENSION, SCH_LINE, LIB_PIN, TEXTE_MODULE, TRACK, LIB_ITEM, SCH_FIELD, WS_DRAW_ITEM_POLYPOLYGONS, SCH_BITMAP, PCB_GROUP, SCH_BUS_ENTRY_BASE, SCH_NO_CONNECT, TEXTE_PCB, SCH_JUNCTION, WS_DRAW_ITEM_BASE, PCB_TARGET, LIB_POLYLINE, LIB_ARC, LIB_BEZIER, LIB_TEXT, and LIB_CIRCLE.

Definition at line 321 of file base_struct.h.

322  {
323  return false; // derived classes should override this function
324  }

◆ IsAlias()

◆ IsBrightened()

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 201 of file base_struct.h.

201 { return m_Flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:119
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References IS_DRAGGED, and EDA_ITEM::m_Flags.

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

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 286 of file base_struct.h.

286 { return m_forceVisible; }
bool m_forceVisible
Definition: base_struct.h:175

References EDA_ITEM::m_forceVisible.

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

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 198 of file base_struct.h.

198 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:113
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsMulti()

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

Definition at line 502 of file class_libentry.h.

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

References m_unitCount.

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

◆ IsNew()

◆ IsNormal()

bool LIB_PART::IsNormal ( ) const
inline

Definition at line 237 of file class_libentry.h.

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

References ENTRY_NORMAL, and m_options.

◆ IsPower()

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

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

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

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 502 of file base_struct.h.

502 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 204 of file base_struct.h.

204 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:118

References IS_RESIZED, and EDA_ITEM::m_Flags.

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

◆ IsRoot()

◆ IsSelected()

◆ IsType()

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

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

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

Reimplemented in VIA, SCH_LABEL, DIMENSION, D_PAD, DRAWSEGMENT, TEXTE_MODULE, SCH_FIELD, SCH_LINE, EDGE_MODULE, and TEXTE_PCB.

Definition at line 262 of file base_struct.h.

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

References EOT, EDA_ITEM::m_StructType, and SCH_LOCATE_ANY_T.

Referenced by SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), TEXTE_PCB::IsType(), EDGE_MODULE::IsType(), SCH_LINE::IsType(), SCH_FIELD::IsType(), TEXTE_MODULE::IsType(), DRAWSEGMENT::IsType(), D_PAD::IsType(), DIMENSION::IsType(), SCH_LABEL::IsType(), VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 202 of file base_struct.h.

202 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

◆ IterateForward() [1/2]

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

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

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

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

Definition at line 384 of file base_struct.h.

388  {
389  for( auto it : aList )
390  {
391  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
393  return SEARCH_RESULT::QUIT;
394  }
395 
397  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...

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

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

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

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

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

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

Definition at line 405 of file base_struct.h.

407  {
408  for( auto it : aList )
409  {
410  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
412  return SEARCH_RESULT::QUIT;
413  }
414 
416  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...

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

◆ LocateDrawItem() [1/2]

LIB_ITEM * LIB_PART::LocateDrawItem ( int  aUnit,
int  aConvert,
KICAD_T  aType,
const wxPoint aPoint 
)

Locate a draw object.

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

Definition at line 996 of file class_libentry.cpp.

998 {
999  for( LIB_ITEM& item : m_drawings )
1000  {
1001  if( ( aUnit && item.m_Unit && ( aUnit != item.m_Unit) )
1002  || ( aConvert && item.m_Convert && ( aConvert != item.m_Convert ) )
1003  || ( ( item.Type() != aType ) && ( aType != TYPE_NOT_INIT ) ) )
1004  continue;
1005 
1006  if( item.HitTest( aPoint ) )
1007  return &item;
1008  }
1009 
1010  return NULL;
1011 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define NULL

References m_drawings, NULL, and TYPE_NOT_INIT.

Referenced by LocateDrawItem().

◆ LocateDrawItem() [2/2]

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

Locate a draw object (overlaid)

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

Definition at line 1014 of file class_libentry.cpp.

1016 {
1017  /* we use LocateDrawItem( int aUnit, int convert, KICAD_T type, const
1018  * wxPoint& pt ) to search items.
1019  * because this function uses DefaultTransform as orient/mirror matrix
1020  * we temporary copy aTransform in DefaultTransform
1021  */
1022  LIB_ITEM* item;
1023  TRANSFORM transform = DefaultTransform;
1024  DefaultTransform = aTransform;
1025 
1026  item = LocateDrawItem( aUnit, aConvert, aType, aPoint );
1027 
1028  // Restore matrix
1029  DefaultTransform = transform;
1030 
1031  return item;
1032 }
TRANSFORM DefaultTransform
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
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 246 of file class_libentry.h.

246 { 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 BOOST_AUTO_TEST_CASE(), LIB_EDIT_FRAME::CreateNewPart(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ Matches() [1/2]

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

Function Matches compares the item against the search criteria in aSearchData.

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

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

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, SCH_PIN, TEXTE_MODULE, SCH_MARKER, MARKER_PCB, and TEXTE_PCB.

Definition at line 458 of file base_struct.h.

459  {
460  return false;
461  }

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

◆ Matches() [2/2]

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

141 {
142  wxString text = aText;
143  wxString searchText = aSearchData.GetFindString();
144 
145  // Don't match if searching for replaceable item and the item doesn't support text replace.
146  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
147  return false;
148 
149  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
150  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
151 
152  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
153  {
154  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
155  return text.Matches( searchText );
156 
157  return text.MakeUpper().Matches( searchText.MakeUpper() );
158  }
159 
160  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
161  return aText.Find( searchText ) != wxNOT_FOUND;
162 
163  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
164 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:502

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

◆ operator!=()

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

Definition at line 608 of file class_libentry.h.

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

References Compare().

◆ operator<()

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

Test if another item is less than this object.

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

Definition at line 194 of file base_struct.cpp.

195 {
196  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
197  GetChars( GetClass() ) ) );
198 
199  return false;
200 }
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:153
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:201

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

◆ operator=()

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

Definition at line 173 of file class_libentry.cpp.

174 {
175  if( &aPart == this )
176  return aPart;
177 
178  LIB_ITEM* newItem;
179 
180  m_library = aPart.m_library;
181  m_name = aPart.m_name;
182  m_FootprintList = wxArrayString( aPart.m_FootprintList );
183  m_unitCount = aPart.m_unitCount;
191  m_options = aPart.m_options;
192  m_libId = aPart.m_libId;
194  m_keyWords = aPart.m_keyWords;
195 
196  m_drawings.clear();
197 
198  for( const LIB_ITEM& oldItem : aPart.m_drawings )
199  {
200  if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 )
201  continue;
202 
203  newItem = (LIB_ITEM*) oldItem.Clone();
204  newItem->SetParent( this );
205  m_drawings.push_back( newItem );
206  }
207 
208  PART_SPTR parent = aPart.m_parent.lock();
209 
210  if( parent )
211  SetParent( parent.get() );
212 
213  return *this;
214 }
timestamp_t m_dateLastEdition
Date of the last modification.
bool m_showPinNumbers
Determines if part pin numbers are visible.
int m_unitCount
Number of units (parts) per package.
PART_LIB * m_library
Library the part belongs to if any.
void clear(int aType=UNDEFINED_TYPE)
Definition: multivector.h:207
bool m_includeOnBoard
Determines if symbol should be excluded from.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
bool m_includeInBom
Determines if symbol should be included in schematic BOM.
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define IS_NEW
New item, just created.
Definition: base_struct.h:117
int m_pinNameOffset
The offset in mils to draw the pin name.
PART_REF m_parent
Use for inherited symbols.
wxString m_name
Symbol name.
void push_back(T *aItem)
Definition: multivector.h:169
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
void SetParent(LIB_PART *aParent=nullptr)
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
wxArrayString m_FootprintList
List of suitable footprint names for the part (wild card names accepted).
LIB_ID m_libId
wxString m_keyWords
keyword list (used for search for parts by keyword)
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:234
bool m_showPinNames
Determines if part pin names are visible.
wxString m_description
documentation for info

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

◆ operator==() [1/2]

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

Definition at line 606 of file class_libentry.h.

606 { return this == aPart; }

◆ operator==() [2/2]

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

Definition at line 607 of file class_libentry.h.

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

References Compare().

◆ PinsConflictWith()

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

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

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

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

Definition at line 696 of file class_libentry.cpp.

698 {
699  LIB_PINS thisPinList;
700  GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 );
701 
702  for( LIB_PIN* eachThisPin : thisPinList )
703  {
704  wxASSERT( eachThisPin );
705  LIB_PINS otherPinList;
706  aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 );
707  bool foundMatch = false;
708 
709  for( LIB_PIN* eachOtherPin : otherPinList )
710  {
711  wxASSERT( eachOtherPin );
712 
713  // Same unit?
714  if( eachThisPin->GetUnit() != eachOtherPin->GetUnit() )
715  continue;
716 
717  // Same body stype?
718  if( eachThisPin->GetConvert() != eachOtherPin->GetConvert() )
719  continue;
720 
721  // Same position?
722  if( eachThisPin->GetPosition() != eachOtherPin->GetPosition() )
723  continue;
724 
725  // Same number?
726  if( aTestNums && ( eachThisPin->GetNumber() != eachOtherPin->GetNumber() ) )
727  continue;
728 
729  // Same name?
730  if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ) )
731  continue;
732 
733  // Same electrical type?
734  if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ) )
735  continue;
736 
737  // Same orientation?
738  if( aTestOrientation
739  && ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ) )
740  continue;
741 
742  // Same length?
743  if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ) )
744  continue;
745 
746  foundMatch = true;
747  break; // Match found so seach is complete.
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 }
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.

References GetPins().

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

◆ Plot()

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

Plot lib part to plotter.

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

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

Definition at line 508 of file class_libentry.cpp.

510 {
511  wxASSERT( aPlotter != NULL );
512 
513  aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
514  bool fill = aPlotter->GetColorMode();
515 
516  // draw background for filled items using background option
517  // Solid lines will be drawn after the background
518  for( LIB_ITEM& item : m_drawings )
519  {
520  // Lib Fields are not plotted here, because this plot function
521  // is used to plot schematic items, which have they own fields
522  if( item.Type() == LIB_FIELD_T )
523  continue;
524 
525  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
526  continue;
527 
528  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
529  continue;
530 
531  if( item.m_Fill == FILLED_WITH_BG_BODYCOLOR )
532  item.Plot( aPlotter, aOffset, fill, aTransform );
533  }
534 
535  // Not filled items and filled shapes are now plotted
536  // Items that have BG fills only get re-stroked to ensure the edges are in the foreground
537  for( LIB_ITEM& item : m_drawings )
538  {
539  if( item.Type() == LIB_FIELD_T )
540  continue;
541 
542  if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
543  continue;
544 
545  if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
546  continue;
547 
548  item.Plot( aPlotter, aOffset, fill && ( item.m_Fill != FILLED_WITH_BG_BODYCOLOR ),
549  aTransform );
550  }
551 }
virtual void SetColor(COLOR4D color)=0
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define NULL
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
bool GetColorMode() const
Definition: plotter.h:144

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

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

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

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

Referenced by LIB_EDIT_FRAME::SVG_PlotComponent().

◆ Print()

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

Print part.

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

Definition at line 441 of file class_libentry.cpp.

443 {
444  /* draw background for filled items using background option
445  * Solid lines will be drawn after the background
446  * Note also, background is not drawn when printing in black and white
447  */
448  if( !GetGRForceBlackPenState() )
449  {
450  for( LIB_ITEM& drawItem : m_drawings )
451  {
452  if( drawItem.m_Fill != FILLED_WITH_BG_BODYCOLOR )
453  continue;
454 
455  // Do not draw items not attached to the current part
456  if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
457  continue;
458 
459  if( aConvert && drawItem.m_Convert && ( drawItem.m_Convert != aConvert ) )
460  continue;
461 
462  if( drawItem.Type() == LIB_FIELD_T )
463  continue;
464 
465  // Now, draw only the background for items with
466  // m_Fill == FILLED_WITH_BG_BODYCOLOR:
467  drawItem.Print( aSettings, aOffset, (void*) false, aOpts.transform );
468  }
469  }
470 
471  for( LIB_ITEM& drawItem : m_drawings )
472  {
473  // Do not draw items not attached to the current part
474  if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
475  continue;
476 
477  if( aConvert && drawItem.m_Convert && ( drawItem.m_Convert != aConvert ) )
478  continue;
479 
480  if( drawItem.Type() == LIB_FIELD_T )
481  {
482  LIB_FIELD& field = static_cast<LIB_FIELD&>( drawItem );
483 
484  if( field.IsVisible() && !aOpts.draw_visible_fields )
485  continue;
486 
487  if( !field.IsVisible() && !aOpts.draw_hidden_fields )
488  continue;
489  }
490 
491  if( drawItem.Type() == LIB_PIN_T )
492  {
493  drawItem.Print( aSettings, aOffset, (void*) &aOpts, aOpts.transform );
494  }
495  else if( drawItem.Type() == LIB_FIELD_T )
496  {
497  drawItem.Print( aSettings, aOffset, (void*) NULL, aOpts.transform );
498  }
499  else
500  {
501  bool forceNoFill = drawItem.m_Fill == FILLED_WITH_BG_BODYCOLOR;
502  drawItem.Print( aSettings, aOffset, (void*) forceNoFill, aOpts.transform );
503  }
504  }
505 }
bool IsVisible() const
Definition: eda_text.h:186
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
#define NULL
bool GetGRForceBlackPenState(void)
Function GetGRForceBlackPenState.
Definition: gr_basic.cpp:213

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

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

◆ RemoveDrawItem()

void LIB_PART::RemoveDrawItem ( LIB_ITEM aItem)

Remove draw aItem from list.

Parameters
aItem- Draw item to remove from list.

Definition at line 591 of file class_libentry.cpp.

592 {
593  wxASSERT( aItem != NULL );
594 
595  // none of the MANDATORY_FIELDS may be removed in RAM, but they may be
596  // omitted when saving to disk.
597  if( aItem->Type() == LIB_FIELD_T )
598  {
599  if( static_cast<LIB_FIELD*>( aItem )->IsMandatory() )
600  return;
601  }
602 
603  LIB_ITEMS& items = m_drawings[ aItem->Type() ];
604 
605  for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
606  {
607  if( *i == aItem )
608  {
609  items.erase( i );
610  SetModified();
611  break;
612  }
613  }
614 }
void SetModified()
Definition: base_struct.cpp:87
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
#define NULL
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:174
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

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

Referenced by BOOST_AUTO_TEST_CASE(), LIB_EDIT_TOOL::DoDelete(), LIB_PIN_TOOL::EditPinProperties(), and DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow().

◆ RemoveDuplicateDrawItems()

void LIB_PART::RemoveDuplicateDrawItems ( )

Remove duplicate draw items from list.

Definition at line 955 of file class_libentry.cpp.

956 {
957  m_drawings.unique();
958 }
void unique()
Remove duplicate elements in list.
Definition: multivector.h:251
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.

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

Referenced by LIB_EDIT_FRAME::LoadOneSymbol().

◆ Replace() [1/2]

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

Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

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

Definition at line 167 of file base_struct.cpp.

168 {
169  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
170 
171  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
172  aSearchData.GetFindString() :
173  aSearchData.GetFindString().Upper() );
174 
175  if( result == wxNOT_FOUND )
176  return false;
177 
178  wxString prefix = aText.Left( result );
179  wxString suffix;
180 
181  if( aSearchData.GetFindString().length() + result < aText.length() )
182  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
183 
184  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
185  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
186  GetChars( suffix ) );
187 
188  aText = prefix + aSearchData.GetReplaceString() + suffix;
189 
190  return true;
191 }
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:153

References GetChars(), and traceFindReplace.

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

◆ Replace() [2/2]

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

Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

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

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

Reimplemented in SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, and SCH_PIN.

Definition at line 490 of file base_struct.h.

490 { return false; }

◆ Set() [1/3]

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

Definition at line 40 of file inspectable.h.

41  {
43  TYPE_ID thisType = TYPE_HASH( *this );
44  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
45 
46  if( object )
47  aProperty->setter( object, aValue );
48 
49  return object != nullptr;
50  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ Set() [2/3]

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

Definition at line 53 of file inspectable.h.

54  {
56  TYPE_ID thisType = TYPE_HASH( *this );
57  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
58 
59  if( object )
60  aProperty->set<T>( object, aValue );
61 
62  return object != nullptr;
63  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ Set() [3/3]

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

Definition at line 66 of file inspectable.h.

67  {
69  TYPE_ID thisType = TYPE_HASH( *this );
70  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71  void* object = nullptr;
72 
73  if( prop )
74  {
75  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76 
77  if( object )
78  prop->set<T>( object, aValue );
79  }
80 
81  return object != nullptr;
82  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ SetBrightened()

◆ SetConversion()

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

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

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

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

Definition at line 1107 of file class_libentry.cpp.

1108 {
1109  if( aSetConvert == HasConversion() )
1110  return;
1111 
1112  // Duplicate items to create the converted shape
1113  if( aSetConvert )
1114  {
1115  if( aDuplicatePins )
1116  {
1117  std::vector< LIB_ITEM* > tmp; // Temporarily store the duplicated pins here.
1118 
1119  for( LIB_ITEM& item : m_drawings )
1120  {
1121  // Only pins are duplicated.
1122  if( item.Type() != LIB_PIN_T )
1123  continue;
1124 
1125  if( item.m_Convert == 1 )
1126  {
1127  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1128  newItem->m_Convert = 2;
1129  tmp.push_back( newItem );
1130  }
1131  }
1132 
1133  // Transfer the new pins to the LIB_PART.
1134  for( unsigned i = 0; i < tmp.size(); i++ )
1135  m_drawings.push_back( tmp[i] );
1136  }
1137  }
1138  else
1139  {
1140  // Delete converted shape items because the converted shape does
1141  // not exist
1143 
1144  while( i != m_drawings.end() )
1145  {
1146  if( i->m_Convert > 1 )
1147  i = m_drawings.erase( i );
1148  else
1149  ++i;
1150  }
1151  }
1152 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:189
void push_back(T *aItem)
Definition: multivector.h:169
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:174
ITERATOR_BASE< LIB_ITEM, MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
The non-const iterator
Definition: multivector.h:160
int m_Convert
Shape identification for alternate body styles.
Definition: lib_item.h:87

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

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

◆ SetDescription()

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

Definition at line 170 of file class_libentry.h.

171  {
172  m_description = aDescription;
173  }
wxString m_description
documentation for info

References m_description.

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

◆ SetFields()

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

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

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

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

Definition at line 834 of file class_libentry.cpp.

835 {
836  deleteAllFields();
837 
838  for( unsigned i=0; i<aFields.size(); ++i )
839  {
840  // drawings is a ptr_vector, new and copy an object on the heap.
841  LIB_FIELD* field = new LIB_FIELD( aFields[i] );
842 
843  field->SetParent( this );
844  m_drawings.push_back( field );
845  }
846 }
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
void deleteAllFields()
void push_back(T *aItem)
Definition: multivector.h:169

References deleteAllFields(), 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 232 of file base_struct.h.

232 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddModuleToBoard(), SCH_MOVE_TOOL::AlignElements(), PCBNEW_CONTROL::AppendBoard(), SCH_EDIT_TOOL::ChangeTextType(), GRAPHICS_CLEANER::cleanupSegments(), TRACKS_CLEANER::cleanupSegments(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), LIB_PIN_TOOL::CreatePin(), SCH_EDIT_FRAME::CreateSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), DRAWING_TOOL::DrawRectangle(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::Duplicate(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_MOVE_TOOL::getConnectedDragItems(), EDIT_POINTS_FACTORY::Make(), TRACKS_CLEANER::mergeCollinearSegments(), LIB_MOVE_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseWire(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), WS_DATA_ITEM::SyncDrawItems(), WS_DATA_ITEM_TEXT::SyncDrawItems(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetFootprintFilters()

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

Definition at line 200 of file class_libentry.h.

201  {
202  m_FootprintList = aFootprintFilters;
203  }
wxArrayString m_FootprintList
List of suitable footprint names for the part (wild card names accepted).

References m_FootprintList.

Referenced by BOOST_AUTO_TEST_CASE(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

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

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

Definition at line 284 of file base_struct.h.

284 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: base_struct.h:175

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetIncludeInBom()

void LIB_PART::SetIncludeInBom ( bool  aIncludeInBom)
inline

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

Parameters
aIncludeInBomtrue to include symbol in schematic bill of material

Definition at line 584 of file class_libentry.h.

584 { m_includeInBom = aIncludeInBom; }
bool m_includeInBom
Determines if symbol should be included in schematic BOM.

References m_includeInBom.

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

◆ SetIncludeOnBoard()

void LIB_PART::SetIncludeOnBoard ( bool  aIncludeOnBoard)
inline

Set or clear include in board netlist flag.

Parameters
aIncludeOnBoardtrue to include symbol in the board netlist

Definition at line 592 of file class_libentry.h.

592 { m_includeOnBoard = aIncludeOnBoard; }
bool m_includeOnBoard
Determines if symbol should be excluded from.

References m_includeOnBoard.

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

◆ SetKeyWords()

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

Definition at line 177 of file class_libentry.h.

178  {
179  m_keyWords = aKeyWords;
180  }
wxString m_keyWords
keyword list (used for search for parts by keyword)

References m_keyWords.

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

◆ SetLib()

void LIB_PART::SetLib ( PART_LIB aLibrary)
inline

Definition at line 195 of file class_libentry.h.

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

References m_library.

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

◆ SetLibId()

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

Definition at line 87 of file base_struct.cpp.

88 {
90 
91  // If this a child object, then the parent modification state also needs to be set.
92  if( m_Parent )
94 }
void SetModified()
Definition: base_struct.cpp:87
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:174
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:113
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:232

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

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

◆ SetName()

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

Definition at line 313 of file class_libentry.cpp.

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

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

Referenced by BOOST_AUTO_TEST_CASE(), LIB_EDIT_TOOL::editFieldProperties(), LIB_EDIT_FRAME::ensureUniqueName(), LIB_PART(), SCH_ALTIUM_PLUGIN::ParseComponent(), LIB_EDIT_FRAME::savePartAs(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow(), LIB_EDIT_FRAME::UpdateAfterSymbolProperties(), and DIALOG_LIB_EDIT_ONE_FIELD::UpdateField().

◆ SetNormal()

void LIB_PART::SetNormal ( )
inline

Definition at line 240 of file class_libentry.h.

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

References ENTRY_NORMAL, and m_options.

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

◆ SetOffset()

void LIB_PART::SetOffset ( const wxPoint aOffset)

Move the part aOffset.

Parameters
aOffset- Offset displacement.

Definition at line 948 of file class_libentry.cpp.

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

References m_drawings.

Referenced by LIB_DRAWING_TOOLS::PlaceAnchor().

◆ SetParent() [1/3]

virtual void EDA_ITEM::SetParent
inlineprivate

Definition at line 196 of file base_struct.h.

196 { m_Parent = aParent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:174

◆ SetParent() [2/3]

void LIB_PART::SetParent ( LIB_PART aParent = nullptr)

◆ SetParent() [3/3]

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Reimplemented in DIMENSION.

Definition at line 196 of file base_struct.h.

196 { m_Parent = aParent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:174

References EDA_ITEM::m_Parent.

Referenced by MODULE::Add(), BOARD::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewComponent(), SCH_SHEET::AddPin(), LIB_CONTROL::AddSymbolToSchematic(), SCH_SCREEN::Append(), ZONE_FILLER::buildCopperItemClearances(), LIB_FIELD::Copy(), LIB_EDIT_FRAME::CreateNewPart(), SCH_DRAWING_TOOLS::createNewText(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SCH_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), Flatten(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetModule(), LIB_PART(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), LIB_EDIT_FRAME::LoadOneSymbol(), MODULE::MODULE(), MODULE::operator=(), operator=(), PCB_PARSER::parseMODULE_unchecked(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_SEXPR_PARSER::ParseSymbol(), LIB_EDIT_TOOL::Paste(), PCBNEW_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), pasteModuleItemsToModEdit(), SCH_DRAWING_TOOLS::PlaceComponent(), PCB_EDITOR_CONTROL::PlaceModule(), BACK_ANNOTATE::processNetNameChange(), BOARD_COMMIT::Push(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET_PIN::SCH_SHEET_PIN(), SetFields(), DIMENSION::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), and SwapItemData().

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

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

References m_pinNameOffset.

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

◆ SetPosition()

◆ SetPower()

void LIB_PART::SetPower ( )
inline

Definition at line 239 of file class_libentry.h.

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

References ENTRY_POWER, and m_options.

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

◆ SetSelected()

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

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

References m_showPinNames.

Referenced by BOOST_AUTO_TEST_CASE(), LIB_EDIT_FRAME::CreateNewPart(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), 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 576 of file class_libentry.h.

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

References m_showPinNumbers.

Referenced by BOOST_AUTO_TEST_CASE(), LIB_EDIT_FRAME::CreateNewPart(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow().

◆ SetState()

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

Definition at line 221 of file base_struct.h.

222  {
223  if( state )
224  m_Status |= type; // state = ON or OFF
225  else
226  m_Status &= ~type;
227  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

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

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 230 of file base_struct.h.

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

References EDA_ITEM::m_Status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetSubpartIdNotation()

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

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

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

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

Definition at line 1155 of file class_libentry.cpp.

1156 {
1157  m_subpartFirstId = 'A';
1159 
1160  if( aSep == '.' || aSep == '-' || aSep == '_' )
1161  m_subpartIdSeparator = aSep;
1162 
1163  if( aFirstId == '1' && aSep != 0 )
1164  m_subpartFirstId = aFirstId;
1165 }
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::LoadProjectSettings(), and PANEL_SETUP_FORMATTING::TransferDataFromWindow().

◆ SetUnitCount()

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

Set the units per part count.

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

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

Definition at line 1051 of file class_libentry.cpp.

1052 {
1053  if( m_unitCount == aCount )
1054  return;
1055 
1056  if( aCount < m_unitCount )
1057  {
1059 
1060  while( i != m_drawings.end() )
1061  {
1062  if( i->m_Unit > aCount )
1063  i = m_drawings.erase( i );
1064  else
1065  ++i;
1066  }
1067  }
1068  else if( aDuplicateDrawItems )
1069  {
1070  int prevCount = m_unitCount;
1071 
1072  // Temporary storage for new items, as adding new items directly to
1073  // m_drawings may cause the buffer reallocation which invalidates the
1074  // iterators
1075  std::vector< LIB_ITEM* > tmp;
1076 
1077  for( LIB_ITEM& item : m_drawings )
1078  {
1079  if( item.m_Unit != 1 )
1080  continue;
1081 
1082  for( int j = prevCount + 1; j <= aCount; j++ )
1083  {
1084  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
1085  newItem->m_Unit = j;
1086  tmp.push_back( newItem );
1087  }
1088  }
1089 
1090  for( auto item : tmp )
1091  m_drawings.push_back( item );
1092  }
1093 
1094  m_unitCount = aCount;
1095 }
ITERATOR begin(int aType=UNDEFINED_TYPE)
Definition: multivector.h:183
int m_unitCount
Number of units (parts) per package.
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
int m_Unit
Unit identification for multiple parts per package.
Definition: lib_item.h:81
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
ITERATOR end(int aType=UNDEFINED_TYPE)
Definition: multivector.h:189
void push_back(T *aItem)
Definition: multivector.h:169
ITERATOR erase(const ITERATOR &aIterator)
Definition: multivector.h:174
ITERATOR_BASE< LIB_ITEM, MULTIVECTOR< LIB_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
The non-const iterator
Definition: multivector.h:160

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

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

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 207 of file base_struct.h.

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

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ SharedPtr()

PART_SPTR LIB_PART::SharedPtr ( )
inline

Definition at line 145 of file class_libentry.h.

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

References m_me.

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

◆ ShowPinNames()

◆ ShowPinNumbers()

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

521 { return *aLeft < *aRight; }

◆ SubpartFirstIdPtr()

static int* LIB_PART::SubpartFirstIdPtr ( )
inlinestatic

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

Definition at line 525 of file class_libentry.h.

525 { 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 SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS().

◆ SubpartIdSeparatorPtr()

static int* LIB_PART::SubpartIdSeparatorPtr ( )
inlinestatic

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

Definition at line 520 of file class_libentry.h.

520 { 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 SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS().

◆ SubReference()

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

Definition at line 409 of file class_libentry.cpp.

410 {
411  wxString subRef;
412 
413  if( m_subpartIdSeparator != 0 && aAddSeparator )
414  subRef << wxChar( m_subpartIdSeparator );
415 
416  if( m_subpartFirstId >= '0' && m_subpartFirstId <= '9' )
417  subRef << aUnit;
418  else
419  {
420  // use letters as notation. To allow more than 26 units, the sub ref
421  // use one letter if letter = A .. Z or a ... z, and 2 letters otherwise
422  // first letter is expected to be 'A' or 'a' (i.e. 26 letters are available)
423  int u;
424  aUnit -= 1; // Unit number starts to 1. now to 0.
425 
426  while( aUnit >= 26 ) // more than one letter are needed
427  {
428  u = aUnit / 26;
429  subRef << wxChar( m_subpartFirstId + u -1 );
430  aUnit %= 26;
431  }
432 
433  u = m_subpartFirstId + aUnit;
434  subRef << wxChar( u );
435  }
436 
437  return subRef;
438 }
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the part number: only 'A',...

References m_subpartFirstId, and m_subpartIdSeparator.

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), SCH_REFERENCE_LIST::CheckAnnotation(), SCH_REFERENCE::GetFullRef(), LIB_FIELD::GetFullText(), SCH_COMPONENT::GetRef(), SCH_FIELD::GetShownText(), GetUnitReference(), SCH_EDIT_FRAME::mapExistingAnnotation(), SCH_FIELD::Matches(), LIB_EDIT_FRAME::RebuildSymbolUnitsList(), SCH_COMPONENT::ResolveTextVar(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), and SYMBOL_UNIT_MENU::update().

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Function Type()

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

Returns
KICAD_T - the type of object.

Definition at line 193 of file base_struct.h.

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

References EDA_ITEM::m_StructType.

Referenced by MODULE::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), POINT_EDITOR::addCorner(), CONNECTION_SUBGRAPH::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), ZONE_FILLER::addKnockout(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), SCH_SCREEN::Append(), CONNECTION_GRAPH::buildConnectionGraph(), DIALOG_SELECT_NET_FROM_LIST::buildNetsList(), SCH_SCREENS::buildScreenList(), calcArea(), calcMaxArea(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), CN_VISITOR::checkZoneItemConnection(), SCH_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_NO_CONNECT::ClassOf(), TEXTE_PCB::ClassOf(), MARKER_PCB::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), EDGE_MODULE::ClassOf(), SCH_PIN::ClassOf(), PCB_GROUP::ClassOf(), SCH_LINE::ClassOf(), PCB_TARGET::ClassOf(), SCH_FIELD::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), ZONE_CONTAINER::ClassOf(), SCH_BITMAP::ClassOf(), D_PAD::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), SCH_SHEET_PIN::ClassOf(), MODULE::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_COMPONENT::ClassOf(), SCH_SCREEN::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), SCH_TEXT::ClassOf(), BOARD::ClassOf(), SCH_SHEET::ClassOf(), ARC::ClassOf(), SCH_LABEL::ClassOf(), VIA::ClassOf(), ALIGNED_DIMENSION::ClassOf(), SCH_GLOBALLABEL::ClassOf(), SCH_HIERLABEL::ClassOf(), ORTHOGONAL_DIMENSION::ClassOf(), LEADER::ClassOf(), CENTER_DIMENSION::ClassOf(), TRACKS_CLEANER::cleanupSegments(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_TEXT::compare(), LIB_POLYLINE::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_ITEM::compare(), EE_GRID_HELPER::computeAnchors(), GRID_HELPER::computeAnchors(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), EE_RTREE::contains(), BOARD::ConvertKIIDsToCrossReferences(), SCHEMATIC::ConvertKIIDsToRefs(), MODULE::CoverageRatio(), BOARD_ADAPTER::createLayers(), PCB_BASE_FRAME::CreateNewModule(), SCH_DRAWING_TOOLS::createNewText(), BOARD_ADAPTER::createNewTrack(), ZONE_CREATE_HELPER::createNewZone(), D_PAD::D_PAD(), SCH_SCREEN::DeleteItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDIT_TOOL::DoDelete(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::doTrackDrc(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), CN_ITEM::Dump(), EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), MODULE::DuplicateItem(), EDA_ITEM_DESC::EDA_ITEM_DESC(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), LIB_EDIT_TOOL::editTextProperties(), EditToolSelectionFilter(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckNoConnects(), NETLIST_EXPORTER::findNextComponent(), PCB_BASE_FRAME::FocusOnItem(), EDIT_TOOL::FootprintFilter(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), SCH_FIELD::GetBoundingBox(), TRACK::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetContextualTextVars(), CONNECTION_GRAPH::getDefaultConnection(), CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_TEXT::GetEndPoints(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_FIELD::GetMenuImage(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTION_SUBGRAPH::GetNameForDriver(), CONNECTIVITY_DATA::GetNetItems(), GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), getRect(), KIGFX::SCH_PAINTER::getRenderColor(), TEXTE_PCB::GetShownText(), SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), CONVERT_TOOL::getStartEndPoints(), PCB_EDITOR_CONTROL::GroupFlattenSelected(), BOARD::GroupLegalOps(), PCB_EDITOR_CONTROL::GroupMergeSelected(), BOARD::GroupsSanityCheckInternal(), EE_SELECTION_TOOL::GuessSelectionCandidates(), SELECTION_TOOL::GuessSelectionCandidates(), hash_eda(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlightInternal(), highlightNet(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_RTREE::insert(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), PCB_INSPECTION_TOOL::InspectClearance(), ARRAY_CREATOR::Invoke(), CN_ANCHOR::IsDangling(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), TRACK::IsNull(), PNS_KICAD_IFACE::IsOnLayer(), SCH_LINE::IsParallel(), SCH_FIELD::IsReplaceable(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), SELECTION_TOOL::itemPassesFilter(), CONVERT_TOOL::LinesToPoly(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_GENERIC::makeListOfNets(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), SCH_FIELD::Matches(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), SCH_EDITOR_CONTROL::nextMatch(), APPEARANCE_CONTROLS::OnBoardItemAdded(), APPEARANCE_CONTROLS::OnBoardItemChanged(), APPEARANCE_CONTROLS::OnBoardItemRemoved(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), TRACK::cmp_tracks::operator()(), CN_VISITOR::operator()(), DRAWSEGMENT::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), MODULE::cmp_drawings::operator()(), SCH_JUNCTION::operator<(), SCH_BUS_ENTRY_BASE::operator<(), SCH_FIELD::operator<(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_TEXT::operator<(), SCH_ITEM::operator<(), SCH_SHEET::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCB_PARSER::parseBOARD_unchecked(), PCBNEW_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), SCH_SCREEN::Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), CONVERT_TOOL::PolyToLines(), SCH_FIELD::Print(), SCH_SCREEN::Print(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), BACK_ANNOTATE::processNetNameChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SELECTION_TOOL::RebuildSelection(), SCH_CONNECTION::recacheName(), SCH_BASE_FRAME::RefreshSelection(), EE_RTREE::remove(), MODULE::Remove(), CN_CONNECTIVITY_ALGO::Remove(), SCH_SCREEN::Remove(), BOARD::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_FIELD::Replace(), SCHEMATIC::ResolveCrossReference(), WS_PROXY_UNDO_ITEM::Restore(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), SCH_TEXT::Rotate(), SCH_SEXPR_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_SEXPR_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_SEXPR_PLUGIN_CACHE::saveCircle(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_SEXPR_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), CLIPBOARD_IO::SaveSelection(), SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SCREEN::Schematic(), SCH_ITEM::Schematic(), CONVERT_TOOL::SegmentToArc(), SELECTION_TOOL::select(), EE_SELECTION_TOOL::Selectable(), SELECTION_TOOL::Selectable(), SELECTION_TOOL::selectConnectedTracks(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), BOARD_COMMIT::Stage(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), PCB_GROUP::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_FIELD::SwapData(), TEXTE_PCB::SwapData(), TRACK::SwapData(), ARC::SwapData(), ALIGNED_DIMENSION::SwapData(), ORTHOGONAL_DIMENSION::SwapData(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), LEADER::SwapData(), VIA::SwapData(), CENTER_DIMENSION::SwapData(), D_PAD::SwapData(), MODULE::SwapData(), ZONE_CONTAINER::SwapData(), SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperDrawItem(), ERC_TESTER::TestMultUnitPinConflicts(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), TEXTE_MODULE::TEXTE_MODULE(), BOARD::TopLevelGroup(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), LIB_DRAWING_TOOLS::TwoClickPlace(), PCB_EDITOR_CONTROL::UngroupSelected(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlightInternal(), KIGFX::PCB_VIEW::Update(), SCH_TEXT::UpdateDanglingState(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), EE_POINT_EDITOR::updateItem(), PL_POINT_EDITOR::updateItem(), POINT_EDITOR::updateItem(), SCH_BASE_FRAME::UpdateItem(), CONNECTION_GRAPH::updateItemConnectivity(), DIALOG_SELECT_NET_FROM_LIST::updateNet(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), SCH_EDITOR_CONTROL::updatePastedInstances(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), PCB_GROUP::Visit(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), SCH_SHEET::Visit(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and NETLIST_EXPORTER_CADSTAR::writeListOfNets().

◆ UnitsLocked()

bool LIB_PART::UnitsLocked ( ) const
inline

Check whether part units are interchangeable.

Returns
False when interchangeable, true otherwise.

Definition at line 252 of file class_libentry.h.

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

References m_unitsLocked.

Referenced by LIB_EDIT_TOOL::editSymbolProperties(), GetUniqueUnits(), SCH_REFERENCE::IsUnitsLocked(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), LIB_EDIT_FRAME::LoadPart(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), LIB_EDIT_FRAME::SetCurPart(), LIB_EDIT_FRAME::setupUIConditions(), 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 MODULE, D_PAD, CENTER_DIMENSION, EDIT_POINTS, DRAWSEGMENT, GERBER_DRAW_ITEM, DIMENSION, TRACK, TEXTE_MODULE, ROUTER_PREVIEW_ITEM, KIGFX::WS_PROXY_VIEW_ITEM, MARKER_PCB, MY_DRAWING, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::POLYGON_ITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, and BRIGHT_BOX.

Definition at line 215 of file base_struct.cpp.

216 {
217  // Basic fallback
218  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
219  VECTOR2I( GetBoundingBox().GetSize() ) );
220 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:522
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: base_struct.cpp:97

References EDA_ITEM::GetBoundingBox().

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

◆ ViewDraw()

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

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

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

Parameters
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on

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

Definition at line 117 of file view_item.h.

118  {}

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.

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

◆ ViewGetLOD()

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

Function ViewGetLOD() Returns the level of detail (LOD) of the item.

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

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

Reimplemented in MODULE_ZONE_CONTAINER, MODULE, D_PAD, VIA, GERBER_DRAW_ITEM, TEXTE_MODULE, TRACK, ZONE_CONTAINER, PCB_GROUP, and EDGE_MODULE.

Definition at line 141 of file view_item.h.

142  {
143  // By default always show the item
144  return 0.0;
145  }

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

◆ viewPrivData()

◆ Visit()

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

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

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

Parameters
inspectorAn INSPECTOR instance to use in the inspection.
testDataArbitrary data used by the inspector.
scanTypesWhich KICAD_T types are of interest and the order is significant too, terminated by EOT.
Returns
SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE, and determined by the inspector.

Reimplemented from EDA_ITEM.

Definition at line 1035 of file class_libentry.cpp.

1036 {
1037  // The part itself is never inspected, only its children
1038  for( LIB_ITEM& item : m_drawings )
1039  {
1040  if( item.IsType( aFilterTypes ) )
1041  {
1042  if( aInspector( &item, aTestData ) == SEARCH_RESULT::QUIT )
1043  return SEARCH_RESULT::QUIT;
1044  }
1045  }
1046 
1047  return SEARCH_RESULT::CONTINUE;
1048 }
LIB_ITEMS_CONTAINER m_drawings
Drawing items of this part.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61

References CONTINUE, m_drawings, and QUIT.

Member Data Documentation

◆ m_dateLastEdition

timestamp_t LIB_PART::m_dateLastEdition
private

Date of the last modification.

Definition at line 115 of file class_libentry.h.

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

◆ m_description

wxString LIB_PART::m_description
private

documentation for info

Definition at line 123 of file class_libentry.h.

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

◆ m_drawings

◆ m_Flags

◆ m_FootprintList

wxArrayString LIB_PART::m_FootprintList
private

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

Definition at line 119 of file class_libentry.h.

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

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_includeInBom

bool LIB_PART::m_includeInBom
private

Determines if symbol should be included in schematic BOM.

Definition at line 111 of file class_libentry.h.

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

◆ m_includeOnBoard

bool LIB_PART::m_includeOnBoard
private

Determines if symbol should be excluded from.

netlist when updating board.

Definition at line 113 of file class_libentry.h.

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

◆ m_keyWords

wxString LIB_PART::m_keyWords
private

keyword list (used for search for parts by keyword)

Definition at line 124 of file class_libentry.h.

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

◆ m_libId

LIB_ID LIB_PART::m_libId
private

Definition at line 103 of file class_libentry.h.

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

◆ m_library

PART_LIB* LIB_PART::m_library
private

Library the part belongs to if any.

Definition at line 121 of file class_libentry.h.

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

◆ m_me

◆ m_name

wxString LIB_PART::m_name
private

Symbol name.

Definition at line 122 of file class_libentry.h.

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

◆ m_options

LIBRENTRYOPTIONS LIB_PART::m_options
private

Special part features such as POWER or NORMAL.)

Definition at line 116 of file class_libentry.h.

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

◆ m_parent

PART_REF LIB_PART::m_parent
private

Use for inherited symbols.

Definition at line 101 of file class_libentry.h.

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

◆ m_Parent

◆ m_pinNameOffset

int LIB_PART::m_pinNameOffset
private

The offset in mils to draw the pin name.

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

Definition at line 105 of file class_libentry.h.

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

◆ m_showPinNames

bool LIB_PART::m_showPinNames
private

Determines if part pin names are visible.

Definition at line 109 of file class_libentry.h.

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

◆ m_showPinNumbers

bool LIB_PART::m_showPinNumbers
private

Determines if part pin numbers are visible.

Definition at line 110 of file class_libentry.h.

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

◆ m_Status

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

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

◆ m_unitCount

int LIB_PART::m_unitCount
private

Number of units (parts) per package.

Definition at line 117 of file class_libentry.h.

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

◆ m_unitsLocked

bool LIB_PART::m_unitsLocked
private

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

Definition at line 107 of file class_libentry.h.

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

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 162 of file base_struct.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddHierarchicalReference(), PCB_GROUP::AddItem(), SCH_EDIT_FRAME::AnnotateComponents(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), D_PAD::D_PAD(), DRAWING_TOOL::DrawVia(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), MODULE::Duplicate(), MODULE::DuplicateItem(), PAD_TOOL::EditPad(), PCB_EDIT_FRAME::Exchange_Module(), PAD_TOOL::explodePad(), BOARD::FillItemMap(), PCB_BASE_FRAME::FocusOnItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_IO::format(), FormatProbeItem(), SCH_PIN::GetDefaultNetName(), BOARD::GetItem(), SCH_SHEET::GetMsgPanelInfo(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), SCH_REFERENCE::GetPath(), SCH_MARKER::GetUUID(), MARKER_PCB::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), BOARD::GroupsSanityCheckInternal(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), SCH_LEGACY_PLUGIN::loadComponent(), CADSTAR_PCB_ARCHIVE_LOADER::loadComponents(), EAGLE_PLUGIN::loadElements(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), LEGACY_PLUGIN::loadTrackList(), NETLIST_EXPORTER_GENERIC::makeComponents(), SCH_EDIT_FRAME::mapExistingAnnotation(), TRACK::cmp_tracks::operator()(), DRAWSEGMENT::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), MODULE::cmp_drawings::operator()(), MODULE::cmp_pads::operator()(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), PCB_PARSER::parseBOARD_unchecked(), PCB_PARSER::parseDIMENSION(), PCB_PARSER::parseMODULE_unchecked(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_COMPONENT::ReplaceInstanceSheetPath(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_EDIT_FRAME::SaveProject(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_COMPONENT::SCH_COMPONENT(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), RC_ITEM::SetItems(), SwapItemData(), testGroupEqual(), SCH_EDITOR_CONTROL::updatePastedInstances(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().


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