diff --git a/pcbnew/tools/pcb_tool.cpp b/pcbnew/tools/pcb_tool.cpp index 26640cf31b..0347ca7ece 100644 --- a/pcbnew/tools/pcb_tool.cpp +++ b/pcbnew/tools/pcb_tool.cpp @@ -214,3 +214,17 @@ PCB_DRAW_PANEL_GAL* PCB_TOOL::canvas() const { return static_cast( frame()->GetGalCanvas() ); } + +const SELECTION& PCB_TOOL::selection() const +{ + auto selTool = m_toolMgr->GetTool(); + const auto& selection = selTool->GetSelection(); + return selection; +} + +SELECTION& PCB_TOOL::selection() +{ + auto selTool = m_toolMgr->GetTool(); + auto& selection = selTool->GetSelection(); + return selection; +} diff --git a/pcbnew/tools/pcb_tool.h b/pcbnew/tools/pcb_tool.h index 5306214194..b00ea8b711 100644 --- a/pcbnew/tools/pcb_tool.h +++ b/pcbnew/tools/pcb_tool.h @@ -47,6 +47,7 @@ class PCB_TOOL; class PCB_EDIT_FRAME; class PCB_DISPLAY_OPTIONS; class PCB_DRAW_PANEL_GAL; +class SELECTION; struct INTERACTIVE_PLACER_BASE { @@ -135,6 +136,8 @@ protected: MODULE* module() const { return board()->m_Modules; } PCB_DISPLAY_OPTIONS* displayOptions() const; PCB_DRAW_PANEL_GAL* canvas() const; + const SELECTION& selection() const; + SELECTION& selection(); bool m_editModules; };