Salome HOME
Merge changes for HYDRO project : hydro/imps_2017_salome_83 branch.
[modules/geom.git] / doc / salome / gui / GEOM / input / working_with_groups.doc
1 /*!
2
3 \page work_with_groups_page Working with groups
4
5 Creation and editing groups of sub-shapes of a geometrical object makes
6 handling sub-shapes much easier. Boolean operations on
7 groups are also available.
8
9 <ul>
10 <li>\ref create_groups_anchor "Create a Group"</li>
11 <li>\ref edit_groups_anchor "Edit a Group"</li>
12 <li>\ref union_groups_anchor "Union Groups"</li>
13 <li>\ref intersect_groups_anchor "Intersect Groups"</li>
14 <li>\ref cut_groups_anchor "Cut Groups"</li>
15 </ul>
16
17 <br>
18 \anchor create_groups_anchor
19 <h2>Create a group</h2>
20
21 \image html image56.png
22
23 This functionality is available in OCC viewer only.
24
25 To create a group of sub-shapes of a geometrical object in the main
26 menu select <b>New entity > Group > Create</b>
27 \n The following dialog box will appear:
28
29 \image html geomcreategroup.png
30
31 In this Menu:
32
33 <ul>
34 <li><b>Shape Type</b> radio button defines the type of elements for the
35 group (points, wires, faces, shells or solids).</li>
36 <li><b>Group Name</b> - allows defining the name of the group, by
37 default, it is Group_n.</li>
38 <li>Then, using the "Select" button, select the <b>Main Shape</b> (a
39 geometrical object on which the group will be created). </li>
40 <li> <b>Main Shape Selection restriction</b> button group allows limiting the range
41 of available group elements,
42 <ul><li> <b>No restriction</b> button enables all sub-shapes of the Main
43 Shape.</li>
44 <li><b>Geometrical parts of the Second Shape</b> restricts the range of accessible
45 elements to the sub-shapes of the Main Shape that geometrically
46 coincide with the <b>Second Shape</b>.</li>
47 <li><b>Only Sub-shapes of the Second Shape</b> restricts the range of
48 accessible elements to the sub-shapes of the Main Shape that 
49 are sub-shapes of the <b>Second Shape</b>. This is useful because 
50 sometimes purely geometrical coincidence is not enough and it 
51 is necessary to work with shapes, which actually belong both 
52 to the main and the second shape.</li>
53 </ul>
54 <li>You can selectively display the selected elements using the following buttons:</li>
55 <ul>
56 <li><b>Show only selected</b> - displays only the sub-shapes selected in the list box.</li>
57 <li><b>Hide selected</b> - hides the sub-shapes selected in the list box.</li>
58 <li><b>Show all sub-shapes</b> - displays only the sub-shapes of the Main Shape.</li>
59 </ul>
60 <li> You can select the elements of your group in several ways:
61 <ul>
62 <li>You can select them manually in the 3D Viewer, and add to the
63 group by clicking the \b Add button (keep down the Shift button on the
64 keyboard to select several elements and add all them together). The
65 indexes of the selected elements will be displayed in the list. To
66 delete elements from the list, select them and click \b Remove
67 button.</li>
68 <li>Clicking <b>Select All</b> button you can add all object's
69 elements of a certain type in the list of the elements of the
70 group. If the <b>Second Shape</b> is used, the elements are added 
71 according to <b>Main Shape Selection restriction</b> settings. To delete elements 
72 from the list, select them and click \b Remove button.
73 </li>
74 <li>Filtering out some entities according to the specified threshold value or values
75 (see below).</li></ul>
76 </li>
77 <li>Finally, confirm your selection by clicking <b>Apply and Close
78 </b> (also closes the Menu) or \b Apply (leaves the Menu open for 
79 creation of other groups), or skip it by clicking \b Close button.
80 </li></ul>
81
82 \n The Result of the operation will be a \b GEOM_Object.
83
84 The \b Filter controls allow to automatically pick up entities, which satisfy specified 
85 threshold value(s). The numerical functor for each sub-shape that is compared with
86 threshold value(s) is computed according to the shape's topological properties:
87 - length for edges and wires;
88 - area for faces and shells;
89 - volume for solids, compounds, compsolids.
90
91 Filtering capabilities are not available for vertices.
92
93 In order to filter out some entities:
94 - Activate one or two filtering controls by switching on the corresponding check boxes;
95 - Select the required threshold comparator type; the following choices are available:
96   - <b>Less Than</b> or <b>Equal or Less Than</b> for the first comparator;
97   - <b>Greater Than</b> or <b>Equal or Greater Than</b> for the second comparator;
98 - Enter the required threshold value (values);
99 - Press \b Apply button in the \b Filter group.
100
101 The entities, which satisfy the entered filtering parameters, will be automatically highlighted
102 in the 3D viewer.
103
104 \b Plot button gives access 
105 to the \ref shape_statistics_operation_page "Shape Statistics" functionality with a simplified look-and-feel:
106
107 \image html shape_statistics_simple.png
108
109 \n <b>TUI Command:</b> <em>geompy.CreateGroup(MainShape,
110 ShapeType),</em> where MainShape is a shape for which the group is
111 created, ShapeType is a type of shapes in the created group.
112 \n <b>Arguments:</b> 1 Shape + Type of sub-shape.
113
114 Our <b>TUI Scripts</b> provide you with useful examples of 
115 \ref tui_create_groups_anchor "Create a Group" operation.
116
117 <b>Example:</b>
118
119 \image html image193.png "Groups on a cylinder"
120
121 <br>
122 \anchor edit_groups_anchor
123 <h2>Edit a group</h2>
124
125 \image html image57.png
126
127 This functionality is available in OCC viewer only.
128
129 To \b Edit an existing group in the main menu select <b>New entity >
130 Group > Edit</b>. This menu is designed in the same way as the
131 <b>Create a group</b> menu.
132
133 \n When a GEOM group is edited, the main shape appears in the 3D viewer in the same mode 
134 as it is displayed in the viewer. If the main shape was not displayed in the viewer, then 
135 the default mode defined in the preferences will be used. 
136
137 \n <b>Working with Dialog Box:</b> 
138
139 \image html editgroup.png
140
141 \n The subshapes already in the group are displayed in the 3D viewer with a specific color, 
142 defined via preferences. The IDs of the subshapes already in the group are also displayed in 
143 a specific color in the dialog box. When the user adds some subshapes, the new IDs are 
144 displayed in the other color.
145
146 \n The \b Result of the operation will be a \b GEOM_Object.
147
148 \n <b>TUI Command:</b>
149 <ul>
150 <li><em>geompy.AddObject(Group, SubShapeID),</em> where Group is a
151 group to which a sub-shape has to be added, SubShapeID is an ID of the
152 sub-shape to be added to the group.</li>
153 <li><em>geompy.RemoveObject(Group, SubShapeID),</em> where Group is a
154 group from which a sub-shape has to be removed, SubShapeID is an ID of
155 the sub-shape to be removed from the group.</li>
156 <li><em>geompy.GetObjectIDs(Group),</em> where Group is a group for which its object's are returned.
157 \n Returns: List of IDs.</li>
158 </ul>
159
160 \n <b>Arguments:</b> 1 Shape + its sub-shapes.
161
162 Our <b>TUI Scripts</b> provide you with useful examples of 
163 \ref tui_edit_groups_anchor "Edit a Group" operation.
164
165 <br>
166 \anchor union_groups_anchor
167 <h2>Union of groups</h2>
168
169 This operation allows to create a new group in such a way that all
170 sub-shapes that are present in the initial groups will be added to
171 the new one.
172
173 <em>To union groups:</em>
174 <ol>
175 <li>In the <b>New Entity</b> menu select the \b Group - <b>Union Groups</b> item.
176 The following dialog box will appear:
177
178 \image html groups_union_dlg.png
179
180 In this dialog box you should specify the name of the resulting group
181 and select the groups, which will be united.
182 </li>
183 <li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the group.</li>
184 </ol>
185
186 <b>See Also</b> a sample TUI Script of a 
187 \ref tui_union_groups_anchor "Union of Groups" operation.
188
189 <br>
190 \anchor intersect_groups_anchor
191 <h2>Intersection of groups</h2>
192
193 This operation allows to create a new group in such a way that only
194 the sub-shapes that are present in all initial groups are added to the
195 new one.
196
197 <em>To intersect groups:</em>
198 <ol>
199 <li>In the <b>New Entity</b> menu select the \b Group - <b>Intersect Groups</b> item.
200 The following dialog box will appear:
201
202 \image html groups_intersect_dlg.png
203
204 In this dialog box you should specify the name of the resulting group
205 and select the groups, which will be intersected.
206 </li>
207 <li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the group.</li>
208 </ol>
209
210 <b>See Also</b> a sample TUI Script of an  
211 \ref tui_intersect_groups_anchor "Intersection of Groups" operation.
212
213 <br>
214 \anchor cut_groups_anchor
215 <h2>Cut of groups</h2>
216
217 This operation allows to create a new group in such a way that all
218 sub-shapes that are present in the main groups but are absent in the
219 tool groups are added to the new one.
220
221 <em>To cut groups:</em>
222 <ol>
223 <li>In the <b>New Entity</b> menu select the \b Group - <b>Cut Groups</b> item.
224 The following dialog box will appear:
225
226 \image html groups_cut_dlg.png
227
228 In this dialog box you should specify the name of the resulting group
229 and the groups which will be cut.
230 </li>
231 <li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the group.</li>
232 </ol>
233
234 Our <b>TUI Scripts</b> provide you with useful examples of 
235 \ref tui_cut_groups_anchor "Cut of Groups" operation.
236
237 */