diff --git a/pcbnew/router/pns_diff_pair_placer.cpp b/pcbnew/router/pns_diff_pair_placer.cpp index 37d6094233..62db640b29 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 5f046f9d8b..dfe7ed682d 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 698f75d529..3748596614 100644 --- a/pcbnew/router/pns_kicad_iface.h +++ b/pcbnew/router/pns_kicad_iface.h @@ -62,6 +62,7 @@ public: 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 @@ public: 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 42744de458..736e3a9d00 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 41e705b5b1..7f9d465cfb 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;