Salome HOME
Improve doc layout
authorvsr <vsr@opencascade.com>
Wed, 29 Apr 2020 15:18:37 +0000 (18:18 +0300)
committervsr <vsr@opencascade.com>
Thu, 30 Apr 2020 06:04:24 +0000 (09:04 +0300)
13 files changed:
.gitattributes
doc/gui/CMakeLists.txt
doc/gui/General/Introduction.rst [new file with mode: 0644]
doc/gui/General/TUI_tutorial.rst [new file with mode: 0644]
doc/gui/General/Tutorial.rst [new file with mode: 0644]
doc/gui/General/tutorial.py [new file with mode: 0644]
doc/gui/Introduction.rst [deleted file]
doc/gui/TUI_scripts.rst.in [new file with mode: 0644]
doc/gui/TUI_tutorial.rst [deleted file]
doc/gui/Tutorial.rst [deleted file]
doc/gui/build_index.py
doc/gui/index.rst.in
doc/gui/tutorial.py [deleted file]

index 2838ea4115d541d4ae253e1e69d8d0fd1b2ac50b..895ba7e5fd327e76373a997e9ab7f9464004087f 100644 (file)
@@ -26,6 +26,7 @@
 *.qml       eol=lf
 *.qrc       eol=lf
 *.py        eol=lf
+*.rst       eol=lf
 *.bat       eol=crlf
 *.cmd       eol=crlf
 *.dll       binary
index 62b5e3cc27f9a846a85deb8c523a1398e61a685a..dd1b911a695794cc9510bf6c56292b791155fed6 100644 (file)
@@ -32,7 +32,7 @@ CONFIGURE_FILE(${input} ${output})
 
 #sphinx-build -b html -c doc -D latex_paper_size=a4 -d doc/doctree /dn23/PPGP/vsv/SALOME730/SOURCES/PPGP_SRC/doc doc/html
 
-INSTALL(FILES ${DOC_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/General DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 
@@ -45,7 +45,7 @@ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build_index.py ${CMAKE_
 
 INSTALL(CODE "
 EXECUTE_PROCESS(
-COMMAND ${SPHINX_EXECUTABLE} -Q -b html -c ${CMAKE_CURRENT_BINARY_DIR} -d doctree ${CMAKE_CURRENT_BINARY_DIR} html
+COMMAND ${SPHINX_EXECUTABLE} -b html -c ${CMAKE_CURRENT_BINARY_DIR} -d doctree ${CMAKE_CURRENT_BINARY_DIR} html
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 )"
 )
diff --git a/doc/gui/General/Introduction.rst b/doc/gui/General/Introduction.rst
new file mode 100644 (file)
index 0000000..2c11ea9
--- /dev/null
@@ -0,0 +1,685 @@
+
+.. _introduction:
+
+Introduction to SHAPER
+======================
+
+SHAPER module of SALOME is destined for:
+
+- import and export of geometrical models in IGES, BREP, STEP and XAO formats;
+- parametric construction of geometrical objects using a wide range of functions:
+    
+  - creation of complex 2D sections using :ref:`sketchPlugin` with consequent extrusion or revolution (see :ref:`featuresPlugin`);
+  - construction of model using primitives defined in :ref:`primitivesPlugin`;
+  - usage of Boolean operations (see :ref:`featuresPlugin`);
+  
+- viewing geometrical objects in the OCC viewer;
+- transformation of geometrical objects using various algorithms.
+
+It is possible to easily set :ref:`parameter_usage` predefined to be used as arguments when objects are created.
+
+SHAPER module preferences are described in the :ref:`preferences` section of SALOME Help.
+
+Almost all SHAPER  module functionalities are accessible via Python Interface.
+
+SHAPER module works with one study containing several documents:
+
+- partset
+- one or several parts.
+
+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.
+  
+A new study contains only a partset with 7 default constructions, which cannot be deleted:
+  
+- one point **Origin** coinciding with the origin of the coordinate system;
+- three axes **OX**, **OY**, **OZ**  coinciding with coordinate axes;
+- three planes **YOZ**, **XOZ**, **XOY**  coinciding with coordinate planes.    
+
+Only  points, axis, planes (see  :ref:`constructionPlugin`) and sketches (see  :ref:`sketchPlugin`) can be added into Partset to be used in any part later.
+:ref:`parameter_usage` can be used both in Partset and any Part.
+    
+A new Part can be created as described in :ref:`partPlugin`.
+
+Double click or pop-up menu can be used to activate existing document.
+
+Application desktop
+-------------------
+
+The main window of the application consists of the following components:
+
+- :ref:`main_menu`;
+- :ref:`doc_windows`;
+- :ref:`viewer`;
+- :ref:`toolbar`;    
+- status bar.    
+
+.. figure:: /images/main_window.png
+   :align: center
+
+   Main window of SHAPER module
+  
+.. _main_menu:
+
+Main menu 
+---------
+
+Main menu provides access to all commands of the application.
+
+.. figure:: /images/main_menu.png
+   :align: center
+
+   Main menu
+
+Main menu includes standard Salome items:
+
+- File;
+- Edit;
+- View;
+- Tools;   
+- Window;
+- Help;
+    
+and items specific for SHAPER module:
+
+- Part (see :ref:`partPlugin`);
+- Sketch (see :ref:`sketchPlugin`);
+- Construction (see :ref:`constructionPlugin`);
+- Build (see :ref:`buildPlugin`);
+- Primitives (see :ref:`primitivesPlugin`);
+- GDML (see :ref:`gdmlPlugin`);
+- Features (see :ref:`featuresPlugin`);  
+- Macros. 
+
+ .. _toolbar:  
+
+SHAPER toolbar
+--------------
+
+Application toolbar contains:
+
+- standard toolbar;
+- modules toolbar;
+- SHAPER toolbar.
+
+.. figure:: /images/toolbar.png
+   :align: center
+
+   Toolbars
+  
+SHAPER toolbar duplicates the main menu and  provides access to all commands of the application.
+
+SHAPER toolbar is separated into sections:
+
+- Part;
+- Movement;
+- Measurement;
+- Sketch;
+- Construction;
+- Build;
+- Primitives;
+- GDML;
+- Features;
+- Boolean;
+- Collections;    
+- Fillet;  
+- Macros.  
+
+Visibility of SHAPER toolbar sections is managed using *View -> Toolbar* :ref:`main_menu` item or toolbar pop-up menu.
+
+.. _doc_windows:
+
+Dock windows
+------------
+
+Standard dock windows are: 
+
+- :ref:`object_browser`
+- :ref:`inspection_panel`
+- :ref:`hidefaces_panel`
+- :ref:`python console`
+- :ref:`property_panel`
+
+Dock windows can be placed in three dock areas using drag-and-drop:
+  
+- left, 
+- right, 
+- bottom.
+
+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.
+
+Property Panel is hidden.
+
+Property Panel is shown on operation start in left dock area of the main window by default.
+
+If Object browser is shown at the same side then they will be tabbed.
+
+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.
+
+.. figure:: /images/popup_menu.png
+   :align: center
+
+   Pop-up menu for visibility of windows and toolbars
+
+.. _object_browser: 
+
+Object browser
+^^^^^^^^^^^^^^
+
+Object browser contains all documents created in the current study. 
+
+Each document includes standard branches where created objects are placed.
+
+Documents with branches are shown in Tree View.
+
+.. figure:: /images/object_browser.png
+   :align: center
+
+   **Object browser**: Partset active
+
+Partset includes three branches:
+
+- Parameters;
+- Constructions;
+- Features    
+
+Part includes the following branches:
+
+- Parameters;
+- Constructions;
+- Results;
+- Fields;
+- Groups;   
+- Features.    
+
+New part contains only 3 empty branches:
+- Parameters;
+- Constructions;
+- Results.
+
+Features are placed one after another in the active document with default names and their results are placed into the corresponding branch.
+
+Examples of default names assigned automatically for :ref:`box_feature` are:
+* **Box_1**, **Box_2**, ... for Feature;
+* **Box_1_1**, **Box_2_1**, ... for Result.
+
+Note, that a default branch is added into Tree View when the first feature of this type is created.
+
+Note, that the result used in feature as argument is removed.
+
+This child result can be restored using **Recover** feature.
+
+Each feature, result, construction, group, field, parameter can be renamed using *Rename* pop-up menu command.
+
+.. figure:: /images/popup_menu_object_browser_feature.png
+   :align: center
+
+   **Feature** pop-up menu
+
+.. figure:: /images/popup_menu_object_browser_result.png
+   :align: center
+
+   **Result** pop-up menu
+
+.. figure:: /images/popup_menu_object_browser_construction.png
+   :align: center
+
+   **Construction** pop-up menu
+
+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.
+
+Folders can be used to arrange long Tree View for features.
+
+.. figure:: /images/object_browser_folder.png
+   :align: center
+
+   **Object browser** with folder Dome: Part_1 active
+
+*Insert a folder before* pop-up menu command creates a new empty folder before the selected feature. The folder can be renamed.
+
+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.
+
+This allows to decrease the length of feature list.
+
+Features can be removed from the folder using *Move out before the folder* / *Move out after the folder* pop-up menu command.
+
+*Clean history* pop-up menu command looks for features that do not participate in other features.
+
+**Clean history** dialog box shows a list of unused features. After confirmation by click **Yes** button unused features are removed.
+
+.. figure:: /images/clean_history.png
+   :align: center
+
+   **Clean history** dialog box
+
+*Select result* and *Select parent feature* pop-up menu commands help to navigate along Tree View.
+
+A feature and its result can be deleted using *Delete* pop-up menu command.
+
+Note that all features using the removed feature and their results will be removed simultaneously.
+
+**Delete feature** dialog box shows the list of features to be removed. After confirmation by click **Yes** button all these features are removed.
+
+.. figure:: /images/delete_feature.png
+   :align: center
+
+   **Delete feature** dialog box
+   
+.. _property_panel:
+
+Property panel
+^^^^^^^^^^^^^^
+
+.. |ok_btn| image:: /images/button_ok.png
+.. |cancel_btn| image:: /images/button_cancel.png
+.. |help_btn| image:: /images/button_help.png
+
+Property panel consists of two parts:
+
+- controls a container for input of parameters for the current operation;
+- buttons panel containing standard buttons:
+   | |ok_btn| **Ok/Apply** executes operation with defined parameters,
+   | |cancel_btn| **Cancel/Close** calls **Abort operation** dialog box to confirm  operation abort, 
+   | |help_btn| **Help** calls User's guide opened on page describing the current operation.
+
+   .. figure:: /images/abort_operation.png
+      :align: center
+     
+      **Abort operation** dialog box
+
+|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.
+
+.. _inspection_panel: 
+
+Inspection panel 
+^^^^^^^^^^^^^^^^
+
+Inspection panel provides the list of types and quantities of all topological entities, composing the selected result, construction or feature.
+
+.. figure:: /images/inspection_panel.png
+   :align: center
+
+   **Inspection panel** for default Box
+
+**Object** displays name of the selected result, construction  or feature.
+
+**Type** characterizes the whole shape.
+   
+The information about Point, Axis or Edge  additionally shows coordinates of point / end points.
+
+.. figure:: /images/inspection_panel_line.png
+   :align: center
+
+   **Inspection panel** for Axis
+   
+The information about  Plane, Face additionally shows coordinates of center point and direction of normal.
+
+.. figure:: /images/inspection_panel_face.png
+   :align: center
+
+   **Inspection panel** for Face 
+
+.. _hidefaces_panel:
+
+Hide Faces panel
+^^^^^^^^^^^^^^^^
+
+**Hide Faces** panel makes possible to hide temporary faces of any displayed object. **Hide Faces** panel looks like following:
+
+.. figure:: /images/hide_faces_panel.png
+   :align: center
+
+   **Hide Faces** panel
+
+- If this panel is activated it "listens" user selection.
+- If a face is selected then its name will be shown in the panel's list and hidden in the viewer. 
+- 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.
+- 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.
+
+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.
+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.
+
+.. _python console:
+
+Python console
+^^^^^^^^^^^^^^
+
+Python console interpreters Python commands entered manually.
+
+In particular, it is possible to load the python script:
+
+*execfile(r"/dn48/newgeom/data/example.py")*
+
+Pop-up menu gives the possibility to:
+
+- Copy the selected text to clipboard;
+- Paste the text from clipboard to Python console ;
+- Clear Python console;
+- Dump commands from console into the specified file;
+- Start/Stop writing log into the specified file.    
+.. figure:: /images/python_console_popup.png
+   :align: center
+
+   Pop-up menu of Python console
+
+.. _viewer:
+
+Viewer
+------
+
+The application supports one instance of OCC 3D viewer and is able to show only one 3D space.
+
+This 3D space can be represented in several view windows. New view window can be created using **Clone view** button in viewer toolbar.
+
+Each view windows shows its own point of view on the 3D scene.
+
+This point of view can be modified using viewer commands: **Panning**, **Zooming**, **Scaling**, etc.
+
+.. figure:: /images/2_viewers.png
+   :align: center
+
+   Two view windows
+
+The description of OCC 3D Viewer architecture and functionality is provided in GUI module user's guide in chapter **OCC 3D Viewer**.
+
+.. _parameter_usage:
+
+Parameters 
+----------
+
+Model parametrization can be done using parameters.
+
+A parameter can be created in the active partset or part by:
+
+- :ref:`parameter`;
+- :ref:`parameters`;
+- :ref:`parameter_expression`.
+
+Any argument in features can be defined as parameter or expression containing parameters.
+
+The list of features using parameters is given in **Parameters** dialog box:
+
+ .. figure:: /images/parameters_feature.png
+   :align: center
+
+   Parameters dialog box
+  
+If a parameter value is changed, then all features where it is used are rebuilt.
+
+A parameter name should be unique in the active document.
+
+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.
+
+In contrast to features (see :ref:`object_browser`), there is an additional option when parameters are deleted.   
+
+.. figure:: /images/delete_parameter.png
+   :align: center
+
+   Delete parameter
+
+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.
+
+.. _parameter_expression:
+
+Create parameter on fly
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Parameter can be created during feature creation simply by writing *variable=expression* in any editbox.
+
+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.
+
+.. _preferences:
+
+SHAPER preferences
+------------------
+
+Description of General application preferences and **Preferences** dialog box is provided in GUI module user's guide in chapter **Setting Preferences**.
+
+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.
+
+To call **Preferences** dialog box:
+
+#. select in the Main Menu *File - > Preferences* item or
+#. use  **Ctrl+P** shortcut.
+
+SHAPER preferences contains the following tabs:
+
+- :ref:`visualization_preferences`;
+- :ref:`plugins_preferences`;
+- :ref:`shortcuts_preferences`;
+- :ref:`windows_preferences`.
+- :ref:`sketch_preferences`.
+- :ref:`viewer_preferences`.
+
+Visualization tab is activated by default when **Preferences** dialog box is opened in the active SHAPER module.
+
+Other tabs are activated by click on tab header.
+  
+.. _visualization_preferences:
+
+Visualization tab
+^^^^^^^^^^^^^^^^^
+
+This tab defines presentation of objects displayed in OCC 3D viewer.
+
+.. figure:: /images/visualization_preferences.png
+   :align: center
+
+   **Preferences**: Visualization tab
+
+**Input fields**:
+
+- **Selection color** defines a color for selected objects;
+- **Result color** selects default shading color for objects from **Results** branch;
+- **Group color** selects default color for objects from **Groups** branch;
+- **Construction color** selects default color for objects from **Constructions** branch;
+- **Part color** selects default color for parts shown in Partset;  
+- **Field color** selects default color for objects from **Fields** branch;
+- **Body deflection coefficient** defines default deflection coefficient for objects from **Results** branch. A smaller coefficient provides better quality of a shape in the viewer;
+- **Construction deflection coefficient** defines default deflection coefficient for objects from **Constructions** branch. A smaller coefficient provides better quality of a shape in the viewer;
+- **Reference shape wireframe color in operation** selects default color used for wireframe visualization of objects used in active operation;
+- **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;
+- **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;
+- **Color of removed feature in operation** selects default color used for visualization of sketch entities to be removed during **Trim/Split** operations;
+- **Color of sketch plane** selects default shading color for sketch plane;
+- **Hidden faces transparency** defines default transparency value for hidden faces;
+- **Dimension arrow size**  defines default size of arrows for extension line showing dimensional constraint;  
+- **Dimension font** defines font used for value of dimensional constraint;
+- **Dimension value size**  defines default size of value for dimensional constraint;
+- **Sketch dimension color**  defines default color of dimensional constraint; 
+- **Construction plane color** selects default color for Construction planes;  
+- **Sketch entity color** selects default color for sketch objects;
+- **Sketch external entity color** selects default color for external objects selected as reference during sketch creation/edition;
+- **Sketch auxiliary entity color** selects default color for sketch auxiliary objects;
+- **Sketch overconstraint color** selects default color for a sketch with redundant constraints;
+- **Sketch fully constraint color** selects default color for a sketch with zero degrees of freedom.
+  
+To redefine any color click on the corresponding line to access **Select color** dialog box
+
+.. figure:: /images/select_color.png
+   :align: center
+
+   **Preferences**: **Select color** dialog box
+   
+Preferences for sketch are applicable  during sketch creation/edition operation.
+   
+.. _plugins_preferences:
+   
+Plugins tab
+^^^^^^^^^^^
+Plugins tab defines folders where plugins and resources are located.
+
+.. figure:: /images/plugins_preferences.png
+   :align: center
+
+   **Preferences**: Plugins tab
+
+**Input fields**:
+
+- **Default path** selects default folder where plugins are located. Click on **Open** button opens standard **Find directory** dialog box to navigate to desired folder;
+
+- **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.
+
+.. figure:: /images/open_button.png
+   :align: center
+
+   **Open** button
+
+.. figure:: /images/find_directory.png
+   :align: center
+
+   **Find directory** dialog box
+    
+   
+.. _shortcuts_preferences:
+   
+Shortcuts tab
+^^^^^^^^^^^^^
+
+Shortcuts tab defines shortcut keys for different operations.
+
+.. figure:: /images/shortcuts_preferences.png
+   :align: center
+
+   **Preferences**: Shortcuts tab
+   
+- **Add parameter in parameters manager dialog** defines shortcut keys for adding parameter in parameters manager dialog box.
+   
+.. _windows_preferences:
+
+Windows tab
+^^^^^^^^^^^
+
+Windows tab contains definitions for the module windows management.
+
+.. figure:: /images/windows_preferences.png
+   :align: center
+
+   **Preferences**: Windows tab
+
+- **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.
+
+.. _sketch_preferences:
+
+Sketch tab
+^^^^^^^^^^
+
+Sketch tab defines properties of coordinate planes shown for selection of sketch plane when no convenient objects are shown in OCC 3D viewer.
+
+.. figure:: /images/sketch_preferences.png
+   :align: center
+
+   **Preferences**: Sketch tab
+
+**Input fields**:
+
+- **Size** defines size of coordinate planes;
+- **Thickness**  defines thickness of coordinate plane borders; 
+- **Rotate to plane when selected** check-box turns on/off automatic switch the viewer to the top view for the selected sketch plane.  
+- **Angular tolerance** defines defines an angular tolerance for automatic creation of horizontal and vertical constraints;
+- **Default spline weight** defines default weight for B-spline nodes during creation. The default value can be changed by editing of the spline;
+- **Cursor for sketch operation** defines a cursor which indicates a launched sketcher sub-operation.
+- **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;
+   
+.. _viewer_preferences:
+   
+Viewer tab
+^^^^^^^^^^
+
+Viewer tab defines selection in OCC 3D viewer properties. 
+
+.. figure:: /images/viewer_preferences.png
+   :align: center
+
+   **Preferences**: Viewer tab   
+
+**Input fields**:
+
+- **Default Selection** defines objects to be selected by mouse click in OCC 3D viewer:
+
+  - **Faces** check-box turns on/off selection of faces;
+  - **Edges** check-box turns on/off selection of edges;
+  - **Vertices** check-box turns on/off selection of vertices;
+
+- **Selection sensitivity** defines size of area around object in pixels, in which  mouse click selects object inside this area:
+
+  - **Vertex** defines selection  sensitivity for vertices; 
+  - **Edge**  defines selection  sensitivity for edges.  
+
+.. _toolbars_management:
+
+Toolbars management
+-------------------
+
+.. _toolbars_dialog:
+
+**Toolbars** dialog box
+^^^^^^^^^^^^^^^^^^^^^^^
+To edit the current tool bars structure select in the Main Menu *Edit - > Edit toolbars* item. 
+The following dialog box with existing toolbars appears:
+
+.. figure:: /images/Toolbars.png
+   :align: center
+
+   **Toolbars** dialog box
+
+**Input fields**:
+
+- **Toolbars** window contains list of toolbars names. Number of commands in each tool bar is shown in brackets.
+- **Add** button creates a new toolbar. Click on **Add** button opens :ref:`create_toolbar`;
+- **Edit**  button  calls :ref:`edit_toolbar` for currently selected tool bar;
+- **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;
+- **Reset** button restores modified tool bars structure to default state;
+- **OK** button closes the dialog box, stores result of tool bars edition and updates Shaper tool bars;
+- **Cancel** button closes the dialog box without modification of tool bars.
+
+.. figure:: /images/delete_toolbar.png
+   :align: center
+
+   Warning dialog box
+   
+.. _create_toolbar:
+
+**Create toolbar** dialog box
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+**Input fields** of **Create toolbar** dialog box:
+
+.. figure:: /images/create_toolbar.png
+   :align: center
+
+   **Create toolbar** dialog box
+
+- **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;
+- **Ok** button closes the dialog box and add a new tool bar of the module into  **Toolbars** window;
+- **Cancel** button closes the dialog box without addition of a new tool bar.
+
+.. figure:: /images/name_toolbar.png
+   :align: center
+
+   **Warning** dialog box
+
+.. _edit_toolbar:
+
+**Edit toolbar** dialog box
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+**Input fields** of **Edit toolbar** dialog box:
+
+.. figure:: /images/EditToolbar.png
+   :align: center
+
+   **Edit toolbar** dialog box
+
+- **Toolbar name** non-editable field displays  name of modified tool bar;
+- **Out of toolbars** window contains list of commands which are not included into any tool bar and separator definition "------";
+- **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; 
+- **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.
+    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.
+- **Left arrow** button transfers currently selected item from **In the toolbar** window into **Out of toolbars** window;
+- **Up** and **Down** buttons  change position of selected command in **In the toolbar** window;
+- **Ok** button closes the dialog box, stores result of edition;
+- **Cancel**  button closes the dialog box without modification of tool bar content.
diff --git a/doc/gui/General/TUI_tutorial.rst b/doc/gui/General/TUI_tutorial.rst
new file mode 100644 (file)
index 0000000..949201b
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_tutorial:
+
+Tutorial TUI Script
+===================
+
+.. literalinclude:: tutorial.py
+    :linenos:
+    :language: python
+
+:download:`Download this script <tutorial.py>` 
\ No newline at end of file
diff --git a/doc/gui/General/Tutorial.rst b/doc/gui/General/Tutorial.rst
new file mode 100644 (file)
index 0000000..e00117d
--- /dev/null
@@ -0,0 +1,357 @@
+
+.. _tutorial:
+
+
+Tutorial
+========
+
+This exercise illustrates how to create screw-nut shape from scratch.
+
+
+Step 1. Sketch
+--------------
+
+At this step we will create a regular hexagon.
+
+- Create a :ref:`new-part` via Main Menu *Part - > New part*
+- Start :ref:`Sketch <sketchPlugin>` creation via Main Menu *Sketch - > Sketch*
+- Set **Size of the view** parameter equal to 250 in the Sketch dialog
+- Select **XOY** plane in the view
+- Click **Set plane view** button in the Sketch property panel
+
+.. figure:: /images/tutorial1_1.png
+   :align: center
+
+   Skecth plane XOY
+
+- Start :ref:`Line <sketchLine>` creation via Main Menu *Sketch - > Line*
+- Pick 3 points in the view one by one and select the first one at the end to get a triangle:
+
+.. figure:: /images/tutorial1_2.png
+   :align: center
+
+   3 Lines forming a triangle
+
+- Hide trihedron via **Show/Hide trihedron** button in viewer toolbar
+- Select **Origin** object from **Part set / Constructions** folder in the object browser
+- Click on the eye icon on the left of the origin item to show it in the view
+- Select both origin and the bottom vertex of the triangle in the view (use **Shift** key for multi-selection)
+
+.. figure:: /images/tutorial1_3.png
+   :align: center
+
+   Origin and triangle
+
+- Create :ref:`Coincident <sketchCoincident>` constraint via **Coincident** button in Sketch toolbar
+
+.. figure:: /images/tutorial1_4.png
+   :align: center
+
+   Triangle vertex coincident with origin
+
+- Show trihedron
+- Select both **OY** axis and the upper side of the triangle in the view
+- Create :ref:`Perpendicular <sketchPerpendicular>` constraint via **Pependicular** button in Sketch toolbar
+
+.. figure:: /images/tutorial1_5.png
+   :align: center
+
+   Upper triangle side perpendicular to OY axis
+
+- Select the left and the upper side of the triangle
+- Create :ref:`Equal <sketchEqual>` constraint via **Equal** button in Sketch toolbar
+- Make the upper and the right sides equal length in the same way
+
+.. figure:: /images/tutorial1_6.png
+   :align: center
+
+   Equilateral triangle
+
+- Select the left side of the triangle
+- Check **Auxiliary** check box in the property panel and click **Apply** button
+
+.. figure:: /images/tutorial1_7.png
+   :align: center
+
+   Line property panel
+
+- Make the right side auxiliary in the same way
+
+.. figure:: /images/tutorial1_8.png
+   :align: center
+
+   The lateral sides are auxiliary
+
+- Start creation of :ref:`Angular copy <sketchAngularCopy>` feature via **Angular copy** button in Sketch toolbar
+- Select the upper side of the triangle for **Segments** parameter in the property panel
+- Select origin in the view as a center of rotation
+- Set **Total number** of objects equal to 6
+
+.. figure:: /images/tutorial1_9.png
+   :align: center
+
+   Angular copy parameters
+
+- Click **Apply** button
+
+.. figure:: /images/tutorial1_10.png
+   :align: center
+
+   Regular hexagon
+
+- Select the upper side of the hexagon
+- Start creation of :ref:`Length <sketchLength>` constraint via **Length** button in Sketch toolbar
+- Set length expression equal to "a=115.4" and press **Enter**
+
+.. figure:: /images/tutorial1_11.png
+   :align: center
+
+   Fully fixed regular hexagon
+
+- Click **Apply** button in the *Skecth* property panel to finish the sketch creation
+
+.. figure:: /images/tutorial1_12.png
+   :align: center
+
+   Finished Sketch
+
+- Check item corresponding to the created parameter **a** under **Part_1 / Parameters** node
+
+.. figure:: /images/tutorial1_13.png
+   :align: center
+
+   Parameter created during the Sketch operation
+
+Step 2. Polyline
+----------------
+
+- Start :ref:`Parameter <parameter>` creation via Main Menu *Part - > Parameter*
+- Set parameter name = "h", set parameter expression = "90", set comment = "nut height"
+
+.. figure:: /images/tutorial2_0.png
+   :align: center
+
+   Creation of parameter h = 90
+
+- Click **Apply** button to finish parameter creation
+- Start :ref:`Point <constructionPoint>` creation via Main Menu *Construction - > Point*
+- Set x = 50, y = 0, z = 0
+
+.. figure:: /images/tutorial2_1.png
+   :align: center
+
+   Construction of point (50, 0, 0)
+
+- Click **Apply** button to finish point creation
+- Create points (80, 0, 0), (112, 0, 13), (112, 0, 48), (80, 0, 63), (80, 0, h), (50, 0, h) in the same way
+- Select the created points in the object browser under **Part_1 / Constructions** node
+- Click right mouse button and select **Color...** item in the popup menu
+- Select blue color and click **OK** button
+
+.. figure:: /images/tutorial2_2.png
+   :align: center
+
+   Points created from scratch
+
+- Start :ref:`Polyline <buildPolyline>` creation via Main Menu *Build - > Polyline*
+- Select all the 7 points (use **Shift** key for multi-selection)
+- Check **Closed** check box
+
+.. figure:: /images/tutorial2_3.png
+   :align: center
+
+   Creation of closed polyline from 7 points
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial2_4.png
+   :align: center
+
+   Closed Polyline
+
+Step 3. Face
+------------
+
+- Start :ref:`Face <buildFace>` creation via Main Menu *Build - > Face*
+- Select **Polyline_1_1** in the object browser under **Part_1 / Results** node
+
+.. figure:: /images/tutorial3_1.png
+   :align: center
+
+   Construction of face from a polyline
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial3_2.png
+   :align: center
+
+   Face
+
+Step 4. Revolution
+------------------
+
+- Start :ref:`Revolution <featureRevolution>` creation via Main Menu *Features - > Revolution*
+- Select the face created at step 3 in the view
+- Click on axis input field in the property panel and select **OZ** axis in the view
+
+.. figure:: /images/tutorial4_1.png
+   :align: center
+
+   Revolution around OZ by 360 degrees
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial4_2.png
+   :align: center
+
+   Solid created by rotation of face
+
+Step 5. Extrusion
+-----------------
+
+- Start :ref:`Extrusion <featureExtrusion>` creation via Main Menu *Features - > Extrusion*
+- Select the hexagon created at step 1
+- Click on axis input field in the property panel and select **OZ** axis in the view
+- Check **By bounding planes and offsets option**
+- Select the bottom face of the revolution shape as **From** plane
+- Select the top face of the revolution shape as **To** plane
+
+.. figure:: /images/tutorial5_1.png
+   :align: center
+
+   Extrusion along OZ axis by bounding planes
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial5_2.png
+   :align: center
+
+   Solid created by extrusion of sketch
+
+Step 6. Common
+--------------
+
+- Start :ref:`Common <featureCommon>` creation via Main Menu *Features - > Common*
+- Select the extrusion and the revolution in the object browser under **Part_1 / Results** node (use **Shift** key for multi-selection)
+
+.. figure:: /images/tutorial6_1.png
+   :align: center
+
+   Common creation
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial6_2.png
+   :align: center
+
+   The revolution and the extrusion common part
+
+Step 7. Fillet
+--------------
+
+- Start :ref:`Fillet <featureFillet>` creation via Main Menu *Features - > Fillet*
+- Select the edge
+
+.. figure:: /images/tutorial7_1.png
+   :align: center
+
+   Select edge for a Fillet
+
+- Select **Radius** parameter equal to 10
+
+.. figure:: /images/tutorial7_2.png
+   :align: center
+
+   Fillet with radius = 10
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial7_3.png
+   :align: center
+
+   Fillet
+
+Step 8. Box
+-----------
+
+- Click right mouse button in the view and select **Hide all** item in the popup menu to clear the view
+- Start :ref:`Box <box_feature>` creation via Main Menu *Primitives - > Box*
+- Set **DX** = 10, **DY** = 120, **DZ** = 20
+
+.. figure:: /images/tutorial8_1.png
+   :align: center
+
+   Box creation
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial8_2.png
+   :align: center
+
+   Box
+
+Step 9. Translation
+-------------------
+
+- Start :ref:`Translation <featureTranslation>` creation via Main Menu *Part - > Translation*
+- Check **By X, Y and Z dimensions** option on the top of the property panel
+- Select the box in the view
+- Set **DX** = -10, **DY** = 20, **DZ** = 70
+
+.. figure:: /images/tutorial9_1.png
+   :align: center
+
+   Box translation
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial9_2.png
+   :align: center
+
+   Translated Box
+
+Step 10. Angular Copy
+---------------------
+
+- Start :ref:`Angular Copy <featureAngularCopy>` creation via Main Menu *Part - > Angular Copy*
+- Select the box in the view
+- Click on axis input field in the property panel and select **OZ** axis in the view
+- Set **Nb copies** parameter equal to 6
+
+.. figure:: /images/tutorial10_1.png
+   :align: center
+
+   Angular Copy around OZ
+
+- Click **Apply** button in the property panel
+
+.. figure:: /images/tutorial10_2.png
+   :align: center
+
+   Copied Box
+
+Step 11. Cut
+------------
+
+- Select **Fillet_1_1** item in the object browser under **Part_1 / Results** node
+- Click on the eye icon on the left of the result item to show it in the view
+- Start :ref:`Cut <featureCut>` creation via Main Menu *Features - > Cut*
+- Select the fillet object in the view as a main object
+- Select the angular copy object in the object browser as a tool object
+
+.. figure:: /images/tutorial11_1.png
+   :align: center
+
+   Cut creation
+
+- Click **Apply** button in the property panel
+- Select the created **Cut_1_1** item in the object browser under **Part_1 / Results** node
+- Click right mouse button and select **Color...** item in the popup menu
+- Set (R: 255, G: 214, B: 0) color and click **OK** button
+
+.. figure:: /images/tutorial11_2.png
+   :align: center
+
+   Cut
+
+**See Also** a :ref:`TUI Script <tui_tutorial>` reproducing all the tutorial steps.
diff --git a/doc/gui/General/tutorial.py b/doc/gui/General/tutorial.py
new file mode 100644 (file)
index 0000000..ade5fc5
--- /dev/null
@@ -0,0 +1,90 @@
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+
+# Parameters
+model.addParameter(Part_1_doc, "h", "90", "nut height")
+model.addParameter(Part_1_doc, "a", "115.4")
+
+# Step1. Sketch.
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-57.69999999999999, 99.93933159672423, 57.70000000000001, 99.93933159672423)
+SketchLine_2 = Sketch_1.addLine(57.70000000000001, 99.93933159672423, 0, 0)
+SketchLine_2.setAuxiliary(True)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(0, 0, -57.69999999999999, 99.93933159672423)
+SketchLine_3.setAuxiliary(True)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_4 = SketchProjection_2.createdFeature()
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_4.result(), SketchLine_1.result())
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result())
+SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_1.result())
+SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_1.result()], SketchAPI_Line(SketchLine_4).startPoint(), 360, 6, True)
+[SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9] = SketchMultiRotation_1.rotated()
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "a")
+model.do()
+
+# Step2. Polyline.
+Point_2 = model.addPoint(Part_1_doc, 50, 0, 0)
+Point_2.result().setColor(0, 0, 255)
+Point_3 = model.addPoint(Part_1_doc, 80, 0, 0)
+Point_3.result().setColor(0, 0, 255)
+Point_4 = model.addPoint(Part_1_doc, 112, 0, 13)
+Point_4.result().setColor(0, 0, 255)
+Point_5 = model.addPoint(Part_1_doc, 112, 0, 48)
+Point_5.result().setColor(0, 0, 255)
+Point_6 = model.addPoint(Part_1_doc, 80, 0, 63)
+Point_6.result().setColor(0, 0, 255)
+Point_7 = model.addPoint(Part_1_doc, "80", "0", "h")
+Point_7.result().setColor(0, 0, 255)
+Point_8 = model.addPoint(Part_1_doc, "50", "0", "h")
+Point_8.result().setColor(0, 0, 255)
+Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2"),
+                      model.selection("VERTEX", "Point_3"), model.selection("VERTEX", "Point_4"),
+                      model.selection("VERTEX", "Point_5"), model.selection("VERTEX", "Point_6"),
+                      model.selection("VERTEX", "Point_7")]
+Polyline_1 = model.addPolyline3D(Part_1_doc, Polyline_1_objects, True)
+
+# Step3. Face.
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Polyline_1_1")])
+
+# Step4. Revolution.
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+
+# Step5. Extrusion.
+Wire = model.selection("WIRE", "Sketch_1/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_1r_wire")
+To = model.selection("FACE", "Revolution_1_1/Generated_Face&Point_4/Point_4")
+From = model.selection("FACE", "Revolution_1_1/Generated_Face&Point_1/Point_1")
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [Wire], model.selection("EDGE", "PartSet/OZ"), To, 0, From, 0)
+
+# Step6. Common.
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Revolution_1_1"), model.selection("SOLID", "Extrusion_1_1")])
+
+# Step7. Fillet.
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Point_6/Point_6][Common_1_1/Modified_Face&Point_7/Point_7]")], 10)
+
+# Step8. Box.
+Box_1 = model.addBox(Part_1_doc, 20, 120, 20)
+
+# Step9. Translation.
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], -10, 20, 70)
+
+# Step10. Angular Copy.
+AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OZ"), 6)
+
+# Step11. Cut.
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Fillet_1_1")], [model.selection("COMPOUND", "AngularCopy_1_1")])
+Cut_1.result().setColor(255, 214, 0)
+
+model.end()
diff --git a/doc/gui/Introduction.rst b/doc/gui/Introduction.rst
deleted file mode 100644 (file)
index ed7d557..0000000
+++ /dev/null
@@ -1,685 +0,0 @@
-\r
-.. _introduction:\r
-\r
-Introduction to SHAPER\r
-======================\r
-\r
-SHAPER module of SALOME is destined for:\r
-\r
-- import and export of geometrical models in IGES, BREP, STEP and XAO formats;\r
-- parametric construction of geometrical objects using a wide range of functions:\r
-    \r
-  - creation of complex 2D sections using :ref:`sketchPlugin` with consequent extrusion or revolution (see :ref:`featuresPlugin`);\r
-  - construction of model using primitives defined in :ref:`primitivesPlugin`;\r
-  - usage of Boolean operations (see :ref:`featuresPlugin`);\r
-  \r
-- viewing geometrical objects in the OCC viewer;\r
-- transformation of geometrical objects using various algorithms.\r
-\r
-It is possible to easily set :ref:`parameter_usage` predefined to be used as arguments when objects are created.\r
-\r
-SHAPER module preferences are described in the :ref:`preferences` section of SALOME Help.\r
-\r
-Almost all SHAPER  module functionalities are accessible via Python Interface.\r
-\r
-SHAPER module works with one study containing several documents:\r
-\r
-- partset\r
-- one or several parts.\r
-\r
-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
-  \r
-A new study contains only a partset with 7 default constructions, which cannot be deleted:\r
-  \r
-- one point **Origin** coinciding with the origin of the coordinate system;\r
-- three axes **OX**, **OY**, **OZ**  coinciding with coordinate axes;\r
-- three planes **YOZ**, **XOZ**, **XOY**  coinciding with coordinate planes.    \r
-\r
-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
-:ref:`parameter_usage` can be used both in Partset and any Part.\r
-    \r
-A new Part can be created as described in :ref:`partPlugin`.\r
-\r
-Double click or pop-up menu can be used to activate existing document.\r
-\r
-Application desktop\r
--------------------\r
-\r
-The main window of the application consists of the following components:\r
-\r
-- :ref:`main_menu`;\r
-- :ref:`doc_windows`;\r
-- :ref:`viewer`;\r
-- :ref:`toolbar`;    \r
-- status bar.    \r
-\r
-.. figure:: images/main_window.png\r
-   :align: center\r
-\r
-   Main window of SHAPER module\r
-  \r
-.. _main_menu:\r
-\r
-Main menu \r
----------\r
-\r
-Main menu provides access to all commands of the application.\r
-\r
-.. figure:: images/main_menu.png\r
-   :align: center\r
-\r
-   Main menu\r
-\r
-Main menu includes standard Salome items:\r
-\r
-- File;\r
-- Edit;\r
-- View;\r
-- Tools;   \r
-- Window;\r
-- Help;\r
-    \r
-and items specific for SHAPER module:\r
-\r
-- Part (see :ref:`partPlugin`);\r
-- Sketch (see :ref:`sketchPlugin`);\r
-- Construction (see :ref:`constructionPlugin`);\r
-- Build (see :ref:`buildPlugin`);\r
-- Primitives (see :ref:`primitivesPlugin`);\r
-- GDML (see :ref:`gdmlPlugin`);\r
-- Features (see :ref:`featuresPlugin`);  \r
-- Macros. \r
-\r
- .. _toolbar:  \r
-\r
-SHAPER toolbar\r
---------------\r
-\r
-Application toolbar contains:\r
-\r
-- standard toolbar;\r
-- modules toolbar;\r
-- SHAPER toolbar.\r
-\r
-.. figure:: images/toolbar.png\r
-   :align: center\r
-\r
-   Toolbars\r
-  \r
-SHAPER toolbar duplicates the main menu and  provides access to all commands of the application.\r
-\r
-SHAPER toolbar is separated into sections:\r
-\r
-- Part;\r
-- Movement;\r
-- Measurement;\r
-- Sketch;\r
-- Construction;\r
-- Build;\r
-- Primitives;\r
-- GDML;\r
-- Features;\r
-- Boolean;\r
-- Collections;    \r
-- Fillet;  \r
-- Macros.  \r
-\r
-Visibility of SHAPER toolbar sections is managed using *View -> Toolbar* :ref:`main_menu` item or toolbar pop-up menu.\r
-\r
-.. _doc_windows:\r
-\r
-Dock windows\r
-------------\r
-\r
-Standard dock windows are: \r
-\r
-- :ref:`object_browser`\r
-- :ref:`inspection_panel`\r
-- :ref:`hidefaces_panel`\r
-- :ref:`python console`\r
-- :ref:`property_panel`\r
-\r
-Dock windows can be placed in three dock areas using drag-and-drop:\r
-  \r
-- left, \r
-- right, \r
-- bottom.\r
-\r
-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
-\r
-Property Panel is hidden.\r
-\r
-Property Panel is shown on operation start in left dock area of the main window by default.\r
-\r
-If Object browser is shown at the same side then they will be tabbed.\r
-\r
-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
-\r
-.. figure:: images/popup_menu.png\r
-   :align: center\r
-\r
-   Pop-up menu for visibility of windows and toolbars\r
-\r
-.. _object_browser: \r
-\r
-Object browser\r
-^^^^^^^^^^^^^^\r
-\r
-Object browser contains all documents created in the current study. \r
-\r
-Each document includes standard branches where created objects are placed.\r
-\r
-Documents with branches are shown in Tree View.\r
-\r
-.. figure:: images/object_browser.png\r
-   :align: center\r
-\r
-   **Object browser**: Partset active\r
-\r
-Partset includes three branches:\r
-\r
-- Parameters;\r
-- Constructions;\r
-- Features    \r
-\r
-Part includes the following branches:\r
-\r
-- Parameters;\r
-- Constructions;\r
-- Results;\r
-- Fields;\r
-- Groups;   \r
-- Features.    \r
-\r
-New part contains only 3 empty branches:\r
\r
-- Parameters;\r
-- Constructions;\r
-- Results.\r
-\r
-Features are placed one after another in the active document with default names and their results are placed into the corresponding branch.\r
-\r
-Examples of default names assigned automatically for :ref:`box_feature` are:\r
\r
-* **Box_1**, **Box_2**, ... for Feature;\r
-* **Box_1_1**, **Box_2_1**, ... for Result.\r
-\r
-Note, that a default branch is added into Tree View when the first feature of this type is created.\r
-\r
-Note, that the result used in feature as argument is removed.\r
-\r
-This child result can be restored using **Recover** feature.\r
-\r
-Each feature, result, construction, group, field, parameter can be renamed using *Rename* pop-up menu command.\r
-\r
-.. figure:: images/popup_menu_object_browser_feature.png\r
-   :align: center\r
-\r
-   **Feature** pop-up menu\r
-\r
-.. figure:: images/popup_menu_object_browser_result.png\r
-   :align: center\r
-\r
-   **Result** pop-up menu\r
-\r
-.. figure:: images/popup_menu_object_browser_construction.png\r
-   :align: center\r
-\r
-   **Construction** pop-up menu\r
-\r
-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.\r
-\r
-Folders can be used to arrange long Tree View for features.\r
-\r
-.. figure:: images/object_browser_folder.png\r
-   :align: center\r
-\r
-   **Object browser** with folder Dome: Part_1 active\r
-\r
-*Insert a folder before* pop-up menu command creates a new empty folder before the selected feature. The folder can be renamed.\r
-\r
-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
-\r
-This allows to decrease the length of feature list.\r
-\r
-Features can be removed from the folder using *Move out before the folder* / *Move out after the folder* pop-up menu command.\r
-\r
-*Clean history* pop-up menu command looks for features that do not participate in other features.\r
-\r
-**Clean history** dialog box shows a list of unused features. After confirmation by click **Yes** button unused features are removed.\r
-\r
-.. figure:: images/clean_history.png\r
-   :align: center\r
-\r
-   **Clean history** dialog box\r
-\r
-*Select result* and *Select parent feature* pop-up menu commands help to navigate along Tree View.\r
-\r
-A feature and its result can be deleted using *Delete* pop-up menu command.\r
-\r
-Note that all features using the removed feature and their results will be removed simultaneously.\r
-\r
-**Delete feature** dialog box shows the list of features to be removed. After confirmation by click **Yes** button all these features are removed.\r
-\r
-.. figure:: images/delete_feature.png\r
-   :align: center\r
-\r
-   **Delete feature** dialog box\r
-   \r
-.. _property_panel:\r
-\r
-Property panel\r
-^^^^^^^^^^^^^^\r
-\r
-.. |ok_btn| image:: images/button_ok.png\r
-.. |cancel_btn| image:: images/button_cancel.png\r
-.. |help_btn| image:: images/button_help.png\r
-\r
-Property panel consists of two parts:\r
-\r
-- controls a container for input of parameters for the current operation;\r
-- buttons panel containing standard buttons:\r
\r
-   | |ok_btn| **Ok/Apply** executes operation with defined parameters,\r
-   | |cancel_btn| **Cancel/Close** calls **Abort operation** dialog box to confirm  operation abort, \r
-   | |help_btn| **Help** calls User's guide opened on page describing the current operation.\r
-\r
-   .. figure:: images/abort_operation.png\r
-      :align: center\r
-     \r
-      **Abort operation** dialog box\r
-\r
-|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.\r
-\r
-.. _inspection_panel: \r
-\r
-Inspection panel \r
-^^^^^^^^^^^^^^^^\r
-\r
-Inspection panel provides the list of types and quantities of all topological entities, composing the selected result, construction or feature.\r
-\r
-.. figure:: images/inspection_panel.png\r
-   :align: center\r
-\r
-   **Inspection panel** for default Box\r
-\r
-**Object** displays name of the selected result, construction  or feature.\r
-\r
-**Type** characterizes the whole shape.\r
-   \r
-The information about Point, Axis or Edge  additionally shows coordinates of point / end points.\r
-\r
-.. figure:: images/inspection_panel_line.png\r
-   :align: center\r
-\r
-   **Inspection panel** for Axis\r
-   \r
-The information about  Plane, Face additionally shows coordinates of center point and direction of normal.\r
-\r
-.. figure:: images/inspection_panel_face.png\r
-   :align: center\r
-\r
-   **Inspection panel** for Face \r
-\r
-.. _hidefaces_panel:\r
-\r
-Hide Faces panel\r
-^^^^^^^^^^^^^^^^\r
-\r
-**Hide Faces** panel makes possible to hide temporary faces of any displayed object. **Hide Faces** panel looks like following:\r
-\r
-.. figure:: images/hide_faces_panel.png\r
-   :align: center\r
-\r
-   **Hide Faces** panel\r
-\r
-- If this panel is activated it "listens" user selection.\r
-- If a face is selected then its name will be shown in the panel's list and hidden in the viewer. \r
-- 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.\r
-- 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.\r
-\r
-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.\r
-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.\r
-\r
-.. _python console:\r
-\r
-Python console\r
-^^^^^^^^^^^^^^\r
-\r
-Python console interpreters Python commands entered manually.\r
-\r
-In particular, it is possible to load the python script:\r
-\r
-*execfile(r"/dn48/newgeom/data/example.py")*\r
-\r
-Pop-up menu gives the possibility to:\r
-\r
-- Copy the selected text to clipboard;\r
-- Paste the text from clipboard to Python console ;\r
-- Clear Python console;\r
-- Dump commands from console into the specified file;\r
-- Start/Stop writing log into the specified file.    \r
\r
-.. figure:: images/python_console_popup.png\r
-   :align: center\r
-\r
-   Pop-up menu of Python console\r
-\r
-.. _viewer:\r
-\r
-Viewer\r
-------\r
-\r
-The application supports one instance of OCC 3D viewer and is able to show only one 3D space.\r
-\r
-This 3D space can be represented in several view windows. New view window can be created using **Clone view** button in viewer toolbar.\r
-\r
-Each view windows shows its own point of view on the 3D scene.\r
-\r
-This point of view can be modified using viewer commands: **Panning**, **Zooming**, **Scaling**, etc.\r
-\r
-.. figure:: images/2_viewers.png\r
-   :align: center\r
-\r
-   Two view windows\r
-\r
-The description of OCC 3D Viewer architecture and functionality is provided in GUI module user's guide in chapter **OCC 3D Viewer**.\r
-\r
-.. _parameter_usage:\r
-\r
-Parameters \r
-----------\r
-\r
-Model parametrization can be done using parameters.\r
-\r
-A parameter can be created in the active partset or part by:\r
-\r
-- :ref:`parameter`;\r
-- :ref:`parameters`;\r
-- :ref:`parameter_expression`.\r
-\r
-Any argument in features can be defined as parameter or expression containing parameters.\r
-\r
-The list of features using parameters is given in **Parameters** dialog box:\r
-\r
- .. figure:: images/parameters_feature.png\r
-   :align: center\r
-\r
-   Parameters dialog box\r
-  \r
-If a parameter value is changed, then all features where it is used are rebuilt.\r
-\r
-A parameter name should be unique in the active document.\r
-\r
-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
-\r
-In contrast to features (see :ref:`object_browser`), there is an additional option when parameters are deleted.   \r
-\r
-.. figure:: images/delete_parameter.png\r
-   :align: center\r
-\r
-   Delete parameter\r
-\r
-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
-\r
-.. _parameter_expression:\r
-\r
-Create parameter on fly\r
-^^^^^^^^^^^^^^^^^^^^^^^\r
-\r
-Parameter can be created during feature creation simply by writing *variable=expression* in any editbox.\r
-\r
-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
-\r
-.. _preferences:\r
-\r
-SHAPER preferences\r
-------------------\r
-\r
-Description of General application preferences and **Preferences** dialog box is provided in GUI module user's guide in chapter **Setting Preferences**.\r
-\r
-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
-\r
-To call **Preferences** dialog box:\r
-\r
-#. select in the Main Menu *File - > Preferences* item or\r
-#. use  **Ctrl+P** shortcut.\r
-\r
-SHAPER preferences contains the following tabs:\r
-\r
-- :ref:`visualization_preferences`;\r
-- :ref:`plugins_preferences`;\r
-- :ref:`shortcuts_preferences`;\r
-- :ref:`windows_preferences`.\r
-- :ref:`sketch_preferences`.\r
-- :ref:`viewer_preferences`.\r
-\r
-Visualization tab is activated by default when **Preferences** dialog box is opened in the active SHAPER module.\r
-\r
-Other tabs are activated by click on tab header.\r
-  \r
-.. _visualization_preferences:\r
-\r
-Visualization tab\r
-^^^^^^^^^^^^^^^^^\r
-\r
-This tab defines presentation of objects displayed in OCC 3D viewer.\r
-\r
-.. figure:: images/visualization_preferences.png\r
-   :align: center\r
-\r
-   **Preferences**: Visualization tab\r
-\r
-**Input fields**:\r
-\r
-- **Selection color** defines a color for selected objects;\r
-- **Result color** selects default shading color for objects from **Results** branch;\r
-- **Group color** selects default color for objects from **Groups** branch;\r
-- **Construction color** selects default color for objects from **Constructions** branch;\r
-- **Part color** selects default color for parts shown in Partset;  \r
-- **Field color** selects default color for objects from **Fields** branch;\r
-- **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
-- **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
-- **Reference shape wireframe color in operation** selects default color used for wireframe visualization of objects used in active operation;\r
-- **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
-- **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
-- **Color of removed feature in operation** selects default color used for visualization of sketch entities to be removed during **Trim/Split** operations;\r
-- **Color of sketch plane** selects default shading color for sketch plane;\r
-- **Hidden faces transparency** defines default transparency value for hidden faces;\r
-- **Dimension arrow size**  defines default size of arrows for extension line showing dimensional constraint;  \r
-- **Dimension font** defines font used for value of dimensional constraint;\r
-- **Dimension value size**  defines default size of value for dimensional constraint;\r
-- **Sketch dimension color**  defines default color of dimensional constraint; \r
-- **Construction plane color** selects default color for Construction planes;  \r
-- **Sketch entity color** selects default color for sketch objects;\r
-- **Sketch external entity color** selects default color for external objects selected as reference during sketch creation/edition;\r
-- **Sketch auxiliary entity color** selects default color for sketch auxiliary objects;\r
-- **Sketch overconstraint color** selects default color for a sketch with redundant constraints;\r
-- **Sketch fully constraint color** selects default color for a sketch with zero degrees of freedom.\r
-  \r
-To redefine any color click on the corresponding line to access **Select color** dialog box\r
-\r
-.. figure:: images/select_color.png\r
-   :align: center\r
-\r
-   **Preferences**: **Select color** dialog box\r
-   \r
-Preferences for sketch are applicable  during sketch creation/edition operation.\r
-   \r
-.. _plugins_preferences:\r
-   \r
-Plugins tab\r
-^^^^^^^^^^^\r
-Plugins tab defines folders where plugins and resources are located.\r
-\r
-.. figure:: images/plugins_preferences.png\r
-   :align: center\r
-\r
-   **Preferences**: Plugins tab\r
-\r
-**Input fields**:\r
-\r
-- **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
-\r
-- **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
-\r
-.. figure:: images/open_button.png\r
-   :align: center\r
-\r
-   **Open** button\r
-\r
-.. figure:: images/find_directory.png\r
-   :align: center\r
-\r
-   **Find directory** dialog box\r
-    \r
-   \r
-.. _shortcuts_preferences:\r
-   \r
-Shortcuts tab\r
-^^^^^^^^^^^^^\r
-\r
-Shortcuts tab defines shortcut keys for different operations.\r
-\r
-.. figure:: images/shortcuts_preferences.png\r
-   :align: center\r
-\r
-   **Preferences**: Shortcuts tab\r
-   \r
-- **Add parameter in parameters manager dialog** defines shortcut keys for adding parameter in parameters manager dialog box.\r
-   \r
-.. _windows_preferences:\r
-\r
-Windows tab\r
-^^^^^^^^^^^\r
-\r
-Windows tab contains definitions for the module windows management.\r
-\r
-.. figure:: images/windows_preferences.png\r
-   :align: center\r
-\r
-   **Preferences**: Windows tab\r
-\r
-- **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.\r
-\r
-.. _sketch_preferences:\r
-\r
-Sketch tab\r
-^^^^^^^^^^\r
-\r
-Sketch tab defines properties of coordinate planes shown for selection of sketch plane when no convenient objects are shown in OCC 3D viewer.\r
-\r
-.. figure:: images/sketch_preferences.png\r
-   :align: center\r
-\r
-   **Preferences**: Sketch tab\r
-\r
-**Input fields**:\r
-\r
-- **Size** defines size of coordinate planes;\r
-- **Thickness**  defines thickness of coordinate plane borders; \r
-- **Rotate to plane when selected** check-box turns on/off automatic switch the viewer to the top view for the selected sketch plane.  \r
-- **Angular tolerance** defines defines an angular tolerance for automatic creation of horizontal and vertical constraints;\r
-- **Default spline weight** defines default weight for B-spline nodes during creation. The default value can be changed by editing of the spline;\r
-- **Cursor for sketch operation** defines a cursor which indicates a launched sketcher sub-operation.\r
-- **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;\r
-   \r
-.. _viewer_preferences:\r
-   \r
-Viewer tab\r
-^^^^^^^^^^\r
-\r
-Viewer tab defines selection in OCC 3D viewer properties. \r
-\r
-.. figure:: images/viewer_preferences.png\r
-   :align: center\r
-\r
-   **Preferences**: Viewer tab   \r
-\r
-**Input fields**:\r
-\r
-- **Default Selection** defines objects to be selected by mouse click in OCC 3D viewer:\r
-\r
-  - **Faces** check-box turns on/off selection of faces;\r
-  - **Edges** check-box turns on/off selection of edges;\r
-  - **Vertices** check-box turns on/off selection of vertices;\r
-\r
-- **Selection sensitivity** defines size of area around object in pixels, in which  mouse click selects object inside this area:\r
-\r
-  - **Vertex** defines selection  sensitivity for vertices; \r
-  - **Edge**  defines selection  sensitivity for edges.  \r
-\r
-.. _toolbars_management:\r
-\r
-Toolbars management\r
--------------------\r
-\r
-.. _toolbars_dialog:\r
-\r
-**Toolbars** dialog box\r
-^^^^^^^^^^^^^^^^^^^^^^^\r
-To edit the current tool bars structure select in the Main Menu *Edit - > Edit toolbars* item. \r
-The following dialog box with existing toolbars appears:\r
-\r
-.. figure:: images/Toolbars.png\r
-   :align: center\r
-\r
-   **Toolbars** dialog box\r
-\r
-**Input fields**:\r
-\r
-- **Toolbars** window contains list of toolbars names. Number of commands in each tool bar is shown in brackets.\r
-- **Add** button creates a new toolbar. Click on **Add** button opens :ref:`create_toolbar`;\r
-- **Edit**  button  calls :ref:`edit_toolbar` for currently selected tool bar;\r
-- **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;\r
-- **Reset** button restores modified tool bars structure to default state;\r
-- **OK** button closes the dialog box, stores result of tool bars edition and updates Shaper tool bars;\r
-- **Cancel** button closes the dialog box without modification of tool bars.\r
-\r
-.. figure:: images/delete_toolbar.png\r
-   :align: center\r
-\r
-   Warning dialog box\r
-   \r
-.. _create_toolbar:\r
-\r
-**Create toolbar** dialog box\r
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r
-\r
-**Input fields** of **Create toolbar** dialog box:\r
-\r
-.. figure:: images/create_toolbar.png\r
-   :align: center\r
-\r
-   **Create toolbar** dialog box\r
-\r
-- **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;\r
-- **Ok** button closes the dialog box and add a new tool bar of the module into  **Toolbars** window;\r
-- **Cancel** button closes the dialog box without addition of a new tool bar.\r
-\r
-.. figure:: images/name_toolbar.png\r
-   :align: center\r
-\r
-   **Warning** dialog box\r
-\r
-.. _edit_toolbar:\r
-\r
-**Edit toolbar** dialog box\r
-^^^^^^^^^^^^^^^^^^^^^^^^^^^\r
-\r
-**Input fields** of **Edit toolbar** dialog box:\r
-\r
-.. figure:: images/EditToolbar.png\r
-   :align: center\r
-\r
-   **Edit toolbar** dialog box\r
-\r
-- **Toolbar name** non-editable field displays  name of modified tool bar;\r
-- **Out of toolbars** window contains list of commands which are not included into any tool bar and separator definition "------";\r
-- **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; \r
-- **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.\r
-    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.\r
-- **Left arrow** button transfers currently selected item from **In the toolbar** window into **Out of toolbars** window;\r
-- **Up** and **Down** buttons  change position of selected command in **In the toolbar** window;\r
-- **Ok** button closes the dialog box, stores result of edition;\r
-- **Cancel**  button closes the dialog box without modification of tool bar content.\r
diff --git a/doc/gui/TUI_scripts.rst.in b/doc/gui/TUI_scripts.rst.in
new file mode 100644 (file)
index 0000000..82a4d8b
--- /dev/null
@@ -0,0 +1,9 @@
+Examples of TUI scripts
+=======================
+
+.. toctree::
+   :titlesonly:
+   :maxdepth: 1
+
+   TUI_tutorial.rst
+<insert here>
diff --git a/doc/gui/TUI_tutorial.rst b/doc/gui/TUI_tutorial.rst
deleted file mode 100644 (file)
index 949201b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-  .. _tui_tutorial:
-
-Tutorial TUI Script
-===================
-
-.. literalinclude:: tutorial.py
-    :linenos:
-    :language: python
-
-:download:`Download this script <tutorial.py>` 
\ No newline at end of file
diff --git a/doc/gui/Tutorial.rst b/doc/gui/Tutorial.rst
deleted file mode 100644 (file)
index d9bc3eb..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-
-.. _tutorial:
-
-
-Tutorial
-========
-
-This exercise illustrates how to create screw-nut shape from scratch.
-
-
-Step 1. Sketch
---------------
-
-At this step we will create a regular hexagon.
-
-- Create a :ref:`new-part` via Main Menu *Part - > New part*
-- Start :ref:`Sketch <sketchPlugin>` creation via Main Menu *Sketch - > Sketch*
-- Set **Size of the view** parameter equal to 250 in the Sketch dialog
-- Select **XOY** plane in the view
-- Click **Set plane view** button in the Sketch property panel
-
-.. figure:: images/tutorial1_1.png
-   :align: center
-
-   Skecth plane XOY
-
-- Start :ref:`Line <sketchLine>` creation via Main Menu *Sketch - > Line*
-- Pick 3 points in the view one by one and select the first one at the end to get a triangle:
-
-.. figure:: images/tutorial1_2.png
-   :align: center
-
-   3 Lines forming a triangle
-
-- Hide trihedron via **Show/Hide trihedron** button in viewer toolbar
-- Select **Origin** object from **Part set / Constructions** folder in the object browser
-- Click on the eye icon on the left of the origin item to show it in the view
-- Select both origin and the bottom vertex of the triangle in the view (use **Shift** key for multi-selection)
-
-.. figure:: images/tutorial1_3.png
-   :align: center
-
-   Origin and triangle
-
-- Create :ref:`Coincident <sketchCoincident>` constraint via **Coincident** button in Sketch toolbar
-
-.. figure:: images/tutorial1_4.png
-   :align: center
-
-   Triangle vertex coincident with origin
-
-- Show trihedron
-- Select both **OY** axis and the upper side of the triangle in the view
-- Create :ref:`Perpendicular <sketchPerpendicular>` constraint via **Pependicular** button in Sketch toolbar
-
-.. figure:: images/tutorial1_5.png
-   :align: center
-
-   Upper triangle side perpendicular to OY axis
-
-- Select the left and the upper side of the triangle
-- Create :ref:`Equal <sketchEqual>` constraint via **Equal** button in Sketch toolbar
-- Make the upper and the right sides equal length in the same way
-
-.. figure:: images/tutorial1_6.png
-   :align: center
-
-   Equilateral triangle
-
-- Select the left side of the triangle
-- Check **Auxiliary** check box in the property panel and click **Apply** button
-
-.. figure:: images/tutorial1_7.png
-   :align: center
-
-   Line property panel
-
-- Make the right side auxiliary in the same way
-
-.. figure:: images/tutorial1_8.png
-   :align: center
-
-   The lateral sides are auxiliary
-
-- Start creation of :ref:`Angular copy <sketchAngularCopy>` feature via **Angular copy** button in Sketch toolbar
-- Select the upper side of the triangle for **Segments** parameter in the property panel
-- Select origin in the view as a center of rotation
-- Set **Total number** of objects equal to 6
-
-.. figure:: images/tutorial1_9.png
-   :align: center
-
-   Angular copy parameters
-
-- Click **Apply** button
-
-.. figure:: images/tutorial1_10.png
-   :align: center
-
-   Regular hexagon
-
-- Select the upper side of the hexagon
-- Start creation of :ref:`Length <sketchLength>` constraint via **Length** button in Sketch toolbar
-- Set length expression equal to "a=115.4" and press **Enter**
-
-.. figure:: images/tutorial1_11.png
-   :align: center
-
-   Fully fixed regular hexagon
-
-- Click **Apply** button in the *Skecth* property panel to finish the sketch creation
-
-.. figure:: images/tutorial1_12.png
-   :align: center
-
-   Finished Sketch
-
-- Check item corresponding to the created parameter **a** under **Part_1 / Parameters** node
-
-.. figure:: images/tutorial1_13.png
-   :align: center
-
-   Parameter created during the Sketch operation
-
-Step 2. Polyline
-----------------
-
-- Start :ref:`Parameter <parameter>` creation via Main Menu *Part - > Parameter*
-- Set parameter name = "h", set parameter expression = "90", set comment = "nut height"
-
-.. figure:: images/tutorial2_0.png
-   :align: center
-
-   Creation of parameter h = 90
-
-- Click **Apply** button to finish parameter creation
-- Start :ref:`Point <constructionPoint>` creation via Main Menu *Construction - > Point*
-- Set x = 50, y = 0, z = 0
-
-.. figure:: images/tutorial2_1.png
-   :align: center
-
-   Construction of point (50, 0, 0)
-
-- Click **Apply** button to finish point creation
-- Create points (80, 0, 0), (112, 0, 13), (112, 0, 48), (80, 0, 63), (80, 0, h), (50, 0, h) in the same way
-- Select the created points in the object browser under **Part_1 / Constructions** node
-- Click right mouse button and select **Color...** item in the popup menu
-- Select blue color and click **OK** button
-
-.. figure:: images/tutorial2_2.png
-   :align: center
-
-   Points created from scratch
-
-- Start :ref:`Polyline <buildPolyline>` creation via Main Menu *Build - > Polyline*
-- Select all the 7 points (use **Shift** key for multi-selection)
-- Check **Closed** check box
-
-.. figure:: images/tutorial2_3.png
-   :align: center
-
-   Creation of closed polyline from 7 points
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial2_4.png
-   :align: center
-
-   Closed Polyline
-
-Step 3. Face
-------------
-
-- Start :ref:`Face <buildFace>` creation via Main Menu *Build - > Face*
-- Select **Polyline_1_1** in the object browser under **Part_1 / Results** node
-
-.. figure:: images/tutorial3_1.png
-   :align: center
-
-   Construction of face from a polyline
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial3_2.png
-   :align: center
-
-   Face
-
-Step 4. Revolution
-------------------
-
-- Start :ref:`Revolution <featureRevolution>` creation via Main Menu *Features - > Revolution*
-- Select the face created at step 3 in the view
-- Click on axis input field in the property panel and select **OZ** axis in the view
-
-.. figure:: images/tutorial4_1.png
-   :align: center
-
-   Revolution around OZ by 360 degrees
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial4_2.png
-   :align: center
-
-   Solid created by rotation of face
-
-Step 5. Extrusion
------------------
-
-- Start :ref:`Extrusion <featureExtrusion>` creation via Main Menu *Features - > Extrusion*
-- Select the hexagon created at step 1
-- Click on axis input field in the property panel and select **OZ** axis in the view
-- Check **By bounding planes and offsets option**
-- Select the bottom face of the revolution shape as **From** plane
-- Select the top face of the revolution shape as **To** plane
-
-.. figure:: images/tutorial5_1.png
-   :align: center
-
-   Extrusion along OZ axis by bounding planes
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial5_2.png
-   :align: center
-
-   Solid created by extrusion of sketch
-
-Step 6. Common
---------------
-
-- Start :ref:`Common <featureCommon>` creation via Main Menu *Features - > Common*
-- Select the extrusion and the revolution in the object browser under **Part_1 / Results** node (use **Shift** key for multi-selection)
-
-.. figure:: images/tutorial6_1.png
-   :align: center
-
-   Common creation
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial6_2.png
-   :align: center
-
-   The revolution and the extrusion common part
-
-Step 7. Fillet
---------------
-
-- Start :ref:`Fillet <featureFillet>` creation via Main Menu *Features - > Fillet*
-- Select the edge
-
-.. figure:: images/tutorial7_1.png
-   :align: center
-
-   Select edge for a Fillet
-
-- Select **Radius** parameter equal to 10
-
-.. figure:: images/tutorial7_2.png
-   :align: center
-
-   Fillet with radius = 10
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial7_3.png
-   :align: center
-
-   Fillet
-
-Step 8. Box
------------
-
-- Click right mouse button in the view and select **Hide all** item in the popup menu to clear the view
-- Start :ref:`Box <box_feature>` creation via Main Menu *Primitives - > Box*
-- Set **DX** = 10, **DY** = 120, **DZ** = 20
-
-.. figure:: images/tutorial8_1.png
-   :align: center
-
-   Box creation
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial8_2.png
-   :align: center
-
-   Box
-
-Step 9. Translation
--------------------
-
-- Start :ref:`Translation <featureTranslation>` creation via Main Menu *Part - > Translation*
-- Check **By X, Y and Z dimensions** option on the top of the property panel
-- Select the box in the view
-- Set **DX** = -10, **DY** = 20, **DZ** = 70
-
-.. figure:: images/tutorial9_1.png
-   :align: center
-
-   Box translation
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial9_2.png
-   :align: center
-
-   Translated Box
-
-Step 10. Angular Copy
----------------------
-
-- Start :ref:`Angular Copy <featureAngularCopy>` creation via Main Menu *Part - > Angular Copy*
-- Select the box in the view
-- Click on axis input field in the property panel and select **OZ** axis in the view
-- Set **Nb copies** parameter equal to 6
-
-.. figure:: images/tutorial10_1.png
-   :align: center
-
-   Angular Copy around OZ
-
-- Click **Apply** button in the property panel
-
-.. figure:: images/tutorial10_2.png
-   :align: center
-
-   Copied Box
-
-Step 11. Cut
-------------
-
-- Select **Fillet_1_1** item in the object browser under **Part_1 / Results** node
-- Click on the eye icon on the left of the result item to show it in the view
-- Start :ref:`Cut <featureCut>` creation via Main Menu *Features - > Cut*
-- Select the fillet object in the view as a main object
-- Select the angular copy object in the object browser as a tool object
-
-.. figure:: images/tutorial11_1.png
-   :align: center
-
-   Cut creation
-
-- Click **Apply** button in the property panel
-- Select the created **Cut_1_1** item in the object browser under **Part_1 / Results** node
-- Click right mouse button and select **Color...** item in the popup menu
-- Set (R: 255, G: 214, B: 0) color and click **OK** button
-
-.. figure:: images/tutorial11_2.png
-   :align: center
-
-   Cut
-
-**See Also** a :ref:`TUI Script <tui_tutorial>` reproducing all the tutorial steps.
index ed63e9ad60740d8802b8af6fea36f9e2f4bb4666..09e22cbe6b4453e9ccbc0595254514953b4f4838 100755 (executable)
 ## and prepares building of help documentation by sphinx
 ###
 
+import argparse
 import os
-import sys
+import os.path as osp
+import re
 import shutil
+import sys
 from xml.dom.minidom import parse
 
-aBuildDir = sys.argv[1]
-aSourcesDir = sys.argv[2]
-aSrcPath = aSourcesDir + os.sep + "../../src"
-
-aConfigPath = aSrcPath + os.sep + "Config/plugins.xml.in"
-
-def findDir(theConfFile):
+def find_dir(src_path, cfg_file):
     """Find a name of a directory where the given config file exists"""
-    aSrcList = os.listdir(aSrcPath)
-    for aDir in aSrcList:
-        aPath = aSrcPath + os.sep + aDir
-        aConfPath = aPath + os.sep + theConfFile
-        if os.path.isdir(aPath) and (os.path.exists(aConfPath) or os.path.exists(aConfPath + ".in")):
-            return aDir
+    entities = os.listdir(src_path)
+    for entity in entities:
+        path = osp.join(src_path, entity)
+        cfg_path = osp.join(path, cfg_file)
+        if not osp.isdir(path):
+            continue
+        if not osp.exists(cfg_path) and not osp.exists(cfg_path + '.in'):
+            continue
+        if osp.exists(osp.join(path, 'doc')):
+            return osp.join(path, 'doc')
     return None
 
-## Find accessible plugins from plugins.xml configuration file
-aPluginList = []
-# A map to avoid duplication of plugins
-aPluginsMap = {}
-aDomObj = parse(aConfigPath)
-aPluginsList = aDomObj.getElementsByTagName("plugin")
-for plugin in aPluginsList:
-    aLibName = plugin.getAttribute("library")
-    if not aLibName:
-        aLibName = plugin.getAttribute("script")
-    aConfigFile = plugin.getAttribute("configuration")
+def main(src_dir, build_dir):
+    """Main function"""
+    src_path = osp.realpath(osp.join(src_dir, *[os.pardir]*2, 'src'))
+    config_file = osp.join(src_path, 'Config', 'plugins.xml.in')
+
+    ## Find accessible plugins from plugins.xml configuration file
+    processed = []
+
+    indices = []
+    tui_scripts = []
 
-    if aLibName and aConfigFile and not aLibName in aPluginsMap:
-        aPluginsMap[aLibName] = True
-        aLibDir = findDir(aConfigFile)
-        if not aLibDir is None:
-            aPluginDocDir = aSrcPath + os.sep + aLibDir + os.sep + "doc"
-            if os.path.exists(aPluginDocDir):
-                ## Copy all files to a building directory
-                aDocDist = aBuildDir + os.sep + aLibName
-                if os.path.exists(aDocDist):
-                    shutil.rmtree(aDocDist)
-                shutil.copytree(aPluginDocDir, aDocDist)
-                aPluginList.append(aLibName)
+    doc = parse(config_file)
+    plugins = doc.getElementsByTagName('plugin')
+    for plugin in plugins:
+        plugin_name = plugin.getAttribute('library')
+        if not plugin_name:
+            plugin_name = plugin.getAttribute('script')
+        if not plugin_name or plugin_name in processed:
+            continue
+        config = plugin.getAttribute('configuration')
+        if not config:
+            continue
+        lib_dir = find_dir(src_path, config)
+        if lib_dir:
+            ## Copy plugin's documenation folder to the build directory
+            dist_dir = osp.join(build_dir, plugin_name)
+            if osp.exists(dist_dir):
+                shutil.rmtree(dist_dir)
+            shutil.copytree(lib_dir, dist_dir)
+            ## Collect index file
+            indices.append(osp.join(plugin_name, plugin_name + '.rst'))
+            ## Collect TUI scripts
+            tui_files = sorted(f for f in os.listdir(lib_dir) if \
+                                   osp.isfile(osp.join(lib_dir, f)) and re.match('TUI_.*\.rst', f))
+            tui_scripts += [osp.join('..', plugin_name, i) for i in tui_files]
+            ## Mark plugin as processed
+            processed.append(plugin_name)
 
-## Modify index.rst file accordingly
-aIndexFile = open(aSourcesDir + os.sep + "index.rst.in", 'r')
-aIndexLines = aIndexFile.readlines()
-aIndexFile.close()
+    ## Generate index file
+    in_file = osp.join(src_dir, 'index.rst.in')
+    out_file = osp.join(build_dir, 'index.rst')
+    with open(in_file, 'r') as fin, open(out_file, 'w') as fout:
+        lines = fin.readlines()
+        idx = lines.index('<insert here>\n')
+        lines = lines[:idx] + ['   {}\n'.format(i) for i in indices] + lines[idx+1:]
+        fout.writelines(lines)
 
-## Add list of plugins after toctree directive
-aIndexLines.append('\n')
-for aLibName in aPluginList:
-    aIndexLines.append("   " + aLibName + "/" + aLibName + ".rst\n")
+    ## Generate TUI scripts index
+    in_file = osp.join(src_dir, 'TUI_scripts.rst.in')
+    out_file = osp.join(build_dir, 'General', 'TUI_scripts.rst')
+    with open(in_file, 'r') as fin, open(out_file, 'w') as fout:
+        lines = fin.readlines()
+        idx = lines.index('<insert here>\n')
+        lines = lines[:idx] + ['   {}\n'.format(i) for i in tui_scripts] + lines[idx+1:]
+        fout.writelines(lines)
 
-aNewIndex = open(aBuildDir + os.sep + "index.rst", 'w')
-aNewIndex.writelines(aIndexLines)
-aNewIndex.close()
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='Generate index file from source directory')
+    parser.add_argument('build_dir', help='build directory')
+    parser.add_argument('src_dir', help='source directory')
+    args = parser.parse_args()
+    sys.exit(main(args.src_dir, args.build_dir))
index a2d14d5c28e80cea2abd5ecf09a2be4f8c37b348..bde9f74766aa7f155ad5d0cd82f06c48129bbe95 100644 (file)
@@ -6,9 +6,11 @@
 Welcome to SHAPER documentation!
 ==================================
 
-- :ref:`introduction`
-- :ref:`tutorial`
-
 .. toctree::
    :titlesonly:
    :maxdepth: 3
+
+   General/Introduction.rst
+   General/Tutorial.rst
+<insert here>
+   General/TUI_scripts.rst
diff --git a/doc/gui/tutorial.py b/doc/gui/tutorial.py
deleted file mode 100644 (file)
index ade5fc5..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-from SketchAPI import *
-
-from salome.shaper import model
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-
-# Parameters
-model.addParameter(Part_1_doc, "h", "90", "nut height")
-model.addParameter(Part_1_doc, "a", "115.4")
-
-# Step1. Sketch.
-Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchLine_1 = Sketch_1.addLine(-57.69999999999999, 99.93933159672423, 57.70000000000001, 99.93933159672423)
-SketchLine_2 = Sketch_1.addLine(57.70000000000001, 99.93933159672423, 0, 0)
-SketchLine_2.setAuxiliary(True)
-SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
-SketchLine_3 = Sketch_1.addLine(0, 0, -57.69999999999999, 99.93933159672423)
-SketchLine_3.setAuxiliary(True)
-SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
-SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
-SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
-SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates())
-SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
-SketchLine_4 = SketchProjection_2.createdFeature()
-SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_4.result(), SketchLine_1.result())
-SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result())
-SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_1.result())
-SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_1.result()], SketchAPI_Line(SketchLine_4).startPoint(), 360, 6, True)
-[SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9] = SketchMultiRotation_1.rotated()
-SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "a")
-model.do()
-
-# Step2. Polyline.
-Point_2 = model.addPoint(Part_1_doc, 50, 0, 0)
-Point_2.result().setColor(0, 0, 255)
-Point_3 = model.addPoint(Part_1_doc, 80, 0, 0)
-Point_3.result().setColor(0, 0, 255)
-Point_4 = model.addPoint(Part_1_doc, 112, 0, 13)
-Point_4.result().setColor(0, 0, 255)
-Point_5 = model.addPoint(Part_1_doc, 112, 0, 48)
-Point_5.result().setColor(0, 0, 255)
-Point_6 = model.addPoint(Part_1_doc, 80, 0, 63)
-Point_6.result().setColor(0, 0, 255)
-Point_7 = model.addPoint(Part_1_doc, "80", "0", "h")
-Point_7.result().setColor(0, 0, 255)
-Point_8 = model.addPoint(Part_1_doc, "50", "0", "h")
-Point_8.result().setColor(0, 0, 255)
-Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2"),
-                      model.selection("VERTEX", "Point_3"), model.selection("VERTEX", "Point_4"),
-                      model.selection("VERTEX", "Point_5"), model.selection("VERTEX", "Point_6"),
-                      model.selection("VERTEX", "Point_7")]
-Polyline_1 = model.addPolyline3D(Part_1_doc, Polyline_1_objects, True)
-
-# Step3. Face.
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Polyline_1_1")])
-
-# Step4. Revolution.
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-
-# Step5. Extrusion.
-Wire = model.selection("WIRE", "Sketch_1/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_1r_wire")
-To = model.selection("FACE", "Revolution_1_1/Generated_Face&Point_4/Point_4")
-From = model.selection("FACE", "Revolution_1_1/Generated_Face&Point_1/Point_1")
-
-Extrusion_1 = model.addExtrusion(Part_1_doc, [Wire], model.selection("EDGE", "PartSet/OZ"), To, 0, From, 0)
-
-# Step6. Common.
-Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Revolution_1_1"), model.selection("SOLID", "Extrusion_1_1")])
-
-# Step7. Fillet.
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Point_6/Point_6][Common_1_1/Modified_Face&Point_7/Point_7]")], 10)
-
-# Step8. Box.
-Box_1 = model.addBox(Part_1_doc, 20, 120, 20)
-
-# Step9. Translation.
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], -10, 20, 70)
-
-# Step10. Angular Copy.
-AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OZ"), 6)
-
-# Step11. Cut.
-Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Fillet_1_1")], [model.selection("COMPOUND", "AngularCopy_1_1")])
-Cut_1.result().setColor(255, 214, 0)
-
-model.end()