PCB_TOOL: added convenience methods for accessing current SELECTION
This commit is contained in:
parent
fa31d5308a
commit
83b020d4da
|
@ -214,3 +214,17 @@ PCB_DRAW_PANEL_GAL* PCB_TOOL::canvas() const
|
|||
{
|
||||
return static_cast<PCB_DRAW_PANEL_GAL*>( frame()->GetGalCanvas() );
|
||||
}
|
||||
|
||||
const SELECTION& PCB_TOOL::selection() const
|
||||
{
|
||||
auto selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
|
||||
const auto& selection = selTool->GetSelection();
|
||||
return selection;
|
||||
}
|
||||
|
||||
SELECTION& PCB_TOOL::selection()
|
||||
{
|
||||
auto selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
|
||||
auto& selection = selTool->GetSelection();
|
||||
return selection;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue