From: azv Date: Wed, 29 May 2019 10:21:05 +0000 (+0300) Subject: Task 3.3. Recovering Compsolids and Compounds X-Git-Tag: VEDF2019Lot4~119 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fc3885fc1195dd926ec8f44c8e7db6dcec0b8a4b;p=modules%2Fshaper.git Task 3.3. Recovering Compsolids and Compounds Update documentation of Recover feature. --- diff --git a/src/FeaturesPlugin/doc/TUI_recoverCompoundFeature.rst b/src/FeaturesPlugin/doc/TUI_recoverCompoundFeature.rst new file mode 100644 index 000000000..330932f8a --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_recoverCompoundFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_recover_compound: + +Recover +======= + +.. literalinclude:: examples/recover_compound.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/FeaturesPlugin/doc/TUI_recoverDefaultFeature.rst b/src/FeaturesPlugin/doc/TUI_recoverDefaultFeature.rst new file mode 100644 index 000000000..24b9ef630 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_recoverDefaultFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_recover_default: + +Recover +======= + +.. literalinclude:: examples/recover_default.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/FeaturesPlugin/doc/examples/recover_compound.py b/src/FeaturesPlugin/doc/examples/recover_compound.py new file mode 100644 index 000000000..781a87167 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/recover_compound.py @@ -0,0 +1,13 @@ +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right")) +Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Back")) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Plane_1")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Split_1_1_1")], [model.selection("FACE", "Plane_2")]) +Recover_1 = model.addRecover(Part_1_doc, Split_2, [Split_1.result()], True) +model.end() diff --git a/src/FeaturesPlugin/doc/examples/recover_default.py b/src/FeaturesPlugin/doc/examples/recover_default.py new file mode 100644 index 000000000..ce6b03507 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/recover_default.py @@ -0,0 +1,13 @@ +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right")) +Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Back")) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Plane_1")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Split_1_1_1")], [model.selection("FACE", "Plane_2")]) +Recover_1 = model.addRecover(Part_1_doc, Split_2, [Split_1.result().subResult(0)]) +model.end() diff --git a/src/FeaturesPlugin/doc/images/Recover.png b/src/FeaturesPlugin/doc/images/Recover.png deleted file mode 100644 index ecf06df6c..000000000 Binary files a/src/FeaturesPlugin/doc/images/Recover.png and /dev/null differ diff --git a/src/FeaturesPlugin/doc/images/recover.png b/src/FeaturesPlugin/doc/images/recover.png new file mode 100644 index 000000000..ddcc1b0f6 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/recover.png differ diff --git a/src/FeaturesPlugin/doc/images/recover_compound_32x32.png b/src/FeaturesPlugin/doc/images/recover_compound_32x32.png new file mode 100644 index 000000000..011658a27 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/recover_compound_32x32.png differ diff --git a/src/FeaturesPlugin/doc/images/recover_default_32x32.png b/src/FeaturesPlugin/doc/images/recover_default_32x32.png new file mode 100644 index 000000000..4e49a3736 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/recover_default_32x32.png differ diff --git a/src/FeaturesPlugin/doc/images/recover_mode_compound.png b/src/FeaturesPlugin/doc/images/recover_mode_compound.png new file mode 100644 index 000000000..22797dc88 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/recover_mode_compound.png differ diff --git a/src/FeaturesPlugin/doc/images/recover_mode_default.png b/src/FeaturesPlugin/doc/images/recover_mode_default.png new file mode 100644 index 000000000..f7370f132 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/recover_mode_default.png differ diff --git a/src/FeaturesPlugin/doc/images/recover_res_compound.png b/src/FeaturesPlugin/doc/images/recover_res_compound.png new file mode 100644 index 000000000..9bcc7f70e Binary files /dev/null and b/src/FeaturesPlugin/doc/images/recover_res_compound.png differ diff --git a/src/FeaturesPlugin/doc/images/recover_res_default.png b/src/FeaturesPlugin/doc/images/recover_res_default.png new file mode 100644 index 000000000..7026429b5 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/recover_res_default.png differ diff --git a/src/FeaturesPlugin/doc/recoverFeature.rst b/src/FeaturesPlugin/doc/recoverFeature.rst index 8370449c0..18ae83f59 100644 --- a/src/FeaturesPlugin/doc/recoverFeature.rst +++ b/src/FeaturesPlugin/doc/recoverFeature.rst @@ -1,9 +1,85 @@ - Recover - ======= +Recover +======= +**Recover** feature restores some objects used in previous operations. -.. image:: images/Recover.png - :align: center +To recover in the active part: + +#. select in the Main Menu *Features - > Recover* item or +#. click **Recover** button in the toolbar + +.. image:: images/recover.png + :align: center .. centered:: - Recover operation + **Recover** button + +The feature has the following options: + +.. image:: images/recover_default_32x32.png + :align: left +restore only the objects used in the operation + +.. image:: images/recover_compound_32x32.png + :align: left +restore full compound/compsolid if the operation used one or more of its sub-shapes + + +Recover objects +--------------- + +.. image:: images/recover_mode_default.png + :align: center + +.. centered:: + Recover objects used in operation + +- **Feature** field contains one of the previous operations; +- **List of recovered** objects contains all the shapes used in the operation. Need to enable checkbox to restore a shape. + +**TUI Command**: *model.addRecover(Part_doc, feature, [recovering_results])* + +**Arguments**: part + the name of the feature + list of results used in the feature. + +Result +"""""" + +Result of restoring the shape used in Split operation in compsolid is a single solid. + +.. image:: images/recover_res_default.png + :align: center + +.. centered:: + Recover a solid + +**See also** a sample TUI script of ref:`tui_recover_default` operation. + + +Recover top-level objects +------------------------- + +.. image:: images/recover_mode_compound.png + :align: center + +.. centered:: + Recover top-level compounds/compsolids of objects used in operation + +- **Feature** field contains one of the previous operations; +- **List of recovered** objects contains all top-level shapes (compounds/compsolids) of the shapes used in the operation. Need to enable checkbox to restore a shape. + +**TUI Command**: *model.addRecover(Part_doc, feature, [recovering_results], True)* + +**Arguments**: part + the name of the feature + list of results used in the feature + *True* to specify restoring compounds. + +Result +"""""" + +Result of restoring the shape used in Split operation in compsolid is a full compsolid. + +.. image:: images/recover_res_compound.png + :align: center + +.. centered:: + Recover a compsolid + +**See also** a sample TUI script of ref:`tui_recover_compound` operation. diff --git a/src/FeaturesPlugin/icons/recover_compound_32x32.png b/src/FeaturesPlugin/icons/recover_compound_32x32.png index 88b4752d1..011658a27 100644 Binary files a/src/FeaturesPlugin/icons/recover_compound_32x32.png and b/src/FeaturesPlugin/icons/recover_compound_32x32.png differ diff --git a/src/FeaturesPlugin/icons/recover_default_32x32.png b/src/FeaturesPlugin/icons/recover_default_32x32.png index caf03179b..4e49a3736 100644 Binary files a/src/FeaturesPlugin/icons/recover_default_32x32.png and b/src/FeaturesPlugin/icons/recover_default_32x32.png differ