1 .. _occ_3d_viewer_page:
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
15 .. image:: ../images/occviewer_toolbar.png
20 .. image:: ../../../../src/OCCViewer/resources/occ_view_camera_dump.png
23 **Dump View** - exports an object from the viewer in bmp, png, jpeg or another image format.
27 .. image:: ../../../../src/OCCViewer/resources/occ_view_style_switch.png
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
40 .. image:: ../../../../src/OCCViewer/resources/occ_view_zooming_style_switch.png
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.
49 .. image:: ../../../../src/OCCViewer/resources/occ_view_triedre.png
52 **Show/Hide Trihedron** - shows or hides coordinate axes.
56 .. image:: ../../../../src/OCCViewer/resources/occ_view_preselection.png
59 **Enable/Disable preselection** - enables or disables preselection (highlighting) in the view.
63 .. image:: ../../../../src/OCCViewer/resources/occ_view_selection.png
66 **Enable/Disable selection** - enables or disables selection in the view.
70 .. image:: ../../../../src/OCCViewer/resources/occ_view_rect_style.png
73 **Selection by rectangle** - enables selection by rectangle (see for details :ref:`viewer_selection` chapter).
77 .. image:: ../../../../src/OCCViewer/resources/occ_view_polygon_style.png
80 **Selection by polygon** - enables selection by polygon (see for details :ref:`viewer_selection` chapter).
84 .. image:: ../../../../src/OCCViewer/resources/occ_view_circle_style.png
87 **Selection by circle** - enables selection by circle (see for details :ref:`viewer_selection` chapter).
91 .. image:: ../../../../src/OCCViewer/resources/occ_view_fitall.png
94 **Fit all** - represents all displayed objects in the
99 .. image:: ../../../../src/OCCViewer/resources/occ_view_fitarea.png
102 **Fit area** - resizes the view to place in the visible area only
103 the contents of a frame drawn with pressed left mouse button.
107 .. image:: ../../../../src/OCCViewer/resources/occ_view_fitselection.png
110 **Fit selection** - fits view contents to the current selection.
114 .. image:: ../../../../src/OCCViewer/resources/occ_view_zoom.png
117 **Zoom** - allows to zoom in and out.
121 .. image:: ../../../../src/OCCViewer/resources/occ_view_pan.png
124 **Panning** - if the represented objects are greater that the
125 visible area and you don't wish to use **Fit all** functionality,
126 click on this button and you'll be able to drag the scene to see its
131 .. image:: ../../../../src/OCCViewer/resources/occ_view_glpan.png
134 **Global panning** - allows to select a point to be the center of a scene
135 representing all displayed objects in the visible area.
139 .. image:: ../../../../src/OCCViewer/resources/occ_view_rotation_point.png
142 **Change rotation point** - allows to choose the point around
143 which the rotation is performed.
145 .. image:: ../images/set_rotation_point_dialog1.png
148 By default the rotation point is located in the Center of the bounding
149 box of represented objects.
151 .. image:: ../images/set_rotation_point_dialog2.png
154 Unchecking **Use Bounding Box Center** check-box allows you to
155 change rotation point:
157 - **Set to Origin** button sets the rotation point to origin of coordinates: (0, 0, 0).
158 - **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.
159 - Also you can define the coordinates of the rotation point manually.
163 .. image:: ../../../../src/OCCViewer/resources/occ_view_rotate.png
166 **Rotation** - allows to rotate the scene using the mouse.
170 .. image:: ../../../../src/OCCViewer/resources/occ_view_front.png
173 .. image:: ../../../../src/OCCViewer/resources/occ_view_back.png
176 .. image:: ../../../../src/OCCViewer/resources/occ_view_top.png
179 .. image:: ../../../../src/OCCViewer/resources/occ_view_bottom.png
182 .. image:: ../../../../src/OCCViewer/resources/occ_view_left.png
185 .. image:: ../../../../src/OCCViewer/resources/occ_view_right.png
188 These buttons orientate the scene strictly about coordinate axes:
189 **Front**, **Back**, **Top**, **Bottom**, **Left** or **Right** side.
193 .. image:: ../../../../src/OCCViewer/resources/occ_view_anticlockwise.png
196 **Rotate counterclockwise** - rotates view 90 @htmlonly ° @endhtmlonly counterclockwise.
200 .. image:: ../../../../src/OCCViewer/resources/occ_view_clockwise.png
203 **Rotate clockwise** - rotates view 90 @htmlonly ° @endhtmlonly clockwise.
207 .. image:: ../../../../src/OCCViewer/resources/occ_view_orthographic.png
210 **Ortographic projection** - default OCC viewer projection mode.
214 .. image:: ../../../../src/OCCViewer/resources/occ_view_perspective.png
217 **Perspective projection** - perspective OCC viewer projection mode.
221 .. image:: ../../../../src/OCCViewer/resources/occ_view_stereo.png
224 **Stereo projection** - stereoscopic rendering of the view.
225 .. note:: Activation of this mode also switches the view to perpective projection in case if the orthographic one has been active.
226 .. 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.
227 .. note:: The stereoscopic view settings can be defined in :ref:`occ_preferences` preferences.
231 .. image:: ../../../../src/OCCViewer/resources/occ_view_reset.png
234 **Reset** - restores the default position (isometric) of objects in
239 .. image:: ../../../../src/OCCViewer/resources/occ_view_shoot.png
242 **Memorize view** - saves the current position of objects in the
247 .. image:: ../../../../src/OCCViewer/resources/occ_view_presets.png
250 **Restore view** - restores the saved position of objects in the
255 .. image:: ../../../../src/OCCViewer/resources/occ_view_clone.png
258 **Clone view** - opens a new duplicate scene.
267 **Clipping** allows creating cross-section views (clipping planes)
270 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.
272 **Absolute Coordinates**
274 .. image:: ../images/Clipping_Absolute.png
277 - **Base point** - allows defining the coordinates of the base point for the clipping plane.
279 - **Reset** - returns the base point to coordinate origin.
281 - **Direction** - allows defining the orientation of the clipping plane.
283 - **Invert** - allows selecting, which part of the object will be removed and which will remain after clipping.
288 .. image:: ../images/Clipping_Relative.png
291 - **Orientation** ( ||X-Y, ||X-Z or ||Y-Z).
293 - **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.
295 - **Rotation** (in angle degrees) **around X** (Y to Z) and **around Y** (X to Z) (depending on the chosen Orientation)
297 The other parameters are available in both modes :
299 - **Active** checkbox is used to apply/erase current plane and it's affect to/from view.
300 - **Delete** removes the active clipping plane and discards it's view changes.
301 - **Disable all** deactivates all created clipping planes and clears **Auto Apply** checkbox.
302 - **Preview** check-box shows the clipping plane in the **3D Viewer**.
303 - **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.
305 It is also possible to interact with the clipping plane directly in 3D
306 view using the mouse.
310 .. image:: ../../../../src/OCCViewer/resources/occ_view_scaling.png
313 **Scaling** - represents objects deformed (stretched or stuffed)
314 along the axes of coordinates.
318 .. image:: ../../../../src/OCCViewer/resources/occ_view_graduated_axes.png
321 **Graduated axes** - allows to define axes parameters and graduate
324 .. image:: ../images/graduatedaxes2.png
327 - **Axis name** - if checked the axis name is displayed in the viewer.
329 - **Name** - allows to redefine the axis name.
331 - **Font** - allows to define the font color of the axis name.
333 - **Labels** - if checked the labels are displayed in the viewer.
335 - **Number** - allows to define the number of labels.
337 - **Offset** - allows to define the distance between axis and labels.
339 - **Font** - allows to define the font color of labels names.
341 - **Tick marks** - if checked the tick marks are displayed in the viewer.
343 - **Length** - allows to define the length of tick marks.
345 - **Is visible** - if checked the graduated axes are displayed in the viewer.
349 .. image:: ../../../../src/OCCViewer/resources/occ_view_ambient.png
352 **Toggle ambient light** - toggle "keep only ambient light" flag
357 .. image:: ../../../../src/OCCViewer/resources/occ_view_minimized.png
362 .. image:: ../../../../src/OCCViewer/resources/occ_view_maximized.png
365 **Minimize/Maximize** - these buttons allow switching the current
366 view area to the minimized / maximized state.
370 .. image:: ../../../../src/OCCViewer/resources/occ_view_return_3d_view.png
373 **Return to 3D** - this button switches from 2D view projection back to the 3D view mode.
377 .. image:: ../images/occ_view_sync.png
380 **Synchronize view** - allows to synchronize 3d view
381 parameters. This button has two states - checked and
382 unchecked. Clicking on this button opens a drop-down menu listing the
383 compatible 3d views. As soon as the user selects any view from the
384 list, the parameters (view point, position, zoom coefficient, etc.) of
385 the current view are synchronized with the selected view (static
388 In addition, when this button is in the "checked" state, the dynamic
389 synchronization of the views is performed, i.e. any zoom, pan, rotate
390 or other view operation done in one view is automatically applied to
395 .. image:: ../../../../src/OCCViewer/resources/occ_view_ray_tracing.png
403 **Ray tracing** - allows to switch between rendering methods in run-time
404 in the current OCCT 3D view. It can be used to produce images with photorealistic quality.
406 .. image:: ../images/doc_ray_tracing.png
409 - **Ray tracing** - specifies rendering mode: OpenGL rasterization (by default) or GPU ray-tracing.
411 - **Depth** - defines maximum ray-tracing depth.
413 - **Specular reflections** - enables/disables specular reflections.
415 - **Adaptive anti-aliasing** - enables/disables adaptive anti-aliasing.
417 - **Shadows rendering** - enables/disables shadows rendering.
419 - **Transparent shadow** - enables/disables light propagation through transparent media.
423 .. image:: ../../../../src/OCCViewer/resources/occ_view_env_texture.png
431 **Environment texture** - allows to set parameters for environment texture.
432 This is a special mode of texture mapping when specular reflection of environment texture
433 is simulated by OpenGL using a special texture coordinates generation algorithm (a sphere map).
435 .. image:: ../images/doc_env_texture.png
438 - **Environment texture** - enables/disables environment texture in the current OCCT 3D view.
440 User can select one of 7 predefined environment texture from the list or define its texture from file by
441 choosing item **"Custom..."** in a combo box.
444 Environment texture file should normally satisfy the following requirements in order to produce good visual result:
445 * The image file should have 2:1 width-to-height ratio.
446 * It should constitute a 360-degrees panoramic image created using a fish-eye lens.
450 .. image:: ../../../../src/OCCViewer/resources/occ_view_light_source.png
458 **Light source** - allows to set parameters for light source.
460 It's possible to choose a type of light source between directional and positional light.
462 .. image:: ../images/doc_dir_light_source.png
465 **Directional** light - creates a directional light source in the viewer.
466 It is defined by direction coordinates, color and headlight parameter.
468 .. image:: ../images/doc_pos_light_source.png
471 **Positional** light - creates an isolated light source X,Y,Z in the viewer.
472 It is also defined by the color and headlight parameter.
476 - **Apply and Close** to apply defined light source to the OCC 3D Viewer.
478 - **Default** to restore default values of light source.
480 - **Close** to return parameters of light source on initial values.