]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task 2.5. Combination operations on Groups (issue #2935) Operations_on_Groups
authorazv <azv@opencascade.com>
Fri, 9 Aug 2019 11:57:39 +0000 (14:57 +0300)
committerazv <azv@opencascade.com>
Fri, 9 Aug 2019 11:57:39 +0000 (14:57 +0300)
Update user documentation.

16 files changed:
src/CollectionPlugin/doc/CollectionPlugin.rst
src/CollectionPlugin/doc/TUI_groupAdditionFeature.rst [new file with mode: 0644]
src/CollectionPlugin/doc/TUI_groupIntersectionFeature.rst [new file with mode: 0644]
src/CollectionPlugin/doc/TUI_groupSubstractionFeature.rst [new file with mode: 0644]
src/CollectionPlugin/doc/examples/group_addition.py [new file with mode: 0644]
src/CollectionPlugin/doc/examples/group_intersection.py [new file with mode: 0644]
src/CollectionPlugin/doc/examples/group_substraction.py [new file with mode: 0644]
src/CollectionPlugin/doc/groupAdditionFeature.rst [new file with mode: 0644]
src/CollectionPlugin/doc/groupIntersectionFeature.rst [new file with mode: 0644]
src/CollectionPlugin/doc/groupSubstractionFeature.rst [new file with mode: 0644]
src/CollectionPlugin/doc/images/group_addition.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/group_addition_property_panel.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/group_intersection.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/group_intersection_property_panel.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/group_substraction.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/group_substraction_property_panel.png [new file with mode: 0644]

index e31d778235bfd4f5e072efc9536f7b7ef10b07dd..2b83ddd8cfc0ba857884478d711d43ad92ba32be 100644 (file)
@@ -13,3 +13,6 @@ Collection plug-in deals with groups of geometrical entities created by selectio
 
    fieldFeature.rst
    groupFeature.rst
+   groupAdditionFeature.rst
+   groupIntersectionFeature.rst
+   groupSubstractionFeature.rst
diff --git a/src/CollectionPlugin/doc/TUI_groupAdditionFeature.rst b/src/CollectionPlugin/doc/TUI_groupAdditionFeature.rst
new file mode 100644 (file)
index 0000000..ea9cbaf
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_create_group_addition:
+
+Create Group Addition
+=====================
+
+.. literalinclude:: examples/group_addition.py
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/group_addition.py>`
diff --git a/src/CollectionPlugin/doc/TUI_groupIntersectionFeature.rst b/src/CollectionPlugin/doc/TUI_groupIntersectionFeature.rst
new file mode 100644 (file)
index 0000000..37a7d8d
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_create_group_intersection:
+
+Create Group Intersection
+=========================
+
+.. literalinclude:: examples/group_intersection.py
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/group_intersection.py>`
diff --git a/src/CollectionPlugin/doc/TUI_groupSubstractionFeature.rst b/src/CollectionPlugin/doc/TUI_groupSubstractionFeature.rst
new file mode 100644 (file)
index 0000000..ca836f9
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_create_group_substraction:
+
+Create Group Substraction
+=========================
+
+.. literalinclude:: examples/group_substraction.py
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/group_substraction.py>`
diff --git a/src/CollectionPlugin/doc/examples/group_addition.py b/src/CollectionPlugin/doc/examples/group_addition.py
new file mode 100644 (file)
index 0000000..20f80fc
--- /dev/null
@@ -0,0 +1,14 @@
+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)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Box_1_1/Top"),
+                                      model.selection("FACE", "Box_1_1/Left")])
+Group_2 = model.addGroup(Part_1_doc, [model.selection("FACE", "Box_1_1/Front"),
+                                      model.selection("FACE", "Box_1_1/Top")])
+GroupAddition_1 = model.addGroupAddition(Part_1_doc, [model.selection("COMPOUND", "Group_1"),
+                                                      model.selection("COMPOUND", "Group_2")])
+model.end()
diff --git a/src/CollectionPlugin/doc/examples/group_intersection.py b/src/CollectionPlugin/doc/examples/group_intersection.py
new file mode 100644 (file)
index 0000000..84cb476
--- /dev/null
@@ -0,0 +1,19 @@
+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)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Box_1_1/Top"),
+                                      model.selection("FACE", "Box_1_1/Left")])
+Group_2 = model.addGroup(Part_1_doc, [model.selection("FACE", "Box_1_1/Front"),
+                                      model.selection("FACE", "Box_1_1/Top")])
+Group_3 = model.addGroup(Part_1_doc, [model.selection("FACE", "Box_1_1/Front"),
+                                      model.selection("FACE", "Box_1_1/Right"),
+                                      model.selection("FACE", "Box_1_1/Top")])
+GroupIntersection_1_objects = [model.selection("COMPOUND", "Group_1"),
+                               model.selection("COMPOUND", "Group_2"),
+                               model.selection("COMPOUND", "Group_3")]
+GroupIntersection_1 = model.addGroupIntersection(Part_1_doc, GroupIntersection_1_objects)
+model.end()
diff --git a/src/CollectionPlugin/doc/examples/group_substraction.py b/src/CollectionPlugin/doc/examples/group_substraction.py
new file mode 100644 (file)
index 0000000..75cf556
--- /dev/null
@@ -0,0 +1,33 @@
+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)
+Group_1_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"),
+                   model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"),
+                   model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"),
+                   model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Left]")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"),
+                   model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"),
+                   model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"),
+                   model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"),
+                   model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"),
+                   model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"),
+                   model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Bottom]"),
+                   model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Bottom]"),
+                   model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"),
+                   model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+GroupSubstraction_1 = model.addGroupSubstraction(Part_1_doc,
+                                                 [model.selection("COMPOUND", "Group_1"),
+                                                  model.selection("COMPOUND", "Group_2")],
+                                                 [model.selection("COMPOUND", "Group_3"),
+                                                  model.selection("COMPOUND", "Group_4")])
+model.end()
diff --git a/src/CollectionPlugin/doc/groupAdditionFeature.rst b/src/CollectionPlugin/doc/groupAdditionFeature.rst
new file mode 100644 (file)
index 0000000..568ca10
--- /dev/null
@@ -0,0 +1,37 @@
+.. |group_addition.icon|    image:: images/group_addition.png
+
+Group Addition
+==============
+
+Group addition produces a union of all the elements of the selected groups.
+To create a Group Addition in the active part:
+
+#. select in the Main Menu *Features - > Group Addition* item  or
+#. click |group_addition.icon| **Group Addition** button in the toolbar:
+
+The following property panel appears. 
+
+.. image:: images/group_addition_property_panel.png
+  :align: center
+
+.. centered::
+  Create a group addition operation
+
+Input fields:
+
+- **Name** defines the name of the group, by default, it is **GroupAddition_n**.
+- The list of selected groups of the same type.  Multiple selection can be done manually in OCC 3D Viewer by mouse click with Shift button pressed or by rectangle selection. To delete entities from the list, select them and call pop-up menu *Delete* item.
+
+Note, that operation is valid only for the groups of the same type.
+
+**TUI Command**:
+
+.. py:function:: model.addGroupAddition(Part_1_doc,
+                                       [model.selection("COMPOUND", "Group_1"), model.selection("COMPOUND", "Group_2")])
+
+    :param part: The current part object
+    :param list: A list of selected groups
+    :return: Created object.
+
+
+**See Also** a sample TUI Script of :ref:`tui_create_group_addition` operation.
diff --git a/src/CollectionPlugin/doc/groupIntersectionFeature.rst b/src/CollectionPlugin/doc/groupIntersectionFeature.rst
new file mode 100644 (file)
index 0000000..dadbd43
--- /dev/null
@@ -0,0 +1,37 @@
+.. |group_intersection.icon|    image:: images/group_intersection.png
+
+Group Intersection
+==================
+
+Group intersection produces a group of elements present in all the selected groups.
+To create a Group Intersection in the active part:
+
+#. select in the Main Menu *Features - > Group Intersection* item  or
+#. click |group_intersection.icon| **Group Intersection** button in the toolbar:
+
+The following property panel appears. 
+
+.. image:: images/group_intersection_property_panel.png
+  :align: center
+
+.. centered::
+  Create a group intersection operation
+
+Input fields:
+
+- **Name** defines the name of the group, by default, it is **GroupIntersection_n**.
+- The list of selected groups of the same type.  Multiple selection can be done manually in OCC 3D Viewer by mouse click with Shift button pressed or by rectangle selection. To delete entities from the list, select them and call pop-up menu *Delete* item.
+
+Note, that operation is valid only for the groups of the same type.
+
+**TUI Command**:
+
+.. py:function:: model.addGroupIntersection(Part_1_doc,
+                                       [model.selection("COMPOUND", "Group_1"), model.selection("COMPOUND", "Group_2")])
+
+    :param part: The current part object
+    :param list: A list of selected groups
+    :return: Created object.
+
+
+**See Also** a sample TUI Script of :ref:`tui_create_group_intersection` operation.
diff --git a/src/CollectionPlugin/doc/groupSubstractionFeature.rst b/src/CollectionPlugin/doc/groupSubstractionFeature.rst
new file mode 100644 (file)
index 0000000..b6ac227
--- /dev/null
@@ -0,0 +1,40 @@
+.. |group_substraction.icon|    image:: images/group_substraction.png
+
+Group Substraction
+==================
+
+Group substraction produces a group containing all elements of the main groups but not present in the tool groups.
+To create a Group Substraction in the active part:
+
+#. select in the Main Menu *Features - > Group Substraction* item  or
+#. click |group_substraction.icon| **Group Substraction** button in the toolbar:
+
+The following property panel appears. 
+
+.. image:: images/group_substraction_property_panel.png
+  :align: center
+
+.. centered::
+  Create a group substraction operation
+
+Input fields:
+
+- **Name** defines the name of the group, by default, it is **GroupSubstraction_n**.
+- The list of main groups.  Multiple selection can be done manually in OCC 3D Viewer by mouse click with Shift button pressed or by rectangle selection. To delete entities from the list, select them and call pop-up menu *Delete* item.
+- The list of tool groups.  Selection approaches are the same as for the main groups.
+
+Note, that operation is valid only if all the main groups and all the tool groups have the same type.
+
+**TUI Command**:
+
+.. py:function:: model.addGroupSubstraction(Part_1_doc,
+                                       [model.selection("COMPOUND", "Group_1"), model.selection("COMPOUND", "Group_2")],
+                                       [model.selection("COMPOUND", "Group_3"), model.selection("COMPOUND", "Group_4")])
+
+    :param part: The current part object
+    :param list: A list of main groups
+    :param list: A list of tool groups
+    :return: Created object.
+
+
+**See Also** a sample TUI Script of :ref:`tui_create_group_substraction` operation.
diff --git a/src/CollectionPlugin/doc/images/group_addition.png b/src/CollectionPlugin/doc/images/group_addition.png
new file mode 100644 (file)
index 0000000..6bc76e0
Binary files /dev/null and b/src/CollectionPlugin/doc/images/group_addition.png differ
diff --git a/src/CollectionPlugin/doc/images/group_addition_property_panel.png b/src/CollectionPlugin/doc/images/group_addition_property_panel.png
new file mode 100644 (file)
index 0000000..54904a1
Binary files /dev/null and b/src/CollectionPlugin/doc/images/group_addition_property_panel.png differ
diff --git a/src/CollectionPlugin/doc/images/group_intersection.png b/src/CollectionPlugin/doc/images/group_intersection.png
new file mode 100644 (file)
index 0000000..aba074c
Binary files /dev/null and b/src/CollectionPlugin/doc/images/group_intersection.png differ
diff --git a/src/CollectionPlugin/doc/images/group_intersection_property_panel.png b/src/CollectionPlugin/doc/images/group_intersection_property_panel.png
new file mode 100644 (file)
index 0000000..54db493
Binary files /dev/null and b/src/CollectionPlugin/doc/images/group_intersection_property_panel.png differ
diff --git a/src/CollectionPlugin/doc/images/group_substraction.png b/src/CollectionPlugin/doc/images/group_substraction.png
new file mode 100644 (file)
index 0000000..7db75ec
Binary files /dev/null and b/src/CollectionPlugin/doc/images/group_substraction.png differ
diff --git a/src/CollectionPlugin/doc/images/group_substraction_property_panel.png b/src/CollectionPlugin/doc/images/group_substraction_property_panel.png
new file mode 100644 (file)
index 0000000..543681f
Binary files /dev/null and b/src/CollectionPlugin/doc/images/group_substraction_property_panel.png differ