diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index bedb6af247..bf62227e1b 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -772,7 +772,9 @@ bool ROUTER::movePlacing( const VECTOR2I& aP, ITEM* aEndItem ) return ret; } -std::unique_ptr ROUTER::GetUpdatedItems( std::vector& aRemoved, std::vector& aAdded ) + +void ROUTER::GetUpdatedItems( std::vector& aRemoved, std::vector& aAdded, + std::vector& aHeads ) { NODE *node; ITEM_SET current; @@ -788,19 +790,15 @@ std::unique_ptr ROUTER::GetUpdatedItems( std::vector& aRemoved current = m_dragger->Traces(); } - std::unique_ptr tmpNode( node->Branch() ); + node->GetUpdatedItems( aRemoved, aAdded ); - for( auto item : current ) + for( auto item : current.CItems() ) { - std::unique_ptr ip( item.item->Clone() ); - tmpNode->Add( std::move( ip ) ); + aHeads.push_back( item.item->Clone() ); } - - tmpNode->GetUpdatedItems( aRemoved, aAdded ); - - return std::move( tmpNode ); } + void ROUTER::CommitRouting( NODE* aNode ) { if( m_state == ROUTE_TRACK && !m_placer->HasPlacedAnything() ) diff --git a/pcbnew/router/pns_router.h b/pcbnew/router/pns_router.h index b996066982..7975e64d68 100644 --- a/pcbnew/router/pns_router.h +++ b/pcbnew/router/pns_router.h @@ -150,7 +150,10 @@ public: void UndoLastSegment(); void CommitRouting(); - std::unique_ptr GetUpdatedItems( std::vector& aRemoved, std::vector& aAdded ); + + void GetUpdatedItems( std::vector& aRemoved, std::vector& aAdded, + std::vector& aHeads ); + void StopRouting(); void ClearViewDecorations();