KiCad PCB EDA Suite
Loading...
Searching...
No Matches
tool_base.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2013 CERN
5 * @author Tomasz Wlostowski <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <tool/tool_event.h>
22#include <tool/tool_manager.h>
23
24#include <eda_draw_frame.h>
25#include <eda_base_frame.h>
26
27
29{
30 return m_toolMgr->IsToolActive( m_toolId );
31}
32
33
35{
36 return m_toolMgr->GetView();
37}
38
39
41{
42 return m_toolMgr->GetViewControls();
43}
44
45
47{
48 return m_toolMgr->GetToolHolder();
49}
50
51
53{
54 return m_toolMgr->GetModel();
55}
56
57
59{
60 m_toolMgr = aManager;
61}
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
An interface for classes handling user events controlling the view behavior such as zooming,...
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
TOOLS_HOLDER * getToolHolderInternal() const
Definition tool_base.cpp:46
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition tool_base.cpp:40
TOOL_MANAGER * m_toolMgr
Definition tool_base.h:220
friend class TOOL_MANAGER
Definition tool_base.h:152
EDA_ITEM * getModelInternal() const
Definition tool_base.cpp:52
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition tool_base.cpp:34
bool IsToolActive() const
Definition tool_base.cpp:28
TOOL_ID m_toolId
Unique id, assigned by a TOOL_MANAGER instance.
Definition tool_base.h:215
void attachManager(TOOL_MANAGER *aManager)
Set the TOOL_MANAGER the tool will belong to.
Definition tool_base.cpp:58
Base window classes and related definitions.