KiCad PCB EDA Suite
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, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 1992-2020 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 
36 #ifndef CLASS_TRACK_H
37 #define CLASS_TRACK_H
38 
39 
40 #include <board_connected_item.h>
41 #include <board_item.h>
42 #include <convert_to_biu.h>
43 #include <pcb_display_options.h>
44 #include <pcbnew.h>
45 
46 #include <geometry/seg.h>
47 #include <geometry/shape_arc.h>
48 
49 #include <trigo.h>
50 
51 
52 class TRACK;
53 class VIA;
54 class PAD;
55 class MSG_PANEL_ITEM;
56 class SHAPE_POLY_SET;
57 
58 
59 // Flag used in locate routines (from which endpoint work)
60 enum ENDPOINT_T : int
61 {
64 };
65 
66 // Via types
67 // Note that this enum must be synchronized to GAL_LAYER_ID
68 enum class VIATYPE : int
69 {
70  THROUGH = 3, /* Always a through hole via */
71  BLIND_BURIED = 2, /* this via can be on internal layers */
72  MICROVIA = 1, /* this via which connect from an external layer
73  * to the near neighbor internal layer */
74  NOT_DEFINED = 0 /* not yet used */
75 };
76 
77 #define UNDEFINED_DRILL_DIAMETER -1 //< Undefined via drill diameter.
78 
79 // Used for tracks and vias for algorithmic safety, not to enforce constraints
80 #define GEOMETRY_MIN_SIZE ( int )( 0.001 * IU_PER_MM )
81 
82 
84 {
85 public:
86  static inline bool ClassOf( const EDA_ITEM* aItem )
87  {
88  return aItem && PCB_TRACE_T == aItem->Type();
89  }
90 
91  TRACK( BOARD_ITEM* aParent, KICAD_T idtype = PCB_TRACE_T );
92 
93  // Do not create a copy constructor. The one generated by the compiler is adequate.
94 
95  void Move( const wxPoint& aMoveVector ) override
96  {
97  m_Start += aMoveVector;
98  m_End += aMoveVector;
99  }
100 
101  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
102 
103  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
104 
105  void SetPosition( const wxPoint& aPos ) override { m_Start = aPos; }
106  wxPoint GetPosition() const override { return m_Start; }
107  const wxPoint GetFocusPosition() const override { return ( m_Start + m_End ) / 2; }
108 
109  void SetWidth( int aWidth ) { m_Width = aWidth; }
110  int GetWidth() const { return m_Width; }
111 
112  void SetEnd( const wxPoint& aEnd ) { m_End = aEnd; }
113  const wxPoint& GetEnd() const { return m_End; }
114 
115  void SetStart( const wxPoint& aStart ) { m_Start = aStart; }
116  const wxPoint& GetStart() const { return m_Start; }
117 
118  void SetEndX( int aX ) { m_End.x = aX; }
119  void SetEndY( int aY ) { m_End.y = aY; }
120 
121  int GetEndX() const { return m_End.x; }
122  int GetEndY() const { return m_End.y; }
123 
125  const wxPoint& GetEndPoint( ENDPOINT_T aEndPoint ) const
126  {
127  if( aEndPoint == ENDPOINT_START )
128  return m_Start;
129  else
130  return m_End;
131  }
132 
133  // Virtual function
134  const EDA_RECT GetBoundingBox() const override;
135 
141  virtual double GetLength() const
142  {
143  return GetLineLength( m_Start, m_End );
144  }
145 
158  PCB_LAYER_ID aLayer, int aClearanceValue,
159  int aError, ERROR_LOC aErrorLoc,
160  bool ignoreLineWidth = false ) const override;
161 
162  // @copydoc BOARD_ITEM::GetEffectiveShape
163  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
164 
172  STATUS_FLAGS IsPointOnEnds( const wxPoint& point, int min_dist = 0 ) const;
173 
178  bool IsNull() const
179  {
180  return ( Type() == PCB_VIA_T ) || ( m_Start == m_End );
181  }
182 
183  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
184 
185  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
186 
187  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
188  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
189 
190  bool ApproxCollinear( const TRACK& aTrack )
191  {
192  SEG a( m_Start, m_End );
193  SEG b( aTrack.GetStart(), aTrack.GetEnd() );
194  return a.ApproxCollinear( b );
195  }
196 
197  wxString GetClass() const override
198  {
199  return wxT( "TRACK" );
200  }
201 
208  int GetLocalClearance( wxString* aSource ) const override;
209 
210  void GetWidthConstraints( int* aMin, int* aMax, wxString* aSource ) const;
211 
212  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
213 
214  BITMAP_DEF GetMenuImage() const override;
215 
216  virtual EDA_ITEM* Clone() const override;
217 
218  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
219 
220  double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
221 
222  const BOX2I ViewBBox() const override;
223 
224  virtual void SwapData( BOARD_ITEM* aImage ) override;
225 
229  bool IsOnCopperLayer() const override
230  {
231  return true;
232  }
233 
234  struct cmp_tracks
235  {
236  bool operator()( const TRACK* aFirst, const TRACK* aSecond ) const;
237  };
238 
239 #if defined (DEBUG)
240  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
241 
247  static wxString ShowState( int stateBits );
248 
249 #endif
250 
251 protected:
252  void GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) const;
253 
254 
255  int m_Width;
256  wxPoint m_Start;
257  wxPoint m_End;
258 
259 };
260 
261 
262 class ARC : public TRACK
263 {
264 public:
265  ARC( BOARD_ITEM* aParent ) : TRACK( aParent, PCB_ARC_T ){};
266 
267  ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc ) :
268  TRACK( aParent, PCB_ARC_T )
269  {
270  m_Start = wxPoint( aArc->GetP0() );
271  m_End = wxPoint( aArc->GetP1() );
272  m_Mid = wxPoint( aArc->GetArcMid() );
273  }
274 
275  static inline bool ClassOf( const EDA_ITEM *aItem )
276  {
277  return aItem && PCB_ARC_T == aItem->Type();
278  }
279 
280  virtual void Move( const wxPoint& aMoveVector ) override
281  {
282  m_Start += aMoveVector;
283  m_Mid += aMoveVector;
284  m_End += aMoveVector;
285  }
286 
287  virtual void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
288 
289  virtual void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
290 
291  void SetMid( const wxPoint& aMid ) { m_Mid = aMid; }
292  const wxPoint& GetMid() const { return m_Mid; }
293 
294  void SetPosition( const wxPoint& aPos ) override
295  {
296  m_Start = aPos;
297  }
298 
299  virtual wxPoint GetPosition() const override;
300 
301  virtual wxPoint GetCenter() const override { return GetPosition(); }
302 
303  double GetRadius() const;
304  double GetAngle() const;
305  double GetArcAngleStart() const;
306  double GetArcAngleEnd() const;
307  virtual bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
308 
309  virtual bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
310 
311  wxString GetClass() const override
312  {
313  return wxT( "ARC" );
314  }
315 
316  // @copydoc BOARD_ITEM::GetEffectiveShape
317  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
318 
319  //TODO(snh): Add GetSelectMenuText() and GetMsgPanelInfoBase()
320 
326  virtual double GetLength() const override
327  {
328  double radius = GetRadius();
329  double includedAngle = std::abs( GetAngle() );
330 
331  return radius * M_PI * includedAngle / 180.0;
332  }
333 
334  EDA_ITEM* Clone() const override;
335 
336  virtual void SwapData( BOARD_ITEM* aImage ) override;
337 
338 private:
339  wxPoint m_Mid;
340 };
341 
342 
343 class VIA : public TRACK
344 {
345 public:
346  VIA( BOARD_ITEM* aParent );
347 
348  static inline bool ClassOf( const EDA_ITEM *aItem )
349  {
350  return aItem && PCB_VIA_T == aItem->Type();
351  }
352 
353  // Do not create a copy constructor. The one generated by the compiler is adequate.
354 
355  bool IsType( const KICAD_T aScanTypes[] ) const override
356  {
357  if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
358  return true;
359 
360  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
361  {
363  return true;
364  else if( *p == PCB_LOCATE_UVIA_T && m_viaType == VIATYPE::MICROVIA )
365  return true;
366  else if( *p == PCB_LOCATE_BBVIA_T && m_viaType == VIATYPE::BLIND_BURIED )
367  return true;
368  }
369 
370  return false;
371  }
372 
373  VIATYPE GetViaType() const { return m_viaType; }
374  void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
375 
376  bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
377 
378  virtual LSET GetLayerSet() const override;
379  virtual void SetLayerSet( LSET aLayers ) override;
380 
387  void SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer );
388 
389  void SetBottomLayer( PCB_LAYER_ID aLayer );
390  void SetTopLayer( PCB_LAYER_ID aLayer );
391 
399  void LayerPair( PCB_LAYER_ID* top_layer, PCB_LAYER_ID* bottom_layer ) const;
400 
401  PCB_LAYER_ID TopLayer() const;
402  PCB_LAYER_ID BottomLayer() const;
403 
409  void SanitizeLayers();
410 
411  wxPoint GetPosition() const override { return m_Start; }
412  void SetPosition( const wxPoint& aPoint ) override { m_Start = aPoint; m_End = aPoint; }
413 
414  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
415 
416  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
417  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
418 
419  wxString GetClass() const override
420  {
421  return wxT( "VIA" );
422  }
423 
424  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
425 
426  BITMAP_DEF GetMenuImage() const override;
427 
428  EDA_ITEM* Clone() const override;
429 
430  void ViewGetLayers( int aLayers[], int& aCount ) const override;
431 
432  double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
433 
434  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
435 
436 #if defined (DEBUG)
437  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
438 #endif
439 
440  int GetMinAnnulus( PCB_LAYER_ID aLayer, wxString* aSource ) const;
441 
446  void SetRemoveUnconnected( bool aSet ) { m_removeUnconnectedLayer = aSet; }
448 
452  void SetKeepTopBottom( bool aSet ) { m_keepTopBottomLayer = aSet; }
453  bool GetKeepTopBottom() const { return m_keepTopBottomLayer; }
454 
460  bool FlashLayer( int aLayer ) const;
461 
467  bool FlashLayer( LSET aLayers ) const;
468 
474  void SetDrill( int aDrill ) { m_drill = aDrill; }
475 
481  int GetDrill() const { return m_drill; }
482 
489  int GetDrillValue() const;
490 
496 
502  bool GetIsFree() const { return m_isFree; }
503  void SetIsFree( bool aFree = true ) { m_isFree = aFree; }
504 
509  bool IsDrillDefault() const { return m_drill <= 0; }
510 
511  void SwapData( BOARD_ITEM* aImage ) override;
512 
513  // @copydoc BOARD_ITEM::GetEffectiveShape
514  std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
515 
516 protected:
517  wxString layerMaskDescribe() const override;
518 
519 private:
522 
524 
525  int m_drill;
526 
529  bool m_isFree;
530 };
531 
532 
533 #endif // CLASS_TRACK_H
virtual void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
Definition: track.cpp:273
void GetWidthConstraints(int *aMin, int *aMax, wxString *aSource) const
Definition: track.cpp:114
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: track.cpp:435
Definition: track.h:343
virtual wxPoint GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: track.h:301
void SetPosition(const wxPoint &aPos) override
Definition: track.h:294
ENDPOINT_T
Definition: track.h:60
wxPoint m_Start
Line start point.
Definition: track.h:256
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
Definition: track.cpp:736
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:223
void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: track.cpp:908
bool m_isFree
"Free" vias don't get their nets auto-updated
Definition: track.h:529
PNG memory record (file in memory).
Definition: bitmap_def.h:29
static bool ClassOf(const EDA_ITEM *aItem)
Definition: track.h:86
VIATYPE m_viaType
through, blind/buried or micro
Definition: track.h:523
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: track.cpp:376
bool IsOnCopperLayer() const override
Definition: track.h:229
wxString GetClass() const override
Return the class name.
Definition: track.h:311
void SetPosition(const wxPoint &aPoint) override
Definition: track.h:412
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
void SetEnd(const wxPoint &aEnd)
Definition: track.h:112
const wxPoint & GetStart() const
Definition: track.h:116
int m_drill
for vias: via drill (- 1 for default value)
Definition: track.h:525
bool IsDrillDefault() const
Function IsDrillDefault.
Definition: track.h:509
bool operator()(const TRACK *aFirst, const TRACK *aSecond) const
Definition: track.cpp:959
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: track.cpp:299
virtual wxPoint GetPosition() const override
Definition: track.cpp:916
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: track.cpp:780
virtual void Move(const wxPoint &aMoveVector) override
Move this object.
Definition: track.h:280
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: track.cpp:220
bool GetIsFree() const
Checks if the via is a free via (as opposed to one created on a track by the router).
Definition: track.h:502
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: track.cpp:572
virtual EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: track.cpp:54
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
ARC(BOARD_ITEM *aParent)
Definition: track.h:265
virtual double GetLength() const override
Function GetLength returns the length of the arc track.
Definition: track.h:326
void Move(const wxPoint &aMoveVector) override
Move this object.
Definition: track.h:95
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: track.cpp:591
void SetEndY(int aY)
Definition: track.h:119
The base class for create windows for drawing purpose.
VIA(BOARD_ITEM *aParent)
Definition: track.cpp:66
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
Definition: track.cpp:266
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:94
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
int m_Width
Thickness of track, or via diameter.
Definition: track.h:255
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
void SetWidth(int aWidth)
Definition: track.h:109
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...
#define UNDEFINED_DRILL_DIAMETER
Definition: track.h:77
static bool ClassOf(const EDA_ITEM *aItem)
Definition: track.h:348
PCB_LAYER_ID
A quick note on layer IDs:
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: track.cpp:889
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
Definition: track.cpp:142
LSET is a set of PCB_LAYER_IDs.
const wxPoint & GetMid() const
Definition: track.h:292
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: track.cpp:173
const wxPoint GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Definition: track.h:107
Represent a set of closed polygons.
bool FlashLayer(int aLayer) const
Checks to see whether the via should have a pad on the specific layer.
Definition: track.cpp:494
int GetDrill() const
Function GetDrill returns the local drill setting for this VIA.
Definition: track.h:481
bool m_keepTopBottomLayer
Keep the top and bottom annular rings.
Definition: track.h:528
const VECTOR2I & GetP0() const
Definition: shape_arc.h:95
wxPoint m_End
Line end point.
Definition: track.h:257
int GetEndY() const
Definition: track.h:122
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: track.cpp:281
static bool ClassOf(const EDA_ITEM *aItem)
Definition: track.h:275
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: track.cpp:880
unsigned STATUS_FLAGS
Definition: eda_item.h:144
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: track.cpp:84
const VECTOR2I & GetArcMid() const
Definition: shape_arc.h:97
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: track.cpp:346
bool ApproxCollinear(const SEG &aSeg) const
Definition: seg.h:269
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
Definition: eda_item.h:232
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: track.cpp:414
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: track.cpp:531
double GetRadius() const
Definition: track.cpp:922
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: track.cpp:559
void SetMid(const wxPoint &aMid)
Definition: track.h:291
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: track.cpp:894
void SetDrillDefault()
Function SetDrillDefault sets the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
Definition: track.h:495
bool ApproxCollinear(const TRACK &aTrack)
Definition: track.h:190
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: track.cpp:992
Definition: seg.h:41
EDA_UNITS
Definition: eda_units.h:38
double GetAngle() const
Definition: track.cpp:928
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
Definition: track.h:446
wxString layerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.
Definition: track.cpp:768
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: track.cpp:522
virtual void SetLayerSet(LSET aLayers) override
Definition: track.cpp:397
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: track.cpp:101
wxString GetClass() const override
Return the class name.
Definition: track.h:419
int GetWidth() const
Definition: track.h:110
STATUS_FLAGS IsPointOnEnds(const wxPoint &point, int min_dist=0) const
Function IsPointOnEnds returns STARTPOINT if point if near (dist = min_dist) start point,...
Definition: track.cpp:188
Definition: track.h:262
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: track.cpp:60
bool GetRemoveUnconnected() const
Definition: track.h:447
void SetTopLayer(PCB_LAYER_ID aLayer)
Definition: track.cpp:423
void SetPosition(const wxPoint &aPos) override
Definition: track.h:105
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: track.cpp:977
double GetArcAngleEnd() const
Definition: track.cpp:949
Handle the component boundary box.
Definition: eda_rect.h:42
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: track.h:474
void SetIsFree(bool aFree=true)
Definition: track.h:503
VIATYPE GetViaType() const
Definition: track.h:373
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
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: track.cpp:643
PCB_LAYER_ID TopLayer() const
Definition: track.cpp:457
const wxPoint & GetEnd() const
Definition: track.h:113
void SetBottomLayer(PCB_LAYER_ID aLayer)
Definition: track.cpp:429
virtual double GetLength() const
Function GetLength returns the length of the track using the hypotenuse calculation.
Definition: track.h:141
wxPoint GetPosition() const override
Definition: track.h:106
bool IsNull() const
Function IsNull returns true if segment length is zero.
Definition: track.h:178
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: track.cpp:901
void SetStart(const wxPoint &aStart)
Definition: track.h:115
double GetArcAngleStart() const
Definition: track.cpp:940
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
Definition: track.cpp:47
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: track.cpp:983
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: track.cpp:361
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:54
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
ARC(BOARD_ITEM *aParent, const SHAPE_ARC *aArc)
Definition: track.h:267
VIATYPE
Definition: track.h:68
Definition: pad.h:60
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
Definition: track.cpp:469
void SetKeepTopBottom(bool aSet)
Sets whether we keep the top and bottom connections even if they are not connected.
Definition: track.h:452
wxPoint GetPosition() const override
Definition: track.h:411
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: track.cpp:694
SEARCH_RESULT
Definition: eda_item.h:40
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: track.cpp:822
const wxPoint & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
Definition: track.h:125
void SetViaType(VIATYPE aViaType)
Definition: track.h:374
PCB_LAYER_ID BottomLayer() const
Definition: track.cpp:463
int GetEndX() const
Definition: track.h:121
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: track.cpp:319
wxPoint m_Mid
Arc mid point, halfway between start and end.
Definition: track.h:339
Definition of PCB_DISPLAY_OPTIONS class.
void SetEndX(int aX)
Definition: track.h:118
const VECTOR2I & GetP1() const
Definition: shape_arc.h:96
PCB_LAYER_ID m_bottomLayer
The bottom layer of the via (the top layer is in m_layer)
Definition: track.h:521
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: track.cpp:786
Definition: track.h:83
bool m_removeUnconnectedLayer
Remove unconnected copper on a via.
Definition: track.h:527
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
Definition: track.h:355
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: track.cpp:78
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162
bool GetKeepTopBottom() const
Definition: track.h:453
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearance overrides set in the "classic" (ie: pre-rule) ...
Definition: track.cpp:107
wxString GetClass() const override
Return the class name.
Definition: track.h:197