KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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) 2023 CERN
6 * Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include <tool/tool_manager.h>
23#include <bitmaps.h>
24#include <3d_viewer_id.h>
25#include <3d_enums.h>
26#include "eda_3d_actions.h"
27#include "tool/tool_action.h"
28
29
30// Actions, being statically-defined, require specialized I18N handling. We continue to
31// use the _() macro so that string harvesting by the I18N framework doesn't have to be
32// specialized, but we don't translate on initialization and instead do it in the getters.
33
34#undef _
35#define _(s) s
36
37// No description, it is not supposed to be shown anywhere
39 .Name( "3DViewer.Control" )
40 .Scope( AS_GLOBAL )
41 .Flags( AF_ACTIVATE ) );
42
44 .Name( "3DViewer.Control.pivotCenter" )
45 .Scope( AS_ACTIVE )
46 .DefaultHotkey( ' ' )
47 .FriendlyName( _( "Set Pivot" ) )
48 .Tooltip( _( "Place point around which the board will be rotated (middle mouse click)" ) )
49 .Flags( AF_NONE )
51
53 .Name( "3DViewer.Control.rotateXclockwise" )
54 .Scope( AS_GLOBAL )
55 .FriendlyName( _( "Rotate X Clockwise" ) )
57 .Flags( AF_NONE )
58 .Parameter( ROTATION_DIR::X_CW ) );
59
61 .Name( "3DViewer.Control.rotateXcounterclockwise" )
62 .Scope( AS_GLOBAL )
63 .FriendlyName( _( "Rotate X Counterclockwise" ) )
65 .Flags( AF_NONE )
66 .Parameter( ROTATION_DIR::X_CCW ) );
67
69 .Name( "3DViewer.Control.rotateYclockwise" )
70 .Scope( AS_GLOBAL )
71 .FriendlyName( _( "Rotate Y Clockwise" ) )
73 .Flags( AF_NONE )
74 .Parameter( ROTATION_DIR::Y_CW ) );
75
77 .Name( "3DViewer.Control.rotateYcounterclockwise" )
78 .Scope( AS_GLOBAL )
79 .FriendlyName( _( "Rotate Y Counterclockwise" ) )
81 .Flags( AF_NONE )
82 .Parameter( ROTATION_DIR::Y_CCW ) );
83
85 .Name( "3DViewer.Control.rotateZclockwise" )
86 .Scope( AS_GLOBAL )
87 .FriendlyName( _( "Rotate Z Clockwise" ) )
89 .Flags( AF_NONE )
90 .Parameter( ROTATION_DIR::Z_CW ) );
91
93 .Name( "3DViewer.Control.rotateZcounterclockwise" )
94 .Scope( AS_GLOBAL )
95 .FriendlyName( _( "Rotate Z Counterclockwise" ) )
97 .Flags( AF_NONE )
98 .Parameter( ROTATION_DIR::Z_CCW ) );
99
101 .Name( "3DViewer.Control.moveLeft" )
102 .Scope( AS_ACTIVE )
103 .DefaultHotkey( WXK_LEFT )
104 .FriendlyName( _( "Move Board Left" ) )
105 .Icon( BITMAPS::left )
106 .Flags( AF_NONE )
107 .Parameter( CURSOR_LEFT ) );
108
110 .Name( "3DViewer.Control.moveRight" )
111 .Scope( AS_ACTIVE )
112 .DefaultHotkey( WXK_RIGHT )
113 .FriendlyName( _( "Move Board Right" ) )
114 .Icon( BITMAPS::right )
115 .Flags( AF_NONE )
116 .Parameter( CURSOR_RIGHT ) );
117
119 .Name( "3DViewer.Control.moveUp" )
120 .Scope( AS_ACTIVE )
121 .DefaultHotkey( WXK_UP )
122 .FriendlyName( _( "Move Board Up" ) )
123 .Icon( BITMAPS::up )
124 .Flags( AF_NONE )
125 .Parameter( CURSOR_UP ) );
126
128 .Name( "3DViewer.Control.moveDown" )
129 .Scope( AS_ACTIVE )
130 .DefaultHotkey( WXK_DOWN )
131 .FriendlyName( _( "Move Board Down" ) )
132 .Icon( BITMAPS::down )
133 .Flags( AF_NONE )
134 .Parameter( CURSOR_DOWN ) );
135
137 .Name( "3DViewer.Control.homeView" )
138 .Scope( AS_ACTIVE )
139 .DefaultHotkey( WXK_HOME )
140 .FriendlyName ( _( "Home View" ) )
141 .Tooltip( _( "Redraw at the home position and zoom" ) )
142 .Flags( AF_NONE )
143 .Parameter( VIEW3D_TYPE::VIEW3D_FIT_SCREEN ) );
144
146 .Name( "3DViewer.Control.flipView" )
147 .Scope( AS_ACTIVE )
148 .DefaultHotkey( 'F' )
149 .FriendlyName( _( "Flip Board" ) )
150 .Tooltip( _( "Flip the board view" ) )
151 .Icon( BITMAPS::flip_board )
152 .Flags( AF_NONE )
153 .Parameter( VIEW3D_TYPE::VIEW3D_FLIP ) );
154
156 .Name( "3DViewer.Control.toggleOrtho" )
157 .Scope( AS_GLOBAL )
158 .FriendlyName( _( "Toggle Orthographic Projection" ) )
159 .Tooltip( _( "Enable/disable orthographic projection" ) )
160 .Icon( BITMAPS::ortho ) );
161
163 .Name( "3DViewer.Control.viewFront" )
164 .Scope( AS_ACTIVE )
165 .DefaultHotkey( 'Y' )
166 .FriendlyName( _( "View Front" ) )
167 .Icon( BITMAPS::axis3d_front )
168 .Flags( AF_NONE )
169 .Parameter( VIEW3D_TYPE::VIEW3D_FRONT ) );
170
172 .Name( "3DViewer.Control.viewBack" )
173 .Scope( AS_ACTIVE )
174 .DefaultHotkey( MD_SHIFT + 'Y' )
175 .FriendlyName( _( "View Back" ) )
176 .Icon( BITMAPS::axis3d_back )
177 .Flags( AF_NONE )
178 .Parameter( VIEW3D_TYPE::VIEW3D_BACK ) );
179
181 .Name( "3DViewer.Control.viewLeft" )
182 .Scope( AS_ACTIVE )
183 .DefaultHotkey( MD_SHIFT + 'X' )
184 .FriendlyName( _( "View Left" ) )
185 .Icon( BITMAPS::axis3d_left )
186 .Flags( AF_NONE )
187 .Parameter( VIEW3D_TYPE::VIEW3D_LEFT ) );
188
190 .Name( "3DViewer.Control.viewRight" )
191 .Scope( AS_ACTIVE )
192 .DefaultHotkey( 'X' )
193 .FriendlyName( _( "View Right" ) )
194 .Icon( BITMAPS::axis3d_right )
195 .Flags( AF_NONE )
196 .Parameter( VIEW3D_TYPE::VIEW3D_RIGHT ) );
197
199 .Name( "3DViewer.Control.viewTop" )
200 .Scope( AS_ACTIVE )
201 .DefaultHotkey( 'Z' )
202 .FriendlyName( _( "View Top" ) )
203 .Icon( BITMAPS::axis3d_top )
204 .Flags( AF_NONE )
205 .Parameter( VIEW3D_TYPE::VIEW3D_TOP ) );
206
208 .Name( "3DViewer.Control.viewBottom" )
209 .Scope( AS_ACTIVE )
210 .DefaultHotkey( MD_SHIFT + 'Z' )
211 .FriendlyName( _( "View Bottom" ) )
213 .Flags( AF_NONE )
214 .Parameter( VIEW3D_TYPE::VIEW3D_BOTTOM ) );
215
217 .Name( "3DViewer.Control.noGrid" )
218 .Scope( AS_GLOBAL )
219 .FriendlyName( _( "No 3D Grid" ) )
220 .Flags( AF_NONE )
221 .Parameter( GRID3D_TYPE::NONE ) );
222
224 .Name( "3DViewer.Control.show10mmGrid" )
225 .Scope( AS_GLOBAL )
226 .FriendlyName( _( "3D Grid 10mm" ) )
227 .Flags( AF_NONE )
228 .Parameter( GRID3D_TYPE::GRID_10MM ) );
229
231 .Name( "3DViewer.Control.show5mmGrid" )
232 .Scope( AS_GLOBAL )
233 .FriendlyName( _( "3D Grid 5mm" ) )
234 .Flags( AF_NONE )
235 .Parameter( GRID3D_TYPE::GRID_5MM ) );
236
238 .Name( "3DViewer.Control.show2_5mmGrid" )
239 .Scope( AS_GLOBAL )
240 .FriendlyName( _( "3D Grid 2.5mm" ) )
241 .Flags( AF_NONE )
242 .Parameter( GRID3D_TYPE::GRID_2P5MM ) );
243
245 .Name( "3DViewer.Control.show1mmGrid" )
246 .Scope( AS_GLOBAL )
247 .FriendlyName( _( "3D Grid 1mm" ) )
248 .Flags( AF_NONE )
249 .Parameter( GRID3D_TYPE::GRID_1MM ) );
250
252 .Name( "3DViewer.Control.materialNormal" )
253 .Scope( AS_ACTIVE )
254 .FriendlyName( _( "Render Realistic Materials" ) )
255 .Tooltip( _( "Use all material properties from each 3D model file" ) )
256 .Flags( AF_NONE )
257 .Parameter( MATERIAL_MODE::NORMAL ) );
258
260 .Name( "3DViewer.Control.materialDiffuse" )
261 .Scope( AS_ACTIVE )
262 .FriendlyName( _( "Render Solid Colors" ) )
263 .Tooltip( _( "Use only the diffuse color property from 3D model file" ) )
264 .Flags( AF_NONE )
265 .Parameter( MATERIAL_MODE::DIFFUSE_ONLY ) );
266
268 .Name( "3DViewer.Control.materialCAD" )
269 .Scope( AS_ACTIVE )
270 .FriendlyName( _( "Render CAD Colors" ) )
271 .Tooltip( _( "Use a CAD color style based on the diffuse color of the material" ) )
272 .Flags( AF_NONE )
273 .Parameter( MATERIAL_MODE::CAD_MODE ) );
274
276 .Name( "3DViewer.Control.attributesTHT" )
277 .Scope( AS_ACTIVE )
278 .DefaultHotkey( 'T' )
279 .FriendlyName( _( "Show Through Hole 3D Models" ) )
280 .Tooltip( _( "Show 3D models for 'Through hole' type footprints" ) )
281 .Icon( BITMAPS::show_tht )
282 .Flags( AF_NONE ) );
283
285 .Name( "3DViewer.Control.attributesSMD" )
286 .Scope( AS_ACTIVE )
287 .DefaultHotkey( 'S' )
288 .FriendlyName( _( "Show SMD 3D Models" ) )
289 .Tooltip( _( "Show 3D models for 'Surface mount' type footprints" ) )
290 .Icon( BITMAPS::show_smt )
291 .Flags( AF_NONE ) );
292
294 .Name( "3DViewer.Control.attributesOther" )
295 .Scope( AS_ACTIVE )
296 .DefaultHotkey( 'V' )
297 .FriendlyName( _( "Show Unspecified 3D Models" ) )
298 .Tooltip( _( "Show 3D models for 'unspecified' type footprints" ) )
299 .Icon( BITMAPS::show_other )
300 .Flags( AF_NONE ) );
301
303 .Name( "3DViewer.Control.attribute_not_in_posfile" )
304 .Scope( AS_ACTIVE )
305 .DefaultHotkey( 'P' )
306 .FriendlyName( _( "Show 3D Models not in POS File" ) )
307 .Tooltip( _( "Show 3D models even if not found in .pos file" ) )
309 .Flags( AF_NONE ) );
310
312 .Name( "3DViewer.Control.attribute_dnp" )
313 .Scope( AS_ACTIVE )
314 .DefaultHotkey( 'D' )
315 .FriendlyName( _( "Show 3D Models marked DNP" ) )
316 .Tooltip( _( "Show 3D models even if marked 'Do Not Place'" ) )
317 .Icon( BITMAPS::show_dnp )
318 .Flags( AF_NONE ) );
319
321 .Name( "3DViewer.Control.showBoundingBoxes" )
322 .Scope( AS_GLOBAL )
323 .FriendlyName( _( "Show Model Bounding Boxes" ) )
324 .Tooltip( _( "Show 3D model bounding boxes in realtime renderer" ) )
325 .Icon( BITMAPS::ortho )
326 .Flags( AF_NONE ) );
327
329 .Name( "3DViewer.Control.showAxis" )
330 .Scope( AS_GLOBAL )
331 .FriendlyName( _( "Show 3D Axis" ) )
332 .Icon( BITMAPS::axis3d_front )
333 .Flags( AF_NONE ) );
334
336 .Name( "3DViewer.Control.showLayersManager" )
337 .Scope( AS_GLOBAL )
338 .FriendlyName( _( "Show Appearance Manager" ) )
339 .Tooltip( _( "Show/hide the appearance manager" ) )
340 .Icon( BITMAPS::layers_manager ) );
341
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.
@ rotate_ccw_z
@ rotate_ccw_x
@ rotate_ccw_y
@ show_not_in_posfile
@ axis3d_bottom
@ axis3d_front
@ axis3d_right
@ layers_manager
static TOOL_ACTION showLayersManager
static TOOL_ACTION rotateXCCW
static TOOL_ACTION showNotInPosFile
static TOOL_ACTION showTHT
static TOOL_ACTION noGrid
static TOOL_ACTION show2_5mmGrid
static TOOL_ACTION rotateZCCW
static TOOL_ACTION rotateZCW
static TOOL_ACTION rotateYCCW
static TOOL_ACTION rotateXCW
static TOOL_ACTION viewTop
static TOOL_ACTION show1mmGrid
static TOOL_ACTION showDNP
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 pivotCenter
static TOOL_ACTION controlActivate
static TOOL_ACTION showVirtual
static TOOL_ACTION rotateYCW
static TOOL_ACTION materialCAD
static TOOL_ACTION viewFront
static TOOL_ACTION showBBoxes
static TOOL_ACTION materialNormal
static TOOL_ACTION showAxis
Build up the properties of a TOOL_ACTION in an incremental manner that is static-construction safe.
Definition: tool_action.h:102
Represent a single user action.
Definition: tool_action.h:269
#define _(s)
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:48
@ AS_ACTIVE
All active tools.
Definition: tool_action.h:47
@ AF_ACTIVATE
Action activates a tool.
Definition: tool_action.h:55
@ AF_NONE
Definition: tool_action.h:54
@ MD_SHIFT
Definition: tool_event.h:142