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 <sch_item.h>
32
33class LIB_SYMBOL;
34class SCH_SYMBOL;
35class LIB_ID;
36class SCH_SHEET_PATH;
38
39// Circle diameter drawn at the active end of pins:
40#define TARGET_PIN_RADIUS schIUScale.MilsToIU( 15 )
41
42
43class SCH_PIN : public SCH_ITEM
44{
45public:
46 struct ALT
47 {
48 wxString m_Name;
49 GRAPHIC_PINSHAPE m_Shape; // Shape drawn around pin
50 ELECTRICAL_PINTYPE m_Type; // Electrical type of the pin.
51 };
52
53 SCH_PIN( LIB_SYMBOL* aParentSymbol );
54
55 SCH_PIN( LIB_SYMBOL* aParentSymbol, const wxString& aName, const wxString& aNumber,
56 PIN_ORIENTATION aOrientation, ELECTRICAL_PINTYPE aPinType, int aLength,
57 int aNameTextSize, int aNumTextSize, int aBodyStyle, const VECTOR2I& aPos, int aUnit );
58
59 SCH_PIN( SCH_SYMBOL* aParentSymbol, SCH_PIN* aLibPin );
60
68 SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxString& aAlt,
69 const KIID& aUuid );
70
71 SCH_PIN( const SCH_PIN& aPin );
72
73 ~SCH_PIN();
74
75 SCH_PIN& operator=( const SCH_PIN& aPin );
76
77 void Serialize( google::protobuf::Any& aContainer ) const override;
78 bool Deserialize( const google::protobuf::Any& aContainer ) override;
79
80 wxString GetClass() const override
81 {
82 return wxT( "SCH_PIN" );
83 }
84
85 static bool ClassOf( const EDA_ITEM* aItem )
86 {
87 return aItem && aItem->Type() == SCH_PIN_T;
88 }
89
90 wxString GetFriendlyName() const override
91 {
92 return _( "Pin" );
93 }
94
95 SCH_PIN* GetLibPin() const { return m_libPin; }
96 void SetLibPin( SCH_PIN* aLibPin ) { m_libPin = aLibPin; }
97
99 void SetOrientation( PIN_ORIENTATION aOrientation ) { m_orientation = aOrientation; }
100
102 void SetShape( GRAPHIC_PINSHAPE aShape ) { m_shape = aShape; }
103
104 int GetLength() const;
105 void SetLength( int aLength ) { m_length = aLength; }
106
112 void ChangeLength( int aLength );
113
115 void SetType( ELECTRICAL_PINTYPE aType );
116 wxString GetCanonicalElectricalTypeName() const;
117 wxString GetElectricalTypeName() const;
118
119 bool IsVisible() const;
120 void SetVisible( bool aVisible ) { m_hidden = !aVisible; }
121
122 const wxString& GetName() const;
123 const wxString& GetShownName() const;
124 void SetName( const wxString& aName );
128 const wxString& GetBaseName() const;
129
130 const wxString& GetNumber() const { return m_number; }
131 const wxString& GetShownNumber() const;
132 std::vector<wxString> GetStackedPinNumbers( bool* aValid = nullptr ) const;
133
144 int GetStackedPinCount( bool* aValid = nullptr ) const;
145
150 std::optional<wxString> GetSmallestLogicalNumber() const;
151
157 wxString GetSmallestStackedPadNumber() const;
158
166
187 wxString GetEffectivePadNumber( const SCH_SHEET_PATH& aSheet, const wxString& aVariantName,
188 const LIB_ID& aFootprintLibId, const std::set<wxString>* aFootprintPadNumbers,
189 PAD_RESOLUTION* aState = nullptr ) const;
190
193 wxString GetEffectivePadNumber( const SCH_SHEET_PATH& aSheet, const wxString& aVariantName = wxEmptyString ) const;
194
195 void SetNumber( const wxString& aNumber );
196
197 int GetNameTextSize() const;
198 void SetNameTextSize( int aSize );
199
200 int GetNumberTextSize() const;
201 void SetNumberTextSize( int aSize );
202
203 const std::map<wxString, ALT>& GetAlternates() const
204 {
205 if( m_libPin )
206 return m_libPin->GetAlternates();
207
208 return m_alternates;
209 }
210
211 std::map<wxString, ALT>& GetAlternates()
212 {
213 return const_cast<std::map<wxString, ALT>&>(
214 static_cast<const SCH_PIN*>( this )->GetAlternates() );
215 }
216
217 ALT GetAlt( const wxString& aAlt )
218 {
219 return GetAlternates()[ aAlt ];
220 }
221
222 wxString GetAlt() const { return m_alt; }
223
233 void SetAlt( const wxString& aAlt );
234
241 PIN_ORIENTATION PinDrawOrient( const TRANSFORM& aTransform ) const;
242
243#if defined(DEBUG)
244 void Show( int nestLevel, std::ostream& os ) const override;
245#endif
246
247 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
248
249 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
250
251 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
252
253 const BOX2I ViewBBox() const override;
254
255 std::vector<int> ViewGetLayers() const override;
256
257 /* Cannot use a default parameter here as it will not be compatible with the virtual. */
258 const BOX2I GetBoundingBox() const override
259 {
260 return GetBoundingBox( false, true, m_flags & SHOW_ELEC_TYPE );
261 }
262
267 BOX2I GetBoundingBox( bool aIncludeLabelsOnInvisiblePins, bool aIncludeNameAndNumber,
268 bool aIncludeElectricalType ) const;
269
274 bool IsGlobalPower() const;
275
280 bool IsLocalPower() const;
281
286 bool IsPower() const;
287
288 int GetPenWidth() const override { return 0; }
289
290 void Move( const VECTOR2I& aOffset ) override;
291
292 VECTOR2I GetPosition() const override;
294 void SetPosition( const VECTOR2I& aPos ) override { m_position = aPos; }
295
296 // For properties system
297 int GetX() const { return m_position.x; }
298 void SetX( int aX ) { m_position.x = aX; }
299 int GetY() const { return m_position.y; }
300 void SetY( int aY ) { m_position.y = aY; }
301
302 VECTOR2I GetPinRoot() const;
303
307 void MirrorHorizontally( int aCenter ) override;
308 void MirrorVertically( int aCenter ) override;
309 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW = true ) override;
310
314 void MirrorHorizontallyPin( int aCenter );
315 void MirrorVerticallyPin( int aCenter );
316 void RotatePin( const VECTOR2I& aCenter, bool aRotateCCW = true );
317
324 void PlotPinTexts( PLOTTER *aPlotter, const VECTOR2I &aPinPos, PIN_ORIENTATION aPinOrient,
325 int aTextInside, bool aDrawPinNum, bool aDrawPinName, bool aDimmed ) const;
326
327 void PlotPinType( PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation,
328 bool aDimmed ) const;
329
330 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
331 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
332
333 BITMAPS GetMenuImage() const override;
334
335 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
336 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, ALT* aAlt ) const;
337
338 EDA_ITEM* Clone() const override;
339
340 void CalcEdit( const VECTOR2I& aPosition ) override;
341
342 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
343
344 bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) override;
345
355
356 bool IsConnectable() const override { return true; }
357
358 bool IsLocked() const override;
359
360 bool HasConnectivityChanges( const SCH_ITEM* aItem,
361 const SCH_SHEET_PATH* aInstance = nullptr ) const override;
362
363 void ClearDefaultNetName( const SCH_SHEET_PATH* aPath );
364 wxString GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoConnect = false );
365
366 bool IsDangling() const override;
367 void SetIsDangling( bool aIsDangling );
368
373 bool IsStacked( const SCH_PIN* aPin ) const;
374
375 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
376 {
377 return m_isDangling && GetPosition() == aPos;
378 }
379
380 bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const override;
381
382 const wxString& GetOperatingPoint() const { return m_operatingPoint; }
383 void SetOperatingPoint( const wxString& aText ) { m_operatingPoint = aText; }
384
393 const wxString& GetRemappedFromNumber() const { return m_remappedFromNumber; }
394 void SetRemappedFromNumber( const wxString& aNumber ) { m_remappedFromNumber = aNumber; }
395
396 double Similarity( const SCH_ITEM& aOther ) const override;
397
398 bool operator>( const SCH_ITEM& aRhs ) const { return compare( aRhs, EQUALITY ) > 0; }
399
408
409protected:
410 wxString getItemDescription( ALT* aAlt ) const;
411
418
419 void validateExtentsCache( KIFONT::FONT* aFont, int aSize, const wxString& aText,
420 EXTENTS_CACHE* aCache ) const;
421
422 std::ostream& operator<<( std::ostream& aStream );
423
424private:
441 int compare( const SCH_ITEM& aOther, int aCompareFlags = 0 ) const override;
442
443protected:
444 SCH_PIN* m_libPin; // The corresponding pin in the LIB_SYMBOL
445 // (nullptr for a pin *in* the LIB_SYMBOL)
446
447 std::map<wxString, ALT> m_alternates; // Map of alternate name to ALT structure
448 // (only valid for pins in LIB_SYMBOLS)
449
450 VECTOR2I m_position; // Position of the pin.
451 std::optional<int> m_length; // Length of the pin.
452 PIN_ORIENTATION m_orientation; // Pin orientation (Up, Down, Left, Right)
453 GRAPHIC_PINSHAPE m_shape; // Shape drawn around pin
454 ELECTRICAL_PINTYPE m_type; // Electrical type of the pin.
455 std::optional<bool> m_hidden;
456 wxString m_name;
457 wxString m_number;
458 std::optional<int> m_numTextSize; // Pin num and Pin name sizes
459 std::optional<int> m_nameTextSize;
460 wxString m_alt; // The current alternate for an instance
461
463
466
468
474 mutable std::unique_ptr<PIN_LAYOUT_CACHE> m_layoutCache;
475
477 std::recursive_mutex m_netmap_mutex;
478 std::map<const SCH_SHEET_PATH, std::pair<wxString, bool>> m_net_name_map;
479};
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
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:96
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
EDA_ITEM_FLAGS m_flags
Definition eda_item.h:542
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:37
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:94
Definition kiid.h:44
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:80
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:133
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:162
friend class LIB_SYMBOL
Definition sch_item.h:797
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:1524
std::ostream & operator<<(std::ostream &aStream)
Definition sch_pin.cpp:2068
void SetAlt(const wxString &aAlt)
Set the name of the alternate pin.
Definition sch_pin.cpp:532
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:1050
VECTOR2I GetLocalPosition() const
Definition sch_pin.h:293
int GetNumberTextSize() const
Definition sch_pin.cpp:850
int GetLength() const
Definition sch_pin.cpp:393
std::optional< bool > m_hidden
Definition sch_pin.h:455
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition sch_pin.cpp:598
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:1552
std::unique_ptr< PIN_LAYOUT_CACHE > m_layoutCache
The layout cache for this pin.
Definition sch_pin.h:474
void MirrorVerticallyPin(int aCenter)
Definition sch_pin.cpp:1473
void validateExtentsCache(KIFONT::FONT *aFont, int aSize, const wxString &aText, EXTENTS_CACHE *aCache) const
Definition sch_pin.cpp:1733
wxString GetAlt() const
Definition sch_pin.h:222
bool operator>(const SCH_ITEM &aRhs) const
Definition sch_pin.h:398
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition sch_pin.cpp:1720
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:1726
const std::map< wxString, ALT > & GetAlternates() const
Definition sch_pin.h:203
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
Definition sch_pin.cpp:2097
void SetNumber(const wxString &aNumber)
Definition sch_pin.cpp:810
std::optional< int > m_nameTextSize
Definition sch_pin.h:459
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:1375
void SetVisible(bool aVisible)
Definition sch_pin.h:120
int GetX() const
Definition sch_pin.h:297
void ChangeLength(int aLength)
Change the length of a pin and adjust its position based on orientation.
Definition sch_pin.cpp:1419
ALT GetAlt(const wxString &aAlt)
Definition sch_pin.h:217
void SetX(int aX)
Definition sch_pin.h:298
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:1773
SCH_PIN & operator=(const SCH_PIN &aPin)
Definition sch_pin.cpp:247
SCH_PIN * m_libPin
Definition sch_pin.h:444
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:706
void Move(const VECTOR2I &aOffset) override
Move the item by aMoveVector to a new position.
Definition sch_pin.cpp:1447
std::map< const SCH_SHEET_PATH, std::pair< wxString, bool > > m_net_name_map
Definition sch_pin.h:478
PIN_ORIENTATION m_orientation
Definition sch_pin.h:452
const wxString & GetOperatingPoint() const
Definition sch_pin.h:382
void SetOrientation(PIN_ORIENTATION aOrientation)
Definition sch_pin.h:99
void SetName(const wxString &aName)
Definition sch_pin.cpp:517
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:453
wxString getItemDescription(ALT *aAlt) const
Definition sch_pin.cpp:1867
bool IsVisible() const
Definition sch_pin.cpp:485
bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
Definition sch_pin.cpp:1807
bool IsLocked() const override
Definition sch_pin.cpp:1813
std::optional< int > m_numTextSize
Definition sch_pin.h:458
VECTOR2I GetPinRoot() const
Definition sch_pin.cpp:876
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:472
ELECTRICAL_PINTYPE m_type
Definition sch_pin.h:454
void SetLibPin(SCH_PIN *aLibPin)
Definition sch_pin.h:96
PAD_RESOLUTION
Outcome of pin-to-pad resolution (issue #2282).
Definition sch_pin.h:161
@ UNMAPPED
No entry and the footprint has no matching pad.
Definition sch_pin.h:164
@ MAPPED
An explicit map entry (or instance edit) supplied the pad number.
Definition sch_pin.h:162
@ IDENTITY
No entry, but the footprint has a pad whose number equals the pin number.
Definition sch_pin.h:163
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition sch_pin.cpp:1486
SCH_PIN * GetLibPin() const
Definition sch_pin.h:95
void SetPosition(const VECTOR2I &aPos) override
Definition sch_pin.h:294
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:2008
bool m_isDangling
Definition sch_pin.h:467
bool IsConnectable() const override
Definition sch_pin.h:356
void SetIsDangling(bool aIsDangling)
Definition sch_pin.cpp:569
wxString GetElectricalTypeName() const
Definition sch_pin.cpp:446
std::vector< wxString > GetStackedPinNumbers(bool *aValid=nullptr) const
Definition sch_pin.cpp:693
int GetPenWidth() const override
Definition sch_pin.h:288
std::map< wxString, ALT > m_alternates
Definition sch_pin.h:447
const wxString & GetName() const
Definition sch_pin.cpp:499
wxString GetFriendlyName() const override
Definition sch_pin.h:90
int GetStackedPinCount(bool *aValid=nullptr) const
Return the count of logical pins represented by this pin's stacked notation.
Definition sch_pin.cpp:699
void SetLength(int aLength)
Definition sch_pin.h:105
bool IsDangling() const override
Definition sch_pin.cpp:560
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:1531
void MirrorHorizontally(int aCenter) override
These transforms have effect only if the pin has a LIB_SYMBOL as parent.
Definition sch_pin.cpp:1466
std::recursive_mutex m_netmap_mutex
The name that this pin connection will drive onto a net.
Definition sch_pin.h:477
PIN_ORIENTATION GetOrientation() const
Definition sch_pin.cpp:358
wxString GetClass() const override
Return the class name.
Definition sch_pin.h:80
void SetNumberTextSize(int aSize)
Definition sch_pin.cpp:864
void SetShape(GRAPHIC_PINSHAPE aShape)
Definition sch_pin.h:102
void RotatePin(const VECTOR2I &aCenter, bool aRotateCCW=true)
Definition sch_pin.cpp:1493
std::map< wxString, ALT > & GetAlternates()
Definition sch_pin.h:211
VECTOR2I GetPosition() const override
Definition sch_pin.cpp:350
wxString GetCanonicalElectricalTypeName() const
Definition sch_pin.cpp:439
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:625
int GetNameTextSize() const
Definition sch_pin.cpp:824
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition sch_pin.cpp:1840
VECTOR2I m_position
Definition sch_pin.h:450
wxString m_operatingPoint
Definition sch_pin.h:462
GRAPHIC_PINSHAPE m_shape
Definition sch_pin.h:453
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition sch_pin.cpp:307
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
The pin specific sort order is as follows:
Definition sch_pin.cpp:1912
const wxString & GetShownName() const
Definition sch_pin.cpp:676
static bool ClassOf(const EDA_ITEM *aItem)
Definition sch_pin.h:85
void MirrorHorizontallyPin(int aCenter)
These transforms have always effects.
Definition sch_pin.cpp:1453
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:646
PIN_LAYOUT_CACHE & GetLayoutCache() const
Get the layout cache associated with this pin.
Definition sch_pin.cpp:1764
wxString m_name
Definition sch_pin.h:456
wxString m_alt
Definition sch_pin.h:460
const wxString & GetRemappedFromNumber() const
Transient, render-only original pin number for a pad-remapped pin (issue #2282).
Definition sch_pin.h:393
void SetOperatingPoint(const wxString &aText)
Definition sch_pin.h:383
void SetType(ELECTRICAL_PINTYPE aType)
Definition sch_pin.cpp:427
const wxString & GetBaseName() const
Get the name without any alternates.
Definition sch_pin.cpp:508
void ClearDefaultNetName(const SCH_SHEET_PATH *aPath)
Definition sch_pin.cpp:1599
void SetY(int aY)
Definition sch_pin.h:300
void SetRemappedFromNumber(const wxString &aNumber)
Definition sch_pin.h:394
SCH_PIN(LIB_SYMBOL *aParentSymbol)
Definition sch_pin.cpp:137
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:727
const wxString & GetShownNumber() const
Definition sch_pin.cpp:687
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition sch_pin.h:375
wxString m_remappedFromNumber
Render-only original number for a pad-remapped pin; see GetRemappedFromNumber(). Not saved.
Definition sch_pin.h:465
bool IsStacked(const SCH_PIN *aPin) const
Definition sch_pin.cpp:575
const wxString & GetNumber() const
Definition sch_pin.h:130
wxString m_number
Definition sch_pin.h:457
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition sch_pin.cpp:1410
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition sch_pin.h:258
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition sch_pin.cpp:271
wxString GetSmallestStackedPadNumber() const
Return the pin number to be used for deterministic operations such as auto‑generated net names.
Definition sch_pin.cpp:718
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath, bool aForceNoConnect=false)
Definition sch_pin.cpp:1610
std::optional< int > m_length
Definition sch_pin.h:451
static wxString GetCanonicalElectricalTypeName(ELECTRICAL_PINTYPE aType)
Return a string giving the electrical type of a pin.
GRAPHIC_PINSHAPE GetShape() const
Definition sch_pin.cpp:372
void PlotPinType(PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation, bool aDimmed) const
Definition sch_pin.cpp:899
int GetY() const
Definition sch_pin.h:299
bool IsPower() const
Check if the pin is either a global or local power pin.
Definition sch_pin.cpp:479
ELECTRICAL_PINTYPE GetType() const
Definition sch_pin.cpp:407
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition sch_pin.cpp:1825
void SetNameTextSize(int aSize)
Definition sch_pin.cpp:838
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:69
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 m_Name
Definition sch_pin.h:48
GRAPHIC_PINSHAPE m_Shape
Definition sch_pin.h:49
ELECTRICAL_PINTYPE m_Type
Definition sch_pin.h:50
KIFONT::FONT * m_Font
Definition sch_pin.h:414
SCH_PIN::PAD_RESOLUTION PAD_RESOLUTION
@ SCH_PIN_T
Definition typeinfo.h:150
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683