KiCad PCB EDA Suite
sch_component.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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2014 Dick Hollenbeck, dick@softplc.com
6  * Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
7  * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #ifndef COMPONENT_CLASS_H
28 #define COMPONENT_CLASS_H
29 
30 #include <base_struct.h>
31 #include <common.h>
32 #include <core/typeinfo.h>
34 #include <lib_id.h>
35 #include <msgpanel.h>
36 
37 #include <memory>
38 #include <string>
39 #include <unordered_map>
40 #include <vector>
41 #include <wx/arrstr.h>
42 #include <wx/chartype.h>
43 #include <wx/fdrepdlg.h>
44 #include <wx/gdicmn.h>
45 #include <wx/string.h>
46 
47 #include <bitmaps.h>
48 #include <sch_field.h>
49 #include <sch_item.h>
50 #include <sch_pin.h>
51 #include <sch_sheet_path.h> // COMPONENT_INSTANCE_REFERENCE
52 #include <symbol_lib_table.h>
53 #include <transform.h>
54 
55 struct COMPONENT_SELECTION;
56 class SCH_SCREEN;
57 class LIB_ITEM;
58 class LIB_PIN;
59 class LIB_PART;
61 class PART_LIB;
62 class PART_LIBS;
63 class EE_COLLECTOR;
64 class SCH_SCREEN;
66 
67 
69 typedef std::vector<std::unique_ptr<SCH_PIN>> SCH_PINS;
70 
71 typedef std::vector<SCH_PIN*> SCH_PIN_PTRS;
72 
74 typedef std::unordered_map<LIB_PIN*, unsigned> SCH_PIN_MAP;
75 
77 typedef std::vector<SCH_FIELD> SCH_FIELDS;
78 
79 typedef std::weak_ptr<LIB_PART> PART_REF;
80 
81 
82 extern std::string toUTFTildaText( const wxString& txt );
83 
84 
88 class SCH_COMPONENT : public SCH_ITEM
89 {
90 public:
91 
92 private:
93 
95 
98 
99  int m_unit;
100  int m_convert;
101  wxString m_prefix;
104 
117 
120 
122  std::unique_ptr< LIB_PART > m_part;
123 
126 
128  bool m_inBom;
129  bool m_onBoard;
130 
131  // Defines the hierarchical path and reference of the component. This allows support
132  // for multiple references to a single sub-sheet.
133  std::vector<COMPONENT_INSTANCE_REFERENCE> m_instanceReferences;
134 
135  void Init( const wxPoint& pos = wxPoint( 0, 0 ) );
136 
137 public:
138  SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ), SCH_ITEM* aParent = NULL );
139 
153  SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* aSheet,
154  int unit = 0, int convert = 0,
155  const wxPoint& pos = wxPoint( 0, 0 ) );
156 
158  const wxPoint& pos = wxPoint( 0, 0 ) );
168  SCH_COMPONENT( const SCH_COMPONENT& aComponent );
169 
171 
172  static inline bool ClassOf( const EDA_ITEM* aItem )
173  {
174  return aItem && SCH_COMPONENT_T == aItem->Type();
175  }
176 
177  wxString GetClass() const override
178  {
179  return wxT( "SCH_COMPONENT" );
180  }
181 
182  const std::vector<COMPONENT_INSTANCE_REFERENCE>& GetInstanceReferences()
183  {
184  return m_instanceReferences;
185  }
186 
187  void ViewGetLayers( int aLayers[], int& aCount ) const override;
188 
202  bool IsMovableFromAnchorPoint() override { return true; }
203 
204  void SetLibId( const LIB_ID& aName );
205 
206  const LIB_ID& GetLibId() const { return m_lib_id; }
207 
219  void SetSchSymbolLibraryName( const wxString& aName ) { m_schLibSymbolName = aName; }
220  wxString GetSchSymbolLibraryName() const;
221  bool UseLibIdLookup() const { return m_schLibSymbolName.IsEmpty(); }
222 
223  std::unique_ptr< LIB_PART >& GetPartRef() { return m_part; }
224 
241  void SetLibSymbol( LIB_PART* aLibSymbol );
242 
246  wxString GetDescription() const;
247 
251  wxString GetDatasheet() const;
252 
253  int GetUnit() const { return m_unit; }
254 
258  void UpdatePins();
259 
263  SCH_CONNECTION* GetConnectionForPin( LIB_PIN* aPin, const SCH_SHEET_PATH& aSheet );
264 
274  void SetUnit( int aUnit );
275 
284  void UpdateUnit( int aUnit );
285 
286  int GetConvert() const { return m_convert; }
287 
288  void SetConvert( int aConvert );
289 
290  wxString GetPrefix() const { return m_prefix; }
291 
292  void SetPrefix( const wxString& aPrefix ) { m_prefix = aPrefix; }
293 
294  TRANSFORM& GetTransform() const { return const_cast< TRANSFORM& >( m_transform ); }
295 
296  void SetTransform( const TRANSFORM& aTransform );
297 
303  int GetUnitCount() const;
304 
311  void SetOrientation( int aOrientation );
312 
328  int GetOrientation();
329 
333  void GetContextualTextVars( wxArrayString* aVars ) const;
334 
339  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
340 
341  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
342 
351  void ClearAnnotation( SCH_SHEET_PATH* aSheetPath );
352 
364  bool AddSheetPathReferenceEntryIfMissing( const KIID_PATH& aSheetPath );
365 
375  bool ReplaceInstanceSheetPath( const KIID_PATH& aOldSheetPath, const KIID_PATH& aNewSheetPath );
376 
377  const EDA_RECT GetBoundingBox() const override;
378 
383 
384 
385  //-----<Fields>-----------------------------------------------------------
386 
394  SCH_FIELD* GetField( int aFieldNdx );
395 
396  const SCH_FIELD* GetField( int aFieldNdx ) const;
397 
403  wxString GetFieldText( const wxString& aFieldName, SCH_EDIT_FRAME* aFrame ) const;
404 
411  void GetFields( std::vector<SCH_FIELD*>& aVector, bool aVisibleOnly );
412 
416  std::vector<SCH_FIELD>& GetFields() { return m_Fields; }
417 
425  SCH_FIELD* AddField( const SCH_FIELD& aField );
426 
432  void RemoveField( const wxString& aFieldName );
433 
442  SCH_FIELD* FindField( const wxString& aFieldName, bool aIncludeDefaultFields = true );
443 
449  void SetFields( const SCH_FIELDS& aFields )
450  {
451  m_Fields = aFields; // vector copying, length is changed possibly
452  }
453 
459  void UpdateFields( bool aResetStyle, bool aResetRef = false );
460 
464  int GetFieldCount() const { return (int)m_Fields.size(); }
465 
475  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
476 
477 
478  //-----</Fields>----------------------------------------------------------
479 
480 
488  LIB_PIN* GetPin( const wxString& number );
489 
495  void GetPins( std::vector<LIB_PIN*>& aPinsList );
496 
503  SCH_PIN_PTRS GetSchPins( const SCH_SHEET_PATH* aSheet = nullptr ) const;
504 
512  void Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
513 
514  void SwapData( SCH_ITEM* aItem ) override;
515 
525  static bool IsReferenceStringValid( const wxString& aReferenceString );
526 
532  const wxString GetRef( const SCH_SHEET_PATH* aSheet, bool aIncludeUnit = false );
533 
540  void SetRef( const SCH_SHEET_PATH* aSheet, const wxString& aReference );
541 
547  bool IsAnnotated( const SCH_SHEET_PATH* aSheet );
548 
557  void AddHierarchicalReference( const KIID_PATH& aPath,
558  const wxString& aRef,
559  int aUnit );
560 
561  // returns the unit selection, for the given sheet path.
562  int GetUnitSelection( const SCH_SHEET_PATH* aSheet ) const;
563 
564  // Set the unit selection, for the given sheet path.
565  void SetUnitSelection( const SCH_SHEET_PATH* aSheet, int aUnitSelection );
566 
567  // Geometric transforms (used in block operations):
568 
569  void Move( const wxPoint& aMoveVector ) override
570  {
571  if( aMoveVector == wxPoint( 0, 0 ) )
572  return;
573 
574  m_Pos += aMoveVector;
575 
576  for( SCH_FIELD& field : m_Fields )
577  field.Move( aMoveVector );
578 
579  SetModified();
580  }
581 
582  void MirrorY( int aYaxis_position ) override;
583  void MirrorX( int aXaxis_position ) override;
584  void Rotate( wxPoint aPosition ) override;
585 
586  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
587 
588  void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ) override;
589 
601  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
602  const SCH_SHEET_PATH* aPath = nullptr ) override;
603 
604  wxPoint GetPinPhysicalPosition( const LIB_PIN* Pin ) const;
605 
606  bool IsConnectable() const override { return m_onBoard; }
607 
608  bool CanConnect( const SCH_ITEM* aItem ) const override
609  {
610  return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
611  ( aItem->Type() == SCH_NO_CONNECT_T ) ||
612  ( aItem->Type() == SCH_JUNCTION_T ) ||
613  ( aItem->Type() == SCH_COMPONENT_T ) ;
614  }
615 
621  bool IsInNetlist() const;
622 
623  void GetConnectionPoints( std::vector<wxPoint>& aPoints ) const override;
624 
625  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
626 
635  LIB_ITEM* GetDrawItem( const wxPoint& aPosition, KICAD_T aType = TYPE_NOT_INIT );
636 
637  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
638 
639  BITMAP_DEF GetMenuImage() const override;
640 
641  void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems, SCH_SHEET_PATH* aSheetPath ) override;
642 
643  bool operator <( const SCH_ITEM& aItem ) const override;
644 
645  bool operator==( const SCH_COMPONENT& aComponent) const;
646  bool operator!=( const SCH_COMPONENT& aComponent) const;
647 
648  SCH_COMPONENT& operator=( const SCH_ITEM& aItem );
649 
650  bool IsReplaceable() const override { return true; }
651 
652  wxPoint GetPosition() const override { return m_Pos; }
653  void SetPosition( const wxPoint& aPosition ) override { Move( aPosition - m_Pos ); }
654 
655  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
656  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
657 
658  void Plot( PLOTTER* aPlotter ) override;
659 
660  EDA_ITEM* Clone() const override;
661 
662 #if defined(DEBUG)
663  void Show( int nestLevel, std::ostream& os ) const override;
664 #endif
665 
666  void ClearBrightenedPins();
667 
668  bool HasBrightenedPins();
669 
670  void BrightenPin( LIB_PIN* aPin );
671 
672  bool GetIncludeInBom() const { return m_inBom; }
673  void SetIncludeInBom( bool aIncludeInBom ) { m_inBom = aIncludeInBom; }
674 
675  bool GetIncludeOnBoard() const { return m_onBoard; }
676  void SetIncludeOnBoard( bool aIncludeOnBoard ) { m_onBoard = aIncludeOnBoard; }
677 
678 private:
679  bool doIsConnected( const wxPoint& aPosition ) const override;
680 };
681 
682 #endif /* COMPONENT_CLASS_H */
bool operator!=(const SCH_COMPONENT &aComponent) const
void UpdateFields(bool aResetStyle, bool aResetRef=false)
Restores fields to the original library values.
EDA_UNITS
Definition: common.h:198
bool ReplaceInstanceSheetPath(const KIID_PATH &aOldSheetPath, const KIID_PATH &aNewSheetPath)
Replace aOldSheetPath with aNewSheetPath in the instance list.
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
std::vector< SCH_PIN * > SCH_PIN_PTRS
Definition: sch_component.h:71
void SetModified()
Definition: base_struct.cpp:87
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
static bool ClassOf(const EDA_ITEM *aItem)
SCH_FIELD * FindField(const wxString &aFieldName, bool aIncludeDefaultFields=true)
Search for a SCH_FIELD with aFieldName.
void SetLibSymbol(LIB_PART *aLibSymbol)
Set this schematic symbol library symbol reference to aLibSymbol.
void SetLibId(const LIB_ID &aName)
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
void SetTransform(const TRANSFORM &aTransform)
PNG memory record (file in memory).
Definition: bitmap_def.h:29
void UpdateUnit(int aUnit)
Change the unit number to aUnit without setting any internal flags.
int GetOrientation()
Get the display symbol orientation.
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
void SetIncludeInBom(bool aIncludeInBom)
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Matches compares the item against the search criteria in aSearchData.
SCH_PINS m_pins
a SCH_PIN for every LIB_PIN (across all units)
bool operator==(const SCH_COMPONENT &aComponent) const
bool GetIncludeOnBoard() const
std::string toUTFTildaText(const wxString &txt)
Convert a wxString to UTF8 and replace any control characters with a ~, where a control character is ...
SCH_FIELDS m_Fields
Variable length list of fields.
bool IsConnectable() const override
wxPoint m_Pos
Name and library where symbol was loaded from, i.e. "74xx:74LS00".
Definition: sch_component.h:94
void GetConnectionPoints(std::vector< wxPoint > &aPoints) const override
Add all the connection points for this item to aPoints.
wxString GetSchSymbolLibraryName() const
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
std::unordered_map< LIB_PIN *, unsigned > SCH_PIN_MAP
A map from the library pin pointer to the SCH_PIN's index.
Definition: sch_component.h:74
bool m_onBoard
True to include in netlist when updating board.
int GetUnitCount() const
Return the number of units per package of the symbol.
void MirrorX(int aXaxis_position) override
Mirror item relative to the X axis about aXaxis_position.
wxString GetPrefix() const
bool IsInNetlist() const
void ClearBrightenedPins()
std::vector< COMPONENT_INSTANCE_REFERENCE > m_instanceReferences
EE_COLLECTOR.
Definition: ee_collectors.h:42
void SetPosition(const wxPoint &aPosition) override
Set the schematic item position to aPosition.
LIB_PIN * GetPin(const wxString &number)
Find a symbol pin by number.
wxString GetDescription() const
Return information about the aliased parts.
Schematic editor (Eeschema) main window.
LIB_ITEM * GetDrawItem(const wxPoint &aPosition, KICAD_T aType=TYPE_NOT_INIT)
Return the component library item at aPosition that is part of this component.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void SetSchSymbolLibraryName(const wxString &aName)
The name of the symbol in the schematic library symbol list.
void SetIncludeOnBoard(bool aIncludeOnBoard)
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
The base class for create windows for drawing purpose.
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool CanConnect(const SCH_ITEM *aItem) const override
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected items in a...
void SetConvert(int aConvert)
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:105
bool UseLibIdLookup() const
int GetUnit() const
void BrightenPin(LIB_PIN *aPin)
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
bool IsMovableFromAnchorPoint() override
Return true for items which are moved with the anchor point at mouse cursor and false for items moved...
void SetFields(const SCH_FIELDS &aFields)
Set multiple schematic fields.
wxString m_schLibSymbolName
The name used to look up a symbol in the symbol library embedded in a schematic.
#define NULL
bool m_isInNetlist
True if the component should appear in the netlist.
TRANSFORM & GetTransform() const
EDA_RECT GetBodyBoundingBox() const
Return a bounding box for the symbol body but not the fields.
std::vector< SCH_FIELD > & GetFields()
Returns a vector of fields from the component.
std::vector< SCH_FIELD > SCH_FIELDS
A container for several SCH_FIELD items.
Definition: sch_component.h:77
bool operator<(const SCH_ITEM &aItem) const override
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
const std::vector< COMPONENT_INSTANCE_REFERENCE > & GetInstanceReferences()
SCH_COMPONENT(const wxPoint &pos=wxPoint(0, 0), SCH_ITEM *aParent=NULL)
Define a library symbol object.
SCH_FIELD * AddField(const SCH_FIELD &aField)
Add a field to the symbol.
void GetNetListItem(NETLIST_OBJECT_LIST &aNetListItems, SCH_SHEET_PATH *aSheetPath) override
Create a new NETLIST_OBJECT for the schematic object and adds it to aNetListItems.
SCH_CONNECTION * GetConnectionForPin(LIB_PIN *aPin, const SCH_SHEET_PATH &aSheet)
Retrieves the connection for a given pin of the component.
wxString GetDatasheet() const
Return the documentation text for the given part alias.
bool IsAnnotated(const SCH_SHEET_PATH *aSheet)
Checks if the component has a valid annotation (reference) for the given sheet path.
void SetUnit(int aUnit)
Change the unit number to aUnit.
SCH_SHEET_PATH.
std::unique_ptr< LIB_PART > & GetPartRef()
bool IsReplaceable() const override
Function IsReplaceable.
std::unique_ptr< LIB_PART > m_part
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false)
Return the reference for the given sheet path.
bool GetIncludeInBom() const
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
int GetFieldCount() const
Return the number of fields in this symbol.
std::weak_ptr< LIB_PART > PART_REF
Definition: sch_component.h:79
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
SCH_FIELD * GetField(int aFieldNdx)
Returns a field in this symbol.
A collection of PART_LIB objects.
int m_unit
The unit for multiple part per package components.
Definition: sch_component.h:99
void Init(const wxPoint &pos=wxPoint(0, 0))
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
Base plotter engine class.
Definition: plotter.h:114
void SetUnitSelection(const SCH_SHEET_PATH *aSheet, int aUnitSelection)
void Print(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a component.
wxString GetFieldText(const wxString &aFieldName, SCH_EDIT_FRAME *aFrame) const
Search for a field named aFieldName and returns text associated with this field.
void GetPins(std::vector< LIB_PIN * > &aPinsList)
Populate a vector with all the pins from the library object.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
std::vector< std::unique_ptr< SCH_PIN > > SCH_PINS
A container for several SCH_PIN items.
Definition: sch_component.h:65
Board layer functions and definitions.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
SCH_PIN_MAP m_pinMap
the component's pins mapped by LIB_PIN*
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
bool HasBrightenedPins()
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Automatically orient all the fields in the component.
Schematic symbol object.
Definition: sch_component.h:88
void SetPrefix(const wxString &aPrefix)
wxPoint GetPosition() const override
void RemoveField(const wxString &aFieldName)
Removes a user field from the symbol.
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
bool m_inBom
True to include in bill of materials export.
The common library.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test if the component's dangling state has changed for all pins.
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...
int GetConvert() const
int m_convert
The alternate body style for components that have more than one body style defined.
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit)
Add a full hierarchical reference to this symbol.
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
SEARCH_RESULT
Definition: base_struct.h:51
static bool IsReferenceStringValid(const wxString &aReferenceString)
Tests for an acceptable reference string.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
wxString GetClass() const override
Function GetClass returns the class name.
Message panel definition file.
wxString m_prefix
C, R, U, Q etc - the first character which typically indicates what the component is.
const LIB_ID & GetLibId() const
SCH_COMPONENT & operator=(const SCH_ITEM &aItem)
wxPoint GetPinPhysicalPosition(const LIB_PIN *Pin) const
Object used to load, save, search, and otherwise manipulate symbol library files.
TRANSFORM m_transform
The rotation/mirror transformation matrix.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:187
bool AddSheetPathReferenceEntryIfMissing(const KIID_PATH &aSheetPath)
Add an instance to the alternate references list (m_instanceReferences), if this entry does not alrea...
int GetUnitSelection(const SCH_SHEET_PATH *aSheet) const
SCH_PIN_PTRS GetSchPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieves a list of the SCH_PINs for the given sheet path.
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...