From 9d4e3455b44da23c3e3dd8fd2b8b05909391b1bd Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 3 Nov 2015 13:13:35 +0300 Subject: [PATCH] A correction for re-entrant operation. --- src/PartSet/PartSet_Validators.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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 -- 2.39.2