From: nds Date: Tue, 3 Nov 2015 10:13:35 +0000 (+0300) Subject: A correction for re-entrant operation. X-Git-Tag: V_2.0.0_alfa1~6^2~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9d4e3455b44da23c3e3dd8fd2b8b05909391b1bd;p=modules%2Fshaper.git A correction for re-entrant operation. --- diff --git a/src/PartSet/PartSet_Validators.cpp b/src/PartSet/PartSet_Validators.cpp index cc80fc8c8..5047a0478 100755 --- a/src/PartSet/PartSet_Validators.cpp +++ b/src/PartSet/PartSet_Validators.cpp @@ -7,6 +7,7 @@ #include "PartSet_Validators.h" #include "PartSet_Tools.h" +#include "PartSet_SketcherMgr.h" #include #include @@ -93,14 +94,21 @@ std::shared_ptr sketcherPlane(ModuleBase_Operation* theOperation) bool isEmptySelectionValid(ModuleBase_Operation* theOperation) { ModuleBase_OperationFeature* aFeatureOp = dynamic_cast(theOperation); + // during the create operation empty selection is always valid if (!aFeatureOp->isEditOperation()) { return true; } - std::shared_ptr aPlane = sketcherPlane(theOperation); - if (aPlane.get()) - return true; - else - return false; + else { + if (PartSet_SketcherMgr::isSketchOperation(aFeatureOp)) { + std::shared_ptr aPlane = sketcherPlane(theOperation); + if (aPlane.get()) + return true; + else + return false; + } + else// in edit operation an empty selection is always valid, performed for re-entrant operrations + return true; + } } bool PartSet_DistanceSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const