40#define TARGET_PIN_RADIUS schIUScale.MilsToIU( 15 )
55 SCH_PIN(
LIB_SYMBOL* aParentSymbol,
const wxString& aName,
const wxString& aNumber,
57 int aNameTextSize,
int aNumTextSize,
int aBodyStyle,
const VECTOR2I& aPos,
int aUnit );
68 SCH_PIN(
SCH_SYMBOL* aParentSymbol,
const wxString& aNumber,
const wxString& aAlt,
77 void Serialize( google::protobuf::Any& aContainer )
const override;
78 bool Deserialize(
const google::protobuf::Any& aContainer )
override;
82 return wxT(
"SCH_PIN" );
122 const wxString&
GetName()
const;
124 void SetName(
const wxString& aName );
188 const LIB_ID& aFootprintLibId,
const std::set<wxString>* aFootprintPadNumbers,
195 void SetNumber(
const wxString& aNumber );
213 return const_cast<std::map<wxString, ALT>&
>(
214 static_cast<const SCH_PIN*
>( this )->GetAlternates() );
233 void SetAlt(
const wxString& aAlt );
244 void Show(
int nestLevel, std::ostream& os )
const override;
247 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
249 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
268 bool aIncludeElectricalType )
const;
309 void Rotate(
const VECTOR2I& aCenter,
bool aRotateCCW =
true )
override;
325 int aTextInside,
bool aDrawPinNum,
bool aDrawPinName,
bool aDimmed )
const;
328 bool aDimmed )
const;
331 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
override;
422 std::ostream&
operator<<( std::ostream& aStream );
441 int compare(
const SCH_ITEM& aOther,
int aCompareFlags = 0 )
const override;
BITMAPS
A list of all bitmap identifiers.
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
FONT is an abstract base class for both outline and stroke fonts.
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
A pin layout helper is a class that manages the layout of the parts of a pin on a schematic symbol:
Base plotter engine class.
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW=true) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
std::ostream & operator<<(std::ostream &aStream)
void SetAlt(const wxString &aAlt)
Set the name of the alternate pin.
void PlotPinTexts(PLOTTER *aPlotter, const VECTOR2I &aPinPos, PIN_ORIENTATION aPinOrient, int aTextInside, bool aDrawPinNum, bool aDrawPinName, bool aDimmed) const
Plot the pin name and number.
VECTOR2I GetLocalPosition() const
int GetNumberTextSize() const
std::optional< bool > m_hidden
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
std::unique_ptr< PIN_LAYOUT_CACHE > m_layoutCache
The layout cache for this pin.
void MirrorVerticallyPin(int aCenter)
void validateExtentsCache(KIFONT::FONT *aFont, int aSize, const wxString &aText, EXTENTS_CACHE *aCache) const
bool operator>(const SCH_ITEM &aRhs) const
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
const std::map< wxString, ALT > & GetAlternates() const
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
void SetNumber(const wxString &aNumber)
std::optional< int > m_nameTextSize
PIN_ORIENTATION PinDrawOrient(const TRANSFORM &aTransform) const
Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation...
void SetVisible(bool aVisible)
void ChangeLength(int aLength)
Change the length of a pin and adjust its position based on orientation.
ALT GetAlt(const wxString &aAlt)
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
SCH_PIN & operator=(const SCH_PIN &aPin)
std::optional< wxString > GetSmallestLogicalNumber() const
Return the smallest logical pin number if this pin uses stacked notation and it is valid.
void Move(const VECTOR2I &aOffset) override
Move the item by aMoveVector to a new position.
std::map< const SCH_SHEET_PATH, std::pair< wxString, bool > > m_net_name_map
PIN_ORIENTATION m_orientation
const wxString & GetOperatingPoint() const
void SetOrientation(PIN_ORIENTATION aOrientation)
void SetName(const wxString &aName)
bool IsGlobalPower() const
Return whether this pin forms a global power connection: i.e., is part of a power symbol and of type ...
wxString getItemDescription(ALT *aAlt) const
bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
bool IsLocked() const override
std::optional< int > m_numTextSize
VECTOR2I GetPinRoot() const
bool IsLocalPower() const
Local power pin is the same except that it is sheet-local and it does not support the legacy hidden p...
ELECTRICAL_PINTYPE m_type
void SetLibPin(SCH_PIN *aLibPin)
PAD_RESOLUTION
Outcome of pin-to-pad resolution (issue #2282).
@ UNMAPPED
No entry and the footprint has no matching pad.
@ MAPPED
An explicit map entry (or instance edit) supplied the pad number.
@ IDENTITY
No entry, but the footprint has a pad whose number equals the pin number.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
SCH_PIN * GetLibPin() const
void SetPosition(const VECTOR2I &aPos) override
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
bool IsConnectable() const override
void SetIsDangling(bool aIsDangling)
wxString GetElectricalTypeName() const
std::vector< wxString > GetStackedPinNumbers(bool *aValid=nullptr) const
int GetPenWidth() const override
std::map< wxString, ALT > m_alternates
const wxString & GetName() const
wxString GetFriendlyName() const override
int GetStackedPinCount(bool *aValid=nullptr) const
Return the count of logical pins represented by this pin's stacked notation.
void SetLength(int aLength)
bool IsDangling() const override
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
void MirrorHorizontally(int aCenter) override
These transforms have effect only if the pin has a LIB_SYMBOL as parent.
std::recursive_mutex m_netmap_mutex
The name that this pin connection will drive onto a net.
PIN_ORIENTATION GetOrientation() const
wxString GetClass() const override
Return the class name.
void SetNumberTextSize(int aSize)
void SetShape(GRAPHIC_PINSHAPE aShape)
void RotatePin(const VECTOR2I &aCenter, bool aRotateCCW=true)
std::map< wxString, ALT > & GetAlternates()
VECTOR2I GetPosition() const override
wxString GetCanonicalElectricalTypeName() const
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
int GetNameTextSize() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
wxString m_operatingPoint
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
The pin specific sort order is as follows:
const wxString & GetShownName() const
static bool ClassOf(const EDA_ITEM *aItem)
void MirrorHorizontallyPin(int aCenter)
These transforms have always effects.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
PIN_LAYOUT_CACHE & GetLayoutCache() const
Get the layout cache associated with this pin.
const wxString & GetRemappedFromNumber() const
Transient, render-only original pin number for a pad-remapped pin (issue #2282).
void SetOperatingPoint(const wxString &aText)
void SetType(ELECTRICAL_PINTYPE aType)
const wxString & GetBaseName() const
Get the name without any alternates.
void ClearDefaultNetName(const SCH_SHEET_PATH *aPath)
void SetRemappedFromNumber(const wxString &aNumber)
SCH_PIN(LIB_SYMBOL *aParentSymbol)
wxString GetEffectivePadNumber(const SCH_SHEET_PATH &aSheet, const wxString &aVariantName, const LIB_ID &aFootprintLibId, const std::set< wxString > *aFootprintPadNumbers, PAD_RESOLUTION *aState=nullptr) const
Resolve the footprint pad number this symbol pin lands on (issue #2282).
const wxString & GetShownNumber() const
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
wxString m_remappedFromNumber
Render-only original number for a pad-remapped pin; see GetRemappedFromNumber(). Not saved.
bool IsStacked(const SCH_PIN *aPin) const
const wxString & GetNumber() const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
wxString GetSmallestStackedPadNumber() const
Return the pin number to be used for deterministic operations such as auto‑generated net names.
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath, bool aForceNoConnect=false)
std::optional< int > m_length
static wxString GetCanonicalElectricalTypeName(ELECTRICAL_PINTYPE aType)
Return a string giving the electrical type of a pin.
GRAPHIC_PINSHAPE GetShape() const
void PlotPinType(PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation, bool aDimmed) const
bool IsPower() const
Check if the pin is either a global or local power pin.
ELECTRICAL_PINTYPE GetType() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetNameTextSize(int aSize)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
#define SHOW_ELEC_TYPE
Show pin electrical type.
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
PIN_ORIENTATION
The symbol library pin object orientations.
ELECTRICAL_PINTYPE m_Type
SCH_PIN::PAD_RESOLUTION PAD_RESOLUTION
VECTOR2< int32_t > VECTOR2I