KiCad PCB EDA Suite
lib_symbol.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 2004-2021 KiCad Developers, see change_log.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #ifndef CLASS_LIBENTRY_H
27 #define CLASS_LIBENTRY_H
28 
29 #include <general.h>
30 #include <lib_tree_item.h>
31 #include <lib_item.h>
32 #include <lib_field.h>
33 #include <vector>
34 #include <multivector.h>
35 
36 class EDA_RECT;
37 class LINE_READER;
38 class OUTPUTFORMATTER;
39 class PART_LIB;
40 class LIB_PART;
41 class LIB_FIELD;
43 
44 
45 typedef std::shared_ptr<LIB_PART> PART_SPTR;
46 typedef std::weak_ptr<LIB_PART> PART_REF;
49 
50 
51 /* values for member .m_options */
53 {
54  ENTRY_NORMAL, // Libentry is a standard part (real or alias)
55  ENTRY_POWER // Libentry is a power symbol
56 };
57 
58 
59 extern bool operator<( const LIB_PART& aItem1, const LIB_PART& aItem2 );
60 
61 
63 {
64  TRANSFORM transform; // Coordinate adjustment settings
65  bool draw_visible_fields; // Whether to draw "visible" fields
66  bool draw_hidden_fields; // Whether to draw "hidden" fields
67  bool show_elec_type; // Whether to show the pin electrical type
68 
70  {
72  draw_visible_fields = true;
73  draw_hidden_fields = true;
74  show_elec_type = false;
75  }
76 };
77 
78 
79 struct PART_UNITS
80 {
81  int m_unit;
82  int m_convert;
83  std::vector<LIB_ITEM*> m_items;
84 };
85 
86 
93 class LIB_PART : public EDA_ITEM, public LIB_TREE_ITEM
94 {
95 public:
96  LIB_PART( const wxString& aName, LIB_PART* aParent = nullptr, PART_LIB* aLibrary = nullptr );
97 
98  LIB_PART( const LIB_PART& aPart, PART_LIB* aLibrary = NULL );
99 
100  virtual ~LIB_PART();
101 
103  PART_SPTR SharedPtr() const { return m_me; }
104 
108  virtual LIB_PART* Duplicate() const
109  {
110  LIB_PART* dupe = new LIB_PART( *this, m_library );
111  const_cast<KIID&>( dupe->m_Uuid ) = KIID();
112 
113  for( LIB_ITEM& item : dupe->m_drawings )
114  const_cast<KIID&>( item.m_Uuid ) = KIID();
115 
116  return dupe;
117  }
118 
119  void SetParent( LIB_PART* aParent = nullptr );
120  PART_REF& GetParent() { return m_parent; }
121  const PART_REF& GetParent() const { return m_parent; }
122 
123  virtual wxString GetClass() const override
124  {
125  return wxT( "LIB_PART" );
126  }
127 
128  virtual void SetName( const wxString& aName );
129  wxString GetName() const override { return m_name; }
130 
131  LIB_ID GetLibId() const override { return m_libId; }
132  void SetLibId( const LIB_ID& aLibId ) { m_libId = aLibId; }
133 
134  wxString GetLibNickname() const override { return GetLibraryName(); }
135 
136  void SetDescription( const wxString& aDescription ) { m_description = aDescription; }
137 
138  wxString GetDescription() override
139  {
140  if( m_description.IsEmpty() && IsAlias() )
141  {
142  if( PART_SPTR parent = m_parent.lock() )
143  return parent->GetDescription();
144  }
145 
146  return m_description;
147  }
148 
149  void SetKeyWords( const wxString& aKeyWords ) { m_keyWords = aKeyWords; }
150 
151  wxString GetKeyWords() const
152  {
153  if( m_keyWords.IsEmpty() && IsAlias() )
154  {
155  if( PART_SPTR parent = m_parent.lock() )
156  return parent->GetKeyWords();
157  }
158 
159  return m_keyWords;
160  }
161 
162  wxString GetSearchText() override;
163 
167  bool IsRoot() const override { return m_parent.use_count() == 0; }
168  bool IsAlias() const { return !m_parent.expired() && m_parent.use_count() > 0; }
169 
170  const wxString GetLibraryName() const;
171 
172  PART_LIB* GetLib() const { return m_library; }
173  void SetLib( PART_LIB* aLibrary ) { m_library = aLibrary; }
174 
176 
177  void SetFPFilters( const wxArrayString& aFilters ) { m_fpFilters = aFilters; }
178 
179  wxArrayString GetFPFilters() const
180  {
181  if( m_fpFilters.IsEmpty() && IsAlias() )
182  {
183  if( PART_SPTR parent = m_parent.lock() )
184  return parent->GetFPFilters();
185  }
186 
187  return m_fpFilters;
188  }
189 
190  void ViewGetLayers( int aLayers[], int& aCount ) const override;
191 
202  const EDA_RECT GetUnitBoundingBox( int aUnit, int aConvert ) const;
203 
214  const EDA_RECT GetBodyBoundingBox( int aUnit, int aConvert ) const;
215 
216  const EDA_RECT GetBoundingBox() const override
217  {
218  return GetUnitBoundingBox( 0, 0 );
219  }
220 
221  bool IsPower() const;
222  bool IsNormal() const;
223 
224  void SetPower();
225  void SetNormal();
226 
231  void LockUnits( bool aLockUnits ) { m_unitsLocked = aLockUnits; }
232 
237  bool UnitsLocked() const { return m_unitsLocked; }
238 
248  void SetFields( const std::vector <LIB_FIELD>& aFieldsList );
249 
255  void GetFields( std::vector<LIB_FIELD*>& aList );
256  void GetFields( std::vector<LIB_FIELD>& aList );
257 
261  void AddField( LIB_FIELD* aField );
262 
267  LIB_FIELD* FindField( const wxString& aFieldName );
268 
269  const LIB_FIELD* FindField( const wxString& aFieldName ) const;
270 
277  LIB_FIELD* GetFieldById( int aId ) const;
278 
281 
284 
287 
290 
299  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
300  int aMulti, int aConvert, const PART_DRAW_OPTIONS& aOpts );
301 
313  void Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint& aOffset,
314  const TRANSFORM& aTransform ) const;
315 
326  void PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint& aOffset,
327  const TRANSFORM& aTransform );
328 
335  void AddDrawItem( LIB_ITEM* aItem, bool aSort = true );
336 
342  void RemoveDrawItem( LIB_ITEM* aItem );
343 
353  LIB_ITEM* GetNextDrawItem( const LIB_ITEM* aItem = NULL, KICAD_T aType = TYPE_NOT_INIT );
354 
355  size_t GetPinCount() const { return m_drawings.size( LIB_PIN_T ); }
356 
357  size_t GetFieldCount() const { return m_drawings.size( LIB_FIELD_T ); }
358 
369  {
370  return (LIB_PIN*) GetNextDrawItem( (LIB_ITEM*) aItem, LIB_PIN_T );
371  }
372 
386  void GetPins( LIB_PINS& aList, int aUnit = 0, int aConvert = 0 ) const;
387 
398  LIB_PIN* GetPin( const wxString& aNumber, int aUnit = 0, int aConvert = 0 ) const;
399 
412  bool PinsConflictWith( const LIB_PART& aOtherPart, bool aTestNums, bool aTestNames,
413  bool aTestType, bool aTestOrientation, bool aTestLength ) const;
414 
420  void SetOffset( const wxPoint& aOffset );
421 
426 
432  bool HasConversion() const;
433 
437  void ClearTempFlags();
438  void ClearEditFlags();
439 
449  LIB_ITEM* LocateDrawItem( int aUnit, int aConvert, KICAD_T aType, const wxPoint& aPoint );
450 
461  LIB_ITEM* LocateDrawItem( int aUnit, int aConvert, KICAD_T aType, const wxPoint& aPoint,
462  const TRANSFORM& aTransform );
463 
470  const LIB_ITEMS_CONTAINER& GetDrawItems() const { return m_drawings; }
471 
472  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
473 
485  void SetUnitCount( int aCount, bool aDuplicateDrawItems = true );
486  int GetUnitCount() const override;
487 
491  wxString GetUnitReference( int aUnit ) override;
492 
497  bool IsMulti() const { return m_unitCount > 1; }
498 
507  static wxString SubReference( int aUnit, bool aAddSeparator = true );
508 
509  // Accessors to sub ref parameters
511 
515  static int* SubpartIdSeparatorPtr() { return &m_subpartIdSeparator; }
516  static int GetSubpartFirstId() { return m_subpartFirstId; }
517 
521  static int* SubpartFirstIdPtr() { return &m_subpartFirstId; }
522 
533  static void SetSubpartIdNotation( int aSep, int aFirstId );
534 
547  void SetConversion( bool aSetConvert, bool aDuplicatePins = true );
548 
556  void SetPinNameOffset( int aOffset ) { m_pinNameOffset = aOffset; }
557  int GetPinNameOffset() const { return m_pinNameOffset; }
558 
564  void SetShowPinNames( bool aShow ) { m_showPinNames = aShow; }
565  bool ShowPinNames() const { return m_showPinNames; }
566 
572  void SetShowPinNumbers( bool aShow ) { m_showPinNumbers = aShow; }
573  bool ShowPinNumbers() const { return m_showPinNumbers; }
574 
580  void SetIncludeInBom( bool aIncludeInBom ) { m_includeInBom = aIncludeInBom; }
581  bool GetIncludeInBom() const { return m_includeInBom; }
582 
588  void SetIncludeOnBoard( bool aIncludeOnBoard ) { m_includeOnBoard = aIncludeOnBoard; }
589  bool GetIncludeOnBoard() const { return m_includeOnBoard; }
590 
600  int Compare( const LIB_PART& aRhs ) const;
601 
602  bool operator==( const LIB_PART* aPart ) const { return this == aPart; }
603  bool operator==( const LIB_PART& aPart ) const { return Compare( aPart ) == 0; }
604  bool operator!=( const LIB_PART& aPart ) const { return Compare( aPart ) != 0; }
605 
606  const LIB_PART& operator=( const LIB_PART& aPart );
607 
615  std::unique_ptr< LIB_PART > Flatten() const;
616 
623  std::vector<struct PART_UNITS> GetUnitDrawItems();
624 
633  std::vector<struct PART_UNITS> GetUniqueUnits();
634 
645  std::vector<LIB_ITEM*> GetUnitItems( int aUnit, int aConvert );
646 
647 #if defined(DEBUG)
648  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
649 #endif
650 
651 private:
652  // We create a different set parent function for this class, so we hide the inherited one.
653  using EDA_ITEM::SetParent;
654 
655  void deleteAllFields();
656 
657 private:
662 
665 
668  bool m_showPinNames;
671 
675 
677 
679  wxString m_name;
680  wxString m_description;
681  wxString m_keyWords;
682  wxArrayString m_fpFilters;
683 
685  static int m_subpartIdSeparator;
686  static int m_subpartFirstId;
689 };
692 
693 #endif // CLASS_LIBENTRY_H
LIB_FIELD & GetFootprintField()
Return reference to the footprint field.
Definition: lib_symbol.cpp:991
void SetLib(PART_LIB *aLibrary)
Definition: lib_symbol.h:173
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
Definition: lib_symbol.h:685
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:80
void SetFPFilters(const wxArrayString &aFilters)
Definition: lib_symbol.h:177
static int * SubpartFirstIdPtr()
Return a reference to m_subpartFirstId, only for read/save setting functions.
Definition: lib_symbol.h:521
void SetPower()
Definition: lib_symbol.cpp:420
virtual ~LIB_PART()
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Definition: lib_symbol.cpp:162
LIB_ID GetLibId() const override
Definition: lib_symbol.h:131
LIB_FIELD & GetDatasheetField()
Return reference to the datasheet field.
Definition: lib_symbol.cpp:999
bool m_showPinNumbers
Definition: lib_symbol.h:670
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
wxString GetName() const override
Definition: lib_symbol.h:129
const LIB_ITEMS_CONTAINER & GetDrawItems() const
Definition: lib_symbol.h:470
const wxString GetLibraryName() const
Definition: lib_symbol.cpp:402
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:56
virtual LIB_PART * Duplicate() const
Create a copy of a LIB_PART and assigns unique KIIDs to the copy and its children.
Definition: lib_symbol.h:108
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
Definition: lib_tree_item.h:39
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: lib_symbol.h:216
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:663
wxString GetLibNickname() const override
Definition: lib_symbol.h:134
LIB_ITEM * GetNextDrawItem(const LIB_ITEM *aItem=NULL, KICAD_T aType=TYPE_NOT_INIT)
Return the next draw object pointer.
Definition: lib_symbol.cpp:666
PART_LIB * m_library
Definition: lib_symbol.h:678
PART_SPTR SharedPtr() const
Definition: lib_symbol.h:103
bool operator==(const LIB_PART *aPart) const
Definition: lib_symbol.h:602
Field object used in symbol libraries.
Definition: lib_field.h:59
void SetUnitCount(int aCount, bool aDuplicateDrawItems=true)
Set the units per part count.
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the part number: only 'A',...
Definition: lib_symbol.h:688
bool m_includeOnBoard
Definition: lib_symbol.h:673
std::vector< struct PART_UNITS > GetUnitDrawItems()
Return a list of LIB_ITEM objects separated by unit and convert number.
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:676
LIB_PIN * GetPin(const wxString &aNumber, int aUnit=0, int aConvert=0) const
Return pin object with the requested pin aNumber.
Definition: lib_symbol.cpp:718
std::vector< LIB_ITEM * > m_items
The items unique to this unit and alternate body style.
Definition: lib_symbol.h:83
LIB_FIELD & GetValueField()
Return reference to the value field.
Definition: lib_symbol.cpp:975
bool operator==(const LIB_PART &aPart) const
Definition: lib_symbol.h:603
int Compare(const LIB_PART &aRhs) const
Comparison test that can be used for operators.
Definition: lib_symbol.cpp:213
wxArrayString GetFPFilters() const
Definition: lib_symbol.h:179
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:306
bool IsNormal() const
Definition: lib_symbol.cpp:429
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
Definition: lib_symbol.h:42
wxString GetKeyWords() const
Definition: lib_symbol.h:151
int m_unit
The unit number.
Definition: lib_symbol.h:81
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
void SetIncludeInBom(bool aIncludeInBom)
Set or clear the include in schematic bill of materials flag.
Definition: lib_symbol.h:580
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
Definition: lib_symbol.h:48
LIBRENTRYOPTIONS m_options
Special part features such as POWER or NORMAL.)
Definition: lib_symbol.h:674
bool m_includeInBom
Definition: lib_symbol.h:672
bool draw_hidden_fields
Definition: lib_symbol.h:66
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:95
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
bool m_unitsLocked
True if part has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:664
void ClearTempFlags()
Clears the status flag all draw objects in this part.
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:166
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
std::vector< struct PART_UNITS > GetUniqueUnits()
Return a list of unit numbers that are unique to this symbol.
void PlotLibFields(PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform)
Plot Lib Fields only of the part to plotter.
Definition: lib_symbol.cpp:592
void SetOffset(const wxPoint &aOffset)
Move the part aOffset.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: lib_symbol.cpp:837
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:667
void deleteAllFields()
Definition: lib_symbol.cpp:874
PART_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:659
Definition: kiid.h:44
static int GetSubpartIdSeparator()
Definition: lib_symbol.h:510
std::vector< LIB_ITEM * > GetUnitItems(int aUnit, int aConvert)
Return a list of item pointers for aUnit and aConvert for this symbol.
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
void SetConversion(bool aSetConvert, bool aDuplicatePins=true)
Set or clear the alternate body style (DeMorgan) for the part.
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
Definition: lib_symbol.cpp:983
virtual wxString GetClass() const override
Return the class name.
Definition: lib_symbol.h:123
LIB_FIELD * FindField(const wxString &aFieldName)
Find a field within this part matching aFieldName and returns it or NULL if not found.
Definition: lib_symbol.cpp:951
MULTIVECTOR< LIB_ITEM, LIB_ARC_T, LIB_FIELD_T > LIB_ITEMS_CONTAINER
Definition: lib_symbol.h:47
#define NULL
int GetUnitCount() const override
For items with units, return the number of units.
wxString m_name
Definition: lib_symbol.h:679
static int GetSubpartFirstId()
Definition: lib_symbol.h:516
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Definition: lib_symbol.cpp:655
size_t GetFieldCount() const
Definition: lib_symbol.h:357
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0) const
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:695
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Definition: lib_symbol.h:469
void SetDescription(const wxString &aDescription)
Definition: lib_symbol.h:136
void SetParent(LIB_PART *aParent=nullptr)
Definition: lib_symbol.cpp:325
PART_REF & GetParent()
Definition: lib_symbol.h:120
LIBRENTRYOPTIONS
Definition: lib_symbol.h:52
Define a library symbol object.
Definition: lib_symbol.h:93
void GetFields(std::vector< LIB_FIELD * > &aList)
Return a list of fields within this part.
Definition: lib_symbol.cpp:903
wxString GetDescription() override
Definition: lib_symbol.h:138
LIB_PART(const wxString &aName, LIB_PART *aParent=nullptr, PART_LIB *aLibrary=nullptr)
Definition: lib_symbol.cpp:82
bool operator<(const LIB_PART &aItem1, const LIB_PART &aItem2)
Definition: lib_symbol.cpp:67
size_t GetPinCount() const
Definition: lib_symbol.h:355
void RemoveDuplicateDrawItems()
Remove duplicate draw items from list.
wxArrayString m_fpFilters
List of suitable footprint names for the part (wild card names accepted).
Definition: lib_symbol.h:682
std::unique_ptr< LIB_PART > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:334
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
Definition: lib_symbol.cpp:937
LIB_ID m_libId
Definition: lib_symbol.h:660
int GetPinNameOffset() const
Definition: lib_symbol.h:557
const KIID m_Uuid
Definition: eda_item.h:525
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
Definition: lib_symbol.h:368
PART_LIB * GetLib() const
Definition: lib_symbol.h:172
const PART_REF & GetParent() const
Definition: lib_symbol.h:121
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: kiid.h:32
int m_convert
The alternate body style of the unit.
Definition: lib_symbol.h:82
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
Definition: lib_symbol.cpp:308
Base plotter engine class.
Definition: plotter.h:121
bool IsPower() const
Definition: lib_symbol.cpp:411
TRANSFORM DefaultTransform
Definition: eeschema.cpp:56
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
Definition: lib_symbol.h:572
bool ShowPinNumbers() const
Definition: lib_symbol.h:573
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or '.
timestamp_t m_lastModDate
Definition: lib_symbol.h:661
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, int aMulti, int aConvert, const PART_DRAW_OPTIONS &aOpts)
Print part.
Definition: lib_symbol.cpp:479
void ClearEditFlags()
void SetKeyWords(const wxString &aKeyWords)
Definition: lib_symbol.h:149
bool IsAlias() const
Definition: lib_symbol.h:168
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Definition: lib_symbol.cpp:803
Handle the component boundary box.
Definition: eda_rect.h:42
static wxString SubReference(int aUnit, bool aAddSeparator=true)
Definition: lib_symbol.cpp:447
static int * SubpartIdSeparatorPtr()
Return a reference to m_subpartIdSeparator, only for read/save setting functions.
Definition: lib_symbol.h:515
bool GetIncludeOnBoard() const
Definition: lib_symbol.h:589
wxString GetSearchText() override
Definition: lib_symbol.cpp:49
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
Definition: lib_symbol.h:167
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
bool IsMulti() const
Definition: lib_symbol.h:497
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
boost::ptr_vector< LIB_ITEM > ITEM_PTR_VECTOR
Helper for defining a list of library draw object pointers.
Definition: multivector.h:54
std::weak_ptr< LIB_PART > PART_REF
weak pointer to LIB_PART
Definition: lib_symbol.h:46
LIB_ITEM * LocateDrawItem(int aUnit, int aConvert, KICAD_T aType, const wxPoint &aPoint)
Locate a draw object.
const LIB_PART & operator=(const LIB_PART &aPart)
Definition: lib_symbol.cpp:167
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:314
timestamp_t GetLastModDate() const
Definition: lib_symbol.h:175
void SetIncludeOnBoard(bool aIncludeOnBoard)
Set or clear include in board netlist flag.
Definition: lib_symbol.h:588
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:681
bool operator!=(const LIB_PART &aPart) const
Definition: lib_symbol.h:604
bool draw_visible_fields
Definition: lib_symbol.h:65
void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
Definition: lib_symbol.h:564
bool GetIncludeInBom() const
Definition: lib_symbol.h:581
SEARCH_RESULT
Definition: eda_item.h:41
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
Definition: lib_symbol.h:556
bool m_showPinNames
Definition: lib_symbol.h:669
const EDA_RECT GetBodyBoundingBox(int aUnit, int aConvert) const
Get the symbol bounding box excluding fields.
Definition: lib_symbol.cpp:849
void SetFields(const std::vector< LIB_FIELD > &aFieldsList)
Overwrite all the existing fields in this symbol with fields supplied in aFieldsList.
Definition: lib_symbol.cpp:886
wxString m_description
Definition: lib_symbol.h:680
void AddField(LIB_FIELD *aField)
Add a field.
Definition: lib_symbol.cpp:880
Object used to load, save, search, and otherwise manipulate symbol library files.
void SetLibId(const LIB_ID &aLibId)
Definition: lib_symbol.h:132
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:225
TRANSFORM transform
Definition: lib_symbol.h:64
bool PinsConflictWith(const LIB_PART &aOtherPart, bool aTestNums, bool aTestNames, bool aTestType, bool aTestOrientation, bool aTestLength) const
Return true if this part's pins do not match another part's pins.
Definition: lib_symbol.cpp:736
void Plot(PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform) const
Plot lib part to plotter.
Definition: lib_symbol.cpp:546
bool ShowPinNames() const
Definition: lib_symbol.h:565
bool UnitsLocked() const
Check whether part units are interchangeable.
Definition: lib_symbol.h:237
void LockUnits(bool aLockUnits)
Set interchangeable the property for part units.
Definition: lib_symbol.h:231
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.
Definition: lib_symbol.cpp:629
void SetNormal()
Definition: lib_symbol.cpp:438
PART_SPTR m_me
Definition: lib_symbol.h:658