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 #define MIN_VIA_DRAW_SIZE 4
80 
81 // Used for tracks and vias for algorithmic safety, not to enforce constraints
82 #define GEOMETRY_MIN_SIZE ( int )( 0.001 * IU_PER_MM )
83 
84 
86 {
87 public:
88  static inline bool ClassOf( const EDA_ITEM* aItem )
89  {
90  return aItem && PCB_TRACE_T == aItem->Type();
91  }
92 
93  TRACK( BOARD_ITEM* aParent, KICAD_T idtype = PCB_TRACE_T );
94 
95  // Do not create a copy constructor. The one generated by the compiler is adequate.
96 
97  void Move( const wxPoint& aMoveVector ) override
98  {
99  m_Start += aMoveVector;
100  m_End += aMoveVector;
101  }
102 
103  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
104 
105  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
106 
107  void SetPosition( const wxPoint& aPos ) override { m_Start = aPos; }
108  wxPoint GetPosition() const override { return m_Start; }
109  const wxPoint GetFocusPosition() const override { return ( m_Start + m_End ) / 2; }
110 
111  void SetWidth( int aWidth ) { m_Width = aWidth; }
112  int GetWidth() const { return m_Width; }
113 
114  void SetEnd( const wxPoint& aEnd ) { m_End = aEnd; }
115  const wxPoint& GetEnd() const { return m_End; }
116 
117  void SetStart( const wxPoint& aStart ) { m_Start = aStart; }
118  const wxPoint& GetStart() const { return m_Start; }
119 
120  void SetEndX( int aX ) { m_End.x = aX; }
121  void SetEndY( int aY ) { m_End.y = aY; }
122 
123  int GetEndX() const { return m_End.x; }
124  int GetEndY() const { return m_End.x; }
125 
127  const wxPoint& GetEndPoint( ENDPOINT_T aEndPoint ) const
128  {
129  if( aEndPoint == ENDPOINT_START )
130  return m_Start;
131  else
132  return m_End;
133  }
134 
135  // Virtual function
136  const EDA_RECT GetBoundingBox() const override;
137 
138  bool IsLocked() const override
139  {
140  return GetState( TRACK_LOCKED );
141  }
142 
143  void SetLocked( bool aLocked ) override
144  {
145  return SetState( TRACK_LOCKED, aLocked );
146  }
147 
153  virtual double GetLength() const
154  {
155  return GetLineLength( m_Start, m_End );
156  }
157 
169  void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aClearanceValue,
170  int aError = ARC_HIGH_DEF, bool ignoreLineWidth = false ) const override;
178  STATUS_FLAGS IsPointOnEnds( const wxPoint& point, int min_dist = 0 ) const;
179 
184  bool IsNull() const
185  {
186  return ( Type() == PCB_VIA_T ) || ( m_Start == m_End );
187  }
188 
189  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
190 
191  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
192 
193  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
194  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
195 
196  bool ApproxCollinear( const TRACK& aTrack )
197  {
198  SEG a( m_Start, m_End );
199  SEG b( aTrack.GetStart(), aTrack.GetEnd() );
200  return a.ApproxCollinear( b );
201  }
202 
203  wxString GetClass() const override
204  {
205  return wxT( "TRACK" );
206  }
207 
214  int GetLocalClearance( wxString* aSource = nullptr ) const override;
215 
216  void GetWidthConstraints( int* aMin, int* aMax, wxString* aSource ) const;
217 
218  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
219 
220  BITMAP_DEF GetMenuImage() const override;
221 
222  virtual EDA_ITEM* Clone() const override;
223 
224  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
225 
226  virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
227 
228  const BOX2I ViewBBox() const override;
229 
230  virtual void SwapData( BOARD_ITEM* aImage ) override;
231 
235  bool IsOnCopperLayer() const override
236  {
237  return true;
238  }
239 
240 #if defined (DEBUG)
241  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
242 
248  static wxString ShowState( int stateBits );
249 
250 #endif
251 
252 protected:
253  void GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
254 
255 
256  int m_Width;
259 
260 };
261 
262 
263 class ARC : public TRACK
264 {
265 public:
266  ARC( BOARD_ITEM* aParent ) : TRACK( aParent, PCB_ARC_T ){};
267 
268  ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc ) :
269  TRACK( aParent, PCB_ARC_T )
270  {
271  m_Start = wxPoint( aArc->GetP0() );
272  m_End = wxPoint( aArc->GetP1() );
273  m_Mid = wxPoint( aArc->GetArcMid() );
274  }
275 
276  static inline bool ClassOf( const EDA_ITEM *aItem )
277  {
278  return aItem && PCB_ARC_T == aItem->Type();
279  }
280 
281  virtual void Move( const wxPoint& aMoveVector ) override
282  {
283  m_Start += aMoveVector;
284  m_Mid += aMoveVector;
285  m_End += aMoveVector;
286  }
287 
288  virtual void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
289 
290  virtual void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
291 
292  void SetMid( const wxPoint& aMid ) { m_Mid = aMid; }
293  const wxPoint& GetMid() const { return m_Mid; }
294 
295  void SetPosition( const wxPoint& aPos ) override
296  {
297  printf("Setting the arc position\n");
298  m_Start = aPos;
299  }
300 
301  virtual wxPoint GetPosition() const override;
302 
303  double GetRadius() const;
304  double GetAngle() const;
305  double GetArcAngleStart() const;
306  double GetArcAngleEnd() const;
307 
308  virtual bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
309 
310  virtual bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
311 
312  wxString GetClass() const override
313  {
314  return wxT( "ARC" );
315  }
316 
317  //TODO(snh): Add GetSelectMenuText() and GetMsgPanelInfoBase()
318 
324  virtual double GetLength() const override
325  {
326  double radius = GetRadius();
327  double angle = GetAngle();
328 
329  return radius * M_PI * angle / 180.0;
330  }
331 
332  EDA_ITEM* Clone() const override;
333 
334  virtual void SwapData( BOARD_ITEM* aImage ) override;
335 
336 protected:
337 
338 private:
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 
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  unsigned int 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( wxString* aSource ) const;
441 
447  void SetDrill( int aDrill ) { m_Drill = aDrill; }
448 
454  int GetDrill() const { return m_Drill; }
455 
462  int GetDrillValue() const;
463 
469 
474  bool IsDrillDefault() const { return m_Drill <= 0; }
475 
476  virtual void SwapData( BOARD_ITEM* aImage ) override;
477 
478 private:
481 
482  VIATYPE m_ViaType; // Type of via
483 
484  int m_Drill; // for vias: via drill (- 1 for default value)
485 };
486 
487 
488 #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:138
int GetMinAnnulus(wxString *aSource) const
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:482
void SetPosition(const wxPoint &aPos) override
Definition: class_track.h:295
wxPoint m_Start
Line start point.
Definition: class_track.h:257
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:206
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:88
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
bool IsOnCopperLayer() const override
Definition: class_track.h:235
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_track.h:312
void SetPosition(const wxPoint &aPoint) override
Definition: class_track.h:412
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:114
const wxPoint & GetStart() const
Definition: class_track.h:118
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
bool IsDrillDefault() const
Function IsDrillDefault.
Definition: class_track.h:474
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.
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, 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...
virtual void Move(const wxPoint &aMoveVector) override
Function Move move this object.
Definition: class_track.h:281
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:45
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
ARC(BOARD_ITEM *aParent)
Definition: class_track.h:266
int GetLocalClearance(wxString *aSource=nullptr) const override
Function GetLocalClearance returns any local clearance overrides set in the "classic" (ie: pre-rule) ...
virtual double GetLength() const override
Function GetLength returns the length of the arc track.
Definition: class_track.h:324
void Move(const wxPoint &aMoveVector) override
Function Move move this object.
Definition: class_track.h:97
void SetEndY(int aY)
Definition: class_track.h:121
The base class for create windows for drawing purpose.
VIA(BOARD_ITEM *aParent)
Definition: class_track.cpp:57
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:256
void SetWidth(int aWidth)
Definition: class_track.h:111
virtual unsigned int ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail (LOD) of the item.
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:143
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_track.h:348
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.
LSET is a set of PCB_LAYER_IDs.
const wxPoint & GetMid() const
Definition: class_track.h:293
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:109
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:454
const VECTOR2I & GetP0() const
Definition: shape_arc.h:69
wxPoint m_End
Line end point.
Definition: class_track.h:258
int GetEndY() const
Definition: class_track.h:124
int m_Drill
Definition: class_track.h:484
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:276
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:72
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:480
bool ApproxCollinear(const SEG &aSeg) const
Definition: seg.h:254
unsigned int ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail (LOD) of the item.
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.
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:292
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:468
bool ApproxCollinear(const TRACK &aTrack)
Definition: class_track.h:196
Definition: seg.h:39
double GetAngle() const
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_track.h:419
void SetState(int type, int state)
Definition: base_struct.h:221
int GetWidth() const
Definition: class_track.h:112
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:51
void SetTopLayer(PCB_LAYER_ID aLayer)
void SetPosition(const wxPoint &aPos) override
Definition: class_track.h:107
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:447
VIATYPE GetViaType() const
Definition: class_track.h:373
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:115
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:153
wxPoint GetPosition() const override
Definition: class_track.h:108
bool IsNull() const
Function IsNull returns true if segment length is zero.
Definition: class_track.h:184
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void SetStart(const wxPoint &aStart)
Definition: class_track.h:117
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:38
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:268
SEARCH_RESULT
Definition: base_struct.h:51
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
wxPoint GetPosition() const override
Definition: class_track.h:411
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:127
void SetViaType(VIATYPE aViaType)
Definition: class_track.h:374
PCB_LAYER_ID BottomLayer() const
int GetState(int type) const
Definition: base_struct.h:216
int GetEndX() const
Definition: class_track.h:123
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:339
Definition of PCB_DISPLAY_OPTIONS class.
void SetEndX(int aX)
Definition: class_track.h:120
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 IsType(const KICAD_T aScanTypes[]) const override
Function IsType Checks whether the item is one of the listed types.
Definition: class_track.h:355
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: class_track.cpp:66
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_track.h:203