Salome HOME
Redesign SALOME documentation
[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 two additional selection mechanisms: rectangle and 
62 polyline 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, press and hold the right mouse button and draw
90 the first side of the selection polygon, then change the direction by clicking
91 the left mouse button add draw another side, etc. Click twice by left mouse 
92 button to finish drawing.
93
94 .. image:: ../images/polyselectionvtk11.png
95         :align: center
96
97 As a result, the objects within the polygon are selected.
98
99 .. image:: ../images/polyselectionvtk21.png
100         :align: center
101
102 To add an area to the existing selection it is necessary to hold down 
103 *Shift* key while selecting.
104
105 .. _viewer_navigation_modes:
106
107 Navigation modes
108 ################
109
110
111 OCC and VTK 3D viewers support two different navigation modes:
112
113 * **Salome standard controls**
114   Rectangle selection in this mode is performed by the left mouse button
115   and polyline selection by the right mouse button;
116   multiple selection is available when *Shift* button is pressed.
117
118   Also, holding *Ctrl* key with pressed mouse buttons performs the following view transformations:
119
120   * *Ctrl* + left mouse button - zooming;
121   * *Ctrl* + middle mouse button - panning;
122   * *Ctrl* + right mouse button - rotation.
123
124 * **Keyboard free style**
125
126   This mode allows performing all view transformations without using the 
127   keyboard (only by the mouse):
128
129   * Left mouse button performs view rotation;
130   * Middle mouse button performs panning; 
131   * Right mouse button makes zooming.
132
133   In this style rectangle selection is done by the left mouse button with *Ctrl* key pressed;
134   polyline selection is done by the right mouse button with *Ctrl* key pressed.
135
136 In both styles selection of objects in the viewer can be performed by pressing
137 *"S"* key or by the left mouse button click. 
138
139 Zooming can be alternatively done by scrolling mouse wheel.
140
141