#
"""
- TestBoolean.py
- Unit test of FeaturesPlugin_Group class
-
- class FeaturesPlugin_Group
- static const std::string MY_GROUP_ID("Group");
- static const std::string MY_GROUP_LIST_ID("group_list");
-
- data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
+ TestAddVolume.py
+ Test case of OperaPlugin_addVolume
"""
#=========================================================================
# Initialization of the test
#=========================================================================
+from salome.shaper import model
-#=========================================================================
-# Create a Box
-#=========================================================================
-
-#=========================================================================
-# Create a Torus
-#=========================================================================
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
#=========================================================================
-# Create a Cylinder
+# Create a Box, a Torus and a Cylinder
#=========================================================================
+Box_1 = model.addBox(Part_1_doc, 10, 20, 10)
+Torus_1 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 15, 3)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
#=========================================================================
# Create one Volume
#=========================================================================
+Volume_1 = model.addVolume(Part_1_doc, "Test_medium", [model.selection("SOLID", "Box_1")])
+
#=========================================================================
# Check results
#=========================================================================
+from GeomAPI import GeomAPI_Shape
+
+# TODO : Check this
+# TODO : Do I need a testNbVolume ??
+model.testNbResults(Volume_1, 1)
+model.testNbSubResults(Volume_1, [0])
+model.testNbSubShapes(Volume_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Volume_1, GeomAPI_Shape.FACE, [6])
+model.testHaveNamingFaces(Volume_1, model, Part_1_doc)
+
#=========================================================================
# Create two volumes at once
#=========================================================================
+Volume_2 = model.addVolume(Part_1_doc, "Test_medium_2", [model.selection("SOLID", "Torus_1"),
+ model.selection("SOLID", "Cylinder_1")])
+
#=========================================================================
# Check results
#=========================================================================
+# TODO : Check this
+
+model.testNbResults(Volume_2, 2)
+model.testNbSubResults(Volume_2, [0])
+model.testNbSubShapes(Volume_2, GeomAPI_Shape.SOLID, [2])
+
#=========================================================================
# End of test
#=========================================================================