From: mpv Date: Thu, 6 Sep 2018 11:06:32 +0000 (+0300) Subject: Issue #2612 : Re-calculate model after modification of parameters X-Git-Tag: V9_2_0a1~54 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1915774e96a2c2180f3682733a7b6c329bc60fd8;p=modules%2Fshaper.git Issue #2612 : Re-calculate model after modification of parameters Correct behavior of auto-update flag on Undo/Redo --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 2bf951ae7..60b2c7206 100755 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -246,6 +246,32 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag #ifdef DEB_UPDATE std::cout<<"****** Event "<eventID().eventText()<isAutoUpdateBlocked(); + if (myUpdateBlocked != aNewAutomaticState) { + myUpdateBlocked = aNewAutomaticState; + if (!myUpdateBlocked) { // process all modified features, even if preview is blocked + bool aPreviewBlockedState = myIsPreviewBlocked; // to update the selected arguments + myIsPreviewBlocked = false; + // iterate everything and add efatures in state "MustBeUpdated" into modified + std::list > allDocs = + ModelAPI_Session::get()->allOpenedDocuments(); + std::list >::iterator aDoc = allDocs.begin(); + for(; aDoc != allDocs.end(); aDoc++) { + std::list > allFeats = (*aDoc)->allFeatures(); + std::list >::iterator aFeat = allFeats.begin(); + for(; aFeat != allFeats.end(); aFeat++) { + if ((*aFeat)->data()->isValid() && + (*aFeat)->data()->execState() == ModelAPI_StateMustBeUpdated) { + addModified(*aFeat, FeaturePtr()); + } + } + } + processFeatures(); + myIsPreviewBlocked = myIsPreviewBlocked; + } + } + if (theMessage->eventID() == kStabilityEvent) { updateStability(theMessage->sender()); return; @@ -265,32 +291,6 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag } return; } - if (theMessage->eventID() == kAutomaticOff) { - myUpdateBlocked = true; - return; - } - if (theMessage->eventID() == kAutomaticOn) { - myUpdateBlocked = false; // then process all modified features, even if preview is blocked - bool aPreviewBlockedState = myIsPreviewBlocked; // to update the selected arguments - myIsPreviewBlocked = false; - // iterate everything and add efatures in state "MustBeUpdated" into modified - std::list > allDocs = - ModelAPI_Session::get()->allOpenedDocuments(); - std::list >::iterator aDoc = allDocs.begin(); - for(; aDoc != allDocs.end(); aDoc++) { - std::list > allFeats = (*aDoc)->allFeatures(); - std::list >::iterator aFeat = allFeats.begin(); - for(; aFeat != allFeats.end(); aFeat++) { - if ((*aFeat)->data()->isValid() && - (*aFeat)->data()->execState() == ModelAPI_StateMustBeUpdated) { - addModified(*aFeat, FeaturePtr()); - } - } - } - processFeatures(); - myIsPreviewBlocked = myIsPreviewBlocked; - return; - } if (theMessage->eventID() == kUpdatedSel) { std::shared_ptr aMsg = std::dynamic_pointer_cast(theMessage);