]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_Validators.cpp
Salome HOME
Task 2.3: Creation of Intersection
[modules/shaper.git] / src / PartSet / PartSet_Validators.cpp
index b2f95ddd3f665a4bc4871e814c7ba1e63996cd8b..49f89d9c033ac2a308aade1b1a558a10846ac122 100755 (executable)
@@ -407,6 +407,17 @@ bool PartSet_ProjectionSelection::isValid(const ModuleBase_ISelection* theSelect
   }
 }
 
+bool PartSet_IntersectionSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                     ModuleBase_Operation* theOperation) const
+{
+  if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
+    return isEmptySelectionValid(theOperation);
+  } else {
+    int aCount = shapesNbLines(theSelection);
+    return aCount == 0;
+  }
+}
+
 
 std::string PartSet_DifferentObjectsValidator::errorMessage(
                          const PartSet_DifferentObjectsValidator::ErrorType& theType,