router: use SHAPEs and PNS::ITEMs only in the ROUTER_PREVIEW_ITEM
This commit is contained in:
parent
b08280d00c
commit
a4ad47cd08
|
@ -1391,8 +1391,7 @@ void PNS_KICAD_IFACE::DisplayItem( const PNS::ITEM* aItem, int aClearance, bool
|
||||||
|
|
||||||
void PNS_KICAD_IFACE::DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor )
|
void PNS_KICAD_IFACE::DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor )
|
||||||
{
|
{
|
||||||
ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( nullptr, m_view );
|
ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( aRatline, m_view );
|
||||||
pitem->Line( aRatline, 10000, aColor );
|
|
||||||
m_previewItems->Add( pitem );
|
m_previewItems->Add( pitem );
|
||||||
m_view->Update( m_previewItems );
|
m_view->Update( m_previewItems );
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,28 @@ ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM( const PNS::ITEM* aItem, KIGFX::VIEW* a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM( const SHAPE& aShape, KIGFX::VIEW* aView ) :
|
||||||
|
EDA_ITEM( NOT_USED )
|
||||||
|
{
|
||||||
|
m_view = aView;
|
||||||
|
|
||||||
|
m_shape = aShape.Clone();
|
||||||
|
m_hole = nullptr;
|
||||||
|
|
||||||
|
m_clearance = -1;
|
||||||
|
m_originLayer = m_layer = LAYER_SELECT_OVERLAY ;
|
||||||
|
|
||||||
|
m_showClearance = false;
|
||||||
|
|
||||||
|
// initialize variables, overwritten by Update( aItem ), if aItem != NULL
|
||||||
|
m_router = nullptr;
|
||||||
|
m_type = PR_SHAPE;
|
||||||
|
m_style = 0;
|
||||||
|
m_width = 0;
|
||||||
|
m_depth = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ROUTER_PREVIEW_ITEM::~ROUTER_PREVIEW_ITEM()
|
ROUTER_PREVIEW_ITEM::~ROUTER_PREVIEW_ITEM()
|
||||||
{
|
{
|
||||||
delete m_shape;
|
delete m_shape;
|
||||||
|
@ -442,32 +464,6 @@ void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ROUTER_PREVIEW_ITEM::Line( const SHAPE_LINE_CHAIN& aLine, int aWidth, int aStyle )
|
|
||||||
{
|
|
||||||
m_width = aWidth;
|
|
||||||
|
|
||||||
if( aStyle >= 0 )
|
|
||||||
m_color = assignColor( aStyle );
|
|
||||||
|
|
||||||
m_type = PR_SHAPE;
|
|
||||||
m_depth = -1024; // TODO gal->GetMinDepth()
|
|
||||||
|
|
||||||
SHAPE_LINE_CHAIN *lc = static_cast<SHAPE_LINE_CHAIN*>( aLine.Clone() );
|
|
||||||
lc->SetWidth( aWidth );
|
|
||||||
m_shape = lc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ROUTER_PREVIEW_ITEM::Point( const VECTOR2I& aPos, int aStyle )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ROUTER_PREVIEW_ITEM::Box( const BOX2I& aBox, int aStyle )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const COLOR4D ROUTER_PREVIEW_ITEM::getLayerColor( int aLayer ) const
|
const COLOR4D ROUTER_PREVIEW_ITEM::getLayerColor( int aLayer ) const
|
||||||
{
|
{
|
||||||
auto settings = static_cast<PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
|
auto settings = static_cast<PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
|
||||||
|
|
|
@ -55,15 +55,12 @@ public:
|
||||||
PR_SHAPE
|
PR_SHAPE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ROUTER_PREVIEW_ITEM( const SHAPE& aShape, KIGFX::VIEW* aView = nullptr);
|
||||||
ROUTER_PREVIEW_ITEM( const PNS::ITEM* aItem = nullptr, KIGFX::VIEW* aView = nullptr);
|
ROUTER_PREVIEW_ITEM( const PNS::ITEM* aItem = nullptr, KIGFX::VIEW* aView = nullptr);
|
||||||
~ROUTER_PREVIEW_ITEM();
|
~ROUTER_PREVIEW_ITEM();
|
||||||
|
|
||||||
void Update( const PNS::ITEM* aItem );
|
void Update( const PNS::ITEM* aItem );
|
||||||
|
|
||||||
void Line( const SHAPE_LINE_CHAIN& aLine, int aWidth = 0, int aStyle = -1 );
|
|
||||||
void Box( const BOX2I& aBox, int aStyle = 0 );
|
|
||||||
void Point ( const VECTOR2I& aPos, int aStyle = 0);
|
|
||||||
|
|
||||||
void SetColor( const KIGFX::COLOR4D& aColor )
|
void SetColor( const KIGFX::COLOR4D& aColor )
|
||||||
{
|
{
|
||||||
m_color = aColor;
|
m_color = aColor;
|
||||||
|
|
Loading…
Reference in New Issue