Cleanup track.h includes

This commit is contained in:
Marek Roszko 2021-06-06 08:59:05 -04:00
parent 3b7480c1c1
commit b610b905fc
5 changed files with 31 additions and 24 deletions

View File

@ -28,6 +28,7 @@
#include <core/kicad_algo.h>
#include <macros.h>
#include <connectivity/connectivity_items.h>
#include <trigo.h>
#include <wx/log.h>

View File

@ -35,6 +35,7 @@
#include <vector>
#include <geometry/rtree.h>
#include <geometry/shape.h>
#include <math/vector2d.h>
/**

View File

@ -25,6 +25,7 @@
#include <geometry/shape_rect.h>
#include <geometry/shape_simple.h>
#include <pcb_painter.h>
#include <trigo.h>
#include "router_preview_item.h"

View File

@ -35,11 +35,13 @@
#include <settings/color_settings.h>
#include <settings/settings_manager.h>
#include <i18n_utility.h>
#include <geometry/seg.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_circle.h>
#include <geometry/shape_arc.h>
#include <drc/drc_engine.h>
#include <pcb_painter.h>
#include <trigo.h>
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 );

View File

@ -38,14 +38,7 @@
#include <board_connected_item.h>
#include <board_item.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;
@ -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 )
{