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, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 1992-2021 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 <board_connected_item.h>
40 #include <convert_to_biu.h>
41 
42 
43 class PCB_TRACK;
44 class PCB_VIA;
45 class PAD;
46 class MSG_PANEL_ITEM;
47 class SHAPE_POLY_SET;
48 class SHAPE_ARC;
49 
50 
51 // Flag used in locate routines (from which endpoint work)
52 enum ENDPOINT_T : int
53 {
56 };
57 
58 // Via types
59 // Note that this enum must be synchronized to GAL_LAYER_ID
60 enum class VIATYPE : int
61 {
62  THROUGH = 3, /* Always a through hole via */
63  BLIND_BURIED = 2, /* this via can be on internal layers */
64  MICROVIA = 1, /* this via which connect from an external layer
65  * to the near neighbor internal layer */
66  NOT_DEFINED = 0 /* not yet used */
67 };
68 
69 #define UNDEFINED_DRILL_DIAMETER -1 //< Undefined via drill diameter.
70 
71 // Used for tracks and vias for algorithmic safety, not to enforce constraints
72 #define GEOMETRY_MIN_SIZE ( int )( 0.001 * IU_PER_MM )
73 
74 
76 {
77 public:
78  static inline bool ClassOf( const EDA_ITEM* aItem )
79  {
80  return aItem && PCB_TRACE_T == aItem->Type();
81  }
82 
83  PCB_TRACK( BOARD_ITEM* aParent, KICAD_T idtype = PCB_TRACE_T );
84 
85  // Do not create a copy constructor. The one generated by the compiler is adequate.
86 
87  void Move( const wxPoint& aMoveVector ) override
88  {
89  m_Start += aMoveVector;
90  m_End += aMoveVector;
91  }
92 
93  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
94 
95  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
96 
97  void SetPosition( const wxPoint& aPos ) override { m_Start = aPos; }
98  wxPoint GetPosition() const override { return m_Start; }
99  const wxPoint GetFocusPosition() const override { return ( m_Start + m_End ) / 2; }
100 
101  void SetWidth( int aWidth ) { m_Width = aWidth; }
102  int GetWidth() const { return m_Width; }
103 
104  void SetEnd( const wxPoint& aEnd ) { m_End = aEnd; }
105  const wxPoint& GetEnd() const { return m_End; }
106 
107  void SetStart( const wxPoint& aStart ) { m_Start = aStart; }
108  const wxPoint& GetStart() const { return m_Start; }
109 
110  void SetEndX( int aX ) { m_End.x = aX; }
111  void SetEndY( int aY ) { m_End.y = aY; }
112 
113  int GetEndX() const { return m_End.x; }
114  int GetEndY() const { return m_End.y; }
115 
117  const wxPoint& GetEndPoint( ENDPOINT_T aEndPoint ) const
118  {
119  if( aEndPoint == ENDPOINT_START )
120  return m_Start;
121  else
122  return m_End;
123  }
124 
125  // Virtual function
126  const EDA_RECT GetBoundingBox() const override;
127 
133  virtual double GetLength() const;
134 
147  PCB_LAYER_ID aLayer, int aClearanceValue,
148  int aError, ERROR_LOC aErrorLoc,
149  bool ignoreLineWidth = false ) const override;
150 
151  // @copydoc BOARD_ITEM::GetEffectiveShape
152  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
153 
161  EDA_ITEM_FLAGS IsPointOnEnds( const wxPoint& point, int min_dist = 0 ) const;
162 
167  bool IsNull() const
168  {
169  return ( Type() == PCB_VIA_T ) || ( m_Start == m_End );
170  }
171 
172  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
173 
174  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
175 
176  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
177  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
178 
179  bool ApproxCollinear( const PCB_TRACK& aTrack );
180 
181  wxString GetClass() const override
182  {
183  return wxT( "PCB_TRACK" );
184  }
185 
192  int GetLocalClearance( wxString* aSource ) const override;
193 
194  void GetWidthConstraints( int* aMin, int* aMax, wxString* aSource ) const;
195 
196  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
197 
198  BITMAPS GetMenuImage() const override;
199 
200  virtual EDA_ITEM* Clone() const override;
201 
202  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
203 
204  double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
205 
206  const BOX2I ViewBBox() const override;
207 
208  virtual void SwapData( BOARD_ITEM* aImage ) override;
209 
213  bool IsOnCopperLayer() const override
214  {
215  return true;
216  }
217 
218  struct cmp_tracks
219  {
220  bool operator()( const PCB_TRACK* aFirst, const PCB_TRACK* aSecond ) const;
221  };
222 
223 #if defined (DEBUG)
224  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
225 
231  static wxString ShowState( int stateBits );
232 
233 #endif
234 
235 protected:
236  void GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) const;
237 
238 
239  int m_Width;
240  wxPoint m_Start;
241  wxPoint m_End;
242 
243 };
244 
245 
246 class PCB_ARC : public PCB_TRACK
247 {
248 public:
249  PCB_ARC( BOARD_ITEM* aParent ) :
250  PCB_TRACK( aParent, PCB_ARC_T )
251  {
252  };
253 
254  PCB_ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc );
255 
256  static inline bool ClassOf( const EDA_ITEM *aItem )
257  {
258  return aItem && PCB_ARC_T == aItem->Type();
259  }
260 
261  virtual void Move( const wxPoint& aMoveVector ) override
262  {
263  m_Start += aMoveVector;
264  m_Mid += aMoveVector;
265  m_End += aMoveVector;
266  }
267 
268  virtual void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
269 
270  virtual void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
271 
272  void SetMid( const wxPoint& aMid ) { m_Mid = aMid; }
273  const wxPoint& GetMid() const { return m_Mid; }
274 
275  void SetPosition( const wxPoint& aPos ) override
276  {
277  m_Start = aPos;
278  }
279 
280  virtual wxPoint GetPosition() const override;
281 
282  virtual wxPoint GetCenter() const override { return GetPosition(); }
283 
284  double GetRadius() const;
285  double GetAngle() const;
286  double GetArcAngleStart() const;
287  double GetArcAngleEnd() const;
288  virtual bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
289 
290  virtual bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
291 
292  wxString GetClass() const override
293  {
294  return wxT( "PCB_ARC" );
295  }
296 
297  // @copydoc BOARD_ITEM::GetEffectiveShape
298  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
299 
300  //TODO(snh): Add GetSelectMenuText() and GetMsgPanelInfoBase()
301 
307  virtual double GetLength() const override
308  {
309  double radius = GetRadius();
310  double includedAngle = std::abs( GetAngle() );
311 
312  return radius * M_PI * includedAngle / 1800.0;
313  }
314 
315  EDA_ITEM* Clone() const override;
316 
317  virtual void SwapData( BOARD_ITEM* aImage ) override;
318 
319 private:
320  wxPoint m_Mid;
321 };
322 
323 
324 class PCB_VIA : public PCB_TRACK
325 {
326 public:
327  PCB_VIA( BOARD_ITEM* aParent );
328 
329  static inline bool ClassOf( const EDA_ITEM *aItem )
330  {
331  return aItem && PCB_VIA_T == aItem->Type();
332  }
333 
334  // Do not create a copy constructor. The one generated by the compiler is adequate.
335 
336  bool IsType( const KICAD_T aScanTypes[] ) const override
337  {
338  if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
339  return true;
340 
341  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
342  {
344  return true;
345  else if( *p == PCB_LOCATE_UVIA_T && m_viaType == VIATYPE::MICROVIA )
346  return true;
347  else if( *p == PCB_LOCATE_BBVIA_T && m_viaType == VIATYPE::BLIND_BURIED )
348  return true;
349  }
350 
351  return false;
352  }
353 
354  VIATYPE GetViaType() const { return m_viaType; }
355  void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
356 
357  bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
358 
359  virtual LSET GetLayerSet() const override;
360  virtual void SetLayerSet( LSET aLayers ) override;
361 
368  void SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer );
369 
370  void SetBottomLayer( PCB_LAYER_ID aLayer );
371  void SetTopLayer( PCB_LAYER_ID aLayer );
372 
380  void LayerPair( PCB_LAYER_ID* top_layer, PCB_LAYER_ID* bottom_layer ) const;
381 
382  PCB_LAYER_ID TopLayer() const;
383  PCB_LAYER_ID BottomLayer() const;
384 
390  void SanitizeLayers();
391 
392  wxPoint GetPosition() const override { return m_Start; }
393  void SetPosition( const wxPoint& aPoint ) override { m_Start = aPoint; m_End = aPoint; }
394 
395  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
396 
397  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
398  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
399 
400  wxString GetClass() const override
401  {
402  return wxT( "PCB_VIA" );
403  }
404 
405  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
406 
407  BITMAPS GetMenuImage() const override;
408 
409  EDA_ITEM* Clone() const override;
410 
411  void ViewGetLayers( int aLayers[], int& aCount ) const override;
412 
413  double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
414 
415  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
416 
417 #if defined (DEBUG)
418  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
419 #endif
420 
421  int GetMinAnnulus( PCB_LAYER_ID aLayer, wxString* aSource ) const;
422 
427  void SetRemoveUnconnected( bool aSet ) { m_removeUnconnectedLayer = aSet; }
429 
433  void SetKeepTopBottom( bool aSet ) { m_keepTopBottomLayer = aSet; }
434  bool GetKeepTopBottom() const { return m_keepTopBottomLayer; }
435 
441  bool FlashLayer( int aLayer ) const;
442 
448  bool FlashLayer( LSET aLayers ) const;
449 
455  void SetDrill( int aDrill ) { m_drill = aDrill; }
456 
462  int GetDrill() const { return m_drill; }
463 
470  int GetDrillValue() const;
471 
477 
483  bool GetIsFree() const { return m_isFree; }
484  void SetIsFree( bool aFree = true ) { m_isFree = aFree; }
485 
490  bool IsDrillDefault() const { return m_drill <= 0; }
491 
492  void SwapData( BOARD_ITEM* aImage ) override;
493 
494  // @copydoc BOARD_ITEM::GetEffectiveShape
495  std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
496 
497 protected:
498  wxString layerMaskDescribe() const override;
499 
500 private:
503 
505 
506  int m_drill;
507 
510  bool m_isFree;
511 };
512 
513 
514 #endif // CLASS_TRACK_H
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: pcb_track.cpp:387
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:78
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: pcb_track.cpp:96
bool operator()(const PCB_TRACK *aFirst, const PCB_TRACK *aSecond) const
Definition: pcb_track.cpp:1007
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: pcb_track.cpp:240
virtual wxPoint GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: pcb_track.h:282
wxPoint m_Start
Line start point.
Definition: pcb_track.h:240
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:256
PCB_ARC(BOARD_ITEM *aParent)
Definition: pcb_track.h:249
void SetBottomLayer(PCB_LAYER_ID aLayer)
Definition: pcb_track.cpp:455
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:345
wxPoint GetPosition() const override
Definition: pcb_track.h:392
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: pcb_track.cpp:833
bool FlashLayer(int aLayer) const
Checks to see whether the via should have a pad on the specific layer.
Definition: pcb_track.cpp:520
wxPoint GetPosition() const override
Definition: pcb_track.h:98
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
Definition: pcb_track.h:427
const wxPoint & GetEnd() const
Definition: pcb_track.h:105
virtual EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:57
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
virtual double GetLength() const override
Function GetLength returns the length of the arc track.
Definition: pcb_track.h:307
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: pcb_track.h:455
void SetEnd(const wxPoint &aEnd)
Definition: pcb_track.h:104
VIATYPE GetViaType() const
Definition: pcb_track.h:354
virtual double GetLength() const
Function GetLength returns the length of the track using the hypotenuse calculation.
Definition: pcb_track.cpp:286
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: pcb_track.cpp:869
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:440
PCB_TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
Definition: pcb_track.cpp:50
void Move(const wxPoint &aMoveVector) override
Move this object.
Definition: pcb_track.h:87
int m_drill
for vias: via drill (- 1 for default value)
Definition: pcb_track.h:506
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
Definition: pcb_track.cpp:162
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:90
void SetPosition(const wxPoint &aPos) override
Definition: pcb_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: pcb_track.cpp:927
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
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: pcb_track.cpp:1031
void SetPosition(const wxPoint &aPoint) override
Definition: pcb_track.h:393
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pcb_track.cpp:402
std::uint32_t EDA_ITEM_FLAGS
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...
int GetWidth() const
Definition: pcb_track.h:102
VIATYPE m_viaType
through, blind/buried or micro
Definition: pcb_track.h:504
The base class for create windows for drawing purpose.
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
Definition: pcb_track.cpp:782
PCB_LAYER_ID BottomLayer() const
Definition: pcb_track.cpp:489
bool IsDrillDefault() const
Function IsDrillDefault.
Definition: pcb_track.h:490
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_track.h:329
void SetEndY(int aY)
Definition: pcb_track.h:111
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 PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
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:679
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: pcb_track.cpp:956
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:598
wxPoint m_End
Line end point.
Definition: pcb_track.h:241
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
Definition: pcb_track.h:336
void SetKeepTopBottom(bool aSet)
Sets whether we keep the top and bottom connections even if they are not connected.
Definition: pcb_track.h:433
int GetEndY() const
Definition: pcb_track.h:114
double GetArcAngleEnd() const
Definition: pcb_track.cpp:997
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: pcb_track.cpp:937
PCB_LAYER_ID TopLayer() const
Definition: pcb_track.cpp:483
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:502
bool ApproxCollinear(const PCB_TRACK &aTrack)
Definition: pcb_track.cpp:119
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearance overrides set in the "classic" (ie: pre-rule) ...
Definition: pcb_track.cpp:127
ENDPOINT_T
Definition: pcb_track.h:52
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_track.cpp:72
void SetDrillDefault()
Function SetDrillDefault sets the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
Definition: pcb_track.h:476
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:181
double GetArcAngleStart() const
Definition: pcb_track.cpp:988
Represent a set of closed polygons.
bool GetRemoveUnconnected() const
Definition: pcb_track.h:428
void SetMid(const wxPoint &aMid)
Definition: pcb_track.h:272
double GetRadius() const
Definition: pcb_track.cpp:970
virtual wxPoint GetPosition() const override
Definition: pcb_track.cpp:964
bool m_keepTopBottomLayer
Keep the top and bottom annular rings.
Definition: pcb_track.h:509
#define UNDEFINED_DRILL_DIAMETER
Definition: pcb_track.h:69
virtual void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
Definition: pcb_track.cpp:299
int GetDrill() const
Function GetDrill returns the local drill setting for this PCB_VIA.
Definition: pcb_track.h:462
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: pcb_track.cpp:1025
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:461
void SetStart(const wxPoint &aStart)
Definition: pcb_track.h:107
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
Definition: eda_item.h:183
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:292
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: pcb_track.cpp:827
void SetViaType(VIATYPE aViaType)
Definition: pcb_track.h:355
bool GetKeepTopBottom() const
Definition: pcb_track.h:434
bool m_removeUnconnectedLayer
Remove unconnected copper on a via.
Definition: pcb_track.h:508
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:325
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: pcb_track.cpp:113
virtual void SetLayerSet(LSET aLayers) override
Definition: pcb_track.cpp:423
void SetTopLayer(PCB_LAYER_ID aLayer)
Definition: pcb_track.cpp:449
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:740
void SetPosition(const wxPoint &aPos) override
Definition: pcb_track.h:97
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: pcb_track.cpp:1040
EDA_UNITS
Definition: eda_units.h:38
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: pcb_track.cpp:585
void SetWidth(int aWidth)
Definition: pcb_track.h:101
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: pcb_track.cpp:372
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_track.cpp:307
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: pcb_track.cpp:942
int m_Width
Thickness of track, or via diameter.
Definition: pcb_track.h:239
PCB_LAYER_ID m_bottomLayer
The bottom layer of the via (the top layer is in m_layer)
Definition: pcb_track.h:502
void SetIsFree(bool aFree=true)
Definition: pcb_track.h:484
VIATYPE
Definition: pcb_track.h:60
double GetAngle() const
Definition: pcb_track.cpp:976
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: pcb_track.cpp:617
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: pcb_track.cpp:557
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:483
int GetEndX() const
Definition: pcb_track.h:113
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:64
EDA_ITEM_FLAGS IsPointOnEnds(const wxPoint &point, int min_dist=0) const
Function IsPointOnEnds returns STARTPOINT if point if near (dist = min_dist) start point,...
Definition: pcb_track.cpp:208
const wxPoint GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Definition: pcb_track.h:99
Handle the component boundary box.
Definition: eda_rect.h:42
const wxPoint & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
Definition: pcb_track.h:117
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: pcb_track.cpp:949
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: pcb_track.cpp:193
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
virtual void Move(const wxPoint &aMoveVector) override
Move this object.
Definition: pcb_track.h:261
void GetWidthConstraints(int *aMin, int *aMax, wxString *aSource) const
Definition: pcb_track.cpp:134
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:548
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:53
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
bool IsNull() const
Function IsNull returns true if segment length is zero.
Definition: pcb_track.h:167
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
Definition: pcb_track.cpp:495
Definition: pad.h:57
void SetEndX(int aX)
Definition: pcb_track.h:110
SEARCH_RESULT
Definition: eda_item.h:41
wxPoint m_Mid
Arc mid point, halfway between start and end.
Definition: pcb_track.h:320
const wxPoint & GetMid() const
Definition: pcb_track.h:273
bool m_isFree
"Free" vias don't get their nets auto-updated
Definition: pcb_track.h:510
bool IsOnCopperLayer() const override
Definition: pcb_track.h:213
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
Definition: pcb_track.cpp:292
const wxPoint & GetStart() const
Definition: pcb_track.h:108
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
wxString GetClass() const override
Return the class name.
Definition: pcb_track.h:400
PCB_VIA(BOARD_ITEM *aParent)
Definition: pcb_track.cpp:78
wxString layerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.
Definition: pcb_track.cpp:815