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