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" ) )
56 .Tooltip( _( "Rotate X Clockwise" ) )
58 .Flags( AF_NONE )
59 .Parameter( ROTATION_DIR::X_CW ) );
60
62 .Name( "3DViewer.Control.rotateXcounterclockwise" )
63 .Scope( AS_GLOBAL )
64 .FriendlyName( _( "Rotate X Counterclockwise" ) )
65 .Tooltip( _( "Rotate X Counterclockwise" ) )
67 .Flags( AF_NONE )
68 .Parameter( ROTATION_DIR::X_CCW ) );
69
71 .Name( "3DViewer.Control.rotateYclockwise" )
72 .Scope( AS_GLOBAL )
73 .FriendlyName( _( "Rotate Y Clockwise" ) )
74 .Tooltip( _( "Rotate Y Clockwise" ) )
76 .Flags( AF_NONE )
77 .Parameter( ROTATION_DIR::Y_CW ) );
78
80 .Name( "3DViewer.Control.rotateYcounterclockwise" )
81 .Scope( AS_GLOBAL )
82 .FriendlyName( _( "Rotate Y Counterclockwise" ) )
83 .Tooltip( _( "Rotate Y Counterclockwise" ) )
85 .Flags( AF_NONE )
86 .Parameter( ROTATION_DIR::Y_CCW ) );
87
89 .Name( "3DViewer.Control.rotateZclockwise" )
90 .Scope( AS_GLOBAL )
91 .FriendlyName( _( "Rotate Z Clockwise" ) )
92 .Tooltip( _( "Rotate Z Clockwise" ) )
94 .Flags( AF_NONE )
95 .Parameter( ROTATION_DIR::Z_CW ) );
96
98 .Name( "3DViewer.Control.rotateZcounterclockwise" )
99 .Scope( AS_GLOBAL )
100 .FriendlyName( _( "Rotate Z Counterclockwise" ) )
101 .Tooltip( _( "Rotate Z Counterclockwise" ) )
102 .Icon( BITMAPS::rotate_ccw_z )
103 .Flags( AF_NONE )
104 .Parameter( ROTATION_DIR::Z_CCW ) );
105
107 .Name( "3DViewer.Control.moveLeft" )
108 .Scope( AS_ACTIVE )
109 .DefaultHotkey( WXK_LEFT )
110 .FriendlyName( _( "Move Board Left" ) )
111 .Tooltip( _( "Move board Left" ) )
112 .Icon( BITMAPS::left )
113 .Flags( AF_NONE )
114 .Parameter( CURSOR_LEFT ) );
115
117 .Name( "3DViewer.Control.moveRight" )
118 .Scope( AS_ACTIVE )
119 .DefaultHotkey( WXK_RIGHT )
120 .FriendlyName( _( "Move Board Right" ) )
121 .Tooltip( _( "Move board Right" ) )
122 .Icon( BITMAPS::right )
123 .Flags( AF_NONE )
124 .Parameter( CURSOR_RIGHT ) );
125
127 .Name( "3DViewer.Control.moveUp" )
128 .Scope( AS_ACTIVE )
129 .DefaultHotkey( WXK_UP )
130 .FriendlyName( _( "Move Board Up" ) )
131 .Tooltip( _( "Move board Up" ) )
132 .Icon( BITMAPS::up )
133 .Flags( AF_NONE )
134 .Parameter( CURSOR_UP ) );
135
137 .Name( "3DViewer.Control.moveDown" )
138 .Scope( AS_ACTIVE )
139 .DefaultHotkey( WXK_DOWN )
140 .FriendlyName( _( "Move Board Down" ) )
141 .Tooltip( _( "Move board Down" ) )
142 .Icon( BITMAPS::down )
143 .Flags( AF_NONE )
144 .Parameter( CURSOR_DOWN ) );
145
147 .Name( "3DViewer.Control.homeView" )
148 .Scope( AS_ACTIVE )
149 .DefaultHotkey( WXK_HOME )
150 .FriendlyName ( _( "Home View" ) )
151 .Tooltip( _( "Home view" ) )
152 .Flags( AF_NONE )
153 .Parameter( VIEW3D_TYPE::VIEW3D_FIT_SCREEN ) );
154
156 .Name( "3DViewer.Control.flipView" )
157 .Scope( AS_ACTIVE )
158 .DefaultHotkey( 'F' )
159 .FriendlyName( _( "Flip Board" ) )
160 .Tooltip( _( "Flip the board view" ) )
161 .Icon( BITMAPS::flip_board )
162 .Flags( AF_NONE )
163 .Parameter( VIEW3D_TYPE::VIEW3D_FLIP ) );
164
166 .Name( "3DViewer.Control.toggleOrtho" )
167 .Scope( AS_GLOBAL )
168 .FriendlyName( _( "Toggle Orthographic Projection" ) )
169 .Tooltip( _( "Enable/disable orthographic projection" ) )
170 .Icon( BITMAPS::ortho ) );
171
173 .Name( "3DViewer.Control.viewFront" )
174 .Scope( AS_ACTIVE )
175 .DefaultHotkey( 'Y' )
176 .FriendlyName( _( "View Front" ) )
177 .Tooltip( _( "View Front" ) )
178 .Icon( BITMAPS::axis3d_front )
179 .Flags( AF_NONE )
180 .Parameter( VIEW3D_TYPE::VIEW3D_FRONT ) );
181
183 .Name( "3DViewer.Control.viewBack" )
184 .Scope( AS_ACTIVE )
185 .DefaultHotkey( MD_SHIFT + 'Y' )
186 .FriendlyName( _( "View Back" ) )
187 .Tooltip( _( "View Back" ) )
188 .Icon( BITMAPS::axis3d_back )
189 .Flags( AF_NONE )
190 .Parameter( VIEW3D_TYPE::VIEW3D_BACK ) );
191
193 .Name( "3DViewer.Control.viewLeft" )
194 .Scope( AS_ACTIVE )
195 .DefaultHotkey( MD_SHIFT + 'X' )
196 .FriendlyName( _( "View Left" ) )
197 .Tooltip( _( "View Left" ) )
198 .Icon( BITMAPS::axis3d_left )
199 .Flags( AF_NONE )
200 .Parameter( VIEW3D_TYPE::VIEW3D_LEFT ) );
201
203 .Name( "3DViewer.Control.viewRight" )
204 .Scope( AS_ACTIVE )
205 .DefaultHotkey( 'X' )
206 .FriendlyName( _( "View Right" ) )
207 .Tooltip( _( "View Right" ) )
208 .Icon( BITMAPS::axis3d_right )
209 .Flags( AF_NONE )
210 .Parameter( VIEW3D_TYPE::VIEW3D_RIGHT ) );
211
213 .Name( "3DViewer.Control.viewTop" )
214 .Scope( AS_ACTIVE )
215 .DefaultHotkey( 'Z' )
216 .FriendlyName( _( "View Top" ) )
217 .Tooltip( _( "View Top" ) )
218 .Icon( BITMAPS::axis3d_top )
219 .Flags( AF_NONE )
220 .Parameter( VIEW3D_TYPE::VIEW3D_TOP ) );
221
223 .Name( "3DViewer.Control.viewBottom" )
224 .Scope( AS_ACTIVE )
225 .DefaultHotkey( MD_SHIFT + 'Z' )
226 .FriendlyName( _( "View Bottom" ) )
227 .Tooltip( _( "View Bottom" ) )
229 .Flags( AF_NONE )
230 .Parameter( VIEW3D_TYPE::VIEW3D_BOTTOM ) );
231
233 .Name( "3DViewer.Control.noGrid" )
234 .Scope( AS_GLOBAL )
235 .FriendlyName( _( "No 3D Grid" ) )
236 .Tooltip( _( "No 3D Grid" ) )
237 .Flags( AF_NONE )
238 .Parameter( GRID3D_TYPE::NONE ) );
239
241 .Name( "3DViewer.Control.show10mmGrid" )
242 .Scope( AS_GLOBAL )
243 .FriendlyName( _( "3D Grid 10mm" ) )
244 .Tooltip( _( "3D Grid 10mm" ) )
245 .Flags( AF_NONE )
246 .Parameter( GRID3D_TYPE::GRID_10MM ) );
247
249 .Name( "3DViewer.Control.show5mmGrid" )
250 .Scope( AS_GLOBAL )
251 .FriendlyName( _( "3D Grid 5mm" ) )
252 .Tooltip( _( "3D Grid 5mm" ) )
253 .Flags( AF_NONE )
254 .Parameter( GRID3D_TYPE::GRID_5MM ) );
255
257 .Name( "3DViewer.Control.show2_5mmGrid" )
258 .Scope( AS_GLOBAL )
259 .FriendlyName( _( "3D Grid 2.5mm" ) )
260 .Tooltip( _( "3D Grid 2.5mm" ) )
261 .Flags( AF_NONE )
262 .Parameter( GRID3D_TYPE::GRID_2P5MM ) );
263
265 .Name( "3DViewer.Control.show1mmGrid" )
266 .Scope( AS_GLOBAL )
267 .FriendlyName( _( "3D Grid 1mm" ) )
268 .Tooltip( _( "3D Grid 1mm" ) )
269 .Flags( AF_NONE )
270 .Parameter( GRID3D_TYPE::GRID_1MM ) );
271
273 .Name( "3DViewer.Control.materialNormal" )
274 .Scope( AS_ACTIVE )
275 .FriendlyName( _( "Render Realistic Materials" ) )
276 .Tooltip( _( "Use all material properties from each 3D model file" ) )
277 .Flags( AF_NONE )
278 .Parameter( MATERIAL_MODE::NORMAL ) );
279
281 .Name( "3DViewer.Control.materialDiffuse" )
282 .Scope( AS_ACTIVE )
283 .FriendlyName( _( "Render Solid Colors" ) )
284 .Tooltip( _( "Use only the diffuse color property from model 3D model file" ) )
285 .Flags( AF_NONE )
286 .Parameter( MATERIAL_MODE::DIFFUSE_ONLY ) );
287
289 .Name( "3DViewer.Control.materialCAD" )
290 .Scope( AS_ACTIVE )
291 .FriendlyName( _( "Render CAD Colors" ) )
292 .Tooltip( _( "Use a CAD color style based on the diffuse color of the material" ) )
293 .Flags( AF_NONE )
294 .Parameter( MATERIAL_MODE::CAD_MODE ) );
295
297 .Name( "3DViewer.Control.attributesTHT" )
298 .Scope( AS_ACTIVE )
299 .DefaultHotkey( 'T' )
300 .FriendlyName( _( "Show Through Hole 3D Models" ) )
301 .Tooltip( _( "Show 3D models for 'Through hole' type footprints" ) )
302 .Icon( BITMAPS::show_tht )
303 .Flags( AF_NONE ) );
304
306 .Name( "3DViewer.Control.attributesSMD" )
307 .Scope( AS_ACTIVE )
308 .DefaultHotkey( 'S' )
309 .FriendlyName( _( "Show SMD 3D Models" ) )
310 .Tooltip( _( "Show 3D models for 'Surface mount' type footprints" ) )
311 .Icon( BITMAPS::show_smt )
312 .Flags( AF_NONE ) );
313
315 .Name( "3DViewer.Control.attributesOther" )
316 .Scope( AS_ACTIVE )
317 .DefaultHotkey( 'V' )
318 .FriendlyName( _( "Show Unspecified 3D Models" ) )
319 .Tooltip( _( "Show 3D models for 'unspecified' type footprints" ) )
320 .Icon( BITMAPS::show_other )
321 .Flags( AF_NONE ) );
322
324 .Name( "3DViewer.Control.attribute_not_in_posfile" )
325 .Scope( AS_ACTIVE )
326 .DefaultHotkey( 'P' )
327 .FriendlyName( _( "Show 3D Models not in POS File" ) )
328 .Tooltip( _( "Show 3D models even if not found in .pos file" ) )
330 .Flags( AF_NONE ) );
331
333 .Name( "3DViewer.Control.attribute_dnp" )
334 .Scope( AS_ACTIVE )
335 .DefaultHotkey( 'D' )
336 .FriendlyName( _( "Show 3D Models marked DNP" ) )
337 .Tooltip( _( "Show 3D models even if marked 'Do Not Place'" ) )
338 .Icon( BITMAPS::show_dnp )
339 .Flags( AF_NONE ) );
340
342 .Name( "3DViewer.Control.showBoundingBoxes" )
343 .Scope( AS_GLOBAL )
344 .FriendlyName( _( "Show Model Bounding Boxes" ) )
345 .Tooltip( _( "Show 3D model bounding boxes in realtime renderer" ) )
346 .Icon( BITMAPS::ortho )
347 .Flags( AF_NONE ) );
348
350 .Name( "3DViewer.Control.showAxis" )
351 .Scope( AS_GLOBAL )
352 .FriendlyName( _( "Show 3D Axis" ) )
353 .Tooltip( _( "Show 3D Axis" ) )
354 .Icon( BITMAPS::axis3d_front )
355 .Flags( AF_NONE ) );
356
358 .Name( "3DViewer.Control.showLayersManager" )
359 .Scope( AS_GLOBAL )
360 .FriendlyName( _( "Show Appearance Manager" ) )
361 .Tooltip( _( "Show/hide the appearance manager" ) )
362 .Icon( BITMAPS::layers_manager ) );
363
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