]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
A correction for re-entrant operation.
authornds <nds@opencascade.com>
Tue, 3 Nov 2015 10:13:35 +0000 (13:13 +0300)
committernds <nds@opencascade.com>
Tue, 3 Nov 2015 10:13:35 +0000 (13:13 +0300)
src/PartSet/PartSet_Validators.cpp

index cc80fc8c894b7bc0385d186e06d8e3fd00faf0ea..5047a04789c7148aa1ad5df4b6fa59db2aad05bf 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>
@@ -93,14 +94,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