Salome HOME
Issue #2716: no check that subshapes of the same shape are used for common
authordbv <dbv@opencascade.com>
Fri, 2 Nov 2018 12:11:37 +0000 (15:11 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
Now common allow selection of sub-shapes of the same shape in simple mode.

src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp
src/FeaturesPlugin/Test/Test2617.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2692.py

index 9ab857eef8701ba095c05e94f27d12e0b75035d2..83646b7450af567f127235fb54689b4dd9fe78a7 100644 (file)
@@ -386,4 +386,5 @@ ADD_UNIT_TESTS(TestExtrusion.py
                Test2701.py
                Test2724.py
                Test2692.py
+               Test2617.py
 )
index d52e23146cafe523e46af72d592c0d667517689d..539724c33280e2c9a89f562b9871af59a34c0337 100644 (file)
@@ -78,7 +78,8 @@ void FeaturesPlugin_BooleanCommon::execute()
     }
     ResultPtr aContext = anObjectAttr->context();
     ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
-    if (aResCompSolidPtr.get())
+    if (!isSimpleMode
+        && aResCompSolidPtr.get())
     {
       std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
       GeomAPI_Shape::ShapeType aShapeType = aResCompSolidPtr->shape()->shapeType();
diff --git a/src/FeaturesPlugin/Test/Test2617.py b/src/FeaturesPlugin/Test/Test2617.py
new file mode 100644 (file)
index 0000000..0e50b6d
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "PartSet/OX"), 5)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OZ"), True)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Symmetry_1_1_2"), model.selection("SOLID", "Symmetry_1_1_1")])
+model.do()
+model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Common_1, 1)
+model.testNbSubResults(Common_1, [0])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.FACE, [3])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.EDGE, [8])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.VERTEX, [16])
+model.testResultsVolumes(Common_1, [461.055845803990962394891539589])
+
+assert(model.checkPythonDump())
index ac516381bb519785c79c58c2025bfdd0e4e68fc9..d7dff2aba38680ad0e363b8ea145c560f05a6e32 100644 (file)
@@ -28,3 +28,5 @@ model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.FACE, [21])
 model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.EDGE, [90])
 model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.VERTEX, [180])
 model.testResultsVolumes(ExtrusionCut_1, [2347.550996571865198347950354218])
+
+assert(model.checkPythonDump())