Salome HOME
bos #32216 [CEA] GUI ergonomic: navigation cube.
[modules/gui.git] / doc / salome / gui / input / occ_3d_viewer.rst
1 .. _occ_3d_viewer_page: 
2
3 *************
4 OCC 3D Viewer
5 *************
6
7 Operations
8 ##########
9
10 The functionalities of OCC viewer are available via its Viewer
11 Toolbar. Buttons marked with small downward triangles have extended
12 functionality which can be accessed by locking on them with left mouse
13 button.
14
15 .. image:: ../images/occviewer_toolbar.png
16         :align: center
17
18 ____
19
20 .. image:: ../../../../src/OCCViewer/resources/occ_view_camera_dump.png
21         :align: center
22
23 **Dump View** - exports an object from the viewer in bmp, png, jpeg or another image format.
24
25 ____
26
27 .. image:: ../../../../src/OCCViewer/resources/occ_view_style_switch.png
28         :align: center
29
30 **Interaction style switch** - allows to switch between standard
31 and "keyboard free" interaction styles. "Keyboard free" style allows
32 to process all view transformations without using keyboard (only by
33 mouse). By default, rotation in this mode is performed by left mouse
34 button, panning - by middle mouse button, zooming - by right mouse 
35 button. Selection in view by pressing "s" key works in both
36 styles.
37
38 ____
39
40 .. image:: ../../../../src/OCCViewer/resources/occ_view_zooming_style_switch.png
41         :align: center
42
43 **Zooming style switch** - allows to switch between standard
44 (zooming at the center of the view) and advanced (zooming at the
45 current cursor position) zooming styles.
46
47 ____
48
49 .. image:: ../../../../src/OCCViewer/resources/occ_view_triedre.png
50         :align: center
51
52 **Show/Hide Trihedron** - shows or hides coordinate axes.
53
54 ____
55
56 .. image:: ../../../../src/OCCViewer/resources/occ_view_viewcube.png
57         :align: center
58
59 **Show/Hide view cube** - shows or hides navigation cube.
60
61 ____
62
63 .. image:: ../../../../src/OCCViewer/resources/occ_view_preselection.png
64         :align: center
65
66 **Enable/Disable preselection** - enables or disables preselection (highlighting) in the view.
67
68 ____
69
70 .. image:: ../../../../src/OCCViewer/resources/occ_view_selection.png
71         :align: center
72
73 **Enable/Disable selection** - enables or disables selection in the view.
74
75 ____
76
77 .. image:: ../../../../src/OCCViewer/resources/occ_view_rect_style.png
78         :align: center
79
80 **Selection by rectangle** - enables selection by rectangle (see for details :ref:`viewer_selection` chapter).
81
82 ____
83
84 .. image:: ../../../../src/OCCViewer/resources/occ_view_polygon_style.png
85         :align: center
86
87 **Selection by polygon** - enables selection by polygon (see for details :ref:`viewer_selection` chapter).
88
89 ____
90
91 .. image:: ../../../../src/OCCViewer/resources/occ_view_circle_style.png
92         :align: center
93
94 **Selection by circle** - enables selection by circle (see for details :ref:`viewer_selection` chapter).
95
96 ____
97
98 .. image:: ../../../../src/OCCViewer/resources/occ_view_fitall.png
99         :align: center
100
101 **Fit all** - represents all displayed objects in the
102 visible area.
103
104 ____
105
106 .. image:: ../../../../src/OCCViewer/resources/occ_view_fitarea.png
107         :align: center
108
109 **Fit area** - resizes the view to place in the visible area only
110 the contents of a frame drawn with pressed left mouse button.
111
112 ____
113
114 .. image:: ../../../../src/OCCViewer/resources/occ_view_fitselection.png
115         :align: center
116
117 **Fit selection** - fits view contents to the current selection.
118
119 ____
120
121 .. image:: ../../../../src/OCCViewer/resources/occ_view_zoom.png
122         :align: center
123
124 **Zoom** - allows to zoom in and out.
125
126 ____
127
128 .. image:: ../../../../src/OCCViewer/resources/occ_view_pan.png
129         :align: center
130
131 **Panning** - if the represented objects are greater that the
132 visible area and you don't wish to use **Fit all** functionality,
133 click on this button and you'll be able to drag the scene to see its
134 remote parts.
135
136 ____
137
138 .. image:: ../../../../src/OCCViewer/resources/occ_view_glpan.png
139         :align: center
140
141 **Global panning** - allows to select a point to be the center of a scene
142 representing all displayed objects in the visible area.
143
144 ____
145
146 .. image:: ../../../../src/OCCViewer/resources/occ_view_rotation_point.png
147         :align: center
148
149 **Change rotation point** - allows to choose the point around
150 which the rotation is performed.
151
152 .. image:: ../images/set_rotation_point_dialog1.png
153         :align: center
154
155 By default the rotation point is located in the Center of the bounding
156 box of represented objects.
157
158 .. image:: ../images/set_rotation_point_dialog2.png
159         :align: center
160
161 Unchecking **Use Bounding Box Center** check-box allows you to
162 change rotation point:
163
164 - **Set to Origin** button sets the rotation point to origin of coordinates: (0, 0, 0).
165 - **Gravity Center of Selected Object** button allows using the gravity center of the object selected in the viewer as the center of the rotation point. When you click this button, you should first choose the type of selectable object: Point, Edge, Face or Solid and only then proceed with selection in the viewer.
166 - Also you can define the coordinates of the rotation point manually.
167
168 ____
169
170 .. image:: ../../../../src/OCCViewer/resources/occ_view_rotate.png
171         :align: center
172
173 **Rotation** - allows to rotate the scene using the mouse.
174
175 ____
176
177 .. image:: ../../../../src/OCCViewer/resources/occ_view_front.png
178         :align: center
179
180 .. image:: ../../../../src/OCCViewer/resources/occ_view_back.png
181         :align: center
182
183 .. image:: ../../../../src/OCCViewer/resources/occ_view_top.png
184         :align: center
185
186 .. image:: ../../../../src/OCCViewer/resources/occ_view_bottom.png
187         :align: center
188
189 .. image:: ../../../../src/OCCViewer/resources/occ_view_left.png
190         :align: center
191
192 .. image:: ../../../../src/OCCViewer/resources/occ_view_right.png
193         :align: center
194
195 These buttons orientate the scene strictly about coordinate axes:
196 **Front**, **Back**, **Top**, **Bottom**, **Left** or **Right** side.
197
198 ____
199
200 .. image:: ../../../../src/OCCViewer/resources/occ_view_anticlockwise.png
201         :align: center
202
203 **Rotate counterclockwise** - rotates view 90 @htmlonly ° @endhtmlonly counterclockwise.
204
205 ____
206
207 .. image:: ../../../../src/OCCViewer/resources/occ_view_clockwise.png
208         :align: center
209
210 **Rotate clockwise** - rotates view 90 @htmlonly ° @endhtmlonly clockwise.
211
212 ____
213
214 .. image:: ../../../../src/OCCViewer/resources/occ_view_orthographic.png
215         :align: center
216
217 **Ortographic projection** - default OCC viewer projection mode.
218
219 ____
220
221 .. image:: ../../../../src/OCCViewer/resources/occ_view_perspective.png
222         :align: center
223
224 **Perspective projection** - perspective OCC viewer projection mode.
225
226 ____
227
228 .. image:: ../../../../src/OCCViewer/resources/occ_view_stereo.png
229         :align: center
230
231 **Stereo projection** - stereoscopic rendering of the view.
232 .. note:: Activation of this mode also switches the view to perpective projection in case if the orthographic one has been active.
233 .. note:: By default, quad-buffered stereo is activated, if it is supported by the graphic card. If no stereo capabilities are available, an error message is shown.
234 .. note:: The stereoscopic view settings can be defined in :ref:`occ_preferences` preferences.
235
236 ____
237
238 .. image:: ../../../../src/OCCViewer/resources/occ_view_reset.png
239         :align: center
240
241 **Reset** - restores the default position (isometric) of objects in
242 the scene.
243
244 ____
245
246 .. image:: ../../../../src/OCCViewer/resources/occ_view_shoot.png
247         :align: center
248
249 **Memorize view** - saves the current position of objects in the
250 scene.
251
252 ____
253
254 .. image:: ../../../../src/OCCViewer/resources/occ_view_presets.png
255         :align: center
256
257 **Restore view** - restores the saved position of objects in the
258 scene.
259
260 ____
261
262 .. image:: ../../../../src/OCCViewer/resources/occ_view_clone.png
263         :align: center
264
265 **Clone view** - opens a new duplicate scene.
266
267 ____
268
269 .. _clipping_planes:
270
271 Clipping Planes
272 ###############
273
274 **Clipping** allows creating cross-section views (clipping planes)
275 of your mesh.
276
277 To create a clipping plane, click on the **New** button in the dialog and choose how it will be defined by **Absolute** or **Relative** coordinates.
278
279 **Absolute Coordinates**
280
281 .. image:: ../images/Clipping_Absolute.png
282         :align: center
283
284 - **Base point** - allows defining the coordinates of the base point for the clipping plane.
285
286   - **Reset** - returns the base point to coordinate origin.
287
288 - **Direction** - allows defining the orientation of the clipping plane.
289
290         - **Invert** - allows selecting, which part of the object will be removed and which will remain after clipping.
291
292     
293 **Relative mode**  
294
295 .. image:: ../images/Clipping_Relative.png
296         :align: center
297
298 - **Orientation** ( ||X-Y, ||X-Z or ||Y-Z).
299
300 - **Distance** between the opposite extremities of the boundary box of represented objects, if it is set to 0.5 the boundary box is split in two halves.
301
302 - **Rotation** (in angle degrees) **around X** (Y to Z) and **around Y** (X to Z) (depending on the chosen Orientation)
303
304 The other parameters are available in both modes : 
305
306 - **Active** checkbox is used to apply/erase current plane and it's affect to/from view.
307 - **Delete** removes the active clipping plane and discards it's view changes.
308 - **Disable all** deactivates all created clipping planes and clears **Auto Apply** checkbox.
309 - **Preview** check-box shows the clipping plane in the **3D Viewer**.
310 - **Auto Apply** check-box allows you to see the result of clipping in the **3D Viewer** immediately. Be careful, it is not a preview 2and Close button could not cancel the applied modifications.
311
312 It is also possible to interact with the clipping plane directly in 3D 
313 view using the mouse. 
314
315 ____
316
317 .. image:: ../../../../src/OCCViewer/resources/occ_view_scaling.png
318         :align: center
319
320 **Scaling** - represents objects deformed (stretched or stuffed)
321 along the axes of coordinates.
322
323 ____
324
325 .. image:: ../../../../src/OCCViewer/resources/occ_view_graduated_axes.png
326         :align: center
327
328 **Graduated axes** - allows to define axes parameters and graduate
329 them.
330
331 .. image:: ../images/graduatedaxes2.png
332         :align: center
333
334 - **Axis name** - if checked the axis name is displayed in the viewer.
335
336   - **Name** - allows to redefine the axis name.
337
338   - **Font** - allows to define the font color of the axis name.
339
340 - **Labels** - if checked the labels are displayed in the viewer.
341
342   - **Number** - allows to define the number of labels.
343
344   - **Offset** - allows to define the distance between axis and labels.
345
346   - **Font** - allows to define the font color of labels names.
347
348 - **Tick marks** - if checked the tick marks are displayed in the viewer.
349
350   - **Length** - allows to define the length of tick marks.
351
352 - **Is visible** - if checked the graduated axes are displayed in the viewer.
353
354 ____
355
356 .. image:: ../../../../src/OCCViewer/resources/occ_view_ambient.png
357         :align: center
358
359 **Toggle ambient light** - toggle "keep only ambient light" flag
360 on/off.
361
362 ____
363
364 .. image:: ../../../../src/OCCViewer/resources/occ_view_minimized.png
365         :align: center
366
367 |
368
369 .. image:: ../../../../src/OCCViewer/resources/occ_view_maximized.png
370         :align: center
371
372 **Minimize/Maximize** - these buttons allow switching the current
373 view area to the minimized / maximized state.
374
375 ____
376
377 .. image:: ../../../../src/OCCViewer/resources/occ_view_return_3d_view.png
378         :align: center
379
380 **Return to 3D** - this button switches from 2D view projection back to the 3D view mode.
381
382 ____
383
384 .. image:: ../images/occ_view_sync.png
385         :align: center
386
387 **Synchronize view** - allows to synchronize 3d view
388 parameters. This button has two states - checked and
389 unchecked. Clicking on this button opens a drop-down menu listing the
390 compatible 3d views. As soon as the user selects any view from the
391 list, the parameters (view point, position, zoom coefficient, etc.) of
392 the current view are synchronized with the selected view (static
393 synchronization).
394
395 In addition, when this button is in the "checked" state, the dynamic
396 synchronization of the views is performed, i.e. any zoom, pan, rotate
397 or other view operation done in one view is automatically applied to
398 the other view.
399
400 ____
401
402 .. image:: ../../../../src/OCCViewer/resources/occ_view_ray_tracing.png
403         :align: center
404
405 .. _ray_tracing:
406
407 Ray tracing
408 ===========
409
410 **Ray tracing** - allows to switch between rendering methods in run-time 
411 in the current OCCT 3D view. It can be used to produce images with photorealistic quality.
412
413 .. image:: ../images/doc_ray_tracing.png
414         :align: center
415
416 - **Ray tracing** - specifies rendering mode: OpenGL rasterization (by default) or GPU ray-tracing.
417
418   - **Depth** - defines maximum ray-tracing depth.
419   
420   - **Specular reflections** - enables/disables specular reflections.
421   
422   - **Adaptive anti-aliasing** - enables/disables adaptive anti-aliasing.
423     
424   - **Shadows rendering** - enables/disables shadows rendering.
425   
426   - **Transparent shadow** - enables/disables light propagation through transparent media.
427   
428 ____
429
430 .. image:: ../../../../src/OCCViewer/resources/occ_view_env_texture.png
431         :align: center
432
433 .. _env_texture:
434
435 Environment texture
436 ###################
437
438 **Environment texture** - allows to set parameters for environment texture.
439 This is a special mode of texture mapping when specular reflection of environment texture 
440 is simulated by OpenGL using a special texture coordinates generation algorithm (a sphere map).
441
442 .. image:: ../images/doc_env_texture.png
443         :align: center
444
445 - **Environment texture** - enables/disables environment texture in the current OCCT 3D view.
446
447 User can select one of 7 predefined environment texture from the list or define its texture from file by 
448 choosing item **"Custom..."** in a combo box.
449
450 .. note:: 
451         Environment texture file should normally satisfy the following requirements in order to produce good visual result:
452                 * The image file should have 2:1 width-to-height ratio.
453                 * It should constitute a 360-degrees panoramic image created using a fish-eye lens. 
454
455 ____
456
457 .. image:: ../../../../src/OCCViewer/resources/occ_view_light_source.png
458         :align: center
459
460 .. _light_source:
461
462 Light source
463 ============
464
465 **Light source** - allows to set parameters for light source.
466
467 It's possible to choose a type of light source between directional and positional light.
468
469 .. image:: ../images/doc_dir_light_source.png
470         :align: center
471
472 **Directional** light - creates a directional light source in the viewer.
473 It is defined by direction coordinates, color and headlight parameter.
474
475 .. image:: ../images/doc_pos_light_source.png
476         :align: center
477
478 **Positional** light - creates an isolated light source X,Y,Z in the viewer. 
479 It is also defined by the color and headlight parameter.
480
481 Click:
482
483 - **Apply and Close** to apply defined light source to the OCC 3D Viewer.
484
485 - **Default** to restore default values of light source.
486
487 - **Close** to return parameters of light source on initial values.
488
489
490