KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_pin.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, jaen-pierre.charras at wanadoo.fr
5 * Copyright (C) 2015 Wayne Stambaugh <[email protected]>
6 * Copyright (C) 2018 CERN
7 * Copyright The KiCad Developers, see AUTHOR.txt for contributors.
8 * @author Jon Evans <[email protected]>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#pragma once
25
26#include <memory>
27#include <set>
28#include <vector>
29
30#include <pin_type.h>
31#include <pin_comparison.h>
32#include <sch_item.h>
33
34class LIB_SYMBOL;
35class SCH_SYMBOL;
36class LIB_ID;
37class SCH_SHEET_PATH;
39
40namespace KIFONT
41{
42class FONT;
43}
44
45// Circle diameter drawn at the active end of pins:
46#define TARGET_PIN_RADIUS schIUScale.MilsToIU( 15 )
47
54wxString FormatStackedPinForDisplay( const wxString& aPinNumber, int aPinLength, int aTextSize,
55 KIFONT::FONT* aFont, const KIFONT::METRICS& aFontMetrics );
56
57
58class SCH_PIN : public SCH_ITEM
59{
60public:
62
64
65 SCH_PIN( LIB_SYMBOL* aParentSymbol );
66
67 SCH_PIN( LIB_SYMBOL* aParentSymbol, const wxString& aName, const wxString& aNumber,
68 PIN_ORIENTATION aOrientation, ELECTRICAL_PINTYPE aPinType, int aLength,
69 int aNameTextSize, int aNumTextSize, int aBodyStyle, const VECTOR2I& aPos, int aUnit );
70
71 SCH_PIN( SCH_SYMBOL* aParentSymbol, SCH_PIN* aLibPin );
72
80 SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxString& aAlt,
81 const KIID& aUuid );
82
83 SCH_PIN( const SCH_PIN& aPin );
84
85 ~SCH_PIN();
86
87 SCH_PIN& operator=( const SCH_PIN& aPin );
88
89 void Serialize( google::protobuf::Any& aContainer ) const override;
90 bool Deserialize( const google::protobuf::Any& aContainer ) override;
91
92 wxString GetClass() const override
93 {
94 return wxT( "SCH_PIN" );
95 }
96
97 static bool ClassOf( const EDA_ITEM* aItem )
98 {
99 return aItem && aItem->Type() == SCH_PIN_T;
100 }
101
102 wxString GetFriendlyName() const override
103 {
104 return _( "Pin" );
105 }
106
107 SCH_PIN* GetLibPin() const { return m_libPin; }
108 void SetLibPin( SCH_PIN* aLibPin ) { m_libPin = aLibPin; }
109
111 void SetOrientation( PIN_ORIENTATION aOrientation ) { m_orientation = aOrientation; }
112
114 void SetShape( GRAPHIC_PINSHAPE aShape ) { m_shape = aShape; }
115
116 int GetLength() const;
117 void SetLength( int aLength ) { m_length = aLength; }
118
124 void ChangeLength( int aLength );
125
127 void SetType( ELECTRICAL_PINTYPE aType );
128 wxString GetCanonicalElectricalTypeName() const;
129 wxString GetElectricalTypeName() const;
130
131 bool IsVisible() const;
132 void SetVisible( bool aVisible ) { m_hidden = !aVisible; }
133
134 const wxString& GetName() const;
135 const wxString& GetShownName() const;
136 void SetName( const wxString& aName );
140 const wxString& GetBaseName() const;
141
142 const wxString& GetNumber() const { return m_number; }
143 const wxString& GetShownNumber() const;
144 std::vector<wxString> GetStackedPinNumbers( bool* aValid = nullptr ) const;
145
156 int GetStackedPinCount( bool* aValid = nullptr ) const;
157
162 std::optional<wxString> GetSmallestLogicalNumber() const;
163
169 wxString GetSmallestStackedPadNumber() const;
170
178
199 wxString GetEffectivePadNumber( const SCH_SHEET_PATH& aSheet, const wxString& aVariantName,
200 const LIB_ID& aFootprintLibId, const std::set<wxString>* aFootprintPadNumbers,
201 PAD_RESOLUTION* aState = nullptr ) const;
202
205 wxString GetEffectivePadNumber( const SCH_SHEET_PATH& aSheet, const wxString& aVariantName = wxEmptyString ) const;
206
207 static bool HasIdentityPad( const wxString& aPinNumber, const std::set<wxString>& aPads );
208
209 void SetNumber( const wxString& aNumber );
210
211 int GetNameTextSize() const;
212 void SetNameTextSize( int aSize );
213
214 int GetNumberTextSize() const;
215 void SetNumberTextSize( int aSize );
216
217 const std::map<wxString, ALT>& GetAlternates() const
218 {
219 if( m_libPin )
220 return m_libPin->GetAlternates();
221
222 return m_alternates;
223 }
224
225 std::map<wxString, ALT>& GetAlternates()
226 {
227 return const_cast<std::map<wxString, ALT>&>(
228 static_cast<const SCH_PIN*>( this )->GetAlternates() );
229 }
230
231 ALT GetAlt( const wxString& aAlt )
232 {
233 return GetAlternates()[ aAlt ];
234 }
235
236 wxString GetAlt() const { return m_alt; }
237
247 void SetAlt( const wxString& aAlt );
248
255 PIN_ORIENTATION PinDrawOrient( const TRANSFORM& aTransform ) const;
256
261 bool StackedTextSideFlipped( const TRANSFORM& aTransform ) const;
262
263#if defined(DEBUG)
264 void Show( int nestLevel, std::ostream& os ) const override;
265#endif
266
267 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
268
269 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
270
271 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
272
273 const BOX2I ViewBBox() const override;
274
275 std::vector<int> ViewGetLayers() const override;
276
277 /* Cannot use a default parameter here as it will not be compatible with the virtual. */
278 const BOX2I GetBoundingBox() const override
279 {
280 return GetBoundingBox( false, true, m_flags & SHOW_ELEC_TYPE );
281 }
282
287 BOX2I GetBoundingBox( bool aIncludeLabelsOnInvisiblePins, bool aIncludeNameAndNumber,
288 bool aIncludeElectricalType ) const;
289
294 bool IsGlobalPower() const;
295
300 bool IsLocalPower() const;
301
306 bool IsPower() const;
307
308 int GetPenWidth() const override { return 0; }
309
310 void Move( const VECTOR2I& aOffset ) override;
311
312 VECTOR2I GetPosition() const override;
314 void SetPosition( const VECTOR2I& aPos ) override { m_position = aPos; }
315
316 // For properties system
317 int GetX() const { return m_position.x; }
318 void SetX( int aX ) { m_position.x = aX; }
319 int GetY() const { return m_position.y; }
320 void SetY( int aY ) { m_position.y = aY; }
321
322 VECTOR2I GetPinRoot() const;
323
327 void MirrorHorizontally( int aCenter ) override;
328 void MirrorVertically( int aCenter ) override;
329 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW = true ) override;
330
334 void MirrorHorizontallyPin( int aCenter );
335 void MirrorVerticallyPin( int aCenter );
336 void RotatePin( const VECTOR2I& aCenter, bool aRotateCCW = true );
337
344 void PlotPinTexts( PLOTTER *aPlotter, const VECTOR2I &aPinPos, PIN_ORIENTATION aPinOrient,
345 int aTextInside, bool aDrawPinNum, bool aDrawPinName, bool aDimmed ) const;
346
347 void PlotPinType( PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation,
348 bool aDimmed ) const;
349
350 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
351 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
352
353 BITMAPS GetMenuImage() const override;
354
355 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
356 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, ALT* aAlt ) const;
357
358 EDA_ITEM* Clone() const override;
359
360 void CalcEdit( const VECTOR2I& aPosition ) override;
361
362 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
363
364 bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) override;
365
375
376 bool IsConnectable() const override { return true; }
377
378 bool IsLocked() const override;
379
380 bool HasConnectivityChanges( const SCH_ITEM* aItem,
381 const SCH_SHEET_PATH* aInstance = nullptr ) const override;
382
383 void ClearDefaultNetName( const SCH_SHEET_PATH* aPath );
384 wxString GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoConnect = false );
385
386 bool IsDangling() const override;
387 void SetIsDangling( bool aIsDangling );
388
393 bool IsStacked( const SCH_PIN* aPin ) const;
394
395 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
396 {
397 return m_isDangling && GetPosition() == aPos;
398 }
399
400 bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const override;
401
402 const wxString& GetOperatingPoint() const { return m_operatingPoint; }
403 void SetOperatingPoint( const wxString& aText ) { m_operatingPoint = aText; }
404
413 const wxString& GetRemappedFromNumber() const { return m_remappedFromNumber; }
414 void SetRemappedFromNumber( const wxString& aNumber ) { m_remappedFromNumber = aNumber; }
415
421 void SetFlipStackedTextSide( bool aFlip ) { m_flipStackedTextSide = aFlip; }
422
423 double Similarity( const SCH_ITEM& aOther ) const override;
424
425 bool operator>( const SCH_ITEM& aRhs ) const { return compare( aRhs, ~COMPARE_FLAGS::UUID ) > 0; }
426
435
436protected:
437 wxString getItemDescription( ALT* aAlt ) const;
438
445
446 void validateExtentsCache( KIFONT::FONT* aFont, int aSize, const wxString& aText, EXTENTS_CACHE* aCache ) const;
447
448 std::ostream& operator<<( std::ostream& aStream );
449
450private:
467 int compare( const SCH_ITEM& aOther, int aCompareFlags = 0 ) const override;
468
469protected:
470 SCH_PIN* m_libPin; // The corresponding pin in the LIB_SYMBOL
471 // (nullptr for a pin *in* the LIB_SYMBOL)
472
473 std::map<wxString, ALT> m_alternates; // Map of alternate name to ALT structure
474 // (only valid for pins in LIB_SYMBOLS)
475
476 VECTOR2I m_position; // Position of the pin.
477 std::optional<int> m_length; // Length of the pin.
478 PIN_ORIENTATION m_orientation; // Pin orientation (Up, Down, Left, Right)
479 GRAPHIC_PINSHAPE m_shape; // Shape drawn around pin
480 ELECTRICAL_PINTYPE m_type; // Electrical type of the pin.
481 std::optional<bool> m_hidden;
482 wxString m_name;
483 wxString m_number;
484 std::optional<int> m_numTextSize; // Pin num and Pin name sizes
485 std::optional<int> m_nameTextSize;
486 wxString m_alt; // The current alternate for an instance
487
489
492
495
497
503 mutable std::unique_ptr<PIN_LAYOUT_CACHE> m_layoutCache;
504
506 std::recursive_mutex m_netmap_mutex;
507 std::map<const SCH_SHEET_PATH, std::pair<wxString, bool>> m_net_name_map;
508};
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:927
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
EDA_ITEM_FLAGS m_flags
Definition eda_item.h:606
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:84
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:94
Definition kiid.h:46
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
Define a library symbol object.
Definition lib_symbol.h:119
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.
Definition plotter.h:136
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
friend class LIB_SYMBOL
Definition sch_item.h:812
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:52
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW=true) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition sch_pin.cpp:1580
std::ostream & operator<<(std::ostream &aStream)
Definition sch_pin.cpp:2163
void SetAlt(const wxString &aAlt)
Set the name of the alternate pin.
Definition sch_pin.cpp:536
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.
Definition sch_pin.cpp:1065
VECTOR2I GetLocalPosition() const
Definition sch_pin.h:313
int GetNumberTextSize() const
Definition sch_pin.cpp:865
int GetLength() const
Definition sch_pin.cpp:397
std::optional< bool > m_hidden
Definition sch_pin.h:481
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition sch_pin.cpp:602
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.
Definition sch_pin.cpp:1608
std::unique_ptr< PIN_LAYOUT_CACHE > m_layoutCache
The layout cache for this pin.
Definition sch_pin.h:503
void MirrorVerticallyPin(int aCenter)
Definition sch_pin.cpp:1529
void validateExtentsCache(KIFONT::FONT *aFont, int aSize, const wxString &aText, EXTENTS_CACHE *aCache) const
Definition sch_pin.cpp:1751
wxString GetAlt() const
Definition sch_pin.h:236
bool operator>(const SCH_ITEM &aRhs) const
Definition sch_pin.h:425
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition sch_pin.cpp:1738
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition sch_pin.cpp:1744
const std::map< wxString, ALT > & GetAlternates() const
Definition sch_pin.h:217
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
Definition sch_pin.cpp:2192
void SetNumber(const wxString &aNumber)
Definition sch_pin.cpp:825
std::optional< int > m_nameTextSize
Definition sch_pin.h:485
PIN_ORIENTATION PinDrawOrient(const TRANSFORM &aTransform) const
Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation...
Definition sch_pin.cpp:1414
void SetVisible(bool aVisible)
Definition sch_pin.h:132
int GetX() const
Definition sch_pin.h:317
void ChangeLength(int aLength)
Change the length of a pin and adjust its position based on orientation.
Definition sch_pin.cpp:1475
ALT GetAlt(const wxString &aAlt)
Definition sch_pin.h:231
void SetX(int aX)
Definition sch_pin.h:318
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
Definition sch_pin.cpp:1791
SCH_PIN & operator=(const SCH_PIN &aPin)
Definition sch_pin.cpp:248
SCH_PIN * m_libPin
Definition sch_pin.h:470
std::optional< wxString > GetSmallestLogicalNumber() const
Return the smallest logical pin number if this pin uses stacked notation and it is valid.
Definition sch_pin.cpp:710
void Move(const VECTOR2I &aOffset) override
Move the item by aMoveVector to a new position.
Definition sch_pin.cpp:1503
bool GetFlipStackedTextSide() const
Transient, render-only hint that the symbol transform mirrors the stacked number block side.
Definition sch_pin.h:420
std::map< const SCH_SHEET_PATH, std::pair< wxString, bool > > m_net_name_map
Definition sch_pin.h:507
PIN_ORIENTATION m_orientation
Definition sch_pin.h:478
const wxString & GetOperatingPoint() const
Definition sch_pin.h:402
void SetOrientation(PIN_ORIENTATION aOrientation)
Definition sch_pin.h:111
void SetName(const wxString &aName)
Definition sch_pin.cpp:521
bool IsGlobalPower() const
Return whether this pin forms a global power connection: i.e., is part of a power symbol and of type ...
Definition sch_pin.cpp:457
wxString getItemDescription(ALT *aAlt) const
Definition sch_pin.cpp:1885
bool IsVisible() const
Definition sch_pin.cpp:489
bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
Definition sch_pin.cpp:1825
bool IsLocked() const override
Definition sch_pin.cpp:1831
std::optional< int > m_numTextSize
Definition sch_pin.h:484
VECTOR2I GetPinRoot() const
Definition sch_pin.cpp:891
bool IsLocalPower() const
Local power pin is the same except that it is sheet-local and it does not support the legacy hidden p...
Definition sch_pin.cpp:476
ELECTRICAL_PINTYPE m_type
Definition sch_pin.h:480
void SetLibPin(SCH_PIN *aLibPin)
Definition sch_pin.h:108
PAD_RESOLUTION
Outcome of pin-to-pad resolution (issue #2282).
Definition sch_pin.h:173
@ UNMAPPED
No entry and the footprint has no matching pad.
Definition sch_pin.h:176
@ MAPPED
An explicit map entry (or instance edit) supplied the pad number.
Definition sch_pin.h:174
@ IDENTITY
No entry, but the footprint has a pad whose number equals the pin number.
Definition sch_pin.h:175
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition sch_pin.cpp:1542
SCH_PIN * GetLibPin() const
Definition sch_pin.h:107
void SetPosition(const VECTOR2I &aPos) override
Definition sch_pin.h:314
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
Definition sch_pin.cpp:2103
bool m_isDangling
Definition sch_pin.h:496
void SetFlipStackedTextSide(bool aFlip)
Definition sch_pin.h:421
bool IsConnectable() const override
Definition sch_pin.h:376
void SetIsDangling(bool aIsDangling)
Definition sch_pin.cpp:573
wxString GetElectricalTypeName() const
Definition sch_pin.cpp:450
std::vector< wxString > GetStackedPinNumbers(bool *aValid=nullptr) const
Definition sch_pin.cpp:697
int GetPenWidth() const override
Definition sch_pin.h:308
std::map< wxString, ALT > m_alternates
Definition sch_pin.h:473
const wxString & GetName() const
Definition sch_pin.cpp:503
wxString GetFriendlyName() const override
Definition sch_pin.h:102
int GetStackedPinCount(bool *aValid=nullptr) const
Return the count of logical pins represented by this pin's stacked notation.
Definition sch_pin.cpp:703
void SetLength(int aLength)
Definition sch_pin.h:117
bool IsDangling() const override
Definition sch_pin.cpp:564
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.
Definition sch_pin.cpp:1587
void MirrorHorizontally(int aCenter) override
These transforms have effect only if the pin has a LIB_SYMBOL as parent.
Definition sch_pin.cpp:1522
std::recursive_mutex m_netmap_mutex
The name that this pin connection will drive onto a net.
Definition sch_pin.h:506
PIN_ORIENTATION GetOrientation() const
Definition sch_pin.cpp:362
wxString GetClass() const override
Return the class name.
Definition sch_pin.h:92
void SetNumberTextSize(int aSize)
Definition sch_pin.cpp:879
void SetShape(GRAPHIC_PINSHAPE aShape)
Definition sch_pin.h:114
void RotatePin(const VECTOR2I &aCenter, bool aRotateCCW=true)
Definition sch_pin.cpp:1549
std::map< wxString, ALT > & GetAlternates()
Definition sch_pin.h:225
VECTOR2I GetPosition() const override
Definition sch_pin.cpp:354
bool StackedTextSideFlipped(const TRANSFORM &aTransform) const
Return true when aTransform maps the side the stacked number block is drawn on (above horizontal pins...
Definition sch_pin.cpp:1449
wxString GetCanonicalElectricalTypeName() const
Definition sch_pin.cpp:443
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 ...
Definition sch_pin.cpp:629
int GetNameTextSize() const
Definition sch_pin.cpp:839
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition sch_pin.cpp:1858
bool m_flipStackedTextSide
Render-only stacked block side hint, see GetFlipStackedTextSide(). Not saved.
Definition sch_pin.h:494
VECTOR2I m_position
Definition sch_pin.h:476
wxString m_operatingPoint
Definition sch_pin.h:488
GRAPHIC_PINSHAPE m_shape
Definition sch_pin.h:479
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition sch_pin.cpp:309
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
The pin specific sort order is as follows:
Definition sch_pin.cpp:2046
const wxString & GetShownName() const
Definition sch_pin.cpp:680
static bool ClassOf(const EDA_ITEM *aItem)
Definition sch_pin.h:97
PIN_ALTERNATE ALT
Definition sch_pin.h:61
void MirrorHorizontallyPin(int aCenter)
These transforms have always effects.
Definition sch_pin.cpp:1509
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition sch_pin.cpp:650
PIN_LAYOUT_CACHE & GetLayoutCache() const
Get the layout cache associated with this pin.
Definition sch_pin.cpp:1782
wxString m_name
Definition sch_pin.h:482
wxString m_alt
Definition sch_pin.h:486
const wxString & GetRemappedFromNumber() const
Transient, render-only original pin number for a pad-remapped pin (issue #2282).
Definition sch_pin.h:413
void SetOperatingPoint(const wxString &aText)
Definition sch_pin.h:403
void SetType(ELECTRICAL_PINTYPE aType)
Definition sch_pin.cpp:431
const wxString & GetBaseName() const
Get the name without any alternates.
Definition sch_pin.cpp:512
void ClearDefaultNetName(const SCH_SHEET_PATH *aPath)
Definition sch_pin.cpp:1655
PIN_COMPARISON_DATA ComparisonData() const
Definition sch_pin.cpp:2038
void SetY(int aY)
Definition sch_pin.h:320
void SetRemappedFromNumber(const wxString &aNumber)
Definition sch_pin.h:414
SCH_PIN(LIB_SYMBOL *aParentSymbol)
Definition sch_pin.cpp:138
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).
Definition sch_pin.cpp:731
const wxString & GetShownNumber() const
Definition sch_pin.cpp:691
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition sch_pin.h:395
wxString m_remappedFromNumber
Render-only original number for a pad-remapped pin; see GetRemappedFromNumber(). Not saved.
Definition sch_pin.h:491
bool IsStacked(const SCH_PIN *aPin) const
Definition sch_pin.cpp:579
const wxString & GetNumber() const
Definition sch_pin.h:142
wxString m_number
Definition sch_pin.h:483
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition sch_pin.cpp:1466
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition sch_pin.h:278
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition sch_pin.cpp:272
static bool HasIdentityPad(const wxString &aPinNumber, const std::set< wxString > &aPads)
Definition sch_pin.cpp:802
wxString GetSmallestStackedPadNumber() const
Return the pin number to be used for deterministic operations such as auto‑generated net names.
Definition sch_pin.cpp:722
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath, bool aForceNoConnect=false)
Definition sch_pin.cpp:1666
std::optional< int > m_length
Definition sch_pin.h:477
static wxString GetCanonicalElectricalTypeName(ELECTRICAL_PINTYPE aType)
Return a string giving the electrical type of a pin.
GRAPHIC_PINSHAPE GetShape() const
Definition sch_pin.cpp:376
void PlotPinType(PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation, bool aDimmed) const
Definition sch_pin.cpp:914
int GetY() const
Definition sch_pin.h:319
bool IsPower() const
Check if the pin is either a global or local power pin.
Definition sch_pin.cpp:483
ELECTRICAL_PINTYPE GetType() const
Definition sch_pin.cpp:411
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition sch_pin.cpp:1843
void SetNameTextSize(int aSize)
Definition sch_pin.cpp:853
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Schematic symbol object.
Definition sch_symbol.h:75
for transforming drawing coordinates for a wxDC device context.
Definition transform.h:42
#define _(s)
#define SHOW_ELEC_TYPE
Show pin electrical type.
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
Definition pin_type.h:32
PIN_ORIENTATION
The symbol library pin object orientations.
Definition pin_type.h:101
GRAPHIC_PINSHAPE
Definition pin_type.h:80
wxString FormatStackedPinForDisplay(const wxString &aPinNumber, int aPinLength, int aTextSize, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics)
Break a stacked pin number of the form "[A,B,C]" into one number per line when it is too wide to sit ...
Definition sch_pin.cpp:50
Owned library-pin inputs; no parent, layout cache or schematic pointers.
KIFONT::FONT * m_Font
Definition sch_pin.h:441
SCH_PIN::PAD_RESOLUTION PAD_RESOLUTION
@ SCH_PIN_T
Definition typeinfo.h:149
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683