KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_track.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) 2004 Jean-Pierre Charras, [email protected]
5 * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
35#ifndef CLASS_TRACK_H
36#define CLASS_TRACK_H
37
38
39#include <mutex>
40#include <array>
42#include <base_units.h>
44#include <core/minoptmax.h>
45#include <core/arraydim.h>
46
47class PCB_TRACK;
48class PCB_VIA;
49class PAD;
50class MSG_PANEL_ITEM;
51class SHAPE_POLY_SET;
52class SHAPE_ARC;
53
54
55// Flag used in locate routines (from which endpoint work)
56enum ENDPOINT_T : int
57{
59 ENDPOINT_END = 1
60};
61
62// Note that this enum must be synchronized to GAL_LAYER_ID
63enum class VIATYPE : int
64{
65 THROUGH = 3, /* Always a through hole via */
66 BLIND_BURIED = 2, /* this via can be on internal layers */
67 MICROVIA = 1, /* this via which connect from an external layer
68 * to the near neighbor internal layer */
69 NOT_DEFINED = 0 /* not yet used */
70};
71
72#define UNDEFINED_DRILL_DIAMETER -1 //< Undefined via drill diameter.
73
74// Used for tracks and vias for algorithmic safety, not to enforce constraints
75#define GEOMETRY_MIN_SIZE (int) ( 0.001 * pcbIUScale.IU_PER_MM )
76
77
79{
80public:
81 static inline bool ClassOf( const EDA_ITEM* aItem )
82 {
83 return aItem && PCB_TRACE_T == aItem->Type();
84 }
85
86 PCB_TRACK( BOARD_ITEM* aParent, KICAD_T idtype = PCB_TRACE_T );
87
88 // Do not create a copy constructor. The one generated by the compiler is adequate.
89
90 void Move( const VECTOR2I& aMoveVector ) override
91 {
92 m_Start += aMoveVector;
93 m_End += aMoveVector;
94 }
95
96 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
97
98 virtual void Mirror( const VECTOR2I& aCentre, bool aMirrorAroundXAxis );
99
100 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
101
102 void SetPosition( const VECTOR2I& aPos ) override { m_Start = aPos; }
103 VECTOR2I GetPosition() const override { return m_Start; }
104 const VECTOR2I GetFocusPosition() const override { return ( m_Start + m_End ) / 2; }
105
106 void SetWidth( int aWidth ) { m_Width = aWidth; }
107 int GetWidth() const { return m_Width; }
108
109 void SetEnd( const VECTOR2I& aEnd ) { m_End = aEnd; }
110 const VECTOR2I& GetEnd() const { return m_End; }
111
112 void SetStart( const VECTOR2I& aStart ) { m_Start = aStart; }
113 const VECTOR2I& GetStart() const { return m_Start; }
114
115 void SetEndX( int aX ) { m_End.x = aX; }
116 void SetEndY( int aY ) { m_End.y = aY; }
117
118 int GetEndX() const { return m_End.x; }
119 int GetEndY() const { return m_End.y; }
120
122 const VECTOR2I& GetEndPoint( ENDPOINT_T aEndPoint ) const
123 {
124 if( aEndPoint == ENDPOINT_START )
125 return m_Start;
126 else
127 return m_End;
128 }
129
130 // Virtual function
131 const BOX2I GetBoundingBox() const override;
132
138 virtual double GetLength() const;
139
151 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
152 int aError, ERROR_LOC aErrorLoc,
153 bool ignoreLineWidth = false ) const override;
154
155 // @copydoc BOARD_ITEM::GetEffectiveShape
156 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
157 FLASHING aFlash = FLASHING::DEFAULT ) const override;
158
166 EDA_ITEM_FLAGS IsPointOnEnds( const VECTOR2I& point, int min_dist = 0 ) const;
167
171 bool IsNull() const
172 {
173 return ( Type() == PCB_VIA_T ) || ( m_Start == m_End );
174 }
175
176 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
177 wxString GetFriendlyName() const override;
178
179 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
180 const std::vector<KICAD_T>& aScanTypes ) override;
181
182 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
183 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
184
185 bool ApproxCollinear( const PCB_TRACK& aTrack );
186
187 wxString GetClass() const override
188 {
189 return wxT( "PCB_TRACK" );
190 }
191
198 int GetLocalClearance( wxString* aSource ) const override;
199
200 MINOPTMAX<int> GetWidthConstraint( wxString* aSource = nullptr ) const;
201
202 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
203
204 BITMAPS GetMenuImage() const override;
205
206 virtual EDA_ITEM* Clone() const override;
207
208 virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
209
210 double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
211
212 const BOX2I ViewBBox() const override;
213
217 bool IsOnCopperLayer() const override
218 {
219 return true;
220 }
221
228 {
229 return m_CachedLOD;
230 }
231
237 void SetCachedLOD( double aLOD )
238 {
239 m_CachedLOD = aLOD;
240 }
241
248 {
249 return m_CachedScale;
250 }
251
257 void SetCachedScale( double aScale )
258 {
259 m_CachedScale = aScale;
260 }
261
263 {
264 bool operator()( const PCB_TRACK* aFirst, const PCB_TRACK* aSecond ) const;
265 };
266
267#if defined (DEBUG)
268 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
269#endif
270
271protected:
272 virtual void swapData( BOARD_ITEM* aImage ) override;
273
275 std::vector<MSG_PANEL_ITEM>& aList ) const;
276
277protected:
281
282 double m_CachedLOD;
283
285};
286
287
288class PCB_ARC : public PCB_TRACK
289{
290public:
291 PCB_ARC( BOARD_ITEM* aParent ) :
292 PCB_TRACK( aParent, PCB_ARC_T )
293 {
294 };
295
296 PCB_ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc );
297
298 static inline bool ClassOf( const EDA_ITEM *aItem )
299 {
300 return aItem && PCB_ARC_T == aItem->Type();
301 }
302
303 virtual void Move( const VECTOR2I& aMoveVector ) override
304 {
305 m_Start += aMoveVector;
306 m_Mid += aMoveVector;
307 m_End += aMoveVector;
308 }
309
310 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
311
312 void Mirror( const VECTOR2I& aCentre, bool aMirrorAroundXAxis ) override;
313
314 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
315
316 void SetMid( const VECTOR2I& aMid ) { m_Mid = aMid; }
317 const VECTOR2I& GetMid() const { return m_Mid; }
318
319 void SetPosition( const VECTOR2I& aPos ) override
320 {
321 m_Start = aPos;
322 }
323
324 virtual VECTOR2I GetPosition() const override;
325
326 virtual VECTOR2I GetCenter() const override { return GetPosition(); }
327
328 double GetRadius() const;
329 EDA_ANGLE GetAngle() const;
332 virtual bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
333
334 virtual bool HitTest( const BOX2I& aRect, bool aContained = true,
335 int aAccuracy = 0 ) const override;
336
337 bool IsCCW() const;
338
339 wxString GetClass() const override
340 {
341 return wxT( "PCB_ARC" );
342 }
343
344 // @copydoc BOARD_ITEM::GetEffectiveShape
345 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
346 FLASHING aFlash = FLASHING::DEFAULT ) const override;
347
353 virtual double GetLength() const override
354 {
355 return GetRadius() * std::abs( GetAngle().AsRadians() );
356 }
357
358 EDA_ITEM* Clone() const override;
359
360protected:
361 virtual void swapData( BOARD_ITEM* aImage ) override;
362
363private:
365};
366
367
368class PCB_VIA : public PCB_TRACK
369{
370public:
371 PCB_VIA( BOARD_ITEM* aParent );
372
373 static inline bool ClassOf( const EDA_ITEM *aItem )
374 {
375 return aItem && PCB_VIA_T == aItem->Type();
376 }
377
378 PCB_VIA( const PCB_VIA& aOther );
379 PCB_VIA& operator=( const PCB_VIA &aOther );
380
381 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
382 {
383 if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
384 return true;
385
386 for( KICAD_T scanType : aScanTypes )
387 {
388 if( scanType == PCB_LOCATE_STDVIA_T && m_viaType == VIATYPE::THROUGH )
389 return true;
390 else if( scanType == PCB_LOCATE_UVIA_T && m_viaType == VIATYPE::MICROVIA )
391 return true;
392 else if( scanType == PCB_LOCATE_BBVIA_T && m_viaType == VIATYPE::BLIND_BURIED )
393 return true;
394 }
395
396 return false;
397 }
398
399 VIATYPE GetViaType() const { return m_viaType; }
400 void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
401
402 bool HasHole() const override
403 {
404 return true;
405 }
406
407 std::shared_ptr<SHAPE_SEGMENT> GetEffectiveHoleShape() const override;
408
409 bool IsTented() const override;
410 int GetSolderMaskExpansion() const;
411
412 bool IsOnLayer( PCB_LAYER_ID aLayer, bool aIncludeCourtyards = false ) const override;
413
414 virtual LSET GetLayerSet() const override;
415 virtual void SetLayerSet( LSET aLayers ) override;
416
423 void SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer );
424
425 void SetBottomLayer( PCB_LAYER_ID aLayer );
426 void SetTopLayer( PCB_LAYER_ID aLayer );
427
435 void LayerPair( PCB_LAYER_ID* top_layer, PCB_LAYER_ID* bottom_layer ) const;
436
437 PCB_LAYER_ID TopLayer() const;
439
444 void SanitizeLayers();
445
446 VECTOR2I GetPosition() const override { return m_Start; }
447 void SetPosition( const VECTOR2I& aPoint ) override { m_Start = aPoint; m_End = aPoint; }
448
449 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
450
451 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
452 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
453
454 wxString GetClass() const override
455 {
456 return wxT( "PCB_VIA" );
457 }
458
459 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
460
461 BITMAPS GetMenuImage() const override;
462
463 EDA_ITEM* Clone() const override;
464
465 void ViewGetLayers( int aLayers[], int& aCount ) const override;
466
467 double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
468
469 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
470
471#if defined (DEBUG)
472 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
473#endif
474
475 int GetMinAnnulus( PCB_LAYER_ID aLayer, wxString* aSource ) const;
476
481 void SetRemoveUnconnected( bool aSet ) { m_removeUnconnectedLayer = aSet; }
483
487 void SetKeepStartEnd( bool aSet ) { m_keepStartEndLayer = aSet; }
488 bool GetKeepStartEnd() const { return m_keepStartEndLayer; }
489
491 {
493 return false;
494
495 if( m_keepStartEndLayer && ( aLayer == m_layer || aLayer == m_bottomLayer ) )
496 return false;
497
498 return true;
499 }
500
507 bool FlashLayer( int aLayer ) const;
508
516 bool FlashLayer( LSET aLayers ) const;
517
523 void SetDrill( int aDrill ) { m_drill = aDrill; }
524
530 int GetDrill() const { return m_drill; }
531
537 int GetDrillValue() const;
538
543
551 bool GetIsFree() const { return m_isFree; }
552 void SetIsFree( bool aFree = true ) { m_isFree = aFree; }
553
557 bool IsDrillDefault() const { return m_drill <= 0; }
558
559 // @copydoc BOARD_ITEM::GetEffectiveShape
560 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
561 FLASHING aFlash = FLASHING::DEFAULT ) const override;
562
564 {
566 }
567
569 {
570 return m_zoneLayerOverrides.at( aLayer );
571 }
572
574 {
575 std::unique_lock<std::mutex> cacheLock( m_zoneLayerOverridesMutex );
576 m_zoneLayerOverrides.at( aLayer ) = aOverride;
577 }
578
579protected:
580 void swapData( BOARD_ITEM* aImage ) override;
581
582 wxString layerMaskDescribe() const override;
583
584private:
587
589
591
594 bool m_isFree;
595
597 std::array<ZONE_LAYER_OVERRIDE, MAX_CU_LAYERS> m_zoneLayerOverrides;
598};
599
600
601#endif // CLASS_TRACK_H
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
ZONE_LAYER_OVERRIDE
Conditionally flashed vias and pads that interact with zones of different priority can be very squirr...
Definition: board_item.h:58
@ ZLO_NONE
Definition: board_item.h:59
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:71
PCB_LAYER_ID m_layer
Definition: board_item.h:345
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:85
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition: eda_item.h:165
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:69
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:536
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Definition: pad.h:59
virtual VECTOR2I GetPosition() const override
Definition: pcb_track.cpp:1132
virtual void swapData(BOARD_ITEM *aImage) override
Definition: pcb_track.cpp:1117
bool IsCCW() const
Definition: pcb_track.cpp:404
virtual double GetLength() const override
Return the length of the arc track.
Definition: pcb_track.h:353
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:76
EDA_ANGLE GetArcAngleStart() const
Definition: pcb_track.cpp:1156
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: pcb_track.cpp:1003
EDA_ANGLE GetArcAngleEnd() const
Definition: pcb_track.cpp:1163
void SetPosition(const VECTOR2I &aPos) override
Definition: pcb_track.h:319
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_track.h:303
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:339
void SetMid(const VECTOR2I &aMid)
Definition: pcb_track.h:316
double GetRadius() const
Definition: pcb_track.cpp:1139
EDA_ANGLE GetAngle() const
Definition: pcb_track.cpp:1146
const VECTOR2I & GetMid() const
Definition: pcb_track.h:317
PCB_ARC(BOARD_ITEM *aParent)
Definition: pcb_track.h:291
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:384
VECTOR2I m_Mid
Arc mid point, halfway between start and end.
Definition: pcb_track.h:364
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:298
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_track.cpp:326
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: pcb_track.cpp:1208
virtual VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: pcb_track.h:326
void Mirror(const VECTOR2I &aCentre, bool aMirrorAroundXAxis) override
Definition: pcb_track.cpp:349
double m_CachedScale
Last zoom scale used to draw this track's net.
Definition: pcb_track.h:284
double m_CachedLOD
Last LOD used to draw this track's net.
Definition: pcb_track.h:282
double GetCachedScale()
Get last used zoom scale for the track net name.
Definition: pcb_track.h:247
double GetCachedLOD()
Get last used LOD for the track net name.
Definition: pcb_track.h:227
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_track.cpp:319
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: pcb_track.cpp:661
int GetLocalClearance(wxString *aSource) const override
Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
Definition: pcb_track.cpp:164
void SetCachedScale(double aScale)
Set the cached scale.
Definition: pcb_track.h:257
void SetEndY(int aY)
Definition: pcb_track.h:116
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Definition: pcb_track.h:104
bool IsOnCopperLayer() const override
Definition: pcb_track.h:217
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_track.h:90
void SetWidth(int aWidth)
Definition: pcb_track.h:106
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:187
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: pcb_track.cpp:673
virtual double GetLength() const
Get the length of the track using the hypotenuse calculation.
Definition: pcb_track.cpp:313
int GetWidth() const
Definition: pcb_track.h:107
virtual void swapData(BOARD_ITEM *aImage) override
Definition: pcb_track.cpp:1110
void SetEnd(const VECTOR2I &aEnd)
Definition: pcb_track.h:109
void SetStart(const VECTOR2I &aStart)
Definition: pcb_track.h:112
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: pcb_track.cpp:1095
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: pcb_track.cpp:738
int GetEndX() const
Definition: pcb_track.h:118
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: pcb_track.cpp:439
bool ApproxCollinear(const PCB_TRACK &aTrack)
Definition: pcb_track.cpp:156
VECTOR2I m_End
Line end point.
Definition: pcb_track.h:280
void SetPosition(const VECTOR2I &aPos) override
Definition: pcb_track.h:102
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: pcb_track.cpp:856
virtual EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:61
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: pcb_track.cpp:267
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the track shape to a closed polygon.
Definition: pcb_track.cpp:1214
const VECTOR2I & GetStart() const
Definition: pcb_track.h:113
VECTOR2I m_Start
Line start point.
Definition: pcb_track.h:279
int GetEndY() const
Definition: pcb_track.h:119
wxString GetFriendlyName() const override
Definition: pcb_track.cpp:844
VECTOR2I GetPosition() const override
Definition: pcb_track.h:103
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: pcb_track.cpp:1105
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:366
void SetCachedLOD(double aLOD)
Set the cached LOD.
Definition: pcb_track.h:237
const VECTOR2I & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
Definition: pcb_track.h:122
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: pcb_track.cpp:997
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:81
bool IsNull() const
Return true if segment length is zero.
Definition: pcb_track.h:171
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: pcb_track.cpp:1188
const VECTOR2I & GetEnd() const
Definition: pcb_track.h:110
int m_Width
Thickness of track, or via diameter.
Definition: pcb_track.h:278
MINOPTMAX< int > GetWidthConstraint(wxString *aSource=nullptr) const
Definition: pcb_track.cpp:171
void SetEndX(int aX)
Definition: pcb_track.h:115
virtual void Mirror(const VECTOR2I &aCentre, bool aMirrorAroundXAxis)
Definition: pcb_track.cpp:334
EDA_ITEM_FLAGS IsPointOnEnds(const VECTOR2I &point, int min_dist=0) const
Return STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if point if near (dist = m...
Definition: pcb_track.cpp:235
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
Definition: pcb_track.cpp:958
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
Definition: pcb_track.h:481
bool IsTented() const override
Definition: pcb_track.cpp:461
bool GetIsFree() const
Check if the via is a free via (as opposed to one created on a track by the router).
Definition: pcb_track.h:551
PCB_LAYER_ID BottomLayer() const
Definition: pcb_track.cpp:597
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: pcb_track.cpp:150
VECTOR2I GetPosition() const override
Definition: pcb_track.h:446
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: pcb_track.cpp:1194
bool GetRemoveUnconnected() const
Definition: pcb_track.h:482
bool FlashLayer(int aLayer) const
Check to see whether the via should have a pad on the specific layer.
Definition: pcb_track.cpp:628
void SetKeepStartEnd(bool aSet)
Sets whether we keep the start and end annular rings even if they are not connected.
Definition: pcb_track.h:487
void SetDrillDefault()
Set the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
Definition: pcb_track.h:542
void ClearZoneLayerOverrides()
Definition: pcb_track.h:563
PCB_LAYER_ID m_bottomLayer
The bottom layer of the via (the top layer is in m_layer)
Definition: pcb_track.h:586
int GetDrill() const
Return the local drill setting for this PCB_VIA.
Definition: pcb_track.h:530
bool m_isFree
"Free" vias don't get their nets auto-updated
Definition: pcb_track.h:594
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: pcb_track.cpp:1039
virtual void SetLayerSet(LSET aLayers) override
Definition: pcb_track.cpp:531
void SetBottomLayer(PCB_LAYER_ID aLayer)
Definition: pcb_track.cpp:563
std::array< ZONE_LAYER_OVERRIDE, MAX_CU_LAYERS > m_zoneLayerOverrides
Definition: pcb_track.h:597
int GetSolderMaskExpansion() const
Definition: pcb_track.cpp:472
void SetDrill(int aDrill)
Set the drill value for vias.
Definition: pcb_track.h:523
void SetIsFree(bool aFree=true)
Definition: pcb_track.h:552
bool IsOnLayer(PCB_LAYER_ID aLayer, bool aIncludeCourtyards=false) const override
Test to see if this object is on the given layer.
Definition: pcb_track.cpp:483
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: pcb_track.cpp:923
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:129
int m_drill
for vias: via drill (- 1 for default value)
Definition: pcb_track.h:590
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: pcb_track.cpp:774
std::mutex m_zoneLayerOverridesMutex
Definition: pcb_track.h:596
void SetTopLayer(PCB_LAYER_ID aLayer)
Definition: pcb_track.cpp:557
void SetPosition(const VECTOR2I &aPoint) override
Definition: pcb_track.h:447
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
Definition: pcb_track.cpp:455
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
For a via m_layer contains the top layer, the other layer is in m_bottomLayer/.
Definition: pcb_track.cpp:548
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: pcb_track.h:381
bool m_removeUnconnectedLayer
Remove annular rings on unconnected layers.
Definition: pcb_track.h:592
bool GetKeepStartEnd() const
Definition: pcb_track.h:488
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:373
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: pcb_track.cpp:752
bool HasHole() const override
Definition: pcb_track.h:402
void SanitizeLayers()
Check so that the layers are correct depending on the type of via, and so that the top actually is on...
Definition: pcb_track.cpp:603
PCB_VIA & operator=(const PCB_VIA &aOther)
Definition: pcb_track.cpp:108
void swapData(BOARD_ITEM *aImage) override
Definition: pcb_track.cpp:1124
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:454
bool ConditionallyFlashed(PCB_LAYER_ID aLayer) const
Definition: pcb_track.h:490
wxString layerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.
Definition: pcb_track.cpp:985
void SetViaType(VIATYPE aViaType)
Definition: pcb_track.h:400
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
Definition: pcb_track.cpp:189
PCB_LAYER_ID TopLayer() const
Definition: pcb_track.cpp:591
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: pcb_track.cpp:135
VIATYPE m_viaType
through, blind/buried or micro
Definition: pcb_track.h:588
bool m_keepStartEndLayer
Keep the start and end annular rings.
Definition: pcb_track.h:593
int GetDrillValue() const
Calculate the drill value for vias (m-Drill if > 0, or default drill value for the board.
Definition: pcb_track.cpp:220
void SetZoneLayerOverride(PCB_LAYER_ID aLayer, ZONE_LAYER_OVERRIDE aOverride)
Definition: pcb_track.h:573
VIATYPE GetViaType() const
Definition: pcb_track.h:399
bool IsDrillDefault() const
Definition: pcb_track.h:557
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pcb_track.cpp:505
const ZONE_LAYER_OVERRIDE & GetZoneLayerOverride(PCB_LAYER_ID aLayer) const
Definition: pcb_track.h:568
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Return the 2 layers used by the via (the via actually uses all layers between these 2 layers)
Definition: pcb_track.cpp:569
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:413
Represent a set of closed polygons.
INSPECT_RESULT
Definition: eda_item.h:42
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:78
std::uint32_t EDA_ITEM_FLAGS
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:147
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ UNDEFINED_LAYER
Definition: layer_ids.h:60
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition: eda_angle.h:418
VIATYPE
Definition: pcb_track.h:64
@ BLIND_BURIED
ENDPOINT_T
Definition: pcb_track.h:57
@ ENDPOINT_END
Definition: pcb_track.h:59
@ ENDPOINT_START
Definition: pcb_track.h:58
#define UNDEFINED_DRILL_DIAMETER
Definition: pcb_track.h:72
bool operator()(const PCB_TRACK *aFirst, const PCB_TRACK *aSecond) const
Definition: pcb_track.cpp:1170
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:93
@ PCB_LOCATE_BBVIA_T
Definition: typeinfo.h:113
@ PCB_LOCATE_STDVIA_T
Definition: typeinfo.h:111
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:94
@ PCB_LOCATE_UVIA_T
Definition: typeinfo.h:112
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:92