KiCad PCB EDA Suite
eda_3d_actions.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) 2017 Jon Evans <[email protected]>
5 * Copyright (C) 2017-2020 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <tool/tool_manager.h>
22#include <bitmaps.h>
23#include <3d_viewer_id.h>
24#include <3d_enums.h>
25#include "eda_3d_actions.h"
26
27
28// Actions, being statically-defined, require specialized I18N handling. We continue to
29// use the _() macro so that string harvesting by the I18N framework doesn't have to be
30// specialized, but we don't translate on initialization and instead do it in the getters.
31
32#undef _
33#define _(s) s
34
35
37 0, "", "", "",
38 BITMAPS::INVALID_BITMAP, AF_ACTIVATE ); // No description, it is not supposed to be shown anywhere
39
40TOOL_ACTION EDA_3D_ACTIONS::pivotCenter( "3DViewer.Control.pivotCenter",
42 ' ', "",
43 _( "Center pivot rotation" ), _( "Center pivot rotation (middle mouse click)" ),
44 BITMAPS::INVALID_BITMAP, AF_NONE, (void*) WXK_SPACE );
45
46TOOL_ACTION EDA_3D_ACTIONS::rotateXCW( "3DViewer.Control.rotateXclockwise",
47 AS_GLOBAL, 0, "",
48 _( "Rotate X Clockwise" ), _( "Rotate X Clockwise" ),
50
51TOOL_ACTION EDA_3D_ACTIONS::rotateXCCW( "3DViewer.Control.rotateXcounterclockwise",
52 AS_GLOBAL, 0, "",
53 _( "Rotate X Counterclockwise" ), _( "Rotate X Counterclockwise" ),
55
56TOOL_ACTION EDA_3D_ACTIONS::rotateYCW( "3DViewer.Control.rotateYclockwise",
57 AS_GLOBAL, 0, "",
58 _( "Rotate Y Clockwise" ), _( "Rotate Y Clockwise" ),
60
61TOOL_ACTION EDA_3D_ACTIONS::rotateYCCW( "3DViewer.Control.rotateYcounterclockwise",
62 AS_GLOBAL, 0, "",
63 _( "Rotate Y Counterclockwise" ), _( "Rotate Y Counterclockwise" ),
65
66TOOL_ACTION EDA_3D_ACTIONS::rotateZCW( "3DViewer.Control.rotateZclockwise",
67 AS_GLOBAL, 0, "",
68 _( "Rotate Z Clockwise" ), _( "Rotate Z Clockwise" ),
70
71TOOL_ACTION EDA_3D_ACTIONS::rotateZCCW( "3DViewer.Control.rotateZcounterclockwise",
72 AS_GLOBAL, 0, "",
73 _( "Rotate Z Counterclockwise" ), _( "Rotate Z Counterclockwise" ),
75
76TOOL_ACTION EDA_3D_ACTIONS::moveLeft( "3DViewer.Control.moveLeft",
78 WXK_LEFT, "",
79 _( "Move board Left" ), _( "Move board Left" ),
80 BITMAPS::left, AF_NONE, (void*) CURSOR_LEFT );
81
82TOOL_ACTION EDA_3D_ACTIONS::moveRight( "3DViewer.Control.moveRight",
84 WXK_RIGHT, "",
85 _( "Move board Right" ), _( "Move board Right" ),
86 BITMAPS::right, AF_NONE, (void*) CURSOR_RIGHT );
87
88TOOL_ACTION EDA_3D_ACTIONS::moveUp( "3DViewer.Control.moveUp",
90 WXK_UP, "",
91 _( "Move board Up" ), _( "Move board Up" ),
92 BITMAPS::up, AF_NONE, (void*) CURSOR_UP );
93
94TOOL_ACTION EDA_3D_ACTIONS::moveDown( "3DViewer.Control.moveDown",
96 WXK_DOWN, "",
97 _( "Move board Down" ), _( "Move board Down" ),
98 BITMAPS::down, AF_NONE, (void*) CURSOR_DOWN );
99
100TOOL_ACTION EDA_3D_ACTIONS::homeView( "3DViewer.Control.homeView",
101 AS_ACTIVE,
102 WXK_HOME, "",
103 _( "Home view" ), _( "Home view" ),
104 BITMAPS::INVALID_BITMAP, AF_NONE, (void*) WXK_HOME );
105
106TOOL_ACTION EDA_3D_ACTIONS::resetView( "3DViewer.Control.resetView",
107 AS_ACTIVE,
108 'R', "",
109 _( "Reset view" ), _( "Reset view" ),
111
112TOOL_ACTION EDA_3D_ACTIONS::flipView( "3DViewer.Control.flipView",
113 AS_ACTIVE,
114 'F', "",
115 _( "Flip Board" ), _( "Flip the board view" ),
117
118TOOL_ACTION EDA_3D_ACTIONS::toggleOrtho( "3DViewer.Control.toggleOrtho",
119 AS_GLOBAL, 0, "",
120 _( "Toggle orthographic projection" ), _( "Enable/disable orthographic projection" ),
122
123TOOL_ACTION EDA_3D_ACTIONS::viewFront( "3DViewer.Control.viewFront",
124 AS_ACTIVE,
125 'Y', "",
126 _( "View Front" ), _( "View Front" ),
128
129TOOL_ACTION EDA_3D_ACTIONS::viewBack( "3DViewer.Control.viewBack",
130 AS_ACTIVE,
131 MD_SHIFT + 'Y', "",
132 _( "View Back" ), _( "View Back" ),
134
135TOOL_ACTION EDA_3D_ACTIONS::viewLeft( "3DViewer.Control.viewLeft",
136 AS_ACTIVE,
137 MD_SHIFT + 'X', "",
138 _( "View Left" ), _( "View Left" ),
140
141TOOL_ACTION EDA_3D_ACTIONS::viewRight( "3DViewer.Control.viewRight",
142 AS_ACTIVE,
143 'X', "",
144 _( "View Right" ), _( "View Right" ),
146
147TOOL_ACTION EDA_3D_ACTIONS::viewTop( "3DViewer.Control.viewTop",
148 AS_ACTIVE,
149 'Z', "",
150 _( "View Top" ), _( "View Top" ),
152
153TOOL_ACTION EDA_3D_ACTIONS::viewBottom( "3DViewer.Control.viewBottom",
154 AS_ACTIVE,
155 MD_SHIFT + 'Z', "",
156 _( "View Bottom" ), _( "View Bottom" ),
158
159TOOL_ACTION EDA_3D_ACTIONS::noGrid( "3DViewer.Control.noGrid",
160 AS_GLOBAL, 0, "",
161 _( "No 3D Grid" ), _( "No 3D Grid" ),
163
164TOOL_ACTION EDA_3D_ACTIONS::show10mmGrid( "3DViewer.Control.show10mmGrid",
165 AS_GLOBAL, 0, "",
166 _( "3D Grid 10mm" ), _( "3D Grid 10mm" ),
168
169TOOL_ACTION EDA_3D_ACTIONS::show5mmGrid( "3DViewer.Control.show5mmGrid",
170 AS_GLOBAL, 0, "",
171 _( "3D Grid 5mm" ), _( "3D Grid 5mm" ),
173
174TOOL_ACTION EDA_3D_ACTIONS::show2_5mmGrid( "3DViewer.Control.show2_5mmGrid",
175 AS_GLOBAL, 0, "",
176 _( "3D Grid 2.5mm" ), _( "3D Grid 2.5mm" ),
178
179TOOL_ACTION EDA_3D_ACTIONS::show1mmGrid( "3DViewer.Control.show1mmGrid",
180 AS_GLOBAL, 0, "",
181 _( "3D Grid 1mm" ), _( "3D Grid 1mm" ),
183
184TOOL_ACTION EDA_3D_ACTIONS::materialNormal( "3DViewer.Control.materialNormal",
185 AS_ACTIVE,
186 0, "",
187 _( "Render Realistic Materials" ),
188 _( "Use all material properties from each 3D model file" ),
190
191TOOL_ACTION EDA_3D_ACTIONS::materialDiffuse( "3DViewer.Control.materialDiffuse",
192 AS_ACTIVE,
193 0, "",
194 _( "Render Solid Colors" ),
195 _( "Use only the diffuse color property from model 3D model file" ),
197
198TOOL_ACTION EDA_3D_ACTIONS::materialCAD( "3DViewer.Control.materialCAD",
199 AS_ACTIVE,
200 0, "",
201 _( "Render CAD Colors" ),
202 _( "Use a CAD color style based on the diffuse color of the material" ),
204
205TOOL_ACTION EDA_3D_ACTIONS::showTHT( "3DViewer.Control.attributesTHT",
206 AS_ACTIVE,
207 'T', "",
208 _( "Toggle Through Hole 3D models" ),
209 _( "Toggle 3D models for 'Through hole' type components" ),
211
212TOOL_ACTION EDA_3D_ACTIONS::showSMD( "3DViewer.Control.attributesSMD",
213 AS_ACTIVE,
214 'S', "",
215 _( "Toggle SMD 3D models" ),
216 _( "Toggle 3D models for 'Surface mount' type components" ),
218
219TOOL_ACTION EDA_3D_ACTIONS::showVirtual( "3DViewer.Control.attributesOther",
220 AS_ACTIVE,
221 'V', "",
222 _( "Toggle unspecified 3D models" ), _( "Toggle 3D models for 'unspecified' type components" ),
224
225TOOL_ACTION EDA_3D_ACTIONS::showNotInPosFile( "3DViewer.Control.attribute_not_in_posfile",
226 AS_ACTIVE,
227 'P', "",
228 _( "Toggle 3D models not in pos file" ), _( "Toggle 3D models not in pos file" ),
230
231TOOL_ACTION EDA_3D_ACTIONS::showBBoxes( "3DViewer.Control.showBoundingBoxes",
232 AS_GLOBAL, 0, "",
233 _( "Show Model Bounding Boxes" ), _( "Show Model Bounding Boxes" ),
235
236TOOL_ACTION EDA_3D_ACTIONS::toggleRealisticMode( "3DViewer.Control.toggleRealisticMode",
237 AS_GLOBAL, 0, "",
238 _( "Toggle realistic mode" ), _( "Toggle realistic mode" ) );
239
240TOOL_ACTION EDA_3D_ACTIONS::toggleBoardBody( "3DViewer.Control.toggleBoardBody",
241 AS_GLOBAL, 0, "",
242 _( "Toggle board body display" ), _( "Toggle board body display" ) );
243
244TOOL_ACTION EDA_3D_ACTIONS::showAxis( "3DViewer.Control.showAxis",
245 AS_GLOBAL, 0, "",
246 _( "Show 3D Axis" ), _( "Show 3D Axis" ),
248
249TOOL_ACTION EDA_3D_ACTIONS::toggleZones( "3DViewer.Control.toggleZones",
250 AS_GLOBAL, 0, "",
251 _( "Toggle zone display" ), _( "Toggle zone display" ) );
252
253TOOL_ACTION EDA_3D_ACTIONS::toggleAdhesive( "3DViewer.Control.toggleAdhesive",
254 AS_GLOBAL, 0, "",
255 _( "Toggle adhesive display" ), _( "Toggle display of adhesive layers" ) );
256
257TOOL_ACTION EDA_3D_ACTIONS::toggleSilk( "3DViewer.Control.toggleSilk",
258 AS_GLOBAL, 0, "",
259 _( "Toggle silkscreen display" ), _( "Toggle display of silkscreen layers" ) );
260
261TOOL_ACTION EDA_3D_ACTIONS::toggleSolderMask( "3DViewer.Control.toggleSolderMask",
262 AS_GLOBAL, 0, "",
263 _( "Toggle solder mask display" ), _( "Toggle display of solder mask layers" ) );
264
265TOOL_ACTION EDA_3D_ACTIONS::toggleSolderPaste( "3DViewer.Control.toggleSolderPaste",
266 AS_GLOBAL, 0, "",
267 _( "Toggle solder paste display" ), _( "Toggle display of solder paste layers" ) );
268
269TOOL_ACTION EDA_3D_ACTIONS::toggleComments( "3DViewer.Control.toggleComments",
270 AS_GLOBAL, 0, "",
271 _( "Toggle comments display" ), _( "Toggle display of comments and drawings layers" ) );
272
273TOOL_ACTION EDA_3D_ACTIONS::toggleECO( "3DViewer.Control.toggleECO",
274 AS_GLOBAL, 0, "",
275 _( "Toggle ECO display" ), _( "Toggle display of ECO layers" ) );
276
declared enumerations and flags
@ NORMAL
Use all material properties from model file.
@ CAD_MODE
Use a gray shading based on diffuse material.
@ DIFFUSE_ONLY
Use only diffuse material properties.
@ ID_VIEW3D_BACK
Definition: 3d_viewer_id.h:26
@ ID_VIEW3D_RESET
Definition: 3d_viewer_id.h:27
@ ID_VIEW3D_RIGHT
Definition: 3d_viewer_id.h:24
@ ID_VIEW3D_FRONT
Definition: 3d_viewer_id.h:25
@ ID_VIEW3D_TOP
Definition: 3d_viewer_id.h:21
@ ID_VIEW3D_LEFT
Definition: 3d_viewer_id.h:23
@ ID_VIEW3D_FLIP
Definition: 3d_viewer_id.h:28
@ ID_VIEW3D_BOTTOM
Definition: 3d_viewer_id.h:22
@ rotate_ccw_z
@ rotate_ccw_x
@ rotate_ccw_y
@ show_not_in_posfile
@ axis3d_bottom
@ INVALID_BITMAP
@ axis3d_front
@ axis3d_right
static TOOL_ACTION resetView
static TOOL_ACTION toggleSolderMask
static TOOL_ACTION toggleBoardBody
static TOOL_ACTION rotateXCCW
static TOOL_ACTION showNotInPosFile
static TOOL_ACTION showTHT
static TOOL_ACTION noGrid
static TOOL_ACTION toggleComments
static TOOL_ACTION show2_5mmGrid
static TOOL_ACTION rotateZCCW
static TOOL_ACTION rotateZCW
static TOOL_ACTION toggleSilk
static TOOL_ACTION rotateYCCW
static TOOL_ACTION rotateXCW
static TOOL_ACTION viewTop
static TOOL_ACTION show1mmGrid
static TOOL_ACTION toggleZones
static TOOL_ACTION toggleOrtho
static TOOL_ACTION moveLeft
static TOOL_ACTION viewLeft
static TOOL_ACTION show10mmGrid
static TOOL_ACTION viewBack
static TOOL_ACTION show5mmGrid
static TOOL_ACTION viewRight
static TOOL_ACTION showSMD
static TOOL_ACTION homeView
static TOOL_ACTION moveUp
static TOOL_ACTION flipView
static TOOL_ACTION moveDown
static TOOL_ACTION viewBottom
static TOOL_ACTION moveRight
static TOOL_ACTION materialDiffuse
static TOOL_ACTION toggleAdhesive
static TOOL_ACTION pivotCenter
static TOOL_ACTION controlActivate
static TOOL_ACTION showVirtual
static TOOL_ACTION rotateYCW
static TOOL_ACTION materialCAD
static TOOL_ACTION viewFront
static TOOL_ACTION toggleRealisticMode
static TOOL_ACTION showBBoxes
static TOOL_ACTION toggleECO
static TOOL_ACTION materialNormal
static TOOL_ACTION showAxis
static TOOL_ACTION toggleSolderPaste
Represent a single user action.
Definition: tool_action.h:68
#define _(s)
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:45
@ AS_ACTIVE
All active tools.
Definition: tool_action.h:44
@ AF_ACTIVATE
Action activates a tool.
Definition: tool_action.h:52
@ AF_NONE
Definition: tool_action.h:51
@ MD_SHIFT
Definition: tool_event.h:138