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 <eda_item.h>
31 #include <core/typeinfo.h>
33 #include <lib_id.h>
34 #include <widgets/msgpanel.h>
35 
36 #include <memory>
37 #include <string>
38 #include <unordered_map>
39 #include <vector>
40 #include <wx/arrstr.h>
41 #include <wx/chartype.h>
42 #include <wx/fdrepdlg.h>
43 #include <wx/gdicmn.h>
44 #include <wx/string.h>
45 
46 #include <bitmaps.h>
47 #include <sch_field.h>
48 #include <sch_item.h>
49 #include <sch_pin.h>
50 #include <sch_sheet_path.h> // COMPONENT_INSTANCE_REFERENCE
51 #include <symbol_lib_table.h>
52 #include <transform.h>
53 
54 struct PICKED_SYMBOL;
55 class SCH_SCREEN;
56 class LIB_ITEM;
57 class LIB_PIN;
58 class LIB_PART;
59 class NETLIST_OBJECT_LIST;
60 class PART_LIB;
61 class PART_LIBS;
62 class EE_COLLECTOR;
63 class SCH_SCREEN;
65 
66 
68 typedef std::vector<SCH_FIELD> SCH_FIELDS;
69 
70 typedef std::weak_ptr<LIB_PART> PART_REF;
71 
72 
73 extern std::string toUTFTildaText( const wxString& txt );
74 
75 
79 class SCH_COMPONENT : public SCH_ITEM
80 {
81 private:
82  wxPoint m_pos;
84  int m_unit;
85  int m_convert;
86  wxString m_prefix;
89 
101 
104 
105  std::unique_ptr< LIB_PART > m_part; // a flattened copy of the LIB_PART from
106  // the PROJECT's libraries.
107  std::vector<std::unique_ptr<SCH_PIN>> m_pins; // a SCH_PIN for every LIB_PIN (all units)
108  std::unordered_map<LIB_PIN*, unsigned> m_pinMap; // library pin pointer to SCH_PIN's index
109 
111  bool m_inBom;
112  bool m_onBoard;
113 
114  // Defines the hierarchical path and reference of the component. This allows support
115  // for multiple references to a single sub-sheet.
116  std::vector<SYMBOL_INSTANCE_REFERENCE> m_instanceReferences;
117 
118  void Init( const wxPoint& pos = wxPoint( 0, 0 ) );
119 
120 public:
121  SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ), SCH_ITEM* aParent = NULL );
122 
136  SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* aSheet,
137  int unit = 0, int convert = 0,
138  const wxPoint& pos = wxPoint( 0, 0 ) );
139 
140  SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* aSheet, PICKED_SYMBOL& aSel,
141  const wxPoint& pos = wxPoint( 0, 0 ) );
151  SCH_COMPONENT( const SCH_COMPONENT& aComponent );
152 
154 
155  static inline bool ClassOf( const EDA_ITEM* aItem )
156  {
157  return aItem && SCH_COMPONENT_T == aItem->Type();
158  }
159 
160  wxString GetClass() const override
161  {
162  return wxT( "SCH_COMPONENT" );
163  }
164 
165  const std::vector<SYMBOL_INSTANCE_REFERENCE>& GetInstanceReferences()
166  {
167  return m_instanceReferences;
168  }
169 
170  void ViewGetLayers( int aLayers[], int& aCount ) const override;
171 
185  bool IsMovableFromAnchorPoint() override { return true; }
186 
187  void SetLibId( const LIB_ID& aName );
188 
189  const LIB_ID& GetLibId() const { return m_lib_id; }
190 
202  void SetSchSymbolLibraryName( const wxString& aName ) { m_schLibSymbolName = aName; }
203  wxString GetSchSymbolLibraryName() const;
204  bool UseLibIdLookup() const { return m_schLibSymbolName.IsEmpty(); }
205 
206  std::unique_ptr< LIB_PART >& GetPartRef() { return m_part; }
207 
224  void SetLibSymbol( LIB_PART* aLibSymbol );
225 
229  wxString GetDescription() const;
230 
234  wxString GetDatasheet() const;
235 
236  int GetUnit() const { return m_unit; }
237 
241  void UpdatePins();
242 
252  void SetUnit( int aUnit );
253 
262  void UpdateUnit( int aUnit );
263 
264  int GetConvert() const { return m_convert; }
265 
266  void SetConvert( int aConvert );
267 
268  wxString GetPrefix() const { return m_prefix; }
269 
270  void SetPrefix( const wxString& aPrefix ) { m_prefix = aPrefix; }
271 
272  TRANSFORM& GetTransform() const { return const_cast< TRANSFORM& >( m_transform ); }
273 
274  void SetTransform( const TRANSFORM& aTransform );
275 
281  int GetUnitCount() const;
282 
289  void SetOrientation( int aOrientation );
290 
306  int GetOrientation();
307 
311  void GetContextualTextVars( wxArrayString* aVars ) const;
312 
317  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
318 
319  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
320 
329  void ClearAnnotation( const SCH_SHEET_PATH* aSheetPath );
330 
342  bool AddSheetPathReferenceEntryIfMissing( const KIID_PATH& aSheetPath );
343 
353  bool ReplaceInstanceSheetPath( const KIID_PATH& aOldSheetPath, const KIID_PATH& aNewSheetPath );
354 
355  const EDA_RECT GetBoundingBox() const override;
356 
357  const EDA_RECT GetBoundingBox( bool aIncludeInvisibleText ) const;
358 
363 
364 
365  //-----<Fields>-----------------------------------------------------------
366 
374  SCH_FIELD* GetField( int aFieldNdx );
375 
376  const SCH_FIELD* GetField( int aFieldNdx ) const;
377 
383  wxString GetFieldText( const wxString& aFieldName, SCH_EDIT_FRAME* aFrame ) const;
384 
391  void GetFields( std::vector<SCH_FIELD*>& aVector, bool aVisibleOnly );
392 
396  std::vector<SCH_FIELD>& GetFields() { return m_fields; }
397 
405  SCH_FIELD* AddField( const SCH_FIELD& aField );
406 
412  void RemoveField( const wxString& aFieldName );
413 
422  SCH_FIELD* FindField( const wxString& aFieldName, bool aIncludeDefaultFields = true );
423 
429  void SetFields( const SCH_FIELDS& aFields )
430  {
431  m_fields = aFields; // vector copying, length is changed possibly
432  }
433 
439  void UpdateFields( bool aResetStyle, bool aResetRef = false );
440 
444  int GetFieldCount() const { return (int)m_fields.size(); }
445 
455  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
456 
457  void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
458 
459 
460  //-----</Fields>----------------------------------------------------------
461 
462 
470  SCH_PIN* GetPin( const wxString& number );
471 
477  void GetLibPins( std::vector<LIB_PIN*>& aPinsList );
478 
479  SCH_PIN* GetPin( LIB_PIN* aLibPin );
480 
487  std::vector<SCH_PIN*> GetPins( const SCH_SHEET_PATH* aSheet = nullptr ) const;
488 
489  std::vector<std::unique_ptr<SCH_PIN>>& GetRawPins() { return m_pins; }
490 
498  void Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
499 
500  void SwapData( SCH_ITEM* aItem ) override;
501 
511  static bool IsReferenceStringValid( const wxString& aReferenceString );
512 
518  const wxString GetRef( const SCH_SHEET_PATH* aSheet, bool aIncludeUnit = false ) const;
519 
526  void SetRef( const SCH_SHEET_PATH* aSheet, const wxString& aReference );
527 
533  bool IsAnnotated( const SCH_SHEET_PATH* aSheet );
534 
546  void AddHierarchicalReference( const KIID_PATH& aPath,
547  const wxString& aRef,
548  int aUnit,
549  const wxString& aValue = wxEmptyString,
550  const wxString& aFootprint = wxEmptyString );
551 
552  // Returns the instance-specific unit selection for the given sheet path.
553  int GetUnitSelection( const SCH_SHEET_PATH* aSheet ) const;
554  void SetUnitSelection( const SCH_SHEET_PATH* aSheet, int aUnitSelection );
555 
556  // Returns the instance-specific value for the given sheet path.
557  const wxString GetValue( const SCH_SHEET_PATH* sheet, bool aResolve ) const;
558  void SetValue( const SCH_SHEET_PATH* sheet, const wxString& aValue );
559 
560  // Set the value for all instances (the default GUI behaviour)
561  void SetValue( const wxString& aValue )
562  {
563  SetValue( nullptr, aValue );
564  }
565 
566  // Returns the instance-specific footprint assignment for the given sheet path.
567  const wxString GetFootprint( const SCH_SHEET_PATH* sheet, bool aResolve ) const;
568  void SetFootprint( const SCH_SHEET_PATH* sheet, const wxString& aFootprint );
569 
570  // Set the value for all instances (the default GUI behaviour)
571  void SetFootprint( const wxString& aFootprint )
572  {
573  SetFootprint( nullptr, aFootprint );
574  }
575 
576  // Geometric transforms (used in block operations):
577 
578  void Move( const wxPoint& aMoveVector ) override
579  {
580  if( aMoveVector == wxPoint( 0, 0 ) )
581  return;
582 
583  m_pos += aMoveVector;
584 
585  for( SCH_FIELD& field : m_fields )
586  field.Move( aMoveVector );
587 
588  SetModified();
589  }
590 
591  void MirrorY( int aYaxis_position ) override;
592  void MirrorX( int aXaxis_position ) override;
593  void Rotate( wxPoint aPosition ) override;
594 
595  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
596 
597  void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ) override;
598 
610  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
611  const SCH_SHEET_PATH* aPath = nullptr ) override;
612 
613  wxPoint GetPinPhysicalPosition( const LIB_PIN* Pin ) const;
614 
615  bool IsConnectable() const override { return true; }
616 
617  bool CanConnect( const SCH_ITEM* aItem ) const override
618  {
619  return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
620  ( aItem->Type() == SCH_NO_CONNECT_T ) ||
621  ( aItem->Type() == SCH_JUNCTION_T ) ||
622  ( aItem->Type() == SCH_COMPONENT_T ) ;
623  }
624 
630  bool IsInNetlist() const;
631 
632  std::vector<wxPoint> GetConnectionPoints() const override;
633 
634  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
635 
644  LIB_ITEM* GetDrawItem( const wxPoint& aPosition, KICAD_T aType = TYPE_NOT_INIT );
645 
646  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
647 
648  BITMAP_DEF GetMenuImage() const override;
649 
650  bool operator <( const SCH_ITEM& aItem ) const override;
651 
652  bool operator==( const SCH_COMPONENT& aComponent) const;
653  bool operator!=( const SCH_COMPONENT& aComponent) const;
654 
655  SCH_COMPONENT& operator=( const SCH_ITEM& aItem );
656 
657  bool IsReplaceable() const override { return true; }
658 
659  wxPoint GetPosition() const override { return m_pos; }
660  void SetPosition( const wxPoint& aPosition ) override { Move( aPosition - m_pos ); }
661 
662  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
663  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
664 
665  void Plot( PLOTTER* aPlotter ) override;
666 
667  EDA_ITEM* Clone() const override;
668 
669 #if defined(DEBUG)
670  void Show( int nestLevel, std::ostream& os ) const override;
671 #endif
672 
673  void ClearBrightenedPins();
674 
675  bool HasBrightenedPins();
676 
677  bool GetIncludeInBom() const { return m_inBom; }
678  void SetIncludeInBom( bool aIncludeInBom ) { m_inBom = aIncludeInBom; }
679 
680  bool GetIncludeOnBoard() const { return m_onBoard; }
681  void SetIncludeOnBoard( bool aIncludeOnBoard ) { m_onBoard = aIncludeOnBoard; }
682 
683 private:
684  bool doIsConnected( const wxPoint& aPosition ) const override;
685 };
686 
687 #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.
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:51
void SetModified()
Definition: eda_item.cpp:79
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
static bool ClassOf(const EDA_ITEM *aItem)
std::vector< std::unique_ptr< SCH_PIN > > & GetRawPins()
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.
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 ...
bool IsConnectable() const override
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.
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()
SCH_PIN * GetPin(const wxString &number)
Find a symbol pin by number.
EE_COLLECTOR.
Definition: ee_collectors.h:42
void SetPosition(const wxPoint &aPosition) override
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.
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:94
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:62
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
void SetConvert(int aConvert)
const wxString GetFootprint(const SCH_SHEET_PATH *sheet, bool aResolve) const
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
bool UseLibIdLookup() const
int GetUnit() const
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.
const wxString GetValue(const SCH_SHEET_PATH *sheet, bool aResolve) const
#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:64
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.
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.
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.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
std::unique_ptr< LIB_PART > & GetPartRef()
bool IsReplaceable() const override
Function IsReplaceable.
std::unique_ptr< LIB_PART > m_part
bool GetIncludeInBom() const
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::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieves a list of the SCH_PINs for the given sheet path.
std::weak_ptr< LIB_PART > PART_REF
Definition: sch_component.h:70
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:285
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.
EDA_UNITS
Definition: eda_units.h:38
A collection of PART_LIB objects.
int m_unit
The unit for multiple part per package components.
Definition: sch_component.h:84
void SetValue(const wxString &aValue)
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:131
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.
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.
LIB_ID m_lib_id
Name and library the symbol was loaded from, i.e. 74xx:74LS00.
Definition: sch_component.h:83
Board layer functions and definitions.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
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:79
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: eda_item.h:148
bool m_inBom
True to include in bill of materials export.
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...
std::vector< SYMBOL_INSTANCE_REFERENCE > m_instanceReferences
int GetConvert() const
int m_convert
The alternate body style for components that have more than one body style defined.
Definition: sch_component.h:85
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit, const wxString &aValue=wxEmptyString, const wxString &aFootprint=wxEmptyString)
Add a full hierarchical reference to this symbol.
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
std::vector< std::unique_ptr< SCH_PIN > > m_pins
void SetValue(const SCH_SHEET_PATH *sheet, const wxString &aValue)
void GetLibPins(std::vector< LIB_PIN * > &aPinsList)
Populate a vector with all the pins from the library object.
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.
const std::vector< SYMBOL_INSTANCE_REFERENCE > & GetInstanceReferences()
SEARCH_RESULT
Definition: eda_item.h:40
Message panel definition file.
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
wxString m_prefix
C, R, U, Q etc - the first character which typically indicates what the component is.
Definition: sch_component.h:88
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:194
SCH_FIELDS m_fields
Variable length list of fields.
void SetFootprint(const SCH_SHEET_PATH *sheet, const wxString &aFootprint)
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
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...
std::unordered_map< LIB_PIN *, unsigned > m_pinMap
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...
void SetFootprint(const wxString &aFootprint)