X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FModel_Update.cpp;h=23d96f4298a3d909c0a248f30e9c9f3e19a32080;hb=f36409774efce7c530518a1553946c9c76526fb9;hp=2bf951ae7962223f3f85ae29b312f920f6c7d879;hpb=36063c8969dc4067cda6196c2d3abba7e9ed3af9;p=modules%2Fshaper.git diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 2bf951ae7..23d96f429 100755 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -198,7 +198,7 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) { } } } - // proccess also results + // process also results std::list allResults; // list of this feature and results ModelAPI_Tools::allResults(theFeature, allResults); std::list::iterator aRes = allResults.begin(); @@ -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 features 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); @@ -331,7 +331,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag if ((*anObjIter)->groupName() == ModelAPI_ResultParameter::group()) { myIsParamUpdated = true; } - // on undo/redo, abort do not update persisten features + // on undo/redo, abort do not update persistent features FeaturePtr anUpdated = std::dynamic_pointer_cast(*anObjIter); if (anUpdated.get()) { if (addModified(anUpdated, FeaturePtr())) @@ -395,7 +395,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag } myIsFinish = false; } - // processed features must be only on finish, so clear anyway (to avoid reimport on load) + // processed features must be only on finish, so clear anyway (to avoid re-import on load) myProcessOnFinish.clear(); // #2156: current must be sketch, left after the macro execution @@ -483,7 +483,7 @@ void Model_Update::processFeatures(const bool theFlushRedisplay) } } -// collects all the feautres this feature depends on: reasons +// collects all the features this feature depends on: reasons static void allReasons(FeaturePtr theFeature, std::set& theReasons) { std::list > > > aDeps; theFeature->data()->referencesToObjects(aDeps); @@ -690,7 +690,7 @@ bool Model_Update::processFeature(FeaturePtr theFeature) theFeature->data()->execState(ModelAPI_StateDone); // this checking must be after the composite feature sub-elements processing: - // composite feature status may depend on it's subelements + // composite feature status may depend on it's sub-elements if ((theFeature->data()->execState() == ModelAPI_StateInvalidArgument || isReferencedInvalid) && theFeature->getKind() != "Part") { // don't disable Part because it will make disabled all the features