1 .. _common_functionality_page:
3 ********************************************
4 Functionality common for OCC and VTK viewers
5 ********************************************
12 Viewers background can be customized using the "Change background"
13 popup menu command that opens the following dialog box:
15 .. image:: ../images/change_background_dlg.png
18 The following types of the background are supported:
20 * **Single color:** the background is colored with the solid color specified by the user in the dialog box.
22 * **Gradient background:** the background is gradiently colored according to two colors and the gradient type specified in the dialog box. The following types of background are supported:
33 * **Image:** allows to set image as viewer background and define filling type:
35 * **Center:** the image is located at the center of the viewer backgound
36 * **Tile:** the image fills the entire viewer backgound one by one
37 * **Stretch:** the image is stretched to the entire viewer backgound.
39 Default background for the OCC viewer is specified via the
40 :ref:`occ_preferences` and for the
41 VTK viewer via the :ref:`vtk_preferences`.
47 An element can be selected by clicking on it with the left mouse button.
48 Selecting objects with locked *Shift* key produces a multi selection.
50 Additionally, when the viewer owns an input focus, an object can be selected
51 by pressing *"S"* on the keyboard. Pressing *"S"* when holding
52 \em Shift key allows adding/removing an object to/from the current selection.
54 OCC viewer provides a way to navigate between the selectable objects.
55 This feature (disabled by default) is used in some dialog boxes (for example,
56 in Geometry module). When there are several objects which suit current
57 selection requirements (specified by the dialog) under the current mouse cursor,
58 it is possible to switch between them by means of mouse scroll wheel.
59 The same can be also done by pressing *"N"* and *"P"* keys.
61 There are also three additional selection mechanisms: rectangle,
62 polyline and circle selection.
67 Rectangle Selection is the basic and commonly used selection tool.
69 To select a rectangle area press and hold the left mouse button while drawing the diagonal of the selection rectangle in the viewer.
71 .. image:: ../images/rectselectionvtk.png
74 As a result, the objects within the rectangle are selected.
76 .. image:: ../images/rectselectionvtk2.png
79 .. note:: It is possible to add an area to the existing selection by holding down *Shift* key while selecting.
84 OCC and VTK Viewers feature a special Polyline Selection mechanism,
85 which allows selecting an arbitrary part of the graphic area using a
86 polygon frame (rubber band), instead of the usual selection with a
89 To produce a Polyline Selection in VTK Viewer, press and hold the right
90 mouse button and draw the first side of the selection polygon, then change
91 the direction by clicking the left mouse button add draw another side, etc.
92 Click twice by left mouse button to finish drawing.
94 To produce a Polyline Selection in OCC Viewer, press and hold the left
95 mouse button and draw the first side of the selection polygon, then change
96 the direction by clicking the Space keyboard button add draw another side, etc.
97 You can delete last polygon point by Backspace button.
98 To finish drawing use Enter (Return) key or put mouse cursor near the first
99 polygon point (you mouse cursor will have '+' shape in this case)
100 and click the Space or release the left mouse button.
102 .. image:: ../images/polyselectionvtk11.png
105 As a result, the objects within the polygon are selected.
107 .. image:: ../images/polyselectionvtk21.png
110 .. note:: To add an area to the existing selection it is necessary to hold down *Shift* key while selecting.
115 To select a circular area press the left mouse button in the viewer at the
116 desired centre of the circle and hold it while you reach required circle radius.
118 .. image:: ../images/circselectionocc1.png
121 As a result, the objects within the circle are selected.
123 .. image:: ../images/circselectionocc2.png
126 .. note:: It is possible to add an area to the existing selection by holding down *Shift* key while selecting.
128 .. _viewer_navigation_modes:
134 OCC and VTK 3D viewers support two different navigation modes:
136 * **Salome standard controls**
137 Rectangle selection in this mode is performed by the left mouse button
138 and polyline selection by the right mouse button;
139 multiple selection is available when *Shift* button is pressed.
141 Also, holding *Ctrl* key with pressed mouse buttons performs the following view transformations:
143 * *Ctrl* + left mouse button - zooming;
144 * *Ctrl* + middle mouse button - panning;
145 * *Ctrl* + right mouse button - rotation.
147 * **Keyboard free style**
149 This mode allows performing all view transformations without using the
150 keyboard (only by the mouse):
152 * Left mouse button performs view rotation;
153 * Middle mouse button performs panning;
154 * Right mouse button makes zooming.
156 In this style rectangle selection is done by the left mouse button with *Ctrl* key pressed;
157 polyline selection is done by the right mouse button with *Ctrl* key pressed.
159 In both styles selection of objects in the viewer can be performed by pressing
160 *"S"* key or by the left mouse button click.
162 Zooming can be alternatively done by scrolling mouse wheel.