KiCad PCB EDA Suite
Loading...
Searching...
No Matches
toolbars_3d.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) 2016 Mario Luzeiro <[email protected]>
5 * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
6 * Copyright (C) 2013 Wayne Stambaugh <[email protected]>
7 * Copyright (C) 2023 CERN
8 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, you may find one here:
22 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
23 * or you may search the http://www.gnu.org website for the version 2 license,
24 * or you may write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26 */
27
28#include <wx/wupdlock.h>
29#include <wx/choice.h>
30
31#include <bitmaps.h>
33#include <eda_3d_viewer_frame.h>
34#include <tool/action_toolbar.h>
36#include <3d_viewer_id.h>
37
38#include <toolbars_3d.h>
39
40
41std::optional<TOOLBAR_CONFIGURATION> EDA_3D_VIEWER_TOOLBAR_SETTINGS::DefaultToolbarConfig( TOOLBAR_LOC aToolbar )
42{
44
45 // clang-format off
46 switch( aToolbar )
47 {
48 case TOOLBAR_LOC::LEFT:
49 case TOOLBAR_LOC::RIGHT:
50 case TOOLBAR_LOC::TOP_AUX:
51 return std::nullopt;
52 case TOOLBAR_LOC::TOP_MAIN:
53 config.AppendAction( EDA_3D_ACTIONS::reloadBoard );
54
55 config.AppendSeparator()
56 .AppendAction( EDA_3D_ACTIONS::copyToClipboard );
57
58 config.AppendSeparator()
59 .AppendAction( EDA_3D_ACTIONS::toggleRaytacing );
60
61 config.AppendSeparator()
62 .AppendAction( ACTIONS::zoomRedraw )
63 .AppendAction( ACTIONS::zoomInCenter )
64 .AppendAction( ACTIONS::zoomOutCenter )
65 .AppendAction( ACTIONS::zoomFitScreen );
66
67 config.AppendSeparator()
68 .AppendAction( EDA_3D_ACTIONS::rotateXCW )
69 .AppendAction( EDA_3D_ACTIONS::rotateXCCW );
70
71 config.AppendSeparator()
72 .AppendAction( EDA_3D_ACTIONS::rotateYCW )
73 .AppendAction( EDA_3D_ACTIONS::rotateYCCW );
74
75 config.AppendSeparator()
76 .AppendAction( EDA_3D_ACTIONS::rotateZCW )
77 .AppendAction( EDA_3D_ACTIONS::rotateZCCW );
78
79 config.AppendSeparator()
80 .AppendAction( EDA_3D_ACTIONS::flipView );
81
82 config.AppendSeparator()
83 .AppendAction( EDA_3D_ACTIONS::moveLeft )
84 .AppendAction( EDA_3D_ACTIONS::moveRight )
85 .AppendAction( EDA_3D_ACTIONS::moveUp )
86 .AppendAction( EDA_3D_ACTIONS::moveDown );
87
88 config.AppendSeparator()
89 .AppendAction( EDA_3D_ACTIONS::toggleOrtho );
90
91 config.AppendSeparator()
92 .AppendAction( EDA_3D_ACTIONS::showLayersManager );
93 break;
94 }
95
96 // clang-format on
97 return config;
98}
static TOOL_ACTION zoomRedraw
Definition: actions.h:124
static TOOL_ACTION zoomOutCenter
Definition: actions.h:128
static TOOL_ACTION zoomFitScreen
Definition: actions.h:134
static TOOL_ACTION zoomInCenter
Definition: actions.h:127
static TOOL_ACTION showLayersManager
static TOOL_ACTION rotateXCCW
static TOOL_ACTION reloadBoard
static TOOL_ACTION rotateZCCW
static TOOL_ACTION rotateZCW
static TOOL_ACTION rotateYCCW
static TOOL_ACTION rotateXCW
static TOOL_ACTION toggleOrtho
static TOOL_ACTION moveLeft
static TOOL_ACTION toggleRaytacing
static TOOL_ACTION moveUp
static TOOL_ACTION flipView
static TOOL_ACTION moveDown
static TOOL_ACTION copyToClipboard
static TOOL_ACTION moveRight
static TOOL_ACTION rotateYCW
std::optional< TOOLBAR_CONFIGURATION > DefaultToolbarConfig(TOOLBAR_LOC aToolbar) override
Get the default tools to show on the specified canvas toolbar.
Definition: toolbars_3d.cpp:41
Declaration of the eda_3d_viewer class.