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