From 30dac59b5b850cfb10a87ef7a0d45096b7b4c881 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 14 Nov 2018 12:12:37 +0300 Subject: [PATCH] Make all result construction store shapes in the document structure --- src/Model/Model_ResultConstruction.cpp | 5 ++--- src/ModelAPI/Test/TestCustomName_CommonCompSolid.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index 76706aa41..94b844d2e 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -67,8 +67,7 @@ void Model_ResultConstruction::colorConfigInfo(std::string& theSection, std::str void Model_ResultConstruction::setShape(std::shared_ptr 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 theShap std::shared_ptr aMyDoc = std::dynamic_pointer_cast(document()); const TopoDS_Shape& aShape = theShape->impl(); - if (aShape.ShapeType() == TopAbs_VERTEX) { + if (isInfinite() || aShape.ShapeType() == TopAbs_VERTEX) { aShapeLab.ForgetAllAttributes(); // clear all previously stored TNaming_Builder aBuilder(aShapeLab); aBuilder.Generated(aShape); diff --git a/src/ModelAPI/Test/TestCustomName_CommonCompSolid.py b/src/ModelAPI/Test/TestCustomName_CommonCompSolid.py index b6051222f..b15ec73dc 100644 --- a/src/ModelAPI/Test/TestCustomName_CommonCompSolid.py +++ b/src/ModelAPI/Test/TestCustomName_CommonCompSolid.py @@ -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()) -- 2.39.2