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 <jon@craftyjon.com>
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 
36 TOOL_ACTION EDA_3D_ACTIONS::controlActivate( "3DViewer.Control", AS_GLOBAL,
37  0, "", "", "",
38  BITMAPS::INVALID_BITMAP, AF_ACTIVATE ); // No description, it is not supposed to be shown anywhere
39 
40 TOOL_ACTION EDA_3D_ACTIONS::pivotCenter( "3DViewer.Control.pivotCenter",
41  AS_ACTIVE,
42  ' ', "",
43  _( "Center pivot rotation" ), _( "Center pivot rotation (middle mouse click)" ),
44  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) WXK_SPACE );
45 
46 TOOL_ACTION EDA_3D_ACTIONS::rotateXCW( "3DViewer.Control.rotateXclockwise",
47  AS_GLOBAL, 0, "",
48  _( "Rotate X Clockwise" ), _( "Rotate X Clockwise" ),
50 
51 TOOL_ACTION EDA_3D_ACTIONS::rotateXCCW( "3DViewer.Control.rotateXcounterclockwise",
52  AS_GLOBAL, 0, "",
53  _( "Rotate X Counterclockwise" ), _( "Rotate X Counterclockwise" ),
55 
56 TOOL_ACTION EDA_3D_ACTIONS::rotateYCW( "3DViewer.Control.rotateYclockwise",
57  AS_GLOBAL, 0, "",
58  _( "Rotate Y Clockwise" ), _( "Rotate Y Clockwise" ),
60 
61 TOOL_ACTION EDA_3D_ACTIONS::rotateYCCW( "3DViewer.Control.rotateYcounterclockwise",
62  AS_GLOBAL, 0, "",
63  _( "Rotate Y Counterclockwise" ), _( "Rotate Y Counterclockwise" ),
65 
66 TOOL_ACTION EDA_3D_ACTIONS::rotateZCW( "3DViewer.Control.rotateZclockwise",
67  AS_GLOBAL, 0, "",
68  _( "Rotate Z Clockwise" ), _( "Rotate Z Clockwise" ),
70 
71 TOOL_ACTION EDA_3D_ACTIONS::rotateZCCW( "3DViewer.Control.rotateZcounterclockwise",
72  AS_GLOBAL, 0, "",
73  _( "Rotate Z Counterclockwise" ), _( "Rotate Z Counterclockwise" ),
75 
76 TOOL_ACTION EDA_3D_ACTIONS::moveLeft( "3DViewer.Control.moveLeft",
77  AS_ACTIVE,
78  WXK_LEFT, "",
79  _( "Move board Left" ), _( "Move board Left" ),
80  BITMAPS::left, AF_NONE, (void*) CURSOR_LEFT );
81 
82 TOOL_ACTION EDA_3D_ACTIONS::moveRight( "3DViewer.Control.moveRight",
83  AS_ACTIVE,
84  WXK_RIGHT, "",
85  _( "Move board Right" ), _( "Move board Right" ),
86  BITMAPS::right, AF_NONE, (void*) CURSOR_RIGHT );
87 
88 TOOL_ACTION EDA_3D_ACTIONS::moveUp( "3DViewer.Control.moveUp",
89  AS_ACTIVE,
90  WXK_UP, "",
91  _( "Move board Up" ), _( "Move board Up" ),
92  BITMAPS::up, AF_NONE, (void*) CURSOR_UP );
93 
94 TOOL_ACTION EDA_3D_ACTIONS::moveDown( "3DViewer.Control.moveDown",
95  AS_ACTIVE,
96  WXK_DOWN, "",
97  _( "Move board Down" ), _( "Move board Down" ),
98  BITMAPS::down, AF_NONE, (void*) CURSOR_DOWN );
99 
100 TOOL_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 
106 TOOL_ACTION EDA_3D_ACTIONS::resetView( "3DViewer.Control.resetView",
107  AS_ACTIVE,
108  'R', "",
109  _( "Reset view" ), _( "Reset view" ),
111 
112 TOOL_ACTION EDA_3D_ACTIONS::flipView( "3DViewer.Control.flipView",
113  AS_ACTIVE,
114  0, "",
115  _( "Flip Board" ), _( "Flip the board view" ),
117 
118 TOOL_ACTION EDA_3D_ACTIONS::toggleOrtho( "3DViewer.Control.toggleOrtho",
119  AS_GLOBAL, 0, "",
120  _( "Toggle orthographic projection" ), _( "Enable/disable orthographic projection" ),
121  BITMAPS::ortho );
122 
123 TOOL_ACTION EDA_3D_ACTIONS::viewFront( "3DViewer.Control.viewFront",
124  AS_ACTIVE,
125  'Y', "",
126  _( "View Front" ), _( "View Front" ),
128 
129 TOOL_ACTION EDA_3D_ACTIONS::viewBack( "3DViewer.Control.viewBack",
130  AS_ACTIVE,
131  MD_SHIFT + 'Y', "",
132  _( "View Back" ), _( "View Back" ),
134 
135 TOOL_ACTION EDA_3D_ACTIONS::viewLeft( "3DViewer.Control.viewLeft",
136  AS_ACTIVE,
137  MD_SHIFT + 'X', "",
138  _( "View Left" ), _( "View Left" ),
140 
141 TOOL_ACTION EDA_3D_ACTIONS::viewRight( "3DViewer.Control.viewRight",
142  AS_ACTIVE,
143  'X', "",
144  _( "View Right" ), _( "View Right" ),
146 
147 TOOL_ACTION EDA_3D_ACTIONS::viewTop( "3DViewer.Control.viewTop",
148  AS_ACTIVE,
149  'Z', "",
150  _( "View Top" ), _( "View Top" ),
152 
153 TOOL_ACTION EDA_3D_ACTIONS::viewBottom( "3DViewer.Control.viewBottom",
154  AS_ACTIVE,
155  MD_SHIFT + 'Z', "",
156  _( "View Bottom" ), _( "View Bottom" ),
158 
159 TOOL_ACTION EDA_3D_ACTIONS::noGrid( "3DViewer.Control.noGrid",
160  AS_GLOBAL, 0, "",
161  _( "No 3D Grid" ), _( "No 3D Grid" ),
163 
164 TOOL_ACTION EDA_3D_ACTIONS::show10mmGrid( "3DViewer.Control.show10mmGrid",
165  AS_GLOBAL, 0, "",
166  _( "3D Grid 10mm" ), _( "3D Grid 10mm" ),
168 
169 TOOL_ACTION EDA_3D_ACTIONS::show5mmGrid( "3DViewer.Control.show5mmGrid",
170  AS_GLOBAL, 0, "",
171  _( "3D Grid 5mm" ), _( "3D Grid 5mm" ),
173 
174 TOOL_ACTION EDA_3D_ACTIONS::show2_5mmGrid( "3DViewer.Control.show2_5mmGrid",
175  AS_GLOBAL, 0, "",
176  _( "3D Grid 2.5mm" ), _( "3D Grid 2.5mm" ),
178 
179 TOOL_ACTION EDA_3D_ACTIONS::show1mmGrid( "3DViewer.Control.show1mmGrid",
180  AS_GLOBAL, 0, "",
181  _( "3D Grid 1mm" ), _( "3D Grid 1mm" ),
183 
184 TOOL_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 
191 TOOL_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 
198 TOOL_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 
205 TOOL_ACTION EDA_3D_ACTIONS::rotate45axisZ( "3DViewer.Control.rotate45axisZ",
206  AS_ACTIVE,
207  WXK_TAB, "",
208  "Rotate 45 degrees over Z axis" );
209 
210 TOOL_ACTION EDA_3D_ACTIONS::attributesTHT( "3DViewer.Control.attributesTHT",
211  AS_ACTIVE,
212  'T', "",
213  _( "Toggle Through Hole 3D models" ), _( "Toggle 3D models with 'Through hole' attribute" ),
215 
216 TOOL_ACTION EDA_3D_ACTIONS::attributesSMD( "3DViewer.Control.attributesSMD",
217  AS_ACTIVE,
218  'S', "",
219  _( "Toggle SMD 3D models" ), _( "Toggle 3D models with 'Surface mount' attribute" ),
221 
222 TOOL_ACTION EDA_3D_ACTIONS::attributesVirtual( "3DViewer.Control.attributesVirtual",
223  AS_ACTIVE,
224  'V', "",
225  _( "Toggle Virtual 3D models" ), _( "Toggle 3D models with 'Virtual' attribute" ),
227 
228 TOOL_ACTION EDA_3D_ACTIONS::showBoundingBoxes( "3DViewer.Control.showBoundingBoxes",
229  AS_GLOBAL, 0, "",
230  _( "Show Model Bounding Boxes" ), _( "Show Model Bounding Boxes" ),
232 
233 TOOL_ACTION EDA_3D_ACTIONS::toggleRealisticMode( "3DViewer.Control.toggleRealisticMode",
234  AS_GLOBAL, 0, "",
235  _( "Toggle realistic mode" ), _( "Toggle realistic mode" ),
237 
238 TOOL_ACTION EDA_3D_ACTIONS::toggleBoardBody( "3DViewer.Control.toggleBoardBody",
239  AS_GLOBAL, 0, "",
240  _( "Toggle board body display" ), _( "Toggle board body display" ),
242 
243 TOOL_ACTION EDA_3D_ACTIONS::showAxis( "3DViewer.Control.showAxis",
244  AS_GLOBAL, 0, "",
245  _( "Show 3D Axis" ), _( "Show 3D Axis" ),
247 
248 TOOL_ACTION EDA_3D_ACTIONS::toggleZones( "3DViewer.Control.toggleZones",
249  AS_GLOBAL, 0, "",
250  _( "Toggle zone display" ), _( "Toggle zone display" ),
252 
253 TOOL_ACTION EDA_3D_ACTIONS::toggleAdhesive( "3DViewer.Control.toggleAdhesive",
254  AS_GLOBAL, 0, "",
255  _( "Toggle adhesive display" ), _( "Toggle display of adhesive layers" ),
257 
258 TOOL_ACTION EDA_3D_ACTIONS::toggleSilk( "3DViewer.Control.toggleSilk",
259  AS_GLOBAL, 0, "",
260  _( "Toggle silkscreen display" ), _( "Toggle display of silkscreen layers" ),
262 
263 TOOL_ACTION EDA_3D_ACTIONS::toggleSolderMask( "3DViewer.Control.toggleSolderMask",
264  AS_GLOBAL, 0, "",
265  _( "Toggle solder mask display" ), _( "Toggle display of solder mask layers" ),
267 
268 TOOL_ACTION EDA_3D_ACTIONS::toggleSolderPaste( "3DViewer.Control.toggleSolderPaste",
269  AS_GLOBAL, 0, "",
270  _( "Toggle solder paste display" ), _( "Toggle display of solder paste layers" ),
272 
273 TOOL_ACTION EDA_3D_ACTIONS::toggleComments( "3DViewer.Control.toggleComments",
274  AS_GLOBAL, 0, "",
275  _( "Toggle comments display" ), _( "Toggle display of comments and drawings layers" ),
277 
278 TOOL_ACTION EDA_3D_ACTIONS::toggleECO( "3DViewer.Control.toggleECO",
279  AS_GLOBAL, 0, "",
280  _( "Toggle ECO display" ), _( "Toggle display of ECO layers" ),
282 
static TOOL_ACTION rotateXCW
Use a gray shading based on diffuse material.
static TOOL_ACTION homeView
static TOOL_ACTION show10mmGrid
static TOOL_ACTION materialCAD
static TOOL_ACTION pivotCenter
static TOOL_ACTION showBoundingBoxes
static TOOL_ACTION toggleAdhesive
static TOOL_ACTION attributesVirtual
static TOOL_ACTION toggleSilk
static TOOL_ACTION toggleSolderMask
static TOOL_ACTION resetView
static TOOL_ACTION controlActivate
declared enumerations and flags
static TOOL_ACTION flipView
static TOOL_ACTION toggleZones
static TOOL_ACTION viewRight
static TOOL_ACTION viewLeft
static TOOL_ACTION toggleECO
Use only diffuse material properties.
static TOOL_ACTION rotate45axisZ
static TOOL_ACTION moveLeft
static TOOL_ACTION toggleComments
static TOOL_ACTION show5mmGrid
static TOOL_ACTION toggleSolderPaste
Use all material properties from model file.
Action activates a tool.
Definition: tool_action.h:52
static TOOL_ACTION rotateYCW
static TOOL_ACTION rotateXCCW
#define _(s)
static TOOL_ACTION materialNormal
static TOOL_ACTION viewBottom
static TOOL_ACTION rotateZCCW
static TOOL_ACTION showAxis
static TOOL_ACTION rotateZCW
static TOOL_ACTION viewTop
static TOOL_ACTION viewBack
static TOOL_ACTION attributesSMD
static TOOL_ACTION materialDiffuse
static TOOL_ACTION toggleRealisticMode
static TOOL_ACTION moveDown
static TOOL_ACTION show2_5mmGrid
static TOOL_ACTION show1mmGrid
static TOOL_ACTION attributesTHT
static TOOL_ACTION viewFront
static TOOL_ACTION rotateYCCW
Represent a single user action.
Definition: tool_action.h:67
static TOOL_ACTION moveUp
static TOOL_ACTION noGrid
static TOOL_ACTION toggleOrtho
static TOOL_ACTION moveRight
static TOOL_ACTION toggleBoardBody