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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef __PCB_TEST_FRAME_H
22#define __PCB_TEST_FRAME_H
23
24#include <wx/wx.h>
25#include <wx/app.h>
26
27#include <memory>
28
29#include <pcb_draw_panel_gal.h>
31
32#include <tool/tools_holder.h>
33
34using std::unique_ptr;
35
37class BOARD;
38
39class TOOL_MANAGER;
40class TOOL_DISPATCHER;
41class ACTIONS;
42class PCB_SELECTION;
44
45namespace KIGFX {
46 class VIEW;
47};
48
50{
51public:
53 virtual ~PCB_TEST_FRAME_BASE();
54
55 virtual void SetBoard( std::shared_ptr<BOARD> b);
56 virtual BOARD* LoadAndDisplayBoard ( const std::string& filename );
57
58 std::shared_ptr < PCB_DRAW_PANEL_GAL > GetPanel() { return m_galPanel; }
59 std::shared_ptr < BOARD > GetBoard() { return m_board; }
60
61 void LoadSettings();
62
63 virtual wxWindow* GetToolCanvas() const override
64 {
65 return m_galPanel.get();
66 }
67
68 void SetSelectionHook( std::function<void(PCB_TEST_FRAME_BASE*, PCB_SELECTION*)> aHook );
69 void SetSelectableItemTypes( const std::vector<KICAD_T> aTypes );
70 std::shared_ptr< PCB_TEST_SELECTION_TOOL> GetSelectionTool() const { return m_selectionTool; }
71
72protected:
73
75 virtual void createUserTools() {};
76
77 std::shared_ptr < PCB_DRAW_PANEL_GAL > m_galPanel;
78 std::shared_ptr < BOARD > m_board;
79 std::shared_ptr < PCB_TEST_SELECTION_TOOL> m_selectionTool;
81 wxString m_mruPath;
82};
83
84void SetTopFrame ( wxFrame* aFrame );
85
86#endif
Gather all the actions that are shared by tools.
Definition actions.h:44
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
@ GAL_TYPE_OPENGL
OpenGL implementation.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
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()
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:
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29
void SetTopFrame(wxFrame *aFrame)