From: nds Date: Wed, 20 May 2015 12:30:23 +0000 (+0300) Subject: A fix for the bug: it is possible to apply extrusion even if the algorithm is failed... X-Git-Tag: V_1.2.0~137^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4f3ea1843a6075ad925d50527c2242b7783753ef;p=modules%2Fshaper.git A fix for the bug: it is possible to apply extrusion even if the algorithm is failed to build the result. Scenario: create a sketch, create a part, visualize all default planes, create extrusion, select a sketch, in "to" control select a perpendicular plane. An error message appears but "Apply" is enabled. This fix disables the "Apply" button. --- diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index ba66473b5..17c2e936a 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -71,7 +71,13 @@ bool ModuleBase_Operation::isValid() const //Get validators for the Id SessionPtr aMgr = ModelAPI_Session::get(); ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); - return aFactory->validate(myFeature); + bool aValid = aFactory->validate(myFeature); + + // the feature exec state should be checked in order to do not apply features, which result can not + // be built. E.g. extrusion on sketch, where the "to" is a perpendicular plane to the sketch + bool isDone = myFeature->data()->execState() == ModelAPI_StateDone; + + return aValid && isDone; }