Salome HOME
New generic 2D View based on Qt
[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 .. _viewer_selection:
44
45 Selection
46 #########
47
48 An element can be selected by clicking on it with the left mouse button.
49 Selecting objects with locked *Shift* key produces a multi selection. 
50
51 Additionally, when the viewer owns an input focus, an object can be selected
52 by pressing *"S"* on the keyboard. Pressing *"S"* when holding
53 \em Shift key allows adding/removing an object to/from the current selection.
54
55 OCC viewer provides a way to navigate between the selectable objects. 
56 This feature (disabled by default) is used in some dialog boxes (for example, 
57 in Geometry module). When there are several objects which suit current
58 selection requirements (specified by the dialog) under the current mouse cursor,
59 it is possible to switch between them by means of mouse scroll wheel.
60 The same can be also done by pressing *"N"* and *"P"* keys.
61
62 There are also three additional selection mechanisms: rectangle, 
63 polyline and circle selection.
64
65 Rectangle selection
66 *******************
67
68 Rectangle Selection is the basic and commonly used selection tool.
69  
70 To select a rectangle area press and hold the left mouse button while drawing the diagonal of the selection rectangle in the viewer.
71
72 .. image:: ../images/rectselectionvtk.png
73         :align: center
74
75 As a result, the objects within the rectangle are selected.
76
77 .. image:: ../images/rectselectionvtk2.png
78         :align: center
79
80 .. note:: It is possible to add an area to the existing selection by holding down *Shift* key while selecting.
81
82 Polyline selection
83 ******************
84
85 OCC and VTK Viewers feature a special Polyline Selection mechanism,
86 which allows selecting an arbitrary part of the graphic area using a
87 polygon frame (rubber band), instead of the usual selection with a
88 rectangular frame.
89
90 To produce a Polyline Selection in VTK Viewer, press and hold the right
91 mouse button and draw the first side of the selection polygon, then change
92 the direction by clicking the left mouse button add draw another side, etc.
93 Click twice by left mouse button to finish drawing.
94
95 To produce a Polyline Selection in OCC Viewer, press and hold the left
96 mouse button and draw the first side of the selection polygon, then change
97 the direction by clicking the Space keyboard button add draw another side, etc.
98 You can delete last polygon point by Backspace button.
99 To finish drawing use Enter (Return) key or put mouse cursor near the first
100 polygon point (you mouse cursor will have '+' shape in this case)
101 and click the Space or release the left mouse button.
102
103 .. image:: ../images/polyselectionvtk11.png
104         :align: center
105
106 As a result, the objects within the polygon are selected.
107
108 .. image:: ../images/polyselectionvtk21.png
109         :align: center
110
111 .. note:: To add an area to the existing selection it is necessary to hold down *Shift* key while selecting.
112
113 Circle selection
114 ****************
115
116 To select a circular area press the left mouse button in the viewer at the
117 desired centre of the circle and hold it while you reach required circle radius.
118
119 .. image:: ../images/circselectionocc1.png
120         :align: center
121
122 As a result, the objects within the circle are selected.
123
124 .. image:: ../images/circselectionocc2.png
125         :align: center
126
127 .. note:: It is possible to add an area to the existing selection by holding down *Shift* key while selecting.
128
129 .. _viewer_navigation_modes:
130
131 Navigation modes
132 ################
133
134
135 OCC and VTK 3D viewers support two different navigation modes:
136
137 * **Salome standard controls**
138   Rectangle selection in this mode is performed by the left mouse button
139   and polyline selection by the right mouse button;
140   multiple selection is available when *Shift* button is pressed.
141
142   Also, holding *Ctrl* key with pressed mouse buttons performs the following view transformations:
143
144   * *Ctrl* + left mouse button - zooming;
145   * *Ctrl* + middle mouse button - panning;
146   * *Ctrl* + right mouse button - rotation.
147
148 * **Keyboard free style**
149
150   This mode allows performing all view transformations without using the 
151   keyboard (only by the mouse):
152
153   * Left mouse button performs view rotation;
154   * Middle mouse button performs panning; 
155   * Right mouse button makes zooming.
156
157   In this style rectangle selection is done by the left mouse button with *Ctrl* key pressed;
158   polyline selection is done by the right mouse button with *Ctrl* key pressed.
159
160 In both styles selection of objects in the viewer can be performed by pressing
161 *"S"* key or by the left mouse button click. 
162
163 Zooming can be alternatively done by scrolling mouse wheel.
164
165