Cleanup track.h includes
This commit is contained in:
parent
3b7480c1c1
commit
b610b905fc
|
@ -28,6 +28,7 @@
|
||||||
#include <core/kicad_algo.h>
|
#include <core/kicad_algo.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <connectivity/connectivity_items.h>
|
#include <connectivity/connectivity_items.h>
|
||||||
|
#include <trigo.h>
|
||||||
|
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <geometry/rtree.h>
|
#include <geometry/rtree.h>
|
||||||
|
#include <geometry/shape.h>
|
||||||
#include <math/vector2d.h>
|
#include <math/vector2d.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <geometry/shape_rect.h>
|
#include <geometry/shape_rect.h>
|
||||||
#include <geometry/shape_simple.h>
|
#include <geometry/shape_simple.h>
|
||||||
#include <pcb_painter.h>
|
#include <pcb_painter.h>
|
||||||
|
#include <trigo.h>
|
||||||
|
|
||||||
#include "router_preview_item.h"
|
#include "router_preview_item.h"
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,13 @@
|
||||||
#include <settings/color_settings.h>
|
#include <settings/color_settings.h>
|
||||||
#include <settings/settings_manager.h>
|
#include <settings/settings_manager.h>
|
||||||
#include <i18n_utility.h>
|
#include <i18n_utility.h>
|
||||||
|
#include <geometry/seg.h>
|
||||||
#include <geometry/shape_segment.h>
|
#include <geometry/shape_segment.h>
|
||||||
#include <geometry/shape_circle.h>
|
#include <geometry/shape_circle.h>
|
||||||
#include <geometry/shape_arc.h>
|
#include <geometry/shape_arc.h>
|
||||||
#include <drc/drc_engine.h>
|
#include <drc/drc_engine.h>
|
||||||
#include <pcb_painter.h>
|
#include <pcb_painter.h>
|
||||||
|
#include <trigo.h>
|
||||||
|
|
||||||
using KIGFX::PCB_PAINTER;
|
using KIGFX::PCB_PAINTER;
|
||||||
using KIGFX::PCB_RENDER_SETTINGS;
|
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
|
EDA_ITEM* ARC::Clone() const
|
||||||
{
|
{
|
||||||
return new ARC( *this );
|
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
|
int TRACK::GetLocalClearance( wxString* aSource ) const
|
||||||
{
|
{
|
||||||
// Not currently implemented
|
// 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 )
|
void TRACK::Rotate( const wxPoint& aRotCentre, double aAngle )
|
||||||
{
|
{
|
||||||
RotatePoint( &m_Start, aRotCentre, aAngle );
|
RotatePoint( &m_Start, aRotCentre, aAngle );
|
||||||
|
|
|
@ -38,14 +38,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <board_connected_item.h>
|
#include <board_connected_item.h>
|
||||||
#include <board_item.h>
|
|
||||||
#include <convert_to_biu.h>
|
#include <convert_to_biu.h>
|
||||||
#include <pcb_display_options.h>
|
|
||||||
|
|
||||||
#include <geometry/seg.h>
|
|
||||||
#include <geometry/shape_arc.h>
|
|
||||||
|
|
||||||
#include <trigo.h>
|
|
||||||
|
|
||||||
|
|
||||||
class TRACK;
|
class TRACK;
|
||||||
|
@ -53,6 +46,7 @@ class VIA;
|
||||||
class PAD;
|
class PAD;
|
||||||
class MSG_PANEL_ITEM;
|
class MSG_PANEL_ITEM;
|
||||||
class SHAPE_POLY_SET;
|
class SHAPE_POLY_SET;
|
||||||
|
class SHAPE_ARC;
|
||||||
|
|
||||||
|
|
||||||
// Flag used in locate routines (from which endpoint work)
|
// Flag used in locate routines (from which endpoint work)
|
||||||
|
@ -137,10 +131,7 @@ public:
|
||||||
* returns the length of the track using the hypotenuse calculation.
|
* returns the length of the track using the hypotenuse calculation.
|
||||||
* @return double - the length of the track
|
* @return double - the length of the track
|
||||||
*/
|
*/
|
||||||
virtual double GetLength() const
|
virtual double GetLength() const;
|
||||||
{
|
|
||||||
return GetLineLength( m_Start, m_End );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function TransformShapeWithClearanceToPolygon
|
* Function TransformShapeWithClearanceToPolygon
|
||||||
|
@ -186,12 +177,7 @@ public:
|
||||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||||
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||||
|
|
||||||
bool ApproxCollinear( const TRACK& aTrack )
|
bool ApproxCollinear( const TRACK& aTrack );
|
||||||
{
|
|
||||||
SEG a( m_Start, m_End );
|
|
||||||
SEG b( aTrack.GetStart(), aTrack.GetEnd() );
|
|
||||||
return a.ApproxCollinear( b );
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString GetClass() const override
|
wxString GetClass() const override
|
||||||
{
|
{
|
||||||
|
@ -263,13 +249,7 @@ class ARC : public TRACK
|
||||||
public:
|
public:
|
||||||
ARC( BOARD_ITEM* aParent ) : TRACK( aParent, PCB_ARC_T ){};
|
ARC( BOARD_ITEM* aParent ) : TRACK( aParent, PCB_ARC_T ){};
|
||||||
|
|
||||||
ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc ) :
|
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() );
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool ClassOf( const EDA_ITEM *aItem )
|
static inline bool ClassOf( const EDA_ITEM *aItem )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue