Salome HOME
5c52b251103f52cd83fbd9040e4ece0cc2805c53
[modules/gui.git] / doc / salome / gui / input / common_functionality.rst
1 .. _common_functionality_page:
2
3 ********************************************
4 Functionality common for OCC and VTK viewers
5 ******************************************** 
6
7 .. _viewer_background:
8
9 Background
10 ##########
11
12 Viewers background can be customized using the "Change background"
13 popup menu command that opens the following dialog box:
14
15 .. image:: ../images/change_background_dlg.png
16         :align: center
17
18 The following types of the background are supported:
19
20 * **Single color:** the background is colored with the solid color specified by the user in the dialog box.
21
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:
23
24   * Horizontal
25   * Vertical
26   * First diagonal
27   * Second diagonal
28   * First corner
29   * Second corner
30   * Third corner
31   * Fourth corner
32
33 * **Image:** allows to set image as viewer background and define filling type:
34
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.
38
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`.
42
43
44 Selection
45 #########
46
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. 
49
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.
53
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.
60
61 There are also three additional selection mechanisms: rectangle, 
62 polyline and circle selection.
63
64 Rectangle selection
65 *******************
66
67 Rectangle Selection is the basic and commonly used selection tool.
68  
69 To select a rectangle area press and hold the left mouse button while drawing the diagonal of the selection rectangle in the viewer.
70
71 .. image:: ../images/rectselectionvtk.png
72         :align: center
73
74 As a result, the objects within the rectangle are selected.
75
76 .. image:: ../images/rectselectionvtk2.png
77         :align: center
78
79 .. note:: It is possible to add an area to the existing selection by holding down *Shift* key while selecting.
80
81 Polyline selection
82 ******************
83
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
87 rectangular frame.
88
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.
93
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.
101
102 .. image:: ../images/polyselectionvtk11.png
103         :align: center
104
105 As a result, the objects within the polygon are selected.
106
107 .. image:: ../images/polyselectionvtk21.png
108         :align: center
109
110 .. note:: To add an area to the existing selection it is necessary to hold down *Shift* key while selecting.
111
112 Circle selection
113 ****************
114
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.
117
118 .. image:: ../images/circselectionocc1.png
119         :align: center
120
121 As a result, the objects within the circle are selected.
122
123 .. image:: ../images/circselectionocc2.png
124         :align: center
125
126 .. note:: It is possible to add an area to the existing selection by holding down *Shift* key while selecting.
127
128 .. _viewer_navigation_modes:
129
130 Navigation modes
131 ################
132
133
134 OCC and VTK 3D viewers support two different navigation modes:
135
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.
140
141   Also, holding *Ctrl* key with pressed mouse buttons performs the following view transformations:
142
143   * *Ctrl* + left mouse button - zooming;
144   * *Ctrl* + middle mouse button - panning;
145   * *Ctrl* + right mouse button - rotation.
146
147 * **Keyboard free style**
148
149   This mode allows performing all view transformations without using the 
150   keyboard (only by the mouse):
151
152   * Left mouse button performs view rotation;
153   * Middle mouse button performs panning; 
154   * Right mouse button makes zooming.
155
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.
158
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. 
161
162 Zooming can be alternatively done by scrolling mouse wheel.
163
164