37#define TARGET_PIN_RADIUS schIUScale.MilsToIU( 15 )
52 SCH_PIN(
LIB_SYMBOL* aParentSymbol,
const wxString& aName,
const wxString& aNumber,
54 int aNameTextSize,
int aNumTextSize,
int aBodyStyle,
const VECTOR2I& aPos,
int aUnit );
58 SCH_PIN(
SCH_SYMBOL* aParentSymbol,
const wxString& aNumber,
const wxString& aAlt,
69 return wxT(
"SCH_PIN" );
109 const wxString&
GetName()
const;
111 void SetName(
const wxString& aName );
119 void SetNumber(
const wxString& aNumber );
137 return const_cast<std::map<wxString, ALT>&
>(
150 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
override;
161 void Show(
int nestLevel, std::ostream& os )
const override;
164 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
166 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
172 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
185 bool aIncludeElectricalType )
const;
193 return GetType() == ELECTRICAL_PINTYPE::PT_POWER_IN
218 void Rotate(
const VECTOR2I& aCenter,
bool aRotateCCW =
true )
override;
233 int aTextInside,
bool aDrawPinNum,
bool aDrawPinName,
bool aDimmed )
const;
236 bool aDimmed )
const;
239 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
override;
334 bool aDrawPinName,
bool aDimmed );
341 std::ostream&
operator<<( std::ostream& aStream );
360 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.
FONT is an abstract base class for both outline and stroke fonts.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
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,...
const SYMBOL * GetParentSymbol() const
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)
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.
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)
wxString GetShownNumber() const
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.
std::optional< int > m_numTextSize
VECTOR2I GetPinRoot() const
ELECTRICAL_PINTYPE m_type
void SetLibPin(SCH_PIN *aLibPin)
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
int GetPenWidth() const override
std::map< wxString, ALT > m_alternates
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
const wxString & GetName() const
wxString GetFriendlyName() const override
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 printPinTexts(const RENDER_SETTINGS *aSettings, const VECTOR2I &aPinPos, PIN_ORIENTATION aPinOrient, int aTextInside, bool aDrawPinNum, bool aDrawPinName, bool aDimmed)
Put the pin number and pin text info, given the pin line coordinates.
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.
void printPinSymbol(const SCH_RENDER_SETTINGS *aSettings, const VECTOR2I &aPos, PIN_ORIENTATION aOrientation, bool aDimmed)
Print the pin symbol without text.
wxString m_operatingPoint
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
The pin specific sort order is as follows:
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.
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 printPinElectricalTypeName(const RENDER_SETTINGS *aSettings, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation, bool aDimmed)
Draw the electrical type text of the pin (only for the footprint editor)
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
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 Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath, bool aForceNoConnect=false)
std::optional< int > m_length
GRAPHIC_PINSHAPE GetShape() const
void PlotPinType(PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation, bool aDimmed) const
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...
virtual bool IsPower() const =0
#define SHOW_ELEC_TYPE
Show pin electrical type. Shared with IS_ROLLOVER.
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