]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2194: Error when loading a Python dump
authordbv <dbv@opencascade.com>
Wed, 28 Jun 2017 07:33:36 +0000 (10:33 +0300)
committerdbv <dbv@opencascade.com>
Wed, 28 Jun 2017 07:33:36 +0000 (10:33 +0300)
Fixed wrong check.

src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/Test/Test2194.py [new file with mode: 0644]
src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp

index 987de3a17ba3d467139aa4aa76addb97bcd03af4..7bdb1d51a1d053d74d53441d12350d897fa75781 100644 (file)
@@ -167,4 +167,5 @@ ADD_UNIT_TESTS(TestExtrusion.py
                Test2023.py
                Test2046.py
                Test2038.py
+               Test2194.py
 )
diff --git a/src/FeaturesPlugin/Test/Test2194.py b/src/FeaturesPlugin/Test/Test2194.py
new file mode 100644 (file)
index 0000000..1504129
--- /dev/null
@@ -0,0 +1,31 @@
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
+SketchCircle_1 = Sketch_1.addCircle(-79.57211859899775, 93.0358363165245, 69.46562387481423)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+SketchCircle_2 = Sketch_2.addCircle(-111.8968837135755, 98.96901887198163, 6.57145775571253)
+SketchCircle_3 = Sketch_2.addCircle(-41.97827733564338, 89.35676702647821, 6.102067916018811)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), 10, 0)
+Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_2_2/To_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_2/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Boolean_1_1/Modified_3"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Extrusion_2_1/To_Face_1")])
+model.do()
+model.end()
+
+groupFeature = Group_1.feature()
+groupSelectionList = groupFeature.selectionList("group_list")
+assert(groupSelectionList.size() == 11)
+for index in range(0, groupSelectionList.size()):
+  attrSelection = groupSelectionList.value(index)
+  shape = attrSelection.value()
+  name = attrSelection.namingName()
+  assert(shape.isFace())
+  assert(name != ""), "Empty shape name"
+
+assert(model.checkPythonDump())
index fa5f9f098ae634b8e63e6d0a060a5b131b33d948..7cf3b3fb44c74768de6adb32fa4162565cc9fe33 100644 (file)
@@ -123,9 +123,9 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr<GeomAPI_Shape> theS
       aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) {
     std::shared_ptr<GeomAlgoAPI_MakeShape> aMakeShape = *aBuilderIt;
     NCollection_Map<TopoDS_Shape> aTempShapes;
-    bool hasResults = false;
     for(NCollection_Map<TopoDS_Shape>::Iterator
         aShapeIt(anAlgoShapes); aShapeIt.More(); aShapeIt.Next()) {
+      bool hasResults = false;
       std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape);
       aShape->setImpl(new TopoDS_Shape(aShapeIt.Value()));
       ListOfShape aGeneratedShapes;