]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_Validators.cpp
Salome HOME
Merge remote-tracking branch 'origin/BR_REENTRANCE_OPERATION' into origin_Dev_1.5.0
[modules/shaper.git] / src / PartSet / PartSet_Validators.cpp
index a53eb3596cd4e314138db36954cac113726a9ca7..9b4aa471db355d9369f04e6c83e2a6526a7b91be 100755 (executable)
@@ -7,6 +7,7 @@
 #include "PartSet_Validators.h"
 
 #include "PartSet_Tools.h"
+#include "PartSet_SketcherMgr.h"
 
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
@@ -92,14 +93,21 @@ std::shared_ptr<GeomAPI_Pln> sketcherPlane(ModuleBase_Operation* theOperation)
 bool isEmptySelectionValid(ModuleBase_Operation* theOperation)
 {
   ModuleBase_OperationFeature* aFeatureOp = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+  // during the create operation empty selection is always valid
   if (!aFeatureOp->isEditOperation()) {
     return true;
   }
-  std::shared_ptr<GeomAPI_Pln> aPlane = sketcherPlane(theOperation);
-  if (aPlane.get())
-    return true;
-  else 
-    return false;
+  else {
+    if (PartSet_SketcherMgr::isSketchOperation(aFeatureOp)) {
+      std::shared_ptr<GeomAPI_Pln> 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