Salome HOME
Initial implementation of work of "To add all elements that share the same topology...
[modules/shaper.git] / doc / gui / Introduction.rst
1 \r
2 .. _introduction:\r
3 \r
4 \r
5 Introduction to SHAPER\r
6 ======================\r
7 \r
8 SHAPER module of SALOME is destined for:\r
9 \r
10 - import and export of geometrical models in IGES, BREP, STEP and XAO formats;\r
11 - parametric construction of geometrical objects using a wide range of functions:\r
12     \r
13   - creation of complex 2D sections using :ref:`sketchPlugin` with consequent extrusion or revolution (see :ref:`featuresPlugin`);\r
14   - construction of model using primitives defined in :ref:`primitivesPlugin`;\r
15   - usage of Boolean operations (see :ref:`featuresPlugin`);\r
16   \r
17 - viewing geometrical objects in the OCC viewer;\r
18 - transformation of geometrical objects using various algorithms.\r
19 \r
20 It is possible to easily set :ref:`parameter_usage` predefined to be used as arguments when objects are created.\r
21 \r
22 SHAPER module preferences are described in the :ref:`preferences` section of SALOME Help.\r
23 \r
24 Almost all SHAPER  module functionalities are accessible via Python Interface.\r
25 \r
26 SHAPER module works with one study containing several documents:\r
27 \r
28 - partset\r
29 - one or several parts.\r
30 \r
31 Only one document can be active. In complicated models partset consists of several parts. Parts in partset may be copied, positioned relatively to each other, or simply translated.\r
32   \r
33 A new study contains only a partset with 7 default constructions, which cannot be deleted:\r
34   \r
35 - one point **Origin** coinciding with the origin of the coordinate system;\r
36 - three axes **OX**, **OY**, **OZ**  coinciding with coordinate axes;\r
37 - three planes **YOZ**, **XOZ**, **XOY**  coinciding with coordinate planes.    \r
38 \r
39 Only  points, axis, planes (see  :ref:`constructionPlugin`) and sketches (see  :ref:`sketchPlugin`) can be added into Partset to be used in any part later.\r
40 :ref:`parameter_usage` can be used both in Partset and any Part.\r
41 \r
42      \r
43 A new Part can be created as described in :ref:`partPlugin`.\r
44 \r
45 Double click or pop-up menu can be used to activate existing document.\r
46 \r
47 \r
48 Application desktop\r
49 -------------------\r
50 \r
51 The main window of the application consists of the following components:\r
52 \r
53 - :ref:`main_menu`;\r
54 - :ref:`doc_windows`;\r
55 - :ref:`viewer`;\r
56 - :ref:`toolbar`;    \r
57 - status bar.    \r
58 \r
59 .. image:: images/main_window.png\r
60    :align: center\r
61 \r
62 .. centered::\r
63    Main window of SHAPER module\r
64 \r
65   \r
66 .. _main_menu:\r
67 \r
68 Main menu \r
69 ---------\r
70 \r
71 Main menu provides access to all commands of the application.\r
72 \r
73 .. image:: images/main_menu.png\r
74    :align: center\r
75 \r
76 .. centered::\r
77    Main menu\r
78 \r
79 Main menu includes standard Salome items:\r
80 \r
81 - File;\r
82 - Edit;\r
83 - View;\r
84 - Tools;   \r
85 - Window;\r
86 - Help;\r
87     \r
88 and items specific for SHAPER module:\r
89 \r
90 - Part (see :ref:`partPlugin`);\r
91 - Sketch (see :ref:`sketchPlugin`);\r
92 - Construction (see :ref:`constructionPlugin`);\r
93 - Build (see :ref:`buildPlugin`);\r
94 - Primitives (see :ref:`primitivesPlugin`);\r
95 - GDML (see :ref:`gdmlPlugin`);\r
96 - Features (see :ref:`featuresPlugin`);  \r
97 - Macros. \r
98 \r
99  .. _toolbar:  \r
100 \r
101 SHAPER toolbar\r
102 --------------\r
103 \r
104 Application toolbar contains:\r
105 \r
106 - standard toolbar;\r
107 - modules toolbar;\r
108 - SHAPER toolbar.\r
109 \r
110 .. image:: images/toolbar.png\r
111    :align: center\r
112 \r
113 .. centered::\r
114    Toolbars\r
115   \r
116 SHAPER toolbar duplicates the main menu and  provides access to all commands of the application.\r
117 \r
118 SHAPER toolbar is separated into sections:\r
119 \r
120 - Part;\r
121 - Movement;\r
122 - Measurement;\r
123 - Sketch;\r
124 - Construction;\r
125 - Build;\r
126 - Primitives;\r
127 - GDML;\r
128 - Features;\r
129 - Boolean;\r
130 - Collections;    \r
131 - Fillet;  \r
132 - Macros.  \r
133 \r
134 Visibility of SHAPER toolbar sections is managed using *View -> Toolbar* :ref:`main_menu` item or toolbar pop-up menu.\r
135    \r
136   \r
137 .. _doc_windows:\r
138 \r
139 Dock windows\r
140 ------------\r
141 \r
142 Standard dock windows are: \r
143 \r
144 - :ref:`object_browser`\r
145 - :ref:`inspection_panel`\r
146 - :ref:`python console`\r
147 - :ref:`property_panel`\r
148 \r
149 Dock windows can be placed in three dock areas using drag-and-drop:\r
150   \r
151 - left, \r
152 - right, \r
153 - bottom.\r
154 \r
155 By default Object browser window is placed at the left dock area, Inspection panel at the right dock area and Python console at the bottom dock area of the main window.\r
156 \r
157 Property Panel is hidden.\r
158 \r
159 Property Panel is shown on operation start in left dock area of the main window by default.\r
160 \r
161 If Object browser is shown at the same side then they will be tabbed.\r
162 \r
163 Each dock window can be closed using **Cross** window button and opened again using a corresponding command from *View - Windows* :ref:`main_menu` or alternatively using pop-up menu.\r
164 \r
165 .. image:: images/popup_menu.png\r
166    :align: center\r
167 \r
168 .. centered::\r
169    Pop-up menu for visibility of windows and toolbars\r
170 \r
171 \r
172 .. _object_browser: \r
173 \r
174 Object browser\r
175 ^^^^^^^^^^^^^^\r
176 \r
177 Object browser contains all documents created in the current study. \r
178 \r
179 Each document includes standard branches where created objects are placed.\r
180 \r
181 Documents with branches are shown in Tree View.\r
182 \r
183 .. image:: images/object_browser.png\r
184    :align: center\r
185 \r
186 .. centered::\r
187    Object browser. Partset active\r
188 \r
189 \r
190 Partset includes three branches:\r
191 \r
192 - Parameters;\r
193 - Constructions;\r
194 - Features    \r
195 \r
196 Part includes the following branches:\r
197 \r
198 - Parameters;\r
199 - Constructions;\r
200 - Results;\r
201 - Fields;\r
202 - Groups;   \r
203 - Features.    \r
204 \r
205 New part contains only 3 empty branches:\r
206  \r
207 - Parameters;\r
208 - Constructions;\r
209 - Results.\r
210 \r
211 Features are placed one after another in the active document with default names and their results are placed into the corresponding branch.\r
212 \r
213 Examples of default names assigned automatically for :ref:`box_feature` are:\r
214  \r
215 * **Box_1**, **Box_2**, ... for Feature;\r
216 * **Box_1_1**, **Box_2_1**, ... for Result.\r
217 \r
218 Note, that a default branch is added into Tree View when the first feature of this type is created.\r
219 \r
220 Note, that the result used in feature as argument is removed.\r
221 \r
222 This child result can be restored using **Recover** feature.\r
223 \r
224 Each feature, result, construction, group, field, parameter can be renamed using *Rename* pop-up menu command.\r
225 \r
226 .. image:: images/popup_menu_object_browser_feature.png\r
227    :align: center\r
228 \r
229 .. centered::\r
230    Feature pop-up menu\r
231 \r
232 .. image:: images/popup_menu_object_browser_result.png\r
233    :align: center\r
234 \r
235 .. centered::\r
236     Result pop-up menu\r
237 \r
238 .. image:: images/popup_menu_object_browser_construction.png\r
239    :align: center\r
240 \r
241 .. centered::\r
242    Construction pop-up menu\r
243 \r
244 The order of features can be changed using *Move to the end* pop-up menu command. It works only for Group features. The selected group will be moved to the end of features list.\r
245 \r
246 Folders can be used to arrange long Tree View for features.\r
247 \r
248 .. image:: images/object_browser_folder.png\r
249    :align: center\r
250 \r
251 .. centered::\r
252    Object browser with folder Dome. Part_1 active\r
253 \r
254 *Insert a folder before* pop-up menu command creates a new empty folder before the selected feature. The folder can be renamed.\r
255 \r
256 Features placed after/before the created folder can be moved into the folder using *Move into the previous folder* / *Move into the next folder* pop-up menu command.\r
257 \r
258 This allows to decrease the length of feature list.\r
259 \r
260 Features can be removed from the folder using *Move out before the folder* / *Move out after the folder* pop-up menu command.\r
261 \r
262 *Clean history* pop-up menu command looks for features that do not participate in other features.\r
263 \r
264 **Clean history** dialog box shows a list of unused features. After confirmation by click **Yes** button unused features are removed.\r
265 \r
266 .. image:: images/clean_history.png\r
267    :align: center\r
268 \r
269 .. centered::\r
270    **Clean history** dialog box\r
271 \r
272 \r
273 *Select result* and *Select parent feature* pop-up menu commands help to navigate along Tree View.\r
274 \r
275 \r
276 A feature and its result can be deleted using *Delete* pop-up menu command.\r
277 \r
278 Note that all features using the removed feature and their results will be removed simultaneously.\r
279 \r
280 **Delete feature** dialog box shows the list of features to be removed. After confirmation by click **Yes** button all these features are removed.\r
281 \r
282 \r
283 .. image:: images/delete_feature.png\r
284    :align: center\r
285 \r
286 .. centered::\r
287    **Delete feature** dialog box\r
288    \r
289 .. _property_panel:\r
290 \r
291 Property panel\r
292 ^^^^^^^^^^^^^^\r
293 \r
294 Property panel consists of two parts:\r
295 \r
296 - controls a container for input of parameters for the current operation;\r
297 - buttons panel containing standard buttons:\r
298  \r
299   .. image:: images/button_ok.png\r
300     :align: left\r
301   **Ok/Apply** executes operation with defined parameters,\r
302 \r
303 \r
304   .. image:: images/button_cancel.png\r
305    :align: left\r
306   **Cancel/Close** calls **Abort operation** dialog box to confirm  operation abort, \r
307 \r
308   .. image:: images/button_help.png\r
309    :align: left\r
310   **Help** calls User's guide opened on page describing the current operation.\r
311 \r
312 .. image:: images/abort_operation.png\r
313    :align: center\r
314 \r
315 .. centered::\r
316    **Abort operation** dialog box\r
317 \r
318 \r
319 .. image:: images/button_ok.png\r
320     :align: left\r
321 **OK/Apply**  button is disabled if not all input parameters are defined or some errors are found. Error is shown as tooltip and in status bar.\r
322 \r
323 .. _inspection_panel: \r
324 \r
325 Inspection panel \r
326 ^^^^^^^^^^^^^^^^\r
327 \r
328 Inspection panel provides the list of types and quantities of all topological entities, composing the selected result, construction or feature.\r
329 \r
330 .. image:: images/inspection_panel.png\r
331    :align: center\r
332 \r
333 .. centered::\r
334    Inspection panel for default Box\r
335 \r
336 **Object** displays name of the selected result, construction  or feature.\r
337 \r
338 **Type** characterizes the whole shape.\r
339    \r
340 The information about Point, Axis or Edge  additionally shows coordinates of point / end points.\r
341 \r
342 .. image:: images/inspection_panel_line.png\r
343    :align: center\r
344 \r
345 .. centered::\r
346    Inspection panel for Axis\r
347    \r
348 \r
349 The information about  Plane, Face additionally shows coordinates of center point and direction of normal.\r
350 \r
351 .. image:: images/inspection_panel_face.png\r
352    :align: center\r
353 \r
354 .. centered::\r
355    Inspection panel for Face \r
356 \r
357 .. _python console:\r
358 \r
359 Python console\r
360 ^^^^^^^^^^^^^^\r
361 \r
362 Python console interpreters Python commands entered manually.\r
363 \r
364 In particular, it is possible to load the python script:\r
365 \r
366 *execfile(r"/dn48/newgeom/data/example.py")*\r
367 \r
368 Pop-up menu gives the possibility to:\r
369 \r
370 - Copy the selected text to clipboard;\r
371 - Paste the text from clipboard to Python console ;\r
372 - Clear Python console;\r
373 - Dump commands from console into the specified file;\r
374 - Start/Stop writing log into the specified file.    \r
375  \r
376 \r
377 .. image:: images/python_console_popup.png\r
378    :align: center\r
379 \r
380 .. centered::\r
381    Pop-up menu of Python console\r
382 \r
383 .. _viewer:\r
384 \r
385 Viewer\r
386 ------\r
387 \r
388 The application supports one instance of OCC 3D viewer and is able to show only one 3D space.\r
389 \r
390 This 3D space can be represented in several view windows. New view window can be created using **Clone view** button in viewer toolbar.\r
391 \r
392 Each view windows shows its own point of view on the 3D scene.\r
393 \r
394 This point of view can be modified using viewer commands: **Panning**, **Zooming**, **Scaling**, etc.\r
395 \r
396 \r
397 .. image:: images/2_viewers.png\r
398    :align: center\r
399 \r
400 .. centered::\r
401    Two view windows\r
402 \r
403 The description of OCC 3D Viewer architecture and functionality is provided in GUI module user's guide in chapter **OCC 3D Viewer**.\r
404 \r
405 \r
406 .. _parameter_usage:\r
407 \r
408 Parameters \r
409 ----------\r
410 \r
411 Model parametrization can be done using parameters.\r
412 \r
413 A parameter can be created in the active partset or part by:\r
414 \r
415 - :ref:`parameter`;\r
416 - :ref:`parameters`;\r
417 - :ref:`parameter_expression`.\r
418 \r
419 Any argument in features can be defined as parameter or expression containing parameters.\r
420 \r
421 The list of features using parameters is given in **Parameters** dialog box:\r
422 \r
423  .. image:: images/parameters_feature.png\r
424    :align: center\r
425 \r
426 .. centered::\r
427    Parameters dialog box\r
428   \r
429 If a parameter value is changed, then all features where it is used are rebuilt.\r
430 \r
431 A parameter name should be unique in the active document.\r
432 \r
433 However, partset and part can have parameters with the same name. If parameter names in Partset and Part are identical, then Part parameter has a higher priority and its value will be used in the features of this part.\r
434 \r
435 In contrast to features (see :ref:`object_browser`), there is an additional option when parameters are deleted.   \r
436 \r
437 .. image:: images/delete_parameter.png\r
438    :align: center\r
439 \r
440 .. centered::\r
441    Delete parameter\r
442 \r
443 After clicking **Replace** button, the selected parameter is removed but its parent parameters and features are not removed. The deleted parameter is replaced by its value.\r
444 \r
445 .. _parameter_expression:\r
446 \r
447 Create parameter on fly\r
448 ^^^^^^^^^^^^^^^^^^^^^^^\r
449 \r
450 Parameter can be created during feature creation simply by writing *variable=expression* in any editbox.\r
451 \r
452 After feature validation a new parameter with the given name **variable** and value equal to the evaluated expression appears in object browser under **Parameters** in the active partset or part.\r
453 \r
454 .. _preferences:\r
455 \r
456 SHAPER preferences\r
457 ------------------\r
458 \r
459 Description of General application preferences and **Preferences** dialog box is provided in GUI module user's guide in chapter **Setting Preferences**.\r
460 \r
461 SHAPER preferences define visualization of objects, visualization during selection, edition. New preferences can be used right after modification or later after activation of SHAPER module.\r
462 \r
463 To call **Preferences** dialog box:\r
464 \r
465 #. select in the Main Menu *File - > Preferences* item or\r
466 #. use  **Ctrl+P** shortcut.\r
467 \r
468 SHAPER preferences include 4 tabs:\r
469 \r
470 - :ref:`visualization_preferences`;\r
471 - :ref:`plugins_preferences`;\r
472 - :ref:`sketch_preferences`;\r
473 - :ref:`viewer_preferences`.\r
474 \r
475 Visualization tab is activated by default when **Preferences** dialog box is opened in the active SHAPER module.\r
476 \r
477 Other tabs are activated by click on tab header.\r
478   \r
479 .. _visualization_preferences:\r
480 \r
481 Visualization tab\r
482 ^^^^^^^^^^^^^^^^^\r
483 \r
484 This tab defines presentation of objects displayed in OCC 3D viewer.\r
485 \r
486 .. image:: images/visualization_preferences.png\r
487    :align: center\r
488 \r
489 .. centered::\r
490    Preferences - Visualization tab\r
491 \r
492 **Input fields**:\r
493 \r
494 - **Result color** selects default shading color for objects from **Results** branch;\r
495 - **Group color** selects default color for objects from **Groups** branch;\r
496 - **Construction color** selects default color for objects from **Constructions** branch;\r
497 - **Part color** selects default color for parts shown in Partset;  \r
498 - **Field color** selects default color for objects from **Fields** branch;\r
499 - **Body deflection coefficient** defines default deflection coefficient for objects from **Results** branch. A smaller coefficient provides better quality of a shape in the viewer;\r
500 - **Construction deflection coefficient** defines default deflection coefficient for objects from **Constructions** branch. A smaller coefficient provides better quality of a shape in the viewer;\r
501 - **Reference shape wireframe color in operation** selects default color used for wireframe visualization of objects used in active operation;\r
502 - **Result shape wireframe color in operation** selects default color used for wireframe visualization of result in active operation. Click **See preview** button to show result;\r
503 - **Multi selector item color in operation** selects default color used for visualization of objects selected in property panel to distinguish them among all objects used in active operation;\r
504 - **Color of removed feature in operation** selects default color used for visualization of sketch entities to be removed during **Trim/Split** operations;\r
505 - **Color of sketch plane** selects default shading color for sketch plane;\r
506 - **Hidden faces transparency** defines default transparency value for hidden faces;\r
507 - **Dimension arrow size**  defines default size of arrows for extension line showing dimensional constraint;  \r
508 - **Dimension font** defines font used for value of dimensional constraint;\r
509 - **Dimension value size**  defines default size of value for dimensional constraint;\r
510 - **Sketch dimension color**  defines default color of dimensional constraint; \r
511 - **Construction plane color** selects default color for Construction planes;  \r
512 - **Sketch entity color** selects default color for sketch objects;\r
513 - **Sketch external entity color** selects default color for external objects selected as reference during sketch creation/edition;\r
514 - **Sketch auxiliary entity color** selects default color for sketch auxiliary objects;\r
515 - **Sketch overconstraint color** selects default color for a sketch with redundant constraints;\r
516 - **Sketch fully constraint color** selects default color for a sketch with zero degrees of freedom.\r
517   \r
518 To redefine any color click on the corresponding line to access **Select color** dialog box\r
519 \r
520 .. image:: images/select_color.png\r
521    :align: center\r
522 \r
523 .. centered::\r
524    **Select color** dialog box\r
525    \r
526 Preferences for sketch are applicable  during sketch creation/edition operation.\r
527    \r
528 .. _plugins_preferences:\r
529    \r
530 Plugins tab\r
531 ^^^^^^^^^^^\r
532 Plugins tab defines folders where plugins and resources are located.\r
533 \r
534 .. image:: images/plugins_preferences.png\r
535    :align: center\r
536 \r
537 .. centered::\r
538    Preferences - Plugins tab\r
539 \r
540 **Input fields**:\r
541 \r
542 - **Default path** selects default folder where plugins are located. Click on **Open** button opens standard **Find directory** dialog box to navigate to desired folder;\r
543 \r
544 - **Import initial directory** selects default folder where resources are located. Click on **Open** button opens standard **Find directory** dialog box to navigate to desired folder.\r
545 \r
546 .. image:: images/open_button.png\r
547    :align: center\r
548 \r
549 .. centered::\r
550    **Open** button\r
551 \r
552 .. image:: images/find_directory.png\r
553    :align: center\r
554 \r
555 .. centered::\r
556    **Find directory** dialog box\r
557     \r
558    \r
559 .. _sketch_preferences:\r
560    \r
561 Sketch tab\r
562 ^^^^^^^^^^\r
563 \r
564 Sketch tab defines properties of coordinate planes shown for selection of sketch plane when no convenient objects are shown in OCC 3D viewer.\r
565 \r
566 .. image:: images/sketch_preferences.png\r
567    :align: center\r
568 \r
569 .. centered::\r
570    Preferences - Sketch tab\r
571 \r
572 **Input fields**:\r
573 \r
574 - **Size** defines size of coordinate planes;\r
575 - **Thickness**  defines thickness of coordinate plane borders; \r
576 - **Rotate to plane when selected** check-box turns on/off automatic switch the viewer to the top view for the selected sketch plane.  \r
577 \r
578    \r
579 .. _viewer_preferences:\r
580    \r
581 Viewer tab\r
582 ^^^^^^^^^^\r
583 \r
584 Viewer tab defines selection in OCC 3D viewer properties. \r
585 \r
586 .. image:: images/viewer_preferences.png\r
587    :align: center\r
588 \r
589 .. centered::\r
590    Preferences - Viewer tab   \r
591 \r
592 **Input fields**:\r
593 \r
594 - **Default Selection** defines objects to be selected by mouse click in OCC 3D viewer:\r
595 \r
596   - **Faces** check-box turns on/off selection of faces;\r
597   - **Edges** check-box turns on/off selection of edges;\r
598   - **Vertices** check-box turns on/off selection of vertices;\r
599 \r
600 - **Selection sensitivity** defines size of area around object in pixels, in which  mouse click selects object inside this area:\r
601 \r
602   - **Vertex** defines selection  sensitivity for vertices; \r
603   - **Edge**  defines selection  sensitivity for edges.  \r