KiCad PCB EDA Suite
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-2022 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
40#include <base_units.h>
42#include "core/minoptmax.h"
43
44class PCB_TRACK;
45class PCB_VIA;
46class PAD;
47class MSG_PANEL_ITEM;
48class SHAPE_POLY_SET;
49class SHAPE_ARC;
50
51
52// Flag used in locate routines (from which endpoint work)
53enum ENDPOINT_T : int
54{
56 ENDPOINT_END = 1
57};
58
59// Via types
60// Note that this enum must be synchronized to GAL_LAYER_ID
61enum class VIATYPE : int
62{
63 THROUGH = 3, /* Always a through hole via */
64 BLIND_BURIED = 2, /* this via can be on internal layers */
65 MICROVIA = 1, /* this via which connect from an external layer
66 * to the near neighbor internal layer */
67 NOT_DEFINED = 0 /* not yet used */
68};
69
70#define UNDEFINED_DRILL_DIAMETER -1 //< Undefined via drill diameter.
71
72// Used for tracks and vias for algorithmic safety, not to enforce constraints
73#define GEOMETRY_MIN_SIZE (int) ( 0.001 * pcbIUScale.IU_PER_MM )
74
75
77{
78public:
79 static inline bool ClassOf( const EDA_ITEM* aItem )
80 {
81 return aItem && PCB_TRACE_T == aItem->Type();
82 }
83
84 PCB_TRACK( BOARD_ITEM* aParent, KICAD_T idtype = PCB_TRACE_T );
85
86 // Do not create a copy constructor. The one generated by the compiler is adequate.
87
88 void Move( const VECTOR2I& aMoveVector ) override
89 {
90 m_Start += aMoveVector;
91 m_End += aMoveVector;
92 }
93
94 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
95
96 virtual void Mirror( const VECTOR2I& aCentre, bool aMirrorAroundXAxis );
97
98 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
99
100 void SetPosition( const VECTOR2I& aPos ) override { m_Start = aPos; }
101 VECTOR2I GetPosition() const override { return m_Start; }
102 const VECTOR2I GetFocusPosition() const override { return ( m_Start + m_End ) / 2; }
103
104 void SetWidth( int aWidth ) { m_Width = aWidth; }
105 int GetWidth() const { return m_Width; }
106
107 void SetEnd( const VECTOR2I& aEnd ) { m_End = aEnd; }
108 const VECTOR2I& GetEnd() const { return m_End; }
109
110 void SetStart( const VECTOR2I& aStart ) { m_Start = aStart; }
111 const VECTOR2I& GetStart() const { return m_Start; }
112
113 void SetEndX( int aX ) { m_End.x = aX; }
114 void SetEndY( int aY ) { m_End.y = aY; }
115
116 int GetEndX() const { return m_End.x; }
117 int GetEndY() const { return m_End.y; }
118
120 const VECTOR2I& GetEndPoint( ENDPOINT_T aEndPoint ) const
121 {
122 if( aEndPoint == ENDPOINT_START )
123 return m_Start;
124 else
125 return m_End;
126 }
127
128 // Virtual function
129 const BOX2I GetBoundingBox() const override;
130
136 virtual double GetLength() const;
137
150 PCB_LAYER_ID aLayer, int aClearanceValue,
151 int aError, ERROR_LOC aErrorLoc,
152 bool ignoreLineWidth = false ) const override;
153
154 // @copydoc BOARD_ITEM::GetEffectiveShape
155 virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
156 FLASHING aFlash = FLASHING::DEFAULT ) const override;
157
165 EDA_ITEM_FLAGS IsPointOnEnds( const VECTOR2I& point, int min_dist = 0 ) const;
166
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
178 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
179 const std::vector<KICAD_T>& aScanTypes ) override;
180
181 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
182 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
183
184 bool ApproxCollinear( const PCB_TRACK& aTrack );
185
186 wxString GetClass() const override
187 {
188 return wxT( "PCB_TRACK" );
189 }
190
197 int GetLocalClearance( wxString* aSource ) const override;
198
199 MINOPTMAX<int> GetWidthConstraint( wxString* aSource ) const;
200
201 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
202
203 BITMAPS GetMenuImage() const override;
204
205 virtual EDA_ITEM* Clone() const override;
206
207 virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
208
209 double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
210
211 const BOX2I ViewBBox() const override;
212
213 virtual void SwapData( BOARD_ITEM* aImage ) override;
214
218 bool IsOnCopperLayer() const override
219 {
220 return true;
221 }
222
224 {
225 bool operator()( const PCB_TRACK* aFirst, const PCB_TRACK* aSecond ) const;
226 };
227
228#if defined (DEBUG)
229 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
230#endif
231
232protected:
233 void GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) const;
234
235public:
237
238protected:
242};
243
244
245class PCB_ARC : public PCB_TRACK
246{
247public:
248 PCB_ARC( BOARD_ITEM* aParent ) :
249 PCB_TRACK( aParent, PCB_ARC_T )
250 {
251 };
252
253 PCB_ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc );
254
255 static inline bool ClassOf( const EDA_ITEM *aItem )
256 {
257 return aItem && PCB_ARC_T == aItem->Type();
258 }
259
260 virtual void Move( const VECTOR2I& aMoveVector ) override
261 {
262 m_Start += aMoveVector;
263 m_Mid += aMoveVector;
264 m_End += aMoveVector;
265 }
266
267 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
268
269 void Mirror( const VECTOR2I& aCentre, bool aMirrorAroundXAxis ) override;
270
271 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
272
273 void SetMid( const VECTOR2I& aMid ) { m_Mid = aMid; }
274 const VECTOR2I& GetMid() const { return m_Mid; }
275
276 void SetPosition( const VECTOR2I& aPos ) override
277 {
278 m_Start = aPos;
279 }
280
281 virtual VECTOR2I GetPosition() const override;
282
283 virtual VECTOR2I GetCenter() const override { return GetPosition(); }
284
285 double GetRadius() const;
286 EDA_ANGLE GetAngle() const;
289 virtual bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
290
291 virtual bool HitTest( const BOX2I& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
292
293 bool IsCCW() const;
294
295 wxString GetClass() const override
296 {
297 return wxT( "PCB_ARC" );
298 }
299
300 // @copydoc BOARD_ITEM::GetEffectiveShape
301 virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
302 FLASHING aFlash = FLASHING::DEFAULT ) const override;
303
309 virtual double GetLength() const override
310 {
311 return GetRadius() * std::abs( GetAngle().AsRadians() );
312 }
313
314 EDA_ITEM* Clone() const override;
315
316 virtual void SwapData( BOARD_ITEM* aImage ) override;
317
318private:
320};
321
322
323class PCB_VIA : public PCB_TRACK
324{
325public:
326 PCB_VIA( BOARD_ITEM* aParent );
327
328 static inline bool ClassOf( const EDA_ITEM *aItem )
329 {
330 return aItem && PCB_VIA_T == aItem->Type();
331 }
332
333 // Do not create a copy constructor. The one generated by the compiler is adequate.
334
335 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
336 {
337 if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
338 return true;
339
340 for( KICAD_T scanType : aScanTypes )
341 {
342 if( scanType == PCB_LOCATE_STDVIA_T && m_viaType == VIATYPE::THROUGH )
343 return true;
344 else if( scanType == PCB_LOCATE_UVIA_T && m_viaType == VIATYPE::MICROVIA )
345 return true;
346 else if( scanType == PCB_LOCATE_BBVIA_T && m_viaType == VIATYPE::BLIND_BURIED )
347 return true;
348 }
349
350 return false;
351 }
352
353 VIATYPE GetViaType() const { return m_viaType; }
354 void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
355
356 bool HasHole() const override
357 {
358 return true;
359 }
360
361 std::shared_ptr<SHAPE_SEGMENT> GetEffectiveHoleShape() const override;
362
363 bool IsTented() const override;
364 int GetSolderMaskExpansion() const;
365
366 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
367
368 virtual LSET GetLayerSet() const override;
369 virtual void SetLayerSet( LSET aLayers ) override;
370
377 void SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer );
378
379 void SetBottomLayer( PCB_LAYER_ID aLayer );
380 void SetTopLayer( PCB_LAYER_ID aLayer );
381
389 void LayerPair( PCB_LAYER_ID* top_layer, PCB_LAYER_ID* bottom_layer ) const;
390
391 PCB_LAYER_ID TopLayer() const;
393
399 void SanitizeLayers();
400
401 VECTOR2I GetPosition() const override { return m_Start; }
402 void SetPosition( const VECTOR2I& aPoint ) override { m_Start = aPoint; m_End = aPoint; }
403
404 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
405
406 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
407 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
408
409 wxString GetClass() const override
410 {
411 return wxT( "PCB_VIA" );
412 }
413
414 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
415
416 BITMAPS GetMenuImage() const override;
417
418 EDA_ITEM* Clone() const override;
419
420 void ViewGetLayers( int aLayers[], int& aCount ) const override;
421
422 double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
423
424 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
425
426#if defined (DEBUG)
427 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
428#endif
429
430 int GetMinAnnulus( PCB_LAYER_ID aLayer, wxString* aSource ) const;
431
436 void SetRemoveUnconnected( bool aSet ) { m_removeUnconnectedLayer = aSet; }
438
442 void SetKeepTopBottom( bool aSet ) { m_keepTopBottomLayer = aSet; }
443 bool GetKeepTopBottom() const { return m_keepTopBottomLayer; }
444
450 bool FlashLayer( int aLayer ) const;
451
457 bool FlashLayer( LSET aLayers ) const;
458
464 void SetDrill( int aDrill ) { m_drill = aDrill; }
465
471 int GetDrill() const { return m_drill; }
472
479 int GetDrillValue() const;
480
486
492 bool GetIsFree() const { return m_isFree; }
493 void SetIsFree( bool aFree = true ) { m_isFree = aFree; }
494
499 bool IsDrillDefault() const { return m_drill <= 0; }
500
501 void SwapData( BOARD_ITEM* aImage ) override;
502
503 // @copydoc BOARD_ITEM::GetEffectiveShape
504 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
505 FLASHING aFlash = FLASHING::DEFAULT ) const override;
506
507protected:
508 wxString layerMaskDescribe() const override;
509
510private:
513
515
517
520 bool m_isFree;
521};
522
523
524#endif // CLASS_TRACK_H
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
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:50
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:183
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:530
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Definition: pad.h:58
virtual VECTOR2I GetPosition() const override
Definition: pcb_track.cpp:1088
bool IsCCW() const
Definition: pcb_track.cpp:369
virtual double GetLength() const override
Function GetLength returns the length of the arc track.
Definition: pcb_track.h:309
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:74
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: pcb_track.cpp:1073
EDA_ANGLE GetArcAngleStart() const
Definition: pcb_track.cpp:1109
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:959
EDA_ANGLE GetArcAngleEnd() const
Definition: pcb_track.cpp:1115
void SetPosition(const VECTOR2I &aPos) override
Definition: pcb_track.h:276
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_track.h:260
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:295
void SetMid(const VECTOR2I &aMid)
Definition: pcb_track.h:273
double GetRadius() const
Definition: pcb_track.cpp:1094
EDA_ANGLE GetAngle() const
Definition: pcb_track.cpp:1100
const VECTOR2I & GetMid() const
Definition: pcb_track.h:274
PCB_ARC(BOARD_ITEM *aParent)
Definition: pcb_track.h:248
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:349
VECTOR2I m_Mid
Arc mid point, halfway between start and end.
Definition: pcb_track.h:319
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:255
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_track.cpp:291
virtual 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:1165
virtual VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: pcb_track.h:283
void Mirror(const VECTOR2I &aCentre, bool aMirrorAroundXAxis) override
Definition: pcb_track.cpp:314
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_track.cpp:284
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:626
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearance overrides set in the "classic" (ie: pre-rule) ...
Definition: pcb_track.cpp:129
void SetEndY(int aY)
Definition: pcb_track.h:114
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: pcb_track.cpp:1066
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Definition: pcb_track.h:102
bool IsOnCopperLayer() const override
Definition: pcb_track.h:218
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_track.h:88
void SetWidth(int aWidth)
Definition: pcb_track.h:104
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:186
MINOPTMAX< int > GetWidthConstraint(wxString *aSource) const
Definition: pcb_track.cpp:136
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: pcb_track.cpp:638
virtual double GetLength() const
Function GetLength returns the length of the track using the hypotenuse calculation.
Definition: pcb_track.cpp:278
int GetWidth() const
Definition: pcb_track.h:105
void SetEnd(const VECTOR2I &aEnd)
Definition: pcb_track.h:107
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: pcb_track.cpp:1051
void SetStart(const VECTOR2I &aStart)
Definition: pcb_track.h:110
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Function TransformShapeWithClearanceToPolygon Convert the track shape to a closed polygon Used in fil...
Definition: pcb_track.cpp:1171
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: pcb_track.cpp:698
int GetEndX() const
Definition: pcb_track.h:116
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:405
bool ApproxCollinear(const PCB_TRACK &aTrack)
Definition: pcb_track.cpp:121
VECTOR2I m_End
Line end point.
Definition: pcb_track.h:241
void SetPosition(const VECTOR2I &aPos) override
Definition: pcb_track.h:100
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:810
virtual EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:59
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: pcb_track.cpp:232
const VECTOR2I & GetStart() const
Definition: pcb_track.h:111
VECTOR2I m_Start
Line start point.
Definition: pcb_track.h:240
int GetEndY() const
Definition: pcb_track.h:117
VECTOR2I GetPosition() const override
Definition: pcb_track.h:101
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: pcb_track.cpp:1061
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:331
VECTOR2I m_LastNetnamePosition
Definition: pcb_track.h:236
const VECTOR2I & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
Definition: pcb_track.h:120
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:953
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:79
bool IsNull() const
Function IsNull returns true if segment length is zero.
Definition: pcb_track.h:171
virtual 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:1140
const VECTOR2I & GetEnd() const
Definition: pcb_track.h:108
PCB_TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
Definition: pcb_track.cpp:52
int m_Width
Thickness of track, or via diameter.
Definition: pcb_track.h:239
void SetEndX(int aX)
Definition: pcb_track.h:113
virtual void Mirror(const VECTOR2I &aCentre, bool aMirrorAroundXAxis)
Definition: pcb_track.cpp:299
EDA_ITEM_FLAGS IsPointOnEnds(const VECTOR2I &point, int min_dist=0) const
Function IsPointOnEnds returns STARTPOINT if point if near (dist = min_dist) start point,...
Definition: pcb_track.cpp:200
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
Definition: pcb_track.cpp:914
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
Definition: pcb_track.h:436
bool IsTented() const override
Definition: pcb_track.cpp:427
bool GetIsFree() const
Checks if the via is a free via (as opposed to one created on a track by the router).
Definition: pcb_track.h:492
PCB_LAYER_ID BottomLayer() const
Definition: pcb_track.cpp:563
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: pcb_track.cpp:115
VECTOR2I GetPosition() const override
Definition: pcb_track.h:401
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:1146
bool GetRemoveUnconnected() const
Definition: pcb_track.h:437
bool FlashLayer(int aLayer) const
Checks to see whether the via should have a pad on the specific layer.
Definition: pcb_track.cpp:594
void SetDrillDefault()
Function SetDrillDefault sets the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
Definition: pcb_track.h:485
PCB_LAYER_ID m_bottomLayer
The bottom layer of the via (the top layer is in m_layer)
Definition: pcb_track.h:512
int GetDrill() const
Function GetDrill returns the local drill setting for this PCB_VIA.
Definition: pcb_track.h:471
bool m_isFree
"Free" vias don't get their nets auto-updated
Definition: pcb_track.h:520
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:995
virtual void SetLayerSet(LSET aLayers) override
Definition: pcb_track.cpp:497
void SetBottomLayer(PCB_LAYER_ID aLayer)
Definition: pcb_track.cpp:529
void SetKeepTopBottom(bool aSet)
Sets whether we keep the top and bottom connections even if they are not connected.
Definition: pcb_track.h:442
int GetSolderMaskExpansion() const
Definition: pcb_track.cpp:438
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: pcb_track.cpp:98
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: pcb_track.h:464
void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: pcb_track.cpp:1080
void SetIsFree(bool aFree=true)
Definition: pcb_track.h:493
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:879
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:92
int m_drill
for vias: via drill (- 1 for default value)
Definition: pcb_track.h:516
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: pcb_track.cpp:734
void SetTopLayer(PCB_LAYER_ID aLayer)
Definition: pcb_track.cpp:523
void SetPosition(const VECTOR2I &aPoint) override
Definition: pcb_track.h:402
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
Definition: pcb_track.cpp:421
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
Function SetLayerPair For a via m_layer contains the top layer, the other layer is in m_bottomLayer.
Definition: pcb_track.cpp:514
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: pcb_track.h:335
bool m_removeUnconnectedLayer
Remove unconnected copper on a via.
Definition: pcb_track.h:518
bool GetKeepTopBottom() const
Definition: pcb_track.h:443
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:328
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:712
bool HasHole() const override
Definition: pcb_track.h:356
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
Definition: pcb_track.cpp:569
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:409
PCB_VIA(BOARD_ITEM *aParent)
Definition: pcb_track.cpp:80
wxString layerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.
Definition: pcb_track.cpp:941
void SetViaType(VIATYPE aViaType)
Definition: pcb_track.h:354
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
Definition: pcb_track.cpp:154
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: pcb_track.cpp:449
PCB_LAYER_ID TopLayer() const
Definition: pcb_track.cpp:557
VIATYPE m_viaType
through, blind/buried or micro
Definition: pcb_track.h:514
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: pcb_track.cpp:185
bool m_keepTopBottomLayer
Keep the top and bottom annular rings.
Definition: pcb_track.h:519
VIATYPE GetViaType() const
Definition: pcb_track.h:353
bool IsDrillDefault() const
Function IsDrillDefault.
Definition: pcb_track.h:499
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pcb_track.cpp:471
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Function LayerPair Return the 2 layers used by the via (the via actually uses all layers between thes...
Definition: pcb_track.cpp:535
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:378
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:401
VIATYPE
Definition: pcb_track.h:62
@ BLIND_BURIED
ENDPOINT_T
Definition: pcb_track.h:54
@ ENDPOINT_END
Definition: pcb_track.h:56
@ ENDPOINT_START
Definition: pcb_track.h:55
#define UNDEFINED_DRILL_DIAMETER
Definition: pcb_track.h:70
bool operator()(const PCB_TRACK *aFirst, const PCB_TRACK *aSecond) const
Definition: pcb_track.cpp:1122
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:102
@ PCB_LOCATE_BBVIA_T
Definition: typeinfo.h:122
@ PCB_LOCATE_STDVIA_T
Definition: typeinfo.h:120
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:103
@ PCB_LOCATE_UVIA_T
Definition: typeinfo.h:121
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:101