From: mpv Date: Tue, 10 May 2016 12:47:16 +0000 (+0300) Subject: Fix for the issue #1491 : parameters are not disabled even other parameters are modif... X-Git-Tag: V_2.3.1~94 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dbbdf63c129926752a75625363bda1acc3cbc255;p=modules%2Fshaper.git Fix for the issue #1491 : parameters are not disabled even other parameters are modified. Also the invalid features must cause "invalid" state of all features referenced to them. --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index b0960472f..54840e4bc 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -1002,7 +1002,8 @@ void Model_Document::setCurrentFeature( } if (anIter->getKind() == "Parameter") {// parameters are always out of the history of features, but not parameters - if (!isCurrentParameter) + // due to the issue 1491 all parameters are kept enabled any time + //if (!isCurrentParameter) aDisabledFlag = false; } else if (isCurrentParameter) { // if paramater is active, all other features become enabled (issue 1307) aDisabledFlag = false; diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 3b7896aea..8f5359772 100755 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -33,7 +33,7 @@ using namespace std; Model_Update MY_UPDATER_INSTANCE; /// the only one instance initialized on load of the library -//#define DEB_UPDATE +#define DEB_UPDATE Model_Update::Model_Update() { @@ -400,13 +400,17 @@ bool Model_Update::processFeature(FeaturePtr theFeature) theFeature->execute(); } + bool isReferencedInvalid = false; // check all features this feature depended on (recursive call of updateFeature) std::set >& aReasons = myModified[theFeature]; if (aReasons.find(theFeature) == aReasons.end()) { std::set >::iterator aReasonIter = aReasons.begin(); for(; aReasonIter != aReasons.end(); aReasonIter++) { - if (*aReasonIter != theFeature && processFeature(*aReasonIter)) { - aIsModified = true; + if (*aReasonIter != theFeature) { + if (processFeature(*aReasonIter)) + aIsModified = true; + if ((*aReasonIter)->data()->execState() == ModelAPI_StateInvalidArgument) + isReferencedInvalid = true; } } } else { // check all features this feature depended on because here which one was modified is unknown @@ -428,6 +432,8 @@ bool Model_Update::processFeature(FeaturePtr theFeature) if (aDepFeat.get()) { if (processFeature(aDepFeat)) aIsModified = true; + if (aDepFeat->data()->execState() == ModelAPI_StateInvalidArgument) + isReferencedInvalid = true; } } } @@ -440,6 +446,8 @@ bool Model_Update::processFeature(FeaturePtr theFeature) if (aSub.get()) { if (processFeature(aSub)) aIsModified = true; + if (aSub->data()->execState() == ModelAPI_StateInvalidArgument) + isReferencedInvalid = true; } } } @@ -468,7 +476,7 @@ bool Model_Update::processFeature(FeaturePtr theFeature) // this checking must be after the composite feature sub-elements processing: // composite feature status may depend on it's subelements - if (theFeature->data()->execState() == ModelAPI_StateInvalidArgument) { + if (theFeature->data()->execState() == ModelAPI_StateInvalidArgument || isReferencedInvalid) { #ifdef DEB_UPDATE std::cout<<"Invalid args "<name()<