diff --git a/pcbnew/router/pns_diff_pair_placer.cpp b/pcbnew/router/pns_diff_pair_placer.cpp index 37d60942332..62db640b292 100644 --- a/pcbnew/router/pns_diff_pair_placer.cpp +++ b/pcbnew/router/pns_diff_pair_placer.cpp @@ -848,14 +848,10 @@ void DIFF_PAIR_PLACER::updateLeadingRatLine() TOPOLOGY topo( m_lastNode ); if( topo.LeadingRatLine( &m_currentTrace.PLine(), ratLineP ) ) - { - Dbg()->AddLine( ratLineP, 1, 10000 ); - } + m_router->GetInterface()->DisplayRatline( ratLineP, 1 ); if( topo.LeadingRatLine ( &m_currentTrace.NLine(), ratLineN ) ) - { - Dbg()->AddLine( ratLineN, 3, 10000 ); - } + m_router->GetInterface()->DisplayRatline( ratLineN, 3 ); } diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 5f046f9d8b3..dfe7ed682d9 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -1301,6 +1301,15 @@ void PNS_KICAD_IFACE::DisplayItem( const PNS::ITEM* aItem, int aColor, int aClea } +void PNS_KICAD_IFACE::DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor ) +{ + ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( nullptr, m_view ); + pitem->Line( aRatline, 10000, aColor ); + m_previewItems->Add( pitem ); + m_view->Update( m_previewItems ); +} + + void PNS_KICAD_IFACE::HideItem( PNS::ITEM* aItem ) { BOARD_CONNECTED_ITEM* parent = aItem->Parent(); diff --git a/pcbnew/router/pns_kicad_iface.h b/pcbnew/router/pns_kicad_iface.h index 698f75d5290..37485966144 100644 --- a/pcbnew/router/pns_kicad_iface.h +++ b/pcbnew/router/pns_kicad_iface.h @@ -62,6 +62,7 @@ class PNS_KICAD_IFACE_BASE : public PNS::ROUTER_IFACE { bool IsItemVisible( const PNS::ITEM* aItem ) const override { return true; } void HideItem( PNS::ITEM* aItem ) override {} void DisplayItem( const PNS::ITEM* aItem, int aColor = 0, int aClearance = 0, bool aEdit = false ) override {} + void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor = -1 ) override {} void AddItem( PNS::ITEM* aItem ) override; void RemoveItem( PNS::ITEM* aItem ) override; void Commit() override {} @@ -117,6 +118,7 @@ class PNS_KICAD_IFACE : public PNS_KICAD_IFACE_BASE { bool IsOnLayer( const PNS::ITEM* aItem, int aLayer ) const override; void HideItem( PNS::ITEM* aItem ) override; void DisplayItem( const PNS::ITEM* aItem, int aColor = 0, int aClearance = 0, bool aEdit = false ) override; + void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor = -1 ) override; void Commit() override; void AddItem( PNS::ITEM* aItem ) override; void RemoveItem( PNS::ITEM* aItem ) override; diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index 42744de4586..736e3a9d006 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -1367,7 +1367,7 @@ void LINE_PLACER::updateLeadingRatLine() TOPOLOGY topo( m_lastNode ); if( topo.LeadingRatLine( ¤t, ratLine ) ) - Dbg()->AddLine( ratLine, 5, 10000 ); + m_router->GetInterface()->DisplayRatline( ratLine, 5 ); } diff --git a/pcbnew/router/pns_router.h b/pcbnew/router/pns_router.h index 41e705b5b1c..7f9d465cfbe 100644 --- a/pcbnew/router/pns_router.h +++ b/pcbnew/router/pns_router.h @@ -102,6 +102,7 @@ enum DRAG_MODE virtual bool IsItemVisible( const PNS::ITEM* aItem ) const = 0; virtual bool IsOnLayer( const PNS::ITEM* aItem, int aLayer ) const = 0; virtual void DisplayItem( const ITEM* aItem, int aColor = -1, int aClearance = -1, bool aEdit = false ) = 0; + virtual void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor = -1 ) = 0; virtual void HideItem( ITEM* aItem ) = 0; virtual void Commit() = 0; virtual bool ImportSizes( SIZES_SETTINGS& aSizes, ITEM* aStartItem, int aNet ) = 0;