]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #1491 : parameters are not disabled even other parameters are modif...
authormpv <mpv@opencascade.com>
Tue, 10 May 2016 12:47:16 +0000 (15:47 +0300)
committermpv <mpv@opencascade.com>
Tue, 10 May 2016 12:47:16 +0000 (15:47 +0300)
src/Model/Model_Document.cpp
src/Model/Model_Update.cpp

index b0960472f2ff5245bfc33c80606c6420c028aaa4..54840e4bc65d1cedfe0165601732964bc28b12e9 100755 (executable)
@@ -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;
index 3b7896aea4749121e3962d6376a449003e28f3a6..8f5359772248484064731113012ef1be47f7f02e 100755 (executable)
@@ -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<std::shared_ptr<ModelAPI_Feature> >& aReasons = myModified[theFeature];
   if (aReasons.find(theFeature) == aReasons.end()) {
     std::set<std::shared_ptr<ModelAPI_Feature> >::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 "<<theFeature->name()<<std::endl;
   #endif