From: Grigory ZHIVOTOVSKY Date: Mon, 17 Sep 2018 12:08:13 +0000 (+0300) Subject: Introduction help page updated, images moved to separate folder X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=842c4039c54700a78763432d2d207bdc5bf53117;p=modules%2Fshaper.git Introduction help page updated, images moved to separate folder --- diff --git a/doc/gui/Introduction.rst b/doc/gui/Introduction.rst index 05171faa8..cbaf9159c 100644 --- a/doc/gui/Introduction.rst +++ b/doc/gui/Introduction.rst @@ -17,7 +17,7 @@ SHAPER module of SALOME is destined for: - viewing geometrical objects in the OCC viewer; - transformation of geometrical objects using various algorithms. -It is possible to easily set :ref:`parameters` predefined to be used as arguments when objects are created. +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 SHAPER :ref:`preferences` section of SALOME Help. @@ -37,9 +37,8 @@ New study contains only Partset with 7 default constructions which cannot be del - three planes **YOZ**, **XOZ**, **XOY** coinciding with coordinate planes. Only points, axis and plane (see :ref:`constructionPlugin`) and sketches (see :ref:`sketchPlugin`) can be added in Partset to be used in any part later. -:ref:`parameters` created can be used both in Partset and any Part. +:ref:`parameter_usage` created can be used both in Partset and any Part. -If parameter name in Partset and Part are identical then Part parameter has higher prority. New Part can be created as described in :ref:`partPlugin`. @@ -54,6 +53,7 @@ The main window of the application consists of the following components: - :ref:`main_menu`; - :ref:`doc_windows`; - :ref:`viewer`; +- :ref:`toolbar`; - status bar. .. image:: images/main_window.png @@ -87,16 +87,52 @@ Main menu includes standard Salome items: and items specific for SHAPER module: -- :ref:`partPlugin`; -- :ref:`sketchPlugin`; -- :ref:`constructionPlugin`; -- :ref:`buildPlugin`; -- :ref:`primitivesPlugin`; -- :ref:`gdmlPlugin`; -- :ref:`featuresPlugin`; +- 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; +- modukles toolbar; +- SHAPER toolbar. + +.. image:: images/toolbar.png + :align: center + +.. centered:: + Toolbars + +SHAPER toolbar duplicates 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: @@ -263,7 +299,7 @@ Property panel consists of two parts: :align: center .. centered:: - **OK** button + **OK/Apply** button .. image:: images/button_cancel.png :align: center @@ -284,7 +320,7 @@ Property panel consists of two parts: **Abort operation** dialog box -**OK** button is disabled if not all input parameters are defined or some errors are found. Error is shown as tooltip and in status bar. +**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: @@ -371,30 +407,98 @@ This point of view can be modified by user with help of viewer commands like **P Description of OCC 3D Viewer architecture and functionality is provided in GUI module user's guide in chapter **OCC 3D Viewer**. -.. _parameters: +.. _parameter_usage: -Parameters ---------- +Parameter usage +--------------- + +Model parametrization can be done using parameters. + +Parameter can be created in the active partset or part by: + +- :ref:`parameter`; +- :ref:`parameters`; +- :ref:`parameter_expression`. -Parameter -^^^^^^^^^ +Created parameters can be used in features defining any argument as parameter or expression containing parameters. +List of features using parameters is given in **Parameters** dialog box: + .. image:: images/parameters_feature.png + :align: center + +.. centered:: + Parameters dialog box + +If parameter value is changed, then all features where it is used are rebuilt. + +Parameter name should be unique in the active document. + +However, partset and part can have parameters with the same name. If parameter name in Partset and Part are identical, then Part parameter has higher prority 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 Delete parameters. + +.. image:: images/delete_parameter.png + :align: center + +.. centered:: + Delete parameter + +After click **Replace** button. selected parameter is removed but parent parameters and features are not removed. Deleted parameter is replaced by its value. + +.. _parameter_expression: + +Create parameter on fly +^^^^^^^^^^^^^^^^^^^^^^^ + +Parameter can be created during feature creation simply writing *variable=expression* in any editbox. + +After validation of feature a new parameter with given name **variable** and value equal to evaluated expression appears in object browser under **Parameters** in the active partset or part. .. _preferences: SHAPER 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 include 4 tabs: + +- :ref:`visualization_preferences`; +- :ref:`plugins_preferences`; +- :ref:`sketch_preferences`; +- :ref:`viewer_preferences`. + +.. _visualization_preferences: + Visualization tab ^^^^^^^^^^^^^^^^^ +Visualization tab is activated by default when **Preferences** dialog box is opened in active SHAPER module. + .. image:: images/visualization_preferences.png :align: center .. centered:: Preferences - Visualization tab +To redefine any color click on the corrersponding line to acccsess **Select color** dialog box + +.. image:: images/select_color.png + :align: center + +.. centered:: + **Select color** dialog box + + + +.. _plugins_preferences: + Plugins tab ^^^^^^^^^^^ @@ -404,6 +508,8 @@ Plugins tab .. centered:: Preferences - Plugins tab +.. _sketch_preferences: + Sketch tab ^^^^^^^^^^ @@ -413,6 +519,8 @@ Sketch tab .. centered:: Preferences - Sketch tab +.. _viewer_preferences: + Viewer tab ^^^^^^^^^^ diff --git a/doc/gui/images/delete_parameter.png b/doc/gui/images/delete_parameter.png new file mode 100755 index 000000000..b0b8aea28 Binary files /dev/null and b/doc/gui/images/delete_parameter.png differ diff --git a/doc/gui/images/parameter.png b/doc/gui/images/parameter.png new file mode 100755 index 000000000..96d593948 Binary files /dev/null and b/doc/gui/images/parameter.png differ diff --git a/doc/gui/images/parameters_feature.png b/doc/gui/images/parameters_feature.png new file mode 100755 index 000000000..92a0afb31 Binary files /dev/null and b/doc/gui/images/parameters_feature.png differ diff --git a/doc/gui/images/select_color.png b/doc/gui/images/select_color.png new file mode 100755 index 000000000..49e9a2c45 Binary files /dev/null and b/doc/gui/images/select_color.png differ diff --git a/doc/gui/images/toolbar.png b/doc/gui/images/toolbar.png new file mode 100755 index 000000000..12d6af8eb Binary files /dev/null and b/doc/gui/images/toolbar.png differ diff --git a/src/ParametersPlugin/doc/ParametersPlugin.rst b/src/ParametersPlugin/doc/ParametersPlugin.rst index 2963a254d..0df2dafc8 100644 --- a/src/ParametersPlugin/doc/ParametersPlugin.rst +++ b/src/ParametersPlugin/doc/ParametersPlugin.rst @@ -4,9 +4,24 @@ Parameters plug-in ================== +Model parametrization can be done using parameters. + +Parameter can be created in the active partset or part by: + +- :ref:`parameter`; +- :ref:`parameters`; +- :ref:`parameter_expression`. + +Created parameters can be used in features defining any argument as parameter or expression containing parameters. + +If parameter value is changed, then it is reevaluated in all fetaures where it is used. + + + .. toctree:: :titlesonly: :maxdepth: 1 managerFeature.rst parameterFeature.rst + TUI_parameterFeature diff --git a/src/ParametersPlugin/doc/TUI_parameterFeature.rst b/src/ParametersPlugin/doc/TUI_parameterFeature.rst new file mode 100755 index 000000000..bf120a891 --- /dev/null +++ b/src/ParametersPlugin/doc/TUI_parameterFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_parameterFeature: + +Create Parameter +================ + +.. literalinclude:: examples/parameter.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/ParametersPlugin/doc/TUI_parametersFeature.rst b/src/ParametersPlugin/doc/TUI_parametersFeature.rst new file mode 100644 index 000000000..e4f8bc776 --- /dev/null +++ b/src/ParametersPlugin/doc/TUI_parametersFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_parametersFeature: + +Create Parameters +================= + +.. literalinclude:: examples/parameters.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/ParametersPlugin/doc/examples/parameter.py b/src/ParametersPlugin/doc/examples/parameter.py new file mode 100755 index 000000000..7f7f04251 --- /dev/null +++ b/src/ParametersPlugin/doc/examples/parameter.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +model.addParameter(partSet, "angle", "60*3.141/180", "main angle") +model.end() diff --git a/src/ParametersPlugin/doc/examples/parameters.py b/src/ParametersPlugin/doc/examples/parameters.py new file mode 100644 index 000000000..a8060a14d --- /dev/null +++ b/src/ParametersPlugin/doc/examples/parameters.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +model.addParameter(partSet, "angle", "60*3.141/180", "main angle") +model.addParameter(partSet, "height", "200*sin(angle)") +model.end() diff --git a/src/ParametersPlugin/doc/images/Parameter.png b/src/ParametersPlugin/doc/images/Parameter.png deleted file mode 100644 index 67f902ead..000000000 Binary files a/src/ParametersPlugin/doc/images/Parameter.png and /dev/null differ diff --git a/src/ParametersPlugin/doc/images/expression.png b/src/ParametersPlugin/doc/images/expression.png new file mode 100755 index 000000000..158678a87 Binary files /dev/null and b/src/ParametersPlugin/doc/images/expression.png differ diff --git a/src/ParametersPlugin/doc/images/object_browser_parameter.png b/src/ParametersPlugin/doc/images/object_browser_parameter.png new file mode 100755 index 000000000..63698f3d6 Binary files /dev/null and b/src/ParametersPlugin/doc/images/object_browser_parameter.png differ diff --git a/src/ParametersPlugin/doc/images/object_browser_parameters.png b/src/ParametersPlugin/doc/images/object_browser_parameters.png new file mode 100755 index 000000000..25801cb6d Binary files /dev/null and b/src/ParametersPlugin/doc/images/object_browser_parameters.png differ diff --git a/src/ParametersPlugin/doc/images/paper_roll.png b/src/ParametersPlugin/doc/images/paper_roll.png new file mode 100755 index 000000000..fc7a124c9 Binary files /dev/null and b/src/ParametersPlugin/doc/images/paper_roll.png differ diff --git a/src/ParametersPlugin/doc/images/parameter.png b/src/ParametersPlugin/doc/images/parameter.png new file mode 100755 index 000000000..96d593948 Binary files /dev/null and b/src/ParametersPlugin/doc/images/parameter.png differ diff --git a/src/ParametersPlugin/doc/images/parameters.png b/src/ParametersPlugin/doc/images/parameters.png new file mode 100755 index 000000000..4f1e1f66c Binary files /dev/null and b/src/ParametersPlugin/doc/images/parameters.png differ diff --git a/src/ParametersPlugin/doc/images/parameters_down.png b/src/ParametersPlugin/doc/images/parameters_down.png new file mode 100755 index 000000000..dfc36bec2 Binary files /dev/null and b/src/ParametersPlugin/doc/images/parameters_down.png differ diff --git a/src/ParametersPlugin/doc/images/parameters_up.png b/src/ParametersPlugin/doc/images/parameters_up.png new file mode 100755 index 000000000..c6e801735 Binary files /dev/null and b/src/ParametersPlugin/doc/images/parameters_up.png differ diff --git a/src/ParametersPlugin/doc/managerFeature.rst b/src/ParametersPlugin/doc/managerFeature.rst index c32dd48f9..039e9c767 100644 --- a/src/ParametersPlugin/doc/managerFeature.rst +++ b/src/ParametersPlugin/doc/managerFeature.rst @@ -1,10 +1,60 @@ +.. _parameters: + Parameters manager ================== +To create/edit a set of parameters in the active partset or part instead of multiply call: + +#. select in the Main Menu *Part - > Parameters* item or +#. click **Parameters** button in the toolbar: + +.. image:: images/paper_roll.png + :align: center + +.. centered:: + **Parameters** button + +The following dialog box with parameter table appears: + +.. image:: images/parameters.png + :align: center + +.. centered:: + Parameters dialog box + +**Input fields**: + +- **Name** defines parameter name. Name follows the naming rules of the python language for variables; +- **Expression** inputs manually python expression; +- **Result** evaluates expression as real number by python *eval()* function; +- **Comment** contains any text. This field is optional; +- **Add** button adds a new empty string in the end of table. Default **Name** is **, **Expression** is ** +- **Insert** button adds a new empty string before the selected parameter; +- **Delete** button removes the selected parameter from the table; +- **Modify parameter position** button moves the selected parameter + .. image:: images/parameters_up.png + :align: left + up on 1 string in the table, + + .. image:: images/parameters_down.png + :align: left + down on 1 string in the table. + + +**TUI Command**: *model.addParameter(Part_doc, Name, Value, Comment)* + +**Arguments**: 1 Part + 1 string + 1 value + 1 string + +**See Also** a sample TUI Script of a :ref:`tui_parametersFeature` operation. + +Result +------ + +Created parameters and their current values are displayed in the Object Browser, in a special section **Parameters**. -.. image:: images/Manager.png - :align: center +.. image:: images/object_browser_parameters.png + :align: center .. centered:: - Edit parameters with help of parameres manager + **Parameters** in object browser diff --git a/src/ParametersPlugin/doc/parameterFeature.rst b/src/ParametersPlugin/doc/parameterFeature.rst index d8f9025b1..7bbf0b159 100644 --- a/src/ParametersPlugin/doc/parameterFeature.rst +++ b/src/ParametersPlugin/doc/parameterFeature.rst @@ -1,10 +1,55 @@ +.. _parameter: Create parameter ================ +The parameter definition has form *variable=expression*. -.. image:: images/Parameter.png - :align: center +To create parameter in the active partset or part: + +#. select in the Main Menu *Part - > Parameter* item or +#. click **Parameter** button in the toolbar: + +.. image:: images/expression.png + :align: center + +.. centered:: + **Parameter** button + +The following property panel appears. + +.. image:: images/parameter.png + :align: center + +.. centered:: + Parameter property panel + +**Input fields**: + +- .. image:: images/expression.png + :align: left + defines parameter name. Name follows the naming rules of the python language for variables; + +- panel **Expression** evaluates inputted manually expression as real number by python *eval()* function. In the simplest case an expression is a real number. Some standard python modules (like math) are imported by default before evaluation. + +- **Comment** contains any text. This field is optional. + + +The property panel checks validity of the expression. For invalid expression **Apply** button is disabled and error message generated by python interpreter during the evaluation is shown in status bar and in popup of **Apply** button. + +**TUI Command**: *model.addParameter(Part_doc, Name, Value, Comment)* + +**Arguments**: 1 Part + 1 string + 1 value + 1 string + +**See Also** a sample TUI Script of a :ref:`tui_parameterFeature` operation. + +Result +------ + +Created parameter and its current value are displayed in the Object Browser, in a special section **Parameters**. + +.. image:: images/object_browser_parameter.png + :align: center .. centered:: - Create a parameter + **Parameter** in object browser