diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 336d795336..fc66da12d2 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -20,7 +20,6 @@ #include -#include #include using namespace std::placeholders; @@ -52,10 +51,11 @@ using namespace std::placeholders; #include "pns_router.h" #include "pns_meander_placer.h" // fixme: move settings to separate header #include "pns_tune_status_popup.h" +#include "pns_topology.h" + #include "trace.h" using namespace KIGFX; -using boost::optional; TOOL_ACTION PNS_TOOL_BASE::ACT_RouterOptions( "pcbnew.InteractiveRouter.RouterOptions", AS_CONTEXT, 'E', @@ -105,7 +105,7 @@ void PNS_TOOL_BASE::Reset( RESET_REASON aReason ) m_iface->SetBoard (m_board); m_iface->SetView( getView() ); m_iface->SetHostFrame ( m_frame ); - + m_router = new PNS_ROUTER; m_router->SetInterface(m_iface); m_router->ClearWorld(); @@ -306,8 +306,7 @@ void PNS_TOOL_BASE::updateEndItem( TOOL_EVENT& aEvent ) TRACE( 0, "%s, layer : %d", m_endItem->KindStr().c_str() % m_endItem->Layers().Start() ); } -#if 0 -void PNS_TOOL_BASE::DeleteTraces( PNS_ITEM *aStartItem, bool aWholeTrack ) +void PNS_TOOL_BASE::deleteTraces( PNS_ITEM *aStartItem, bool aWholeTrack ) { PNS_NODE *node = m_router->GetWorld()->Branch(); @@ -328,9 +327,7 @@ void PNS_TOOL_BASE::DeleteTraces( PNS_ITEM *aStartItem, bool aWholeTrack ) } m_router->CommitRouting( node ); - } -#endif PNS_ROUTER *PNS_TOOL_BASE::Router() const { diff --git a/pcbnew/router/pns_tool_base.h b/pcbnew/router/pns_tool_base.h index b6973e7cee..5ecea863b7 100644 --- a/pcbnew/router/pns_tool_base.h +++ b/pcbnew/router/pns_tool_base.h @@ -58,6 +58,7 @@ protected: virtual void highlightNet( bool aEnabled, int aNetcode = -1 ); virtual void updateStartItem( TOOL_EVENT& aEvent ); virtual void updateEndItem( TOOL_EVENT& aEvent ); + void deleteTraces( PNS_ITEM *aStartItem, bool aWholeTrack ); MSG_PANEL_ITEMS m_panelItems; diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 443e92997c..b3eb80c8f1 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -710,12 +710,10 @@ int ROUTER_TOOL::mainLoop( PNS_ROUTER_MODE aMode ) m_toolMgr->RunAction( COMMON_ACTIONS::layerToggle, true ); } else if (evt->IsAction ( &COMMON_ACTIONS::remove ) ) { - printf("delitemcursor\n"); - //m_router->DeleteTraces( m_startItem, true ); + deleteTraces( m_startItem, true ); } else if (evt->IsAction ( &COMMON_ACTIONS::removeAlt ) ) { - printf("delitemcursor [alt]\n"); - //m_router->DeleteTraces( m_startItem, false ); + deleteTraces( m_startItem, false ); } handleCommonEvents( *evt ); diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index dcd50d181b..4d52d39043 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -129,6 +129,11 @@ TOOL_ACTION COMMON_ACTIONS::remove( "pcbnew.InteractiveEdit.remove", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DELETE ), _( "Remove" ), _( "Deletes selected item(s)" ), delete_xpm ); +TOOL_ACTION COMMON_ACTIONS::removeAlt( "pcbnew.InteractiveEdit.removeAlt", + AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_BACK_SPACE ), + _( "Remove (alterative)" ), _( "Deletes selected item(s)" ), delete_xpm ); + + TOOL_ACTION COMMON_ACTIONS::properties( "pcbnew.InteractiveEdit.properties", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_ITEM ), _( "Properties..." ), _( "Displays item properties dialog" ), editor_xpm ); diff --git a/pcbnew/tools/common_actions.h b/pcbnew/tools/common_actions.h index dd2bb9f393..3f69ac20a6 100644 --- a/pcbnew/tools/common_actions.h +++ b/pcbnew/tools/common_actions.h @@ -90,6 +90,7 @@ public: /// Deleting a BOARD_ITEM static TOOL_ACTION remove; + static TOOL_ACTION removeAlt; // Drawing Tool /// Activation of the drawing tool (line)