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 <mutex>
27#include <memory>
28#include <set>
29#include <vector>
30
31#include <pin_type.h>
32#include <pin_comparison.h>
33#include <sch_item.h>
34
35class LIB_SYMBOL;
36class TRANSFORM;
37class SCH_SYMBOL;
38class LIB_ID;
39class SCH_SHEET_PATH;
41
42namespace KIFONT
43{
44class FONT;
45}
46
47// Circle diameter drawn at the active end of pins:
48#define TARGET_PIN_RADIUS schIUScale.MilsToIU( 15 )
49
56wxString FormatStackedPinForDisplay( const wxString& aPinNumber, int aPinLength, int aTextSize,
57 KIFONT::FONT* aFont, const KIFONT::METRICS& aFontMetrics );
58
59
60class SCH_PIN : public SCH_ITEM
61{
62public:
64
66
67 SCH_PIN( LIB_SYMBOL* aParentSymbol );
68
69 SCH_PIN( LIB_SYMBOL* aParentSymbol, const wxString& aName, const wxString& aNumber,
70 PIN_ORIENTATION aOrientation, ELECTRICAL_PINTYPE aPinType, int aLength,
71 int aNameTextSize, int aNumTextSize, int aBodyStyle, const VECTOR2I& aPos, int aUnit );
72
73 SCH_PIN( SCH_SYMBOL* aParentSymbol, SCH_PIN* aLibPin );
74
82 SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxString& aAlt,
83 const KIID& aUuid );
84
85 SCH_PIN( const SCH_PIN& aPin );
86
87 ~SCH_PIN();
88
89 SCH_PIN& operator=( const SCH_PIN& aPin );
90
91 void Serialize( google::protobuf::Any& aContainer ) const override;
92 bool Deserialize( const google::protobuf::Any& aContainer ) override;
93
94 wxString GetClass() const override
95 {
96 return wxT( "SCH_PIN" );
97 }
98
99 static bool ClassOf( const EDA_ITEM* aItem )
100 {
101 return aItem && aItem->Type() == SCH_PIN_T;
102 }
103
104 wxString GetFriendlyName() const override
105 {
106 return _( "Pin" );
107 }
108
109 SCH_PIN* GetLibPin() const { return m_libPin; }
110 void SetLibPin( SCH_PIN* aLibPin ) { m_libPin = aLibPin; }
111
113 void SetOrientation( PIN_ORIENTATION aOrientation ) { m_orientation = aOrientation; }
114
116 void SetShape( GRAPHIC_PINSHAPE aShape ) { m_shape = aShape; }
117
118 int GetLength() const;
119 void SetLength( int aLength ) { m_length = aLength; }
120
126 void ChangeLength( int aLength );
127
129 void SetType( ELECTRICAL_PINTYPE aType );
130 wxString GetCanonicalElectricalTypeName() const;
131 wxString GetElectricalTypeName() const;
132
133 bool IsVisible() const;
134 void SetVisible( bool aVisible ) { m_hidden = !aVisible; }
135
136 const wxString& GetName() const;
137 const wxString& GetShownName() const;
138 void SetName( const wxString& aName );
142 const wxString& GetBaseName() const;
143
144 const wxString& GetNumber() const { return m_number; }
145 const wxString& GetShownNumber() const;
146 std::vector<wxString> GetStackedPinNumbers( bool* aValid = nullptr ) const;
147
158 int GetStackedPinCount( bool* aValid = nullptr ) const;
159
164 std::optional<wxString> GetSmallestLogicalNumber() const;
165
171 wxString GetSmallestStackedPadNumber() const;
172
180
201 wxString GetEffectivePadNumber( const SCH_SHEET_PATH& aSheet, const wxString& aVariantName,
202 const LIB_ID& aFootprintLibId, const std::set<wxString>* aFootprintPadNumbers,
203 PAD_RESOLUTION* aState = nullptr ) const;
204
207 wxString GetEffectivePadNumber( const SCH_SHEET_PATH& aSheet, const wxString& aVariantName = wxEmptyString ) const;
208
209 static bool HasIdentityPad( const wxString& aPinNumber, const std::set<wxString>& aPads );
210
211 void SetNumber( const wxString& aNumber );
212
213 int GetNameTextSize() const;
214 void SetNameTextSize( int aSize );
215
216 int GetNumberTextSize() const;
217 void SetNumberTextSize( int aSize );
218
219 const std::map<wxString, ALT>& GetAlternates() const
220 {
221 if( m_libPin )
222 return m_libPin->GetAlternates();
223
224 return m_alternates;
225 }
226
227 std::map<wxString, ALT>& GetAlternates()
228 {
229 return const_cast<std::map<wxString, ALT>&>(
230 static_cast<const SCH_PIN*>( this )->GetAlternates() );
231 }
232
233 ALT GetAlt( const wxString& aAlt )
234 {
235 return GetAlternates()[ aAlt ];
236 }
237
238 wxString GetAlt() const { return m_alt; }
239
249 void SetAlt( const wxString& aAlt );
250
257 PIN_ORIENTATION PinDrawOrient( const TRANSFORM& aTransform ) const;
258
263 bool StackedTextSideFlipped( const TRANSFORM& aTransform ) const;
264
265#if defined(DEBUG)
266 void Show( int nestLevel, std::ostream& os ) const override;
267#endif
268
269 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
270
271 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
272
273 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
274
275 const BOX2I ViewBBox() const override;
276
277 std::vector<int> ViewGetLayers() const override;
278
279 /* Cannot use a default parameter here as it will not be compatible with the virtual. */
280 const BOX2I GetBoundingBox() const override
281 {
282 return GetBoundingBox( false, true, m_flags & SHOW_ELEC_TYPE );
283 }
284
291 BOX2I GetBoundingBox( bool aIncludeLabelsOnInvisiblePins, bool aIncludeNameAndNumber,
292 bool aIncludeElectricalType ) const;
293
298 bool IsGlobalPower() const;
299
304 bool IsLocalPower() const;
305
310 bool IsPower() const;
311
312 int GetPenWidth() const override { return 0; }
313
314 void Move( const VECTOR2I& aOffset ) override;
315
316 VECTOR2I GetPosition() const override;
318 void SetPosition( const VECTOR2I& aPos ) override { m_position = aPos; }
319
320 // For properties system
321 int GetX() const { return m_position.x; }
322 void SetX( int aX ) { m_position.x = aX; }
323 int GetY() const { return m_position.y; }
324 void SetY( int aY ) { m_position.y = aY; }
325
326 VECTOR2I GetPinRoot() const;
327
331 void MirrorHorizontally( int aCenter ) override;
332 void MirrorVertically( int aCenter ) override;
333 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW = true ) override;
334
338 void MirrorHorizontallyPin( int aCenter );
339 void MirrorVerticallyPin( int aCenter );
340 void RotatePin( const VECTOR2I& aCenter, bool aRotateCCW = true );
341
354 void PlotPinTexts( PLOTTER *aPlotter, const VECTOR2I &aPinPos, PIN_ORIENTATION aPinOrient,
355 int aTextInside, bool aDrawPinNum, bool aDrawPinName, bool aDimmed ) const;
356
357 void PlotPinType( PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation,
358 bool aDimmed ) const;
359
360 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
361 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
362
363 BITMAPS GetMenuImage() const override;
364
365 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
366 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, ALT* aAlt ) const;
367
368 EDA_ITEM* Clone() const override;
369
370 void CalcEdit( const VECTOR2I& aPosition ) override;
371
372 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
373
374 bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) override;
375
385
386 bool IsConnectable() const override { return true; }
387
388 bool IsLocked() const override;
389
390 bool HasConnectivityChanges( const SCH_ITEM* aItem,
391 const SCH_SHEET_PATH* aInstance = nullptr ) const override;
392
393 void ClearDefaultNetName( const SCH_SHEET_PATH* aPath );
394 wxString GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoConnect = false );
395
396 bool IsDangling() const override;
397 bool SetIsDangling( bool aIsDangling );
398
403 bool IsStacked( const SCH_PIN* aPin ) const;
404
405 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
406 {
407 return m_isDangling && GetPosition() == aPos;
408 }
409
410 bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const override;
411
412 const wxString& GetOperatingPoint() const { return m_operatingPoint; }
413 void SetOperatingPoint( const wxString& aText ) { m_operatingPoint = aText; }
414
423 const wxString& GetRemappedFromNumber() const { return m_remappedFromNumber; }
424 void SetRemappedFromNumber( const wxString& aNumber ) { m_remappedFromNumber = aNumber; }
425
431 void SetFlipStackedTextSide( bool aFlip ) { m_flipStackedTextSide = aFlip; }
432
433 double Similarity( const SCH_ITEM& aOther ) const override;
434
435 bool operator==( const SCH_ITEM& aPin ) const override;
436 bool operator==( const SCH_PIN& aPin ) const;
437
438 bool operator>( const SCH_ITEM& aRhs ) const { return compare( aRhs, ~COMPARE_FLAGS::UUID ) > 0; }
439
448
449protected:
450 void swapData( SCH_ITEM* aItem ) override;
451
452 wxString getItemDescription( ALT* aAlt ) const;
453
460
461 void validateExtentsCache( KIFONT::FONT* aFont, int aSize, const wxString& aText, EXTENTS_CACHE* aCache ) const;
462
463 std::ostream& operator<<( std::ostream& aStream );
464
465private:
482 int compare( const SCH_ITEM& aOther, int aCompareFlags = 0 ) const override;
483
484protected:
485 SCH_PIN* m_libPin; // The corresponding pin in the LIB_SYMBOL
486 // (nullptr for a pin *in* the LIB_SYMBOL)
487
488 std::map<wxString, ALT> m_alternates; // Map of alternate name to ALT structure
489 // (only valid for pins in LIB_SYMBOLS)
490
491 VECTOR2I m_position; // Position of the pin.
492 std::optional<int> m_length; // Length of the pin.
493 PIN_ORIENTATION m_orientation; // Pin orientation (Up, Down, Left, Right)
494 GRAPHIC_PINSHAPE m_shape; // Shape drawn around pin
495 ELECTRICAL_PINTYPE m_type; // Electrical type of the pin.
496 std::optional<bool> m_hidden;
497 wxString m_name;
498 wxString m_number;
499 std::optional<int> m_numTextSize; // Pin num and Pin name sizes
500 std::optional<int> m_nameTextSize;
501 wxString m_alt; // The current alternate for an instance
502
504
507
510
512
518 mutable std::unique_ptr<PIN_LAYOUT_CACHE> m_layoutCache;
519
521 std::recursive_mutex m_netmap_mutex;
522 std::map<const SCH_SHEET_PATH, std::pair<wxString, bool>> m_net_name_map;
523};
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
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:608
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:114
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:170
friend class LIB_SYMBOL
Definition sch_item.h:817
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:65
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW=true) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition sch_pin.cpp:1597
std::ostream & operator<<(std::ostream &aStream)
Definition sch_pin.cpp:2256
void SetAlt(const wxString &aAlt)
Set the name of the alternate pin.
Definition sch_pin.cpp:560
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:1082
VECTOR2I GetLocalPosition() const
Definition sch_pin.h:317
int GetNumberTextSize() const
Definition sch_pin.cpp:882
int GetLength() const
Definition sch_pin.cpp:421
std::optional< bool > m_hidden
Definition sch_pin.h:496
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition sch_pin.cpp:628
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:1625
std::unique_ptr< PIN_LAYOUT_CACHE > m_layoutCache
The layout cache for this pin.
Definition sch_pin.h:518
void MirrorVerticallyPin(int aCenter)
Definition sch_pin.cpp:1546
void validateExtentsCache(KIFONT::FONT *aFont, int aSize, const wxString &aText, EXTENTS_CACHE *aCache) const
Definition sch_pin.cpp:1768
wxString GetAlt() const
Definition sch_pin.h:238
bool operator>(const SCH_ITEM &aRhs) const
Definition sch_pin.h:438
const BOX2I ViewBBox() const override
The view bounds of text that shows a net name must match the drawing, so this reads connectivity insi...
Definition sch_pin.cpp:1755
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:1761
const std::map< wxString, ALT > & GetAlternates() const
Definition sch_pin.h:219
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
Definition sch_pin.cpp:2285
void SetNumber(const wxString &aNumber)
Definition sch_pin.cpp:842
std::optional< int > m_nameTextSize
Definition sch_pin.h:500
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:1431
void SetVisible(bool aVisible)
Definition sch_pin.h:134
int GetX() const
Definition sch_pin.h:321
void ChangeLength(int aLength)
Change the length of a pin and adjust its position based on orientation.
Definition sch_pin.cpp:1492
ALT GetAlt(const wxString &aAlt)
Definition sch_pin.h:233
void SetX(int aX)
Definition sch_pin.h:322
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:1808
SCH_PIN & operator=(const SCH_PIN &aPin)
Definition sch_pin.cpp:249
SCH_PIN * m_libPin
Definition sch_pin.h:485
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:727
void Move(const VECTOR2I &aOffset) override
Move the item by aMoveVector to a new position.
Definition sch_pin.cpp:1520
bool GetFlipStackedTextSide() const
Transient, render-only hint that the symbol transform mirrors the stacked number block side.
Definition sch_pin.h:430
std::map< const SCH_SHEET_PATH, std::pair< wxString, bool > > m_net_name_map
Definition sch_pin.h:522
PIN_ORIENTATION m_orientation
Definition sch_pin.h:493
const wxString & GetOperatingPoint() const
Definition sch_pin.h:412
void SetOrientation(PIN_ORIENTATION aOrientation)
Definition sch_pin.h:113
void SetName(const wxString &aName)
Definition sch_pin.cpp:545
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:481
bool SetIsDangling(bool aIsDangling)
Definition sch_pin.cpp:597
wxString getItemDescription(ALT *aAlt) const
Definition sch_pin.cpp:1910
bool IsVisible() const
Definition sch_pin.cpp:513
bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
Definition sch_pin.cpp:1850
bool IsLocked() const override
Definition sch_pin.cpp:1856
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition sch_pin.cpp:273
std::optional< int > m_numTextSize
Definition sch_pin.h:499
VECTOR2I GetPinRoot() const
Definition sch_pin.cpp:908
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:500
ELECTRICAL_PINTYPE m_type
Definition sch_pin.h:495
void SetLibPin(SCH_PIN *aLibPin)
Definition sch_pin.h:110
PAD_RESOLUTION
Outcome of pin-to-pad resolution (issue #2282).
Definition sch_pin.h:175
@ UNMAPPED
No entry and the footprint has no matching pad.
Definition sch_pin.h:178
@ MAPPED
An explicit map entry (or instance edit) supplied the pad number.
Definition sch_pin.h:176
@ IDENTITY
No entry, but the footprint has a pad whose number equals the pin number.
Definition sch_pin.h:177
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition sch_pin.cpp:1559
SCH_PIN * GetLibPin() const
Definition sch_pin.h:109
void SetPosition(const VECTOR2I &aPos) override
Definition sch_pin.h:318
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:2200
bool m_isDangling
Definition sch_pin.h:511
void SetFlipStackedTextSide(bool aFlip)
Definition sch_pin.h:431
bool IsConnectable() const override
Definition sch_pin.h:386
wxString GetElectricalTypeName() const
Definition sch_pin.cpp:474
std::vector< wxString > GetStackedPinNumbers(bool *aValid=nullptr) const
Definition sch_pin.cpp:714
int GetPenWidth() const override
Definition sch_pin.h:312
std::map< wxString, ALT > m_alternates
Definition sch_pin.h:488
const wxString & GetName() const
Definition sch_pin.cpp:527
wxString GetFriendlyName() const override
Definition sch_pin.h:104
int GetStackedPinCount(bool *aValid=nullptr) const
Return the count of logical pins represented by this pin's stacked notation.
Definition sch_pin.cpp:720
bool operator==(const SCH_ITEM &aPin) const override
Definition sch_pin.cpp:2129
void SetLength(int aLength)
Definition sch_pin.h:119
bool IsDangling() const override
Definition sch_pin.cpp:588
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:1604
void MirrorHorizontally(int aCenter) override
These transforms have effect only if the pin has a LIB_SYMBOL as parent.
Definition sch_pin.cpp:1539
std::recursive_mutex m_netmap_mutex
The name that this pin connection will drive onto a net.
Definition sch_pin.h:521
PIN_ORIENTATION GetOrientation() const
Definition sch_pin.cpp:386
wxString GetClass() const override
Return the class name.
Definition sch_pin.h:94
void SetNumberTextSize(int aSize)
Definition sch_pin.cpp:896
void SetShape(GRAPHIC_PINSHAPE aShape)
Definition sch_pin.h:116
void RotatePin(const VECTOR2I &aCenter, bool aRotateCCW=true)
Definition sch_pin.cpp:1566
std::map< wxString, ALT > & GetAlternates()
Definition sch_pin.h:227
VECTOR2I GetPosition() const override
Definition sch_pin.cpp:378
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:1466
wxString GetCanonicalElectricalTypeName() const
Definition sch_pin.cpp:467
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:646
int GetNameTextSize() const
Definition sch_pin.cpp:856
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition sch_pin.cpp:1883
bool m_flipStackedTextSide
Render-only stacked block side hint, see GetFlipStackedTextSide(). Not saved.
Definition sch_pin.h:509
VECTOR2I m_position
Definition sch_pin.h:491
wxString m_operatingPoint
Definition sch_pin.h:503
GRAPHIC_PINSHAPE m_shape
Definition sch_pin.h:494
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition sch_pin.cpp:333
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
The pin specific sort order is as follows:
Definition sch_pin.cpp:2071
const wxString & GetShownName() const
Definition sch_pin.cpp:697
static bool ClassOf(const EDA_ITEM *aItem)
Definition sch_pin.h:99
PIN_ALTERNATE ALT
Definition sch_pin.h:63
void MirrorHorizontallyPin(int aCenter)
These transforms have always effects.
Definition sch_pin.cpp:1526
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:667
PIN_LAYOUT_CACHE & GetLayoutCache() const
Get the layout cache associated with this pin.
Definition sch_pin.cpp:1799
wxString m_name
Definition sch_pin.h:497
wxString m_alt
Definition sch_pin.h:501
const wxString & GetRemappedFromNumber() const
Transient, render-only original pin number for a pad-remapped pin (issue #2282).
Definition sch_pin.h:423
void SetOperatingPoint(const wxString &aText)
Definition sch_pin.h:413
void SetType(ELECTRICAL_PINTYPE aType)
Definition sch_pin.cpp:455
const wxString & GetBaseName() const
Get the name without any alternates.
Definition sch_pin.cpp:536
void ClearDefaultNetName(const SCH_SHEET_PATH *aPath)
Definition sch_pin.cpp:1672
PIN_COMPARISON_DATA ComparisonData() const
Definition sch_pin.cpp:2063
void SetY(int aY)
Definition sch_pin.h:324
void SetRemappedFromNumber(const wxString &aNumber)
Definition sch_pin.h:424
SCH_PIN(LIB_SYMBOL *aParentSymbol)
Definition sch_pin.cpp:139
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:748
const wxString & GetShownNumber() const
Definition sch_pin.cpp:708
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition sch_pin.h:405
wxString m_remappedFromNumber
Render-only original number for a pad-remapped pin; see GetRemappedFromNumber(). Not saved.
Definition sch_pin.h:506
bool IsStacked(const SCH_PIN *aPin) const
Definition sch_pin.cpp:605
const wxString & GetNumber() const
Definition sch_pin.h:144
wxString m_number
Definition sch_pin.h:498
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition sch_pin.cpp:1483
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition sch_pin.h:280
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition sch_pin.cpp:296
static bool HasIdentityPad(const wxString &aPinNumber, const std::set< wxString > &aPads)
Definition sch_pin.cpp:819
wxString GetSmallestStackedPadNumber() const
Return the pin number to be used for deterministic operations such as auto‑generated net names.
Definition sch_pin.cpp:739
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath, bool aForceNoConnect=false)
Definition sch_pin.cpp:1683
std::optional< int > m_length
Definition sch_pin.h:492
static wxString GetCanonicalElectricalTypeName(ELECTRICAL_PINTYPE aType)
Return a string giving the electrical type of a pin.
GRAPHIC_PINSHAPE GetShape() const
Definition sch_pin.cpp:400
void PlotPinType(PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation, bool aDimmed) const
Definition sch_pin.cpp:931
int GetY() const
Definition sch_pin.h:323
bool IsPower() const
Check if the pin is either a global or local power pin.
Definition sch_pin.cpp:507
ELECTRICAL_PINTYPE GetType() const
Definition sch_pin.cpp:435
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition sch_pin.cpp:1868
void SetNameTextSize(int aSize)
Definition sch_pin.cpp:870
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:73
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:51
Owned library-pin inputs; no parent, layout cache or schematic pointers.
KIFONT::FONT * m_Font
Definition sch_pin.h:456
SCH_PIN::PAD_RESOLUTION PAD_RESOLUTION
@ SCH_PIN_T
Definition typeinfo.h:149
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708