]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #2078 : enable result of enabled feature only
authormpv <mpv@opencascade.com>
Mon, 3 Apr 2017 08:38:35 +0000 (11:38 +0300)
committermpv <mpv@opencascade.com>
Mon, 3 Apr 2017 08:38:35 +0000 (11:38 +0300)
src/Model/Model_Objects.cpp
src/ModelAPI/ModelAPI_Feature.cpp

index dca740f6c558dc6d821677c2b574f460446b7c56..798e234c5c5c7b68a1c14bb6c0a5bf6d46f84d7e 100644 (file)
@@ -1124,17 +1124,14 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set<FeaturePtr>& t
           if (!aNewP->partDoc().get())
             // create the part result: it is better to restore the previous result if it is possible
             theFeature->execute();
-          break;
         } else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) {
           theFeature->execute(); // construction shapes are needed for sketch solver
-          break;
         } else if (aGroup->Get() == ModelAPI_ResultGroup::group().c_str()) {
           aNewBody = createGroup(theFeature->data(), aResIndex);
         } else if (aGroup->Get() == ModelAPI_ResultField::group().c_str()) {
           aNewBody = createField(theFeature->data(), aResIndex);
         } else if (aGroup->Get() == ModelAPI_ResultParameter::group().c_str()) {
           theFeature->attributeChanged("expression"); // just produce a value
-          break;
         } else {
           Events_InfoMessage("Model_Objects", "Unknown type of result is found in the document:")
             .arg(TCollection_AsciiString(aGroup->Get()).ToCString()).send();
index 73e0428d257012d02c765a953b48970cf390f769..bb387f81c92d22e435e60be0ec24141fc4123301 100644 (file)
@@ -55,7 +55,8 @@ void ModelAPI_Feature::setResult(const std::shared_ptr<ModelAPI_Result>& theResu
     myResults.push_back(theResult);
   }
   // in any case result becomes enabled
-  theResult->setDisabled(theResult, false);
+  if (!isDisabled()) // disabled feature may be executed when it is added as not enabled (#2078)
+    theResult->setDisabled(theResult, false);
 }
 
 void ModelAPI_Feature::setResult(const std::shared_ptr<ModelAPI_Result>& theResult,