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 <[email protected]>
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 SYMBOL_LIB;
40 class LIB_SYMBOL;
41 class LIB_FIELD;
43 
44 
45 typedef std::shared_ptr<LIB_SYMBOL> LIB_SYMBOL_SPTR;
46 typedef std::weak_ptr<LIB_SYMBOL> LIB_SYMBOL_REF;
49 
50 
51 /* values for member .m_options */
53 {
54  ENTRY_NORMAL, // Libentry is a standard symbol (real or alias)
55  ENTRY_POWER // Libentry is a power symbol
56 };
57 
58 
59 extern bool operator<( const LIB_SYMBOL& aItem1, const LIB_SYMBOL& 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  bool show_connect_point; // Whether to show the pin connect point marker (small circle)
69  // useful in dialog pin properties
70 
72  {
74  draw_visible_fields = true;
75  draw_hidden_fields = true;
76  show_elec_type = false;
77  show_connect_point = false;
78  }
79 };
80 
81 
83 {
84  int m_unit;
85  int m_convert;
86  std::vector<LIB_ITEM*> m_items;
87 };
88 
89 
96 class LIB_SYMBOL : public EDA_ITEM, public LIB_TREE_ITEM
97 {
98 public:
99  LIB_SYMBOL( const wxString& aName, LIB_SYMBOL* aParent = nullptr,
100  SYMBOL_LIB* aLibrary = nullptr );
101 
102  LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary = nullptr );
103 
104  virtual ~LIB_SYMBOL();
105 
107  LIB_SYMBOL_SPTR SharedPtr() const { return m_me; }
108 
112  virtual LIB_SYMBOL* Duplicate() const
113  {
114  LIB_SYMBOL* dupe = new LIB_SYMBOL( *this, m_library );
115  const_cast<KIID&>( dupe->m_Uuid ) = KIID();
116 
117  for( LIB_ITEM& item : dupe->m_drawings )
118  const_cast<KIID&>( item.m_Uuid ) = KIID();
119 
120  return dupe;
121  }
122 
123  void SetParent( LIB_SYMBOL* aParent = nullptr );
125  const LIB_SYMBOL_REF& GetParent() const { return m_parent; }
126 
127  virtual wxString GetClass() const override
128  {
129  return wxT( "LIB_SYMBOL" );
130  }
131 
132  virtual void SetName( const wxString& aName );
133  wxString GetName() const override { return m_name; }
134 
135  LIB_ID GetLibId() const override { return m_libId; }
136  void SetLibId( const LIB_ID& aLibId ) { m_libId = aLibId; }
137 
138  wxString GetLibNickname() const override { return GetLibraryName(); }
139 
140  void SetDescription( const wxString& aDescription ) { m_description = aDescription; }
141 
142  wxString GetDescription() override
143  {
144  if( m_description.IsEmpty() && IsAlias() )
145  {
146  if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
147  return parent->GetDescription();
148  }
149 
150  return m_description;
151  }
152 
153  void SetKeyWords( const wxString& aKeyWords ) { m_keyWords = aKeyWords; }
154 
155  wxString GetKeyWords() const
156  {
157  if( m_keyWords.IsEmpty() && IsAlias() )
158  {
159  if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
160  return parent->GetKeyWords();
161  }
162 
163  return m_keyWords;
164  }
165 
166  wxString GetSearchText() override;
167 
171  bool IsRoot() const override { return m_parent.use_count() == 0; }
172  bool IsAlias() const { return !m_parent.expired() && m_parent.use_count() > 0; }
173 
174  const wxString GetLibraryName() const;
175 
176  SYMBOL_LIB* GetLib() const { return m_library; }
177  void SetLib( SYMBOL_LIB* aLibrary ) { m_library = aLibrary; }
178 
180 
181  void SetFPFilters( const wxArrayString& aFilters ) { m_fpFilters = aFilters; }
182 
183  wxArrayString GetFPFilters() const
184  {
185  if( m_fpFilters.IsEmpty() && IsAlias() )
186  {
187  if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
188  return parent->GetFPFilters();
189  }
190 
191  return m_fpFilters;
192  }
193 
194  void ViewGetLayers( int aLayers[], int& aCount ) const override;
195 
206  const EDA_RECT GetUnitBoundingBox( int aUnit, int aConvert ) const;
207 
218  const EDA_RECT GetBodyBoundingBox( int aUnit, int aConvert, bool aIncludePins ) const;
219 
220  const EDA_RECT GetBoundingBox() const override
221  {
222  return GetUnitBoundingBox( 0, 0 );
223  }
224 
225  bool IsPower() const;
226  bool IsNormal() const;
227 
228  void SetPower();
229  void SetNormal();
230 
235  void LockUnits( bool aLockUnits ) { m_unitsLocked = aLockUnits; }
236 
241  bool UnitsLocked() const { return m_unitsLocked; }
242 
252  void SetFields( const std::vector <LIB_FIELD>& aFieldsList );
253 
259  void GetFields( std::vector<LIB_FIELD*>& aList );
260  void GetFields( std::vector<LIB_FIELD>& aList );
261 
265  void AddField( LIB_FIELD* aField );
266 
271  LIB_FIELD* FindField( const wxString& aFieldName );
272 
273  const LIB_FIELD* FindField( const wxString& aFieldName ) const;
274 
281  LIB_FIELD* GetFieldById( int aId ) const;
282 
285 
288 
291 
294 
302  int UpdateFieldOrdinals();
303 
304  int GetNextAvailableFieldId() const;
305 
314  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
315  int aMulti, int aConvert, const LIB_SYMBOL_OPTIONS& aOpts );
316 
328  void Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint& aOffset,
329  const TRANSFORM& aTransform ) const;
330 
341  void PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint& aOffset,
342  const TRANSFORM& aTransform );
343 
350  void AddDrawItem( LIB_ITEM* aItem, bool aSort = true );
351 
357  void RemoveDrawItem( LIB_ITEM* aItem );
358 
368  LIB_ITEM* GetNextDrawItem( const LIB_ITEM* aItem = nullptr, KICAD_T aType = TYPE_NOT_INIT );
369 
370  size_t GetPinCount() const { return m_drawings.size( LIB_PIN_T ); }
371 
372  size_t GetFieldCount() const { return m_drawings.size( LIB_FIELD_T ); }
373 
383  LIB_PIN* GetNextPin( LIB_PIN* aItem = nullptr )
384  {
385  return (LIB_PIN*) GetNextDrawItem( (LIB_ITEM*) aItem, LIB_PIN_T );
386  }
387 
401  void GetPins( LIB_PINS& aList, int aUnit = 0, int aConvert = 0 ) const;
402 
413  LIB_PIN* GetPin( const wxString& aNumber, int aUnit = 0, int aConvert = 0 ) const;
414 
427  bool PinsConflictWith( const LIB_SYMBOL& aOtherSymbol, bool aTestNums, bool aTestNames,
428  bool aTestType, bool aTestOrientation, bool aTestLength ) const;
429 
435  void SetOffset( const wxPoint& aOffset );
436 
441 
447  bool HasConversion() const;
448 
452  void ClearTempFlags();
453  void ClearEditFlags();
454 
464  LIB_ITEM* LocateDrawItem( int aUnit, int aConvert, KICAD_T aType, const wxPoint& aPoint );
465 
476  LIB_ITEM* LocateDrawItem( int aUnit, int aConvert, KICAD_T aType, const wxPoint& aPoint,
477  const TRANSFORM& aTransform );
478 
485  const LIB_ITEMS_CONTAINER& GetDrawItems() const { return m_drawings; }
486 
487  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
488 
500  void SetUnitCount( int aCount, bool aDuplicateDrawItems = true );
501  int GetUnitCount() const override;
502 
506  wxString GetUnitReference( int aUnit ) override;
507 
512  bool IsMulti() const { return m_unitCount > 1; }
513 
522  static wxString SubReference( int aUnit, bool aAddSeparator = true );
523 
524  // Accessors to sub ref parameters
526 
530  static int* SubpartIdSeparatorPtr() { return &m_subpartIdSeparator; }
531  static int GetSubpartFirstId() { return m_subpartFirstId; }
532 
536  static int* SubpartFirstIdPtr() { return &m_subpartFirstId; }
537 
548  static void SetSubpartIdNotation( int aSep, int aFirstId );
549 
562  void SetConversion( bool aSetConvert, bool aDuplicatePins = true );
563 
571  void SetPinNameOffset( int aOffset ) { m_pinNameOffset = aOffset; }
572  int GetPinNameOffset() const { return m_pinNameOffset; }
573 
579  void SetShowPinNames( bool aShow ) { m_showPinNames = aShow; }
580  bool ShowPinNames() const { return m_showPinNames; }
581 
587  void SetShowPinNumbers( bool aShow ) { m_showPinNumbers = aShow; }
588  bool ShowPinNumbers() const { return m_showPinNumbers; }
589 
595  void SetIncludeInBom( bool aIncludeInBom ) { m_includeInBom = aIncludeInBom; }
596  bool GetIncludeInBom() const { return m_includeInBom; }
597 
603  void SetIncludeOnBoard( bool aIncludeOnBoard ) { m_includeOnBoard = aIncludeOnBoard; }
604  bool GetIncludeOnBoard() const { return m_includeOnBoard; }
605 
615  int Compare( const LIB_SYMBOL& aRhs, int aCompareFlags = 0 ) const;
616 
617  bool operator==( const LIB_SYMBOL* aSymbol ) const { return this == aSymbol; }
618  bool operator==( const LIB_SYMBOL& aSymbol ) const
619  {
620  return Compare( aSymbol, LIB_ITEM::COMPARE_FLAGS::EQUALITY ) == 0;
621  }
622 
623  bool operator!=( const LIB_SYMBOL& aSymbol ) const
624  {
625  return Compare( aSymbol, LIB_ITEM::COMPARE_FLAGS::EQUALITY ) != 0;
626  }
627 
628  const LIB_SYMBOL& operator=( const LIB_SYMBOL& aSymbol );
629 
637  std::unique_ptr< LIB_SYMBOL > Flatten() const;
638 
645  std::vector<struct LIB_SYMBOL_UNIT> GetUnitDrawItems();
646 
655  std::vector<struct LIB_SYMBOL_UNIT> GetUniqueUnits();
656 
667  std::vector<LIB_ITEM*> GetUnitDrawItems( int aUnit, int aConvert );
668 
669 #if defined(DEBUG)
670  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
671 #endif
672 
673 private:
674  // We create a different set parent function for this class, so we hide the inherited one.
675  using EDA_ITEM::SetParent;
676 
677  void deleteAllFields();
678 
679 private:
684 
687 
690  bool m_showPinNames;
693 
697 
699 
701  wxString m_name;
702  wxString m_description;
703  wxString m_keyWords;
704  wxArrayString m_fpFilters;
705 
707  static int m_subpartIdSeparator;
708  static int m_subpartFirstId;
711 };
714 
715 #endif // CLASS_LIBENTRY_H
bool m_showPinNumbers
Definition: lib_symbol.h:692
bool IsMulti() const
Definition: lib_symbol.h:512
LIB_FIELD * FindField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName and returns it or NULL if not found.
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
Definition: lib_symbol.h:571
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
Definition: lib_symbol.cpp:66
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:756
LIB_SYMBOL_REF & GetParent()
Definition: lib_symbol.h:124
int GetPinNameOffset() const
Definition: lib_symbol.h:572
std::vector< LIB_ITEM * > m_items
The items unique to this unit and alternate body style.
Definition: lib_symbol.h:86
LIB_SYMBOL_SPTR SharedPtr() const
Definition: lib_symbol.h:107
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:80
timestamp_t GetLastModDate() const
Definition: lib_symbol.h:179
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:965
void AddField(LIB_FIELD *aField)
Add a field.
Definition: lib_symbol.cpp:959
LIB_FIELD & GetFootprintField()
Return reference to the footprint field.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetIncludeOnBoard(bool aIncludeOnBoard)
Set or clear include in board netlist flag.
Definition: lib_symbol.h:603
int GetNextAvailableFieldId() const
bool m_showPinNames
Definition: lib_symbol.h:691
Object used to load, save, search, and otherwise manipulate symbol library files.
wxString GetName() const override
Definition: lib_symbol.h:133
void SetOffset(const wxPoint &aOffset)
Move the symbol aOffset.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
Definition: lib_tree_item.h:38
bool operator!=(const LIB_SYMBOL &aSymbol) const
Definition: lib_symbol.h:623
const LIB_ITEMS_CONTAINER & GetDrawItems() const
Definition: lib_symbol.h:485
void SetConversion(bool aSetConvert, bool aDuplicatePins=true)
Set or clear the alternate body style (DeMorgan) for the symbol.
Field object used in symbol libraries.
Definition: lib_field.h:59
wxString GetLibNickname() const override
Definition: lib_symbol.h:138
bool IsAlias() const
Definition: lib_symbol.h:172
void SetUnitCount(int aCount, bool aDuplicateDrawItems=true)
Set the units per symbol count.
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
Definition: lib_symbol.h:42
bool ShowPinNumbers() const
Definition: lib_symbol.h:588
bool GetIncludeOnBoard() const
Definition: lib_symbol.h:604
size_t GetPinCount() const
Definition: lib_symbol.h:370
virtual wxString GetClass() const override
Return the class name.
Definition: lib_symbol.h:127
wxString m_description
Definition: lib_symbol.h:702
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:309
bool IsPower() const
Definition: lib_symbol.cpp:459
static int * SubpartFirstIdPtr()
Return a reference to m_subpartFirstId, only for read/save setting functions.
Definition: lib_symbol.h:536
std::vector< struct LIB_SYMBOL_UNIT > GetUniqueUnits()
Return a list of unit numbers that are unique to this symbol.
static wxString SubReference(int aUnit, bool aAddSeparator=true)
Definition: lib_symbol.cpp:495
void SetLib(SYMBOL_LIB *aLibrary)
Definition: lib_symbol.h:177
LIB_FIELD & GetValueField()
Return reference to the value field.
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.
Definition: lib_symbol.cpp:690
wxString m_name
Definition: lib_symbol.h:701
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
bool draw_visible_fields
Definition: lib_symbol.h:65
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
Definition: lib_symbol.h:48
Define a library symbol object.
Definition: lib_symbol.h:96
void PlotLibFields(PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform)
Plot Lib Fields only of the symbol to plotter.
Definition: lib_symbol.cpp:653
void ClearEditFlags()
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:380
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
int m_unit
The unit number.
Definition: lib_symbol.h:84
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:93
SYMBOL_LIB * GetLib() const
Definition: lib_symbol.h:176
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:115
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of LIB_ITEM objects separated by unit and convert number.
The base class for drawable items used by schematic library symbols.
Definition: lib_item.h:61
void GetFields(std::vector< LIB_FIELD * > &aList)
Return a list of fields within this symbol.
Definition: lib_symbol.cpp:982
bool PinsConflictWith(const LIB_SYMBOL &aOtherSymbol, bool aTestNums, bool aTestNames, bool aTestType, bool aTestOrientation, bool aTestLength) const
Return true if this symbol's pins do not match another symbol's pins.
Definition: lib_symbol.cpp:801
timestamp_t m_lastModDate
Definition: lib_symbol.h:683
TRANSFORM transform
Definition: lib_symbol.h:64
const EDA_RECT GetBodyBoundingBox(int aUnit, int aConvert, bool aIncludePins) const
Get the symbol bounding box excluding fields.
Definition: lib_symbol.cpp:916
std::weak_ptr< LIB_SYMBOL > LIB_SYMBOL_REF
weak pointer to LIB_SYMBOL
Definition: lib_symbol.h:46
LIB_SYMBOL_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:681
wxString GetSearchText() override
Definition: lib_symbol.cpp:48
const LIB_SYMBOL & operator=(const LIB_SYMBOL &aSymbol)
Definition: lib_symbol.cpp:166
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
Definition: kiid.h:44
static int GetSubpartFirstId()
Definition: lib_symbol.h:531
int m_convert
The alternate body style of the unit.
Definition: lib_symbol.h:85
void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
Definition: lib_symbol.h:579
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
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...
void RemoveDuplicateDrawItems()
Remove duplicate draw items from list.
wxString GetKeyWords() const
Definition: lib_symbol.h:155
MULTIVECTOR< LIB_ITEM, LIB_SHAPE_T, LIB_FIELD_T > LIB_ITEMS_CONTAINER
Definition: lib_symbol.h:47
LIB_ID GetLibId() const override
Definition: lib_symbol.h:135
bool m_unitsLocked
True if symbol has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:686
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:362
bool m_includeOnBoard
Definition: lib_symbol.h:695
int GetUnitCount() const override
For items with units, return the number of units.
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Definition: lib_symbol.cpp:868
int UpdateFieldOrdinals()
Order optional field indices.
void SetDescription(const wxString &aDescription)
Definition: lib_symbol.h:140
LIBRENTRYOPTIONS
Definition: lib_symbol.h:52
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:904
void deleteAllFields()
Definition: lib_symbol.cpp:953
bool ShowPinNames() const
Definition: lib_symbol.h:580
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:716
void SetParent(LIB_SYMBOL *aParent=nullptr)
Definition: lib_symbol.cpp:371
void SetLibId(const LIB_ID &aLibId)
Definition: lib_symbol.h:136
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Definition: lib_symbol.h:484
static int GetSubpartIdSeparator()
Definition: lib_symbol.h:525
bool UnitsLocked() const
Check whether symbol units are interchangeable.
Definition: lib_symbol.h:241
void ClearTempFlags()
Clears the status flag all draw objects in this symbol.
bool operator==(const LIB_SYMBOL *aSymbol) const
Definition: lib_symbol.h:617
const KIID m_Uuid
Definition: eda_item.h:474
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
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, int aMulti, int aConvert, const LIB_SYMBOL_OPTIONS &aOpts)
Print symbol.
Definition: lib_symbol.cpp:527
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:698
Base plotter engine class.
Definition: plotter.h:121
LIB_ITEM * LocateDrawItem(int aUnit, int aConvert, KICAD_T aType, const wxPoint &aPoint)
Locate a draw object.
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
bool m_includeInBom
Definition: lib_symbol.h:694
size_t GetFieldCount() const
Definition: lib_symbol.h:372
TRANSFORM DefaultTransform
Definition: eeschema.cpp:56
void SetIncludeInBom(bool aIncludeInBom)
Set or clear the include in schematic bill of materials flag.
Definition: lib_symbol.h:595
static int * SubpartIdSeparatorPtr()
Return a reference to m_subpartIdSeparator, only for read/save setting functions.
Definition: lib_symbol.h:530
void SetFPFilters(const wxArrayString &aFilters)
Definition: lib_symbol.h:181
void SetPower()
Definition: lib_symbol.cpp:468
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the symbol number: only 'A',...
Definition: lib_symbol.h:710
LIB_FIELD & GetDatasheetField()
Return reference to the datasheet field.
Handle the component boundary box.
Definition: eda_rect.h:42
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
Definition: lib_symbol.h:587
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:99
const wxString GetLibraryName() const
Definition: lib_symbol.cpp:450
wxArrayString GetFPFilters() const
Definition: lib_symbol.h:183
boost::ptr_vector< LIB_ITEM > ITEM_PTR_VECTOR
Helper for defining a list of library draw object pointers.
Definition: multivector.h:54
bool operator==(const LIB_SYMBOL &aSymbol) const
Definition: lib_symbol.h:618
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
Definition: lib_symbol.cpp:356
LIB_SYMBOL(const wxString &aName, LIB_SYMBOL *aParent=nullptr, SYMBOL_LIB *aLibrary=nullptr)
Definition: lib_symbol.cpp:81
LIB_PIN * GetNextPin(LIB_PIN *aItem=nullptr)
Return the next pin object from the draw list.
Definition: lib_symbol.h:383
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: lib_symbol.h:220
LIB_ITEM * GetNextDrawItem(const LIB_ITEM *aItem=nullptr, KICAD_T aType=TYPE_NOT_INIT)
Return the next draw object pointer.
Definition: lib_symbol.cpp:727
virtual ~LIB_SYMBOL()
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Definition: lib_symbol.cpp:161
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
Definition: lib_symbol.h:171
LIB_SYMBOL_SPTR m_me
Definition: lib_symbol.h:680
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:689
wxArrayString m_fpFilters
List of suitable footprint names for the symbol (wild card names accepted).
Definition: lib_symbol.h:704
bool IsNormal() const
Definition: lib_symbol.cpp:477
LIB_ID m_libId
Definition: lib_symbol.h:682
const LIB_SYMBOL_REF & GetParent() const
Definition: lib_symbol.h:125
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:703
SEARCH_RESULT
Definition: eda_item.h:41
wxString GetDescription() override
Definition: lib_symbol.h:142
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or '.
void Plot(PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform) const
Plot lib symbol to plotter.
Definition: lib_symbol.cpp:598
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.)
Definition: lib_symbol.h:696
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:685
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
Definition: lib_symbol.h:707
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:225
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:783
virtual LIB_SYMBOL * Duplicate() const
Create a copy of a LIB_SYMBOL and assigns unique KIIDs to the copy and its children.
Definition: lib_symbol.h:112
SYMBOL_LIB * m_library
Definition: lib_symbol.h:700
void SetKeyWords(const wxString &aKeyWords)
Definition: lib_symbol.h:153
void SetNormal()
Definition: lib_symbol.cpp:486
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
Definition: lib_symbol.h:235
int Compare(const LIB_SYMBOL &aRhs, int aCompareFlags=0) const
Comparison test that can be used for operators.
Definition: lib_symbol.cpp:212
bool GetIncludeInBom() const
Definition: lib_symbol.h:596