KiCad PCB EDA Suite
class_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 <class_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 D_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.x; }
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 
136  bool IsLocked() const override
137  {
138  return GetState( TRACK_LOCKED );
139  }
140 
141  void SetLocked( bool aLocked ) override
142  {
143  return SetState( TRACK_LOCKED, aLocked );
144  }
145 
151  virtual double GetLength() const
152  {
153  return GetLineLength( m_Start, m_End );
154  }
155 
168  int aClearanceValue, int aError = ARC_HIGH_DEF,
169  bool ignoreLineWidth = false ) const override;
170 
171  // @copydoc BOARD_ITEM::GetEffectiveShape
172  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
173 
181  STATUS_FLAGS IsPointOnEnds( const wxPoint& point, int min_dist = 0 ) const;
182 
187  bool IsNull() const
188  {
189  return ( Type() == PCB_VIA_T ) || ( m_Start == m_End );
190  }
191 
192  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
193 
194  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
195 
196  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
197  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
198 
199  bool ApproxCollinear( const TRACK& aTrack )
200  {
201  SEG a( m_Start, m_End );
202  SEG b( aTrack.GetStart(), aTrack.GetEnd() );
203  return a.ApproxCollinear( b );
204  }
205 
206  wxString GetClass() const override
207  {
208  return wxT( "TRACK" );
209  }
210 
217  int GetLocalClearance( wxString* aSource ) const override;
218 
219  void GetWidthConstraints( int* aMin, int* aMax, wxString* aSource ) const;
220 
221  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
222 
223  BITMAP_DEF GetMenuImage() const override;
224 
225  virtual EDA_ITEM* Clone() const override;
226 
227  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
228 
229  double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
230 
231  const BOX2I ViewBBox() const override;
232 
233  virtual void SwapData( BOARD_ITEM* aImage ) override;
234 
238  bool IsOnCopperLayer() const override
239  {
240  return true;
241  }
242 
243  struct cmp_tracks
244  {
245  bool operator()( const TRACK* aFirst, const TRACK* aSecond ) const;
246  };
247 
248 #if defined (DEBUG)
249  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
250 
256  static wxString ShowState( int stateBits );
257 
258 #endif
259 
260 protected:
261  void GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
262 
263 
264  int m_Width;
267 
268 };
269 
270 
271 class ARC : public TRACK
272 {
273 public:
274  ARC( BOARD_ITEM* aParent ) : TRACK( aParent, PCB_ARC_T ){};
275 
276  ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc ) :
277  TRACK( aParent, PCB_ARC_T )
278  {
279  m_Start = wxPoint( aArc->GetP0() );
280  m_End = wxPoint( aArc->GetP1() );
281  m_Mid = wxPoint( aArc->GetArcMid() );
282  }
283 
284  static inline bool ClassOf( const EDA_ITEM *aItem )
285  {
286  return aItem && PCB_ARC_T == aItem->Type();
287  }
288 
289  virtual void Move( const wxPoint& aMoveVector ) override
290  {
291  m_Start += aMoveVector;
292  m_Mid += aMoveVector;
293  m_End += aMoveVector;
294  }
295 
296  virtual void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
297 
298  virtual void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
299 
300  void SetMid( const wxPoint& aMid ) { m_Mid = aMid; }
301  const wxPoint& GetMid() const { return m_Mid; }
302 
303  void SetPosition( const wxPoint& aPos ) override
304  {
305  printf("Setting the arc position\n");
306  m_Start = aPos;
307  }
308 
309  virtual wxPoint GetPosition() const override;
310 
311  double GetRadius() const;
312  double GetAngle() const;
313  double GetArcAngleStart() const;
314  double GetArcAngleEnd() const;
315  virtual bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
316 
317  virtual bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
318 
319  wxString GetClass() const override
320  {
321  return wxT( "ARC" );
322  }
323 
324  // @copydoc BOARD_ITEM::GetEffectiveShape
325  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
326 
327  //TODO(snh): Add GetSelectMenuText() and GetMsgPanelInfoBase()
328 
334  virtual double GetLength() const override
335  {
336  double radius = GetRadius();
337  double angle = GetAngle();
338 
339  return radius * M_PI * angle / 180.0;
340  }
341 
342  EDA_ITEM* Clone() const override;
343 
344  virtual void SwapData( BOARD_ITEM* aImage ) override;
345 
346 private:
348 };
349 
350 
351 class VIA : public TRACK
352 {
353 public:
354  VIA( BOARD_ITEM* aParent );
355 
356  static inline bool ClassOf( const EDA_ITEM *aItem )
357  {
358  return aItem && PCB_VIA_T == aItem->Type();
359  }
360 
361  // Do not create a copy constructor. The one generated by the compiler is adequate.
362 
363  bool IsType( const KICAD_T aScanTypes[] ) const override
364  {
365  if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
366  return true;
367 
368  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
369  {
371  return true;
372  else if( *p == PCB_LOCATE_UVIA_T && m_ViaType == VIATYPE::MICROVIA )
373  return true;
374  else if( *p == PCB_LOCATE_BBVIA_T && m_ViaType == VIATYPE::BLIND_BURIED )
375  return true;
376  }
377 
378  return false;
379  }
380 
381  VIATYPE GetViaType() const { return m_ViaType; }
382  void SetViaType( VIATYPE aViaType ) { m_ViaType = aViaType; }
383 
384  bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
385 
386  virtual LSET GetLayerSet() const override;
387  virtual void SetLayerSet( LSET aLayers ) override;
388 
396  void SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer );
397 
398  void SetBottomLayer( PCB_LAYER_ID aLayer );
399  void SetTopLayer( PCB_LAYER_ID aLayer );
400 
408  void LayerPair( PCB_LAYER_ID* top_layer, PCB_LAYER_ID* bottom_layer ) const;
409 
410  PCB_LAYER_ID TopLayer() const;
411  PCB_LAYER_ID BottomLayer() const;
412 
418  void SanitizeLayers();
419 
420  wxPoint GetPosition() const override { return m_Start; }
421  void SetPosition( const wxPoint& aPoint ) override { m_Start = aPoint; m_End = aPoint; }
422 
423  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
424 
425  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
426  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
427 
428  wxString GetClass() const override
429  {
430  return wxT( "VIA" );
431  }
432 
433  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
434 
435  BITMAP_DEF GetMenuImage() const override;
436 
437  EDA_ITEM* Clone() const override;
438 
439  void ViewGetLayers( int aLayers[], int& aCount ) const override;
440 
441  double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
442 
443  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
444 
445 #if defined (DEBUG)
446  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
447 #endif
448 
449  int GetMinAnnulus( PCB_LAYER_ID aLayer, wxString* aSource ) const;
450 
455  void SetRemoveUnconnected( bool aSet ) { m_RemoveUnconnectedLayer = aSet; }
457 
461  void SetKeepTopBottom( bool aSet ) { m_KeepTopBottomLayer = aSet; }
462  bool GetKeepTopBottom() const { return m_KeepTopBottomLayer; }
463 
469  bool IsPadOnLayer( int aLayer ) const;
470 
476  bool IsPadOnLayer( LSET aLayers ) const;
477 
483  void SetDrill( int aDrill ) { m_Drill = aDrill; }
484 
490  int GetDrill() const { return m_Drill; }
491 
498  int GetDrillValue() const;
499 
505 
510  bool IsDrillDefault() const { return m_Drill <= 0; }
511 
512  virtual void SwapData( BOARD_ITEM* aImage ) override;
513 
514  // @copydoc BOARD_ITEM::GetEffectiveShape
515  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
516 
517 protected:
518  wxString LayerMaskDescribe() const override;
519 
520 private:
523 
524  VIATYPE m_ViaType; // Type of via
525 
526  int m_Drill; // for vias: via drill (- 1 for default value)
527 
530 };
531 
532 
533 #endif // CLASS_TRACK_H
virtual void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:136
EDA_UNITS
Definition: common.h:198
void GetWidthConstraints(int *aMin, int *aMax, wxString *aSource) const
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...
VIATYPE m_ViaType
Definition: class_track.h:524
void SetPosition(const wxPoint &aPos) override
Definition: class_track.h:303
wxPoint m_Start
Line start point.
Definition: class_track.h:265
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:211
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
PNG memory record (file in memory).
Definition: bitmap_def.h:29
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_track.h:86
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
bool IsOnCopperLayer() const override
Definition: class_track.h:238
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_track.h:319
void SetPosition(const wxPoint &aPoint) override
Definition: class_track.h:421
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
void SetEnd(const wxPoint &aEnd)
Definition: class_track.h:112
const wxPoint & GetStart() const
Definition: class_track.h:116
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
bool IsDrillDefault() const
Function IsDrillDefault.
Definition: class_track.h:510
bool operator()(const TRACK *aFirst, const TRACK *aSecond) const
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Function Flip Flip this object, i.e.
virtual wxPoint GetPosition() const override
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
virtual void Move(const wxPoint &aMoveVector) override
Function Move move this object.
Definition: class_track.h:289
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
virtual EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: class_track.cpp:50
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
bool m_RemoveUnconnectedLayer
Remove unconnected copper on a via.
Definition: class_track.h:528
ARC(BOARD_ITEM *aParent)
Definition: class_track.h:274
virtual double GetLength() const override
Function GetLength returns the length of the arc track.
Definition: class_track.h:334
void Move(const wxPoint &aMoveVector) override
Function Move move this object.
Definition: class_track.h:95
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail (LOD) of the item.
void SetEndY(int aY)
Definition: class_track.h:119
The base class for create windows for drawing purpose.
VIA(BOARD_ITEM *aParent)
Definition: class_track.cpp:62
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
int m_Width
Thickness of track, or via diameter.
Definition: class_track.h:264
void SetWidth(int aWidth)
Definition: class_track.h:109
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:105
void SetLocked(bool aLocked) override
Function SetLocked modifies 'lock' status for of the item.
Definition: class_track.h:141
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_track.h:356
wxString LayerMaskDescribe() const override
Helper function Return a string (to be shown to the user) describing a layer mask.
PCB_LAYER_ID
A quick note on layer IDs:
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
LSET is a set of PCB_LAYER_IDs.
const wxPoint & GetMid() const
Definition: class_track.h:301
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
const wxPoint GetFocusPosition() const override
Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rath...
Definition: class_track.h:107
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
SHAPE_POLY_SET.
int GetDrill() const
Function GetDrill returns the local drill setting for this VIA.
Definition: class_track.h:490
const VECTOR2I & GetP0() const
Definition: shape_arc.h:69
wxPoint m_End
Line end point.
Definition: class_track.h:266
int GetEndY() const
Definition: class_track.h:122
int m_Drill
Definition: class_track.h:526
VIATYPE
Definition: class_track.h:68
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Function Flip Flip this object, i.e.
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_track.h:284
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: class_track.cpp:79
const VECTOR2I & GetArcMid() const
Definition: shape_arc.h:71
unsigned STATUS_FLAGS
Definition: base_struct.h:152
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
PCB_LAYER_ID m_BottomLayer
The bottom layer of the via (the top layer is in m_Layer)
Definition: class_track.h:522
bool ApproxCollinear(const SEG &aSeg) const
Definition: seg.h:254
virtual bool IsType(const KICAD_T aScanTypes[]) const
Function IsType Checks whether the item is one of the listed types.
Definition: base_struct.h:262
#define TRACK_LOCKED
Pcbnew: track locked: protected from global deletion.
Definition: base_struct.h:131
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.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail (LOD) of the item.
ENDPOINT_T
Definition: class_track.h:60
double GetRadius() const
#define UNDEFINED_DRILL_DIAMETER
Definition: class_track.h:77
const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers.
void SetMid(const wxPoint &aMid)
Definition: class_track.h:300
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void SetDrillDefault()
Function SetDrillDefault sets the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
Definition: class_track.h:504
bool ApproxCollinear(const TRACK &aTrack)
Definition: class_track.h:199
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Function GetEffectiveShape Some pad shapes can be complex (rounded/chamfered rectangle),...
Definition: seg.h:39
double GetAngle() const
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
Definition: class_track.h:455
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
virtual void SetLayerSet(LSET aLayers) override
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: class_track.cpp:96
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_track.h:428
void SetState(int type, int state)
Definition: base_struct.h:221
int GetWidth() const
Definition: class_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,...
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: class_track.cpp:56
bool GetRemoveUnconnected() const
Definition: class_track.h:456
void SetTopLayer(PCB_LAYER_ID aLayer)
void SetPosition(const wxPoint &aPos) override
Definition: class_track.h:105
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Function GetEffectiveShape Some pad shapes can be complex (rounded/chamfered rectangle),...
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
double GetArcAngleEnd() const
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: class_track.h:483
VIATYPE GetViaType() const
Definition: class_track.h:381
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
PCB_LAYER_ID TopLayer() const
const wxPoint & GetEnd() const
Definition: class_track.h:113
void SetBottomLayer(PCB_LAYER_ID aLayer)
virtual double GetLength() const
Function GetLength returns the length of the track using the hypotenuse calculation.
Definition: class_track.h:151
wxPoint GetPosition() const override
Definition: class_track.h:106
bool m_KeepTopBottomLayer
Keep the top and bottom annular rings.
Definition: class_track.h:529
bool IsNull() const
Function IsNull returns true if segment length is zero.
Definition: class_track.h:187
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void SetStart(const wxPoint &aStart)
Definition: class_track.h:115
double GetArcAngleStart() const
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
Definition: class_track.cpp:43
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Function GetEffectiveShape Some pad shapes can be complex (rounded/chamfered rectangle),...
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
VIEW.
Definition: view.h:61
ARC(BOARD_ITEM *aParent, const SHAPE_ARC *aArc)
Definition: class_track.h:276
SEARCH_RESULT
Definition: base_struct.h:51
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
void SetKeepTopBottom(bool aSet)
Sets whether we keep the top and bottom connections even if they are not connected.
Definition: class_track.h:461
wxPoint GetPosition() const override
Definition: class_track.h:420
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
const wxPoint & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
Definition: class_track.h:125
void SetViaType(VIATYPE aViaType)
Definition: class_track.h:382
PCB_LAYER_ID BottomLayer() const
int GetState(int type) const
Definition: base_struct.h:216
int GetEndX() const
Definition: class_track.h:121
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Function Flip Flip this object, i.e.
wxPoint m_Mid
Arc mid point, halfway between start and end.
Definition: class_track.h:347
Definition of PCB_DISPLAY_OPTIONS class.
void SetEndX(int aX)
Definition: class_track.h:118
const VECTOR2I & GetP1() const
Definition: shape_arc.h:70
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
bool IsPadOnLayer(int aLayer) const
Checks to see whether the via should have a pad on the specific layer.
bool IsType(const KICAD_T aScanTypes[]) const override
Function IsType Checks whether the item is one of the listed types.
Definition: class_track.h:363
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: class_track.cpp:73
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
bool GetKeepTopBottom() const
Definition: class_track.h:462
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError=ARC_HIGH_DEF, bool ignoreLineWidth=false) const override
Function TransformShapeWithClearanceToPolygon Convert the track shape to a closed polygon Used in fil...
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearance overrides set in the "classic" (ie: pre-rule) ...
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_track.h:206