From: dbv Date: Thu, 18 Aug 2016 14:58:35 +0000 (+0300) Subject: Call execute from High API only if feature valid. X-Git-Tag: V_2.5.0~137^2~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=935db942b8a84d02d2e6c2d0d779197c57d3dc1a;p=modules%2Fshaper.git Call execute from High API only if feature valid. --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 61ba6e53f..0d5767605 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -1060,7 +1060,8 @@ void Model_Document::setCurrentFeature( if (anIter->setDisabled(aDisabledFlag)) { static Events_ID anUpdateEvent = aLoop->eventByName(EVENT_OBJECT_UPDATED); // state of feature is changed => so inform that it must be updated if it has such state - if (!aDisabledFlag && anIter->data()->execState() == ModelAPI_StateMustBeUpdated) + if (!aDisabledFlag && + (anIter->data()->execState() == ModelAPI_StateMustBeUpdated || anIter->data()->execState() == ModelAPI_StateInvalidArgument)) ModelAPI_EventCreator::get()->sendUpdated(anIter, anUpdateEvent); // flush is in the end of this method ModelAPI_EventCreator::get()->sendUpdated(anIter, aRedispEvent /*, false*/); diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.cpp b/src/ModelHighAPI/ModelHighAPI_Interface.cpp index 3d351650b..39b076ffb 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Interface.cpp @@ -10,6 +10,8 @@ #include #include +#include +#include #include "ModelHighAPI_Selection.h" //-------------------------------------------------------------------------------------- @@ -37,7 +39,12 @@ const std::string& ModelHighAPI_Interface::getKind() const void ModelHighAPI_Interface::execute() { - feature()->execute(); + SessionPtr aMgr = ModelAPI_Session::get(); + ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); + FeaturePtr aFeature = feature(); + if(aFactory->validate(aFeature)) { + aFeature->execute(); + } } std::list ModelHighAPI_Interface::result() const