diff --git a/pcbnew/connectivity/connectivity_items.cpp b/pcbnew/connectivity/connectivity_items.cpp index 00e1b749b8..ebef6848e0 100644 --- a/pcbnew/connectivity/connectivity_items.cpp +++ b/pcbnew/connectivity/connectivity_items.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include diff --git a/pcbnew/drc/drc_rtree.h b/pcbnew/drc/drc_rtree.h index aef78e0abb..87114548ac 100644 --- a/pcbnew/drc/drc_rtree.h +++ b/pcbnew/drc/drc_rtree.h @@ -35,6 +35,7 @@ #include #include +#include #include /** diff --git a/pcbnew/router/router_preview_item.cpp b/pcbnew/router/router_preview_item.cpp index 9c85ba072c..bd383f8b4e 100644 --- a/pcbnew/router/router_preview_item.cpp +++ b/pcbnew/router/router_preview_item.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "router_preview_item.h" diff --git a/pcbnew/track.cpp b/pcbnew/track.cpp index 1ee08cb60e..616d4ab6fd 100644 --- a/pcbnew/track.cpp +++ b/pcbnew/track.cpp @@ -35,11 +35,13 @@ #include #include #include +#include #include #include #include #include #include +#include using KIGFX::PCB_PAINTER; using KIGFX::PCB_RENDER_SETTINGS; @@ -57,6 +59,14 @@ EDA_ITEM* TRACK::Clone() const } +ARC::ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc ) : TRACK( aParent, PCB_ARC_T ) +{ + m_Start = wxPoint( aArc->GetP0() ); + m_End = wxPoint( aArc->GetP1() ); + m_Mid = wxPoint( aArc->GetArcMid() ); +} + + EDA_ITEM* ARC::Clone() const { return new ARC( *this ); @@ -104,6 +114,14 @@ BITMAPS VIA::GetMenuImage() const } +bool TRACK::ApproxCollinear( const TRACK& aTrack ) +{ + SEG a( m_Start, m_End ); + SEG b( aTrack.GetStart(), aTrack.GetEnd() ); + return a.ApproxCollinear( b ); +} + + int TRACK::GetLocalClearance( wxString* aSource ) const { // Not currently implemented @@ -263,6 +281,12 @@ const EDA_RECT TRACK::GetBoundingBox() const } +double TRACK::GetLength() const +{ + return GetLineLength( m_Start, m_End ); +} + + void TRACK::Rotate( const wxPoint& aRotCentre, double aAngle ) { RotatePoint( &m_Start, aRotCentre, aAngle ); diff --git a/pcbnew/track.h b/pcbnew/track.h index ac6d44f001..082d5d1434 100644 --- a/pcbnew/track.h +++ b/pcbnew/track.h @@ -38,14 +38,7 @@ #include -#include #include -#include - -#include -#include - -#include class TRACK; @@ -53,6 +46,7 @@ class VIA; class PAD; class MSG_PANEL_ITEM; class SHAPE_POLY_SET; +class SHAPE_ARC; // Flag used in locate routines (from which endpoint work) @@ -137,10 +131,7 @@ public: * returns the length of the track using the hypotenuse calculation. * @return double - the length of the track */ - virtual double GetLength() const - { - return GetLineLength( m_Start, m_End ); - } + virtual double GetLength() const; /** * Function TransformShapeWithClearanceToPolygon @@ -186,12 +177,7 @@ public: bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override; bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override; - bool ApproxCollinear( const TRACK& aTrack ) - { - SEG a( m_Start, m_End ); - SEG b( aTrack.GetStart(), aTrack.GetEnd() ); - return a.ApproxCollinear( b ); - } + bool ApproxCollinear( const TRACK& aTrack ); wxString GetClass() const override { @@ -263,13 +249,7 @@ class ARC : public TRACK public: ARC( BOARD_ITEM* aParent ) : TRACK( aParent, PCB_ARC_T ){}; - ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc ) : - TRACK( aParent, PCB_ARC_T ) - { - m_Start = wxPoint( aArc->GetP0() ); - m_End = wxPoint( aArc->GetP1() ); - m_Mid = wxPoint( aArc->GetArcMid() ); - } + ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc ); static inline bool ClassOf( const EDA_ITEM *aItem ) {