From: mpv Date: Wed, 22 Mar 2017 11:02:32 +0000 (+0300) Subject: Fix for the issue #1997 : correct update of the point of sketch after update of sketc... X-Git-Tag: V_2.7.0~204 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=70e80640676fab0521678fec47fd58f986bc3955;p=modules%2Fshaper.git Fix for the issue #1997 : correct update of the point of sketch after update of sketch plane. --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index f95f59d7c..5c0965e7d 100755 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -484,7 +485,21 @@ bool Model_Update::processFeature(FeaturePtr theFeature) } } } + std::shared_ptr aShapeBefore = anExtSel->value(); + if (!aShapeBefore.get() && anExtSel->context()) aShapeBefore = anExtSel->context()->shape(); updateArguments(theFeature); + std::shared_ptr aShapeAfter = anExtSel->value(); + if (!aShapeAfter.get() && anExtSel->context()) aShapeAfter = anExtSel->context()->shape(); + // if selected plane is different, make all subs taouched, reason of this sketch to be recomputed + if (aShapeBefore.get() && !aShapeBefore->isEqual(aShapeAfter)) { + std::set aWholeR; + allReasons(theFeature, aWholeR); + std::set::iterator aRIter = aWholeR.begin(); + for(; aRIter != aWholeR.end(); aRIter++) { + if ((*aRIter)->data()->selection("External")) + (*aRIter)->attributeChanged("External"); + } + } // send event that sketch is prepared to be recomputed static Events_ID anID = Events_Loop::eventByName("SketchPrepared"); std::shared_ptr aMsg(new Events_Message(anID, this)); @@ -633,7 +648,6 @@ ModelAPI_ExecState stateByReference(ObjectPtr theTarget, const ModelAPI_ExecStat void Model_Update::updateArguments(FeaturePtr theFeature) { // perform this method also for disabled features: to make "not done" state for // features referenced to the active and modified features - static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators(); ModelAPI_ExecState aState = theFeature->data()->execState();