From: mpv Date: Fri, 25 May 2018 08:24:04 +0000 (+0300) Subject: The problem of plane of sketch update fix. X-Git-Tag: EDF_2018-1~33^2~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b9540bdcf46cd2ec524383a9101de71715b6ca12;p=modules%2Fshaper.git The problem of plane of sketch update fix. The plane is based on the trihedron plane. Sketch is created on this plane. The distance between planes is changed, but sketch is not. --- diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index 251169908..737a63d25 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -611,10 +611,30 @@ bool Model_ResultConstruction::update(const int theIndex, } return aRes; } else { + // check is this modified or not + std::shared_ptr aNewShape = shape(); + TopoDS_Shape anOldSh; + Handle(TNaming_NamedShape) aNS; + if (aLab.FindAttribute(TNaming_NamedShape::GetID(), aNS)) { + anOldSh = aNS->Get(); + } + if (aNewShape.get()) { + if (anOldSh.IsNull()) + theModified = true; + else { + std::shared_ptr anOldShape(new GeomAPI_Shape); + anOldShape->setImpl(new TopoDS_Shape(anOldSh)); + theModified = !anOldShape->isEqual(aNewShape); + } + } + else if (!anOldSh.IsNull()) { + theModified = true; + } + // For correct naming selection, put the shape into the naming structure. // It seems sub-shapes are not needed: only this shape is (and can be ) selected. TNaming_Builder aBuilder(aLab); - aBuilder.Generated(shape()->impl()); + aBuilder.Generated(aNewShape->impl()); } return shape() && !shape()->isNull(); }