Salome HOME
Make all result construction store shapes in the document structure
authormpv <mpv@opencascade.com>
Wed, 14 Nov 2018 09:12:37 +0000 (12:12 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/Model/Model_ResultConstruction.cpp
src/ModelAPI/Test/TestCustomName_CommonCompSolid.py

index 76706aa41e2f1da6973354ec75f082fdbc23332d..94b844d2e8a6ebddfe30a353a4e3668bab63e7f0 100644 (file)
@@ -67,8 +67,7 @@ void Model_ResultConstruction::colorConfigInfo(std::string& theSection, std::str
 void Model_ResultConstruction::setShape(std::shared_ptr<GeomAPI_Shape> theShape)
 {
   if (myShape != theShape) {
-    if (!isInfinite())
-      storeShape(theShape);
+    storeShape(theShape);
     if (!theShape.get() || !theShape->isEqual(myShape)) {
       static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
       ModelAPI_EventCreator::get()->sendUpdated(data()->owner(), anEvent);
@@ -238,7 +237,7 @@ void Model_ResultConstruction::storeShape(std::shared_ptr<GeomAPI_Shape> theShap
     std::shared_ptr<Model_Document> aMyDoc =
       std::dynamic_pointer_cast<Model_Document>(document());
     const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
-    if (aShape.ShapeType() == TopAbs_VERTEX) {
+    if (isInfinite() || aShape.ShapeType() == TopAbs_VERTEX) {
       aShapeLab.ForgetAllAttributes(); // clear all previously stored
       TNaming_Builder aBuilder(aShapeLab);
       aBuilder.Generated(aShape);
index b6051222fc6cfe6a19b36b1c732e234615bd9a4c..b15ec73dc433ee66f14cadd28c1bf29f58d468b1 100644 (file)
@@ -37,7 +37,7 @@ Partition_1.result().subResult(1).setName("top_left")
 Partition_1.result().subResult(2).setName("bottom_right")
 Partition_1.result().subResult(3).setName("Partition_1_1_4")
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Partition_1_1_1/Modified_Face&_plate/Top"))
-SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&_plate/Top][_weak_name_5_Partition_1_1_1][_weak_name_6_Partition_1_1_1]"), False)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&_plate/Top][Partition_1_1_1/Modified_Face&Plane_2/Plane_2][Partition_1_1_1/Modified_Face&Plane_1/Plane_1]"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchCircle_1 = Sketch_1.addCircle(50, 50, 40)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())