From: mpv Date: Mon, 3 Apr 2017 08:38:35 +0000 (+0300) Subject: Fix for the issue #2078 : enable result of enabled feature only X-Git-Tag: V_2.7.0~98 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=896c5e9b05c9f2ff349a9de2dad3d0d503fa2848;p=modules%2Fshaper.git Fix for the issue #2078 : enable result of enabled feature only --- diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index dca740f6c..798e234c5 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -1124,17 +1124,14 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set& 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(); diff --git a/src/ModelAPI/ModelAPI_Feature.cpp b/src/ModelAPI/ModelAPI_Feature.cpp index 73e0428d2..bb387f81c 100644 --- a/src/ModelAPI/ModelAPI_Feature.cpp +++ b/src/ModelAPI/ModelAPI_Feature.cpp @@ -55,7 +55,8 @@ void ModelAPI_Feature::setResult(const std::shared_ptr& 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& theResult,