]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2046: Naming incorrect after an extrusion of a wire.
authordbv <dbv@opencascade.com>
Tue, 28 Mar 2017 11:25:30 +0000 (14:25 +0300)
committerdbv <dbv@opencascade.com>
Tue, 28 Mar 2017 11:28:21 +0000 (14:28 +0300)
Fixed naming faces for extrusion of wire.

src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp
src/FeaturesPlugin/Test/Test2046.py [new file with mode: 0644]

index 1214c5890efb895722b6deb249d745772b6df1da..5b4e12997c0f6e823fe7511f3121dfd80b4974a1 100644 (file)
@@ -147,4 +147,5 @@ ADD_UNIT_TESTS(TestExtrusion.py
                Test1942.py
                Test1915.py
                Test2023.py
+               Test2046.py
 )
index 06320e03c71610916e502b84e3993381f73101af..6556b2f467a1b8651acc73e11fb593535ff505fc 100644 (file)
@@ -278,7 +278,10 @@ void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theRes
 
   std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = theMakeShape->mapOfSubShapes();
   switch(aBaseShapeType) {
-    case GeomAPI_Shape::EDGE:
+    case GeomAPI_Shape::EDGE: {
+            aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
+      break;
+    }
     case GeomAPI_Shape::WIRE: {
       //std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
       //GeomAlgoAPI_ShapeTools::findBounds(theBaseShape, aV1, aV2);
@@ -291,7 +294,7 @@ void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theRes
       //if(!aV2History.empty()) {
       //  theResultBody->generated(aV2, aV2History.front(), aGenName + "Edge_2", theTag++);
       //}
-      aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
+      aShapeTypeToExplode = GeomAPI_Shape::COMPOUND;
       break;
     }
     case GeomAPI_Shape::FACE:
diff --git a/src/FeaturesPlugin/Test/Test2046.py b/src/FeaturesPlugin/Test/Test2046.py
new file mode 100644 (file)
index 0000000..48590c8
--- /dev/null
@@ -0,0 +1,28 @@
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-1154.716981132076, -199.5283018867925, -849.0566037735849, 128.7735849056603)
+SketchLine_2 = Sketch_1.addLine(-849.0566037735849, 128.7735849056603, -563.2075471698113, -69.33962264150945)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(-563.2075471698113, -69.33962264150945, -70.75471698113215, 326.8867924528301)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+model.do()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_3")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 100, 0)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1")])
+model.do()
+model.end()
+
+groupFeature = Group_1.feature()
+groupSelectionList = groupFeature.selectionList("group_list")
+assert(groupSelectionList.size() == 3)
+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"