KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_test_frame.h
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-2017 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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef __PCB_TEST_FRAME_H
26#define __PCB_TEST_FRAME_H
27
28#include <wx/wx.h>
29#include <wx/app.h>
30
31#include <memory>
32
33#include <pcb_draw_panel_gal.h>
35
36#include <tool/tools_holder.h>
37
38using std::unique_ptr;
39
41class BOARD;
42
43class TOOL_MANAGER;
44class TOOL_DISPATCHER;
45class ACTIONS;
46class PCB_SELECTION;
48
49namespace KIGFX {
50 class VIEW;
51};
52
54{
55public:
57 virtual ~PCB_TEST_FRAME_BASE();
58
59 virtual void SetBoard( std::shared_ptr<BOARD> b);
60 virtual BOARD* LoadAndDisplayBoard ( const std::string& filename );
61
62 std::shared_ptr < PCB_DRAW_PANEL_GAL > GetPanel() { return m_galPanel; }
63 std::shared_ptr < BOARD > GetBoard() { return m_board; }
64
65 void LoadSettings();
66
67 virtual wxWindow* GetToolCanvas() const override
68 {
69 return m_galPanel.get();
70 }
71
72 void SetSelectionHook( std::function<void(PCB_TEST_FRAME_BASE*, PCB_SELECTION*)> aHook );
73 void SetSelectableItemTypes( const std::vector<KICAD_T> aTypes );
74 std::shared_ptr< PCB_TEST_SELECTION_TOOL> GetSelectionTool() const { return m_selectionTool; }
75
76protected:
77
79 virtual void createUserTools() {};
80
81 std::shared_ptr < PCB_DRAW_PANEL_GAL > m_galPanel;
82 std::shared_ptr < BOARD > m_board;
83 std::shared_ptr < PCB_TEST_SELECTION_TOOL> m_selectionTool;
85 wxString m_mruPath;
86};
87
88void SetTopFrame ( wxFrame* aFrame );
89
90#endif
Gather all the actions that are shared by tools.
Definition: actions.h:41
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:281
@ GAL_TYPE_OPENGL
OpenGL implementation.
std::shared_ptr< BOARD > m_board
std::shared_ptr< PCB_DRAW_PANEL_GAL > GetPanel()
std::shared_ptr< PCB_TEST_SELECTION_TOOL > m_selectionTool
std::shared_ptr< PCB_DRAW_PANEL_GAL > m_galPanel
void createView(wxWindow *aParent, PCB_DRAW_PANEL_GAL::GAL_TYPE aGalType=PCB_DRAW_PANEL_GAL::GAL_TYPE_OPENGL)
std::shared_ptr< BOARD > GetBoard()
std::shared_ptr< PCB_TEST_SELECTION_TOOL > GetSelectionTool() const
virtual void SetBoard(std::shared_ptr< BOARD > b)
virtual wxWindow * GetToolCanvas() const override
Canvas access.
virtual void createUserTools()
virtual ~PCB_TEST_FRAME_BASE()
void SetSelectionHook(std::function< void(PCB_TEST_FRAME_BASE *, PCB_SELECTION *)> aHook)
void SetSelectableItemTypes(const std::vector< KICAD_T > aTypes)
KIGFX::GAL_DISPLAY_OPTIONS m_displayOptions
virtual BOARD * LoadAndDisplayBoard(const std::string &filename)
Master controller class:
Definition: tool_manager.h:57
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247
void SetTopFrame(wxFrame *aFrame)