From: mpv Date: Thu, 17 Sep 2015 07:43:13 +0000 (+0300) Subject: Fix for the issue #997 X-Git-Tag: V_1.4.0~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=efd9e979e5d89bf5461bd303202b97e182058bd6;p=modules%2Fshaper.git Fix for the issue #997 --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 5a170ae99..417a3de14 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -55,8 +55,9 @@ Model_Update::Model_Update() static const Events_ID kOpStartEvent = aLoop->eventByName("StartOperation"); aLoop->registerListener(this, kOpStartEvent); + /* not needed now with history line Config_PropManager::registerProp("Model update", "automatic_rebuild", "Rebuild immediately", - Config_Prop::Boolean, "false"); + Config_Prop::Boolean, "false");*/ myIsAutomatic = true; // Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true"; myIsParamUpdated = false; @@ -79,13 +80,14 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag std::cout<<"****** Event "<eventID().eventText()<eventID() == kChangedEvent) { // automatic and manual rebuild flag is changed - bool aPropVal = + /*bool aPropVal = Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true"; if (aPropVal != myIsAutomatic) { // something is changed // myIsAutomatic = aPropVal; if (myIsAutomatic) // higher level of automatization => to rebuild processOperation(false); - } + }*/ + return; } else if (theMessage->eventID() == kRebuildEvent) { // the rebuild command processOperation(true); } else if (theMessage->eventID() == kCreatedEvent || theMessage->eventID() == kUpdatedEvent || @@ -275,10 +277,9 @@ void Model_Update::updateFeature(FeaturePtr theFeature) if (theFeature->isDisabled()) return; - // to optimize with NDS: how to update sketch state if sketch is not executed on apply of sub-element + // do not execute the composite that contains the current //CompositeFeaturePtr aMain = std::dynamic_pointer_cast(theFeature); - //if (aMain.get() && aMain->isSub(theFeature->document()->currentFeature(false))) // do no update the composite that contains the current - // return; + //bool isPostponedMain = aMain.get() && aMain->isSub(theFeature->document()->currentFeature(false)); #ifdef DEB_UPDATE std::cout<<"Update Feature "<name()<data()->execState(); if (aFactory->validate(theFeature)) { - #ifdef DEB_UPDATE - std::cout<<"Execute Feature "<name()<name()<name()< make state Done if (theFeature->data()->execState() == ModelAPI_StateMustBeUpdated) { theFeature->data()->execState(ModelAPI_StateDone); - if (aJustUpdated) // store that it must be updated on finish + if (aJustUpdated) {// store that it must be updated on finish myUpdated[theFeature] = myModification; + aFactory->validate(theFeature); // need to be validated to update the "Apply" state if not previewed + } } } }