Salome HOME
Update copyrights
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Validators.cpp
index cfe4ed74377143f4d242a7b07314ce564b15c857..cb18ffafa06fc05c4e9513b46746be3c8ce2b34f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Validators.h"
 
 #include "FeaturesPlugin_Boolean.h"
+#include "FeaturesPlugin_BooleanFuse.h"
+#include "FeaturesPlugin_BooleanCommon.h"
 #include "FeaturesPlugin_BooleanSmash.h"
+#include "FeaturesPlugin_Pipe.h"
 #include "FeaturesPlugin_Union.h"
 
 #include <Events_InfoMessage.h>
@@ -33,7 +35,7 @@
 #include <ModelAPI_AttributeReference.h>
 #include <ModelAPI_AttributeRefList.h>
 #include <ModelAPI_Feature.h>
-#include <ModelAPI_ResultCompSolid.h>
+#include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_Tools.h>
 
@@ -65,8 +67,10 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute,
   AttributeSelectionPtr aPathAttrSelection =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
   if(!aPathAttrSelection.get()) {
+// LCOV_EXCL_START
     theError = "Error: This validator can only work with path selector in \"Pipe\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   GeomShapePtr aPathShape = aPathAttrSelection->value();
@@ -86,7 +90,84 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute,
 }
 
 //==================================================================================================
-bool FeaturesPlugin_ValidatorPipeLocations::isValid(
+bool FeaturesPlugin_ValidatorPipeLocations::isValid(const AttributePtr& theAttribute,
+                                                    const std::list<std::string>& theArguments,
+                                                    Events_InfoMessage& theError) const
+{
+  AttributeSelectionListPtr anAttrSelectionList =
+    std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+  if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
+    theError =
+      "Error: This validator can only work with selection list attributes in \"Pipe\" feature.";
+    return false;
+// LCOV_EXCL_STOP
+  }
+  std::shared_ptr<FeaturesPlugin_Pipe> aFeature =
+    std::dynamic_pointer_cast<FeaturesPlugin_Pipe>(theAttribute->owner());
+
+  AttributeSelectionPtr aPathSelection = aFeature->selection(FeaturesPlugin_Pipe::PATH_OBJECT_ID());
+  if (!aPathSelection.get()) {
+// LCOV_EXCL_START
+    theError = "Error: Path not selected.";
+    return false;
+// LCOV_EXCL_STOP
+  }
+
+  GeomShapePtr aPathShape = aPathSelection->value();
+  if (!aPathShape.get()) {
+    ResultPtr aContext = aPathSelection->context();
+    if (!aContext.get()) {
+      FeaturePtr aContFeat = aPathSelection->contextFeature();
+      if (!aContFeat.get() || !aContFeat->results().size()) {
+        theError = "Error: Empty selection context.";
+        return false;
+      }
+    }
+    aPathShape = aContext->shape();
+  }
+
+  if (!aPathShape.get()) {
+    theError = "Error: Empty path shape.";
+    return false;
+  }
+
+  for (int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
+    AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
+    if (!anAttrSelection.get()) {
+      theError = "Error: Empty attribute selection.";
+      return false;
+    }
+    ResultPtr aContext = anAttrSelection->context();
+    if (!aContext.get()) {
+      FeaturePtr aContFeat = anAttrSelection->contextFeature();
+      if (!aContFeat.get() || !aContFeat->results().size()) {
+        theError = "Error: Empty selection context.";
+        return false;
+      }
+    }
+    std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
+    if (!aShape.get() && aContext.get()) {
+      GeomShapePtr aContextShape = aContext->shape();
+      aShape = aContextShape;
+    }
+    if (!aShape.get()) {
+      theError = "Error: Empty shape.";
+      return false;
+    }
+
+    if (!aPathShape->isSubShape(aShape)) {
+      theError = "Error: Location should be a vertex subshape from path shape.";
+      return false;
+    }
+  }
+
+  return true;
+}
+
+//==================================================================================================
+// LCOV_EXCL_START
+bool FeaturesPlugin_ValidatorPipeLocationsNumber::isValid(
   const std::shared_ptr<ModelAPI_Feature>& theFeature,
   const std::list<std::string>& theArguments,
   Events_InfoMessage& theError) const
@@ -134,16 +215,19 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(
 
   return true;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
 bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theAttribute,
                                                         const std::list<std::string>& theArguments,
                                                         Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if(theArguments.empty()) {
     theError = "Error: Validator parameters is empty.";
     return false;
   }
+// LCOV_EXCL_STOP
 
   // Checking attribute.
   if(!isValidAttribute(theAttribute, theArguments, theError)) {
@@ -161,7 +245,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA
     for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) {
       AttributeSelectionPtr aSelectionAttr = aListAttr->value(anIndex);
       ResultPtr aContext = aSelectionAttr->context();
-      if(!aContext.get()) {
+      if(!aContext.get() && !aSelectionAttr->contextFeature().get()) {
         theError = "Error: Empty context.";
         return false;
       }
@@ -173,7 +257,12 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA
         // If shape is compound check that it contains only faces and edges.
         GeomShapePtr aShape = aSelectionAttr->value();
         if(!aShape.get()) {
-          aShape = aContext->shape();
+          if (aContext.get()) {
+            aShape = aContext->shape();
+          } else {
+            theError = "Error: Empty context.";
+            return false;
+          }
         }
 
         if(aShape->shapeType() == GeomAPI_Shape::COMPOUND) {
@@ -229,9 +318,11 @@ bool FeaturesPlugin_ValidatorBaseForGenerationSketchOrSketchObjects::isValid(
 
   AttributeSelectionListPtr aListAttr = theFeature->selectionList(aBaseObjectsID);
   if(!aListAttr.get()) {
+// LCOV_EXCL_START
     theError = "Error: Could not get \"%1\" attribute.";
     theError.arg(aBaseObjectsID);
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::set<ResultConstructionPtr> aSelectedSketches;
@@ -241,8 +332,13 @@ bool FeaturesPlugin_ValidatorBaseForGenerationSketchOrSketchObjects::isValid(
     AttributeSelectionPtr aSelectionAttr = aListAttr->value(anIndex);
     ResultPtr aContext = aSelectionAttr->context();
     if(!aContext.get()) {
-      theError = "Error: Empty context.";
-      return false;
+      FeaturePtr aFeature = aSelectionAttr->contextFeature();
+      if (!aFeature.get() || aFeature->results().empty()) {
+        theError = "Error: Empty context.";
+        return false;
+      } else {
+        aContext = aFeature->firstResult();
+      }
     }
 
     ResultConstructionPtr aResultConstruction =
@@ -284,8 +380,10 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
                                                         Events_InfoMessage& theError) const
 {
   if(!theAttribute.get()) {
+// LCOV_EXCL_START
     theError = "Error: Empty attribute.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::string anAttributeType = theAttribute->attributeType();
@@ -303,14 +401,15 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
     AttributeSelectionPtr anAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
     ResultPtr aContext = anAttr->context();
-    if(!aContext.get()) {
+    if(!aContext.get() && !anAttr->contextFeature().get()) {
       theError = "Error: Attribute have empty context.";
       return false;
     }
 
     GeomShapePtr aShape = anAttr->value();
-    GeomShapePtr aContextShape = aContext->shape();
-    if(!aShape.get()) {
+    GeomShapePtr aContextShape;
+    if(!aShape.get() && aContext.get()) {
+      aContextShape = aContext->shape();
       aShape = aContextShape;
     }
     if(!aShape.get()) {
@@ -318,15 +417,20 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
       return false;
     }
 
-    ResultConstructionPtr aConstruction =
-      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+    ResultConstructionPtr aConstruction;
+    if (!aContext.get() && anAttr->contextFeature()->results().size() == 1) {
+      aContext = anAttr->contextFeature()->firstResult();
+    }
+    if (aContext.get())
+      aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
     if(aConstruction.get()) {
-      // Construciotn selected. Check that is is not infinite.
+      // Construction selected. Check that it is not infinite.
       if(aConstruction->isInfinite()) {
         theError = "Error: Infinite constructions is not allowed as base.";
         return false;
       }
 
+      GeomShapePtr aContextShape = aContext->shape();
       if(aShape->isEqual(aContextShape)) {
         // Whole construction selected. Check that it have faces.
         if(aConstruction->facesNum() > 0) {
@@ -339,11 +443,10 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
           return true;
         }
       }
-
       return false;
     }
 
-    if(!aShape->isEqual(aContextShape)) {
+    if(aContextShape.get() && !aShape->isEqual(aContextShape)) {
       // Local selection on body does not allowed.
       theError =
         "Error: Selected shape is in the local selection. Only global selection is allowed.";
@@ -367,15 +470,18 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
     }
 
   } else {
+// LCOV_EXCL_START
     theError = "Error: Attribute \"%1\" does not supported by this validator.";
     theError.arg(anAttributeType);
     return false;
+// LCOV_EXCL_STOP
   }
 
   return true;
 }
 
 //==================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theAttribute,
                                                         const std::list<std::string>& theArguments,
                                                         Events_InfoMessage& theError) const
@@ -422,6 +528,7 @@ bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theA
   bool aValid = !aFeatureKind && aPlanarFace;
   return aValid;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
 bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
@@ -430,8 +537,10 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
                                                Events_InfoMessage& theError) const
 {
   if(theArguments.size() != 2) {
+// LCOV_EXCL_START
     theError = "Error: Validator should be used with 2 parameters for extrusion.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::list<std::string>::const_iterator
@@ -446,13 +555,26 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
     aDirShape = aSelAttr->value();
     if(!aDirShape.get()) {
       ResultPtr aContext = aSelAttr->context();
+      if(!aContext.get()) {
+        FeaturePtr aFeature = aSelAttr->contextFeature();
+        if (aFeature.get() && !aFeature->results().empty()) {
+          aContext = aFeature->firstResult();
+        }
+      }
+
       if(aContext.get()) {
         aDirShape = aContext->shape();
       }
+
+      if (aDirShape.get() && aDirShape->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aDirShape);
+        aDirShape = anIt.current();
+      }
     }
   }
 
-  if(!aDirShape.get()) {
+  if(!aDirShape.get() || aDirShape->isNull() ||
+     aDirShape->shapeType() != GeomAPI_Shape::EDGE) {
     // Check that dir can be empty.
     if(!isShapesCanBeEmpty(aCheckAttribute, theError)) {
       theError = "Error: Base objects list contains vertex or edge, so attribute \"%1\" "
@@ -517,9 +639,11 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
 bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr& theAttribute,
                                                               Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if(!theAttribute.get()) {
     return true;
   }
+// LCOV_EXCL_STOP
 
   std::string anAttributeType = theAttribute->attributeType();
   if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
@@ -536,13 +660,13 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr
     AttributeSelectionPtr anAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
     ResultPtr aContext = anAttr->context();
-    if(!aContext.get()) {
+    if(!aContext.get() && !anAttr->contextFeature().get()) {
       return false;
     }
 
     GeomShapePtr aShape = anAttr->value();
-    GeomShapePtr aContextShape = aContext->shape();
-    if(!aShape.get()) {
+    if(!aShape.get() && aContext.get()) {
+      GeomShapePtr aContextShape = aContext->shape();
       aShape = aContextShape;
     }
     if(!aShape.get()) {
@@ -569,9 +693,11 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
   std::shared_ptr<FeaturesPlugin_Boolean> aFeature =
     std::dynamic_pointer_cast<FeaturesPlugin_Boolean>(theAttribute->owner());
@@ -585,8 +711,11 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt
     }
     ResultPtr aContext = anAttrSelection->context();
     if(!aContext.get()) {
-      theError = "Error: Empty selection context.";
-      return false;
+      FeaturePtr aContFeat = anAttrSelection->contextFeature();
+      if (!aContFeat.get() || !aContFeat->results().size()) {
+        theError = "Error: Empty selection context.";
+        return false;
+      }
     }
     ResultConstructionPtr aResultConstruction =
       std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
@@ -598,15 +727,15 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt
       }
     }
     std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
-    GeomShapePtr aContextShape = aContext->shape();
-    if(!aShape.get()) {
+    if(!aShape.get() && aContext.get()) {
+      GeomShapePtr aContextShape = aContext->shape();
       aShape = aContextShape;
     }
     if(!aShape.get()) {
       theError = "Error: Empty shape.";
       return false;
     }
-    if(!aShape->isEqual(aContextShape)) {
+    if (aContext.get() && !aShape->isEqual(aContext->shape())) {
       theError = "Error: Local selection not allowed.";
       return false;
     }
@@ -655,9 +784,11 @@ bool FeaturesPlugin_ValidatorFilletSelection::isValid(const AttributePtr& theAtt
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: This validator can only work with selection list attributes in \"Fillet\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
@@ -671,16 +802,31 @@ bool FeaturesPlugin_ValidatorFilletSelection::isValid(const AttributePtr& theAtt
     }
     ResultPtr aContext = anAttrSelection->context();
     if(!aContext.get()) {
-      theError = "Error: Empty selection context.";
-      return false;
+      FeaturePtr aContFeat = anAttrSelection->contextFeature();
+      if (!aContFeat.get() || !aContFeat->results().size() ||
+          aContFeat->firstResult()->groupName() != ModelAPI_ResultBody::group()) {
+        theError = "Error: Empty selection context.";
+        return false;
+      }
+      if (aContFeat->results().size() == 1)
+        aContext = aContFeat->firstResult();
+      else {
+        theError = "Error: Too many shapes selected.";
+        return false;
+      }
     }
 
-    ResultCompSolidPtr aContextOwner = ModelAPI_Tools::compSolidOwner(aContext);
+    ResultBodyPtr aContextOwner = ModelAPI_Tools::bodyOwner(aContext);
     GeomShapePtr anOwner = aContextOwner.get() ? aContextOwner->shape() : aContext->shape();
 
+    if (!anOwner) {
+      theError = "Error: wrong feature is selected.";
+      return false;
+    }
+
     if (anOwner->shapeType() != GeomAPI_Shape::SOLID &&
         anOwner->shapeType() != GeomAPI_Shape::COMPSOLID) {
-      theError = "Error: Not all selected shapes are sub-shapes of solids";
+      theError = "Error: Not all selected shapes are sub-shapes of solids.";
       return false;
     }
 
@@ -703,8 +849,10 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError = "Error: This validator can only work with selection list in \"Partition\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
@@ -728,11 +876,22 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the
       return false;
     }
 
-    ResultCompSolidPtr aResultCompsolid =
-      std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aContext);
-    if(aResultCompsolid.get()) {
+    ResultBodyPtr aResultBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aContext);
+    if(aResultBody.get()) {
       continue;
     }
+    FeaturePtr aResultFeature = aSelectAttr->contextFeature();
+    if(aResultFeature.get()) {
+      bool aOkRes = false;
+      std::list<ResultPtr>::const_iterator aFRes = aResultFeature->results().cbegin();
+      for(; aFRes != aResultFeature->results().cend() && !aOkRes; aFRes++) {
+        ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aFRes);
+        if (aBody.get() && !aBody->isDisabled())
+          aOkRes = true;
+      }
+      if (aOkRes)
+        continue;
+    }
 
     theError = "Error: Only body shapes and construction planes are allowed for selection.";
     return false;
@@ -750,9 +909,11 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt
   AttributeSelectionListPtr aSubShapesAttrList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!aSubShapesAttrList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   static const std::string aBaseShapeID = "base_shape";
@@ -760,9 +921,11 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt
   AttributeSelectionPtr aShapeAttrSelection = aFeature->selection(aBaseShapeID);
 
   if(!aShapeAttrSelection.get()) {
+// LCOV_EXCL_START
     theError = "Error: Could not get \"%1\" attribute.";
     theError.arg(aBaseShapeID);
     return false;
+// LCOV_EXCL_STOP
   }
 
   GeomShapePtr aBaseShape = aShapeAttrSelection->value();
@@ -779,17 +942,19 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt
     return false;
   }
 
+  std::list<GeomShapePtr> aSubShapes = GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
   for(int anIndex = 0; anIndex < aSubShapesAttrList->size(); ++anIndex) {
     bool isSameFound = false;
     AttributeSelectionPtr anAttrSelectionInList = aSubShapesAttrList->value(anIndex);
     GeomShapePtr aShapeToAdd = anAttrSelectionInList->value();
-    for(GeomAPI_ShapeIterator anIt(aBaseShape); anIt.more(); anIt.next()) {
-      if(anIt.current()->isEqual(aShapeToAdd)) {
+    for (ListOfShape::const_iterator anIt = aSubShapes.cbegin(); anIt != aSubShapes.cend(); ++anIt)
+    {
+      if ((*anIt)->isEqual(aShapeToAdd)) {
         isSameFound = true;
         break;
       }
     }
-    if(!isSameFound) {
+    if (!isSameFound) {
       theError = "Error: Only sub-shapes of selected shape is allowed for selection.";
       return false;
     }
@@ -807,6 +972,7 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(
   static const std::string aBaseShapeID = "base_shape";
   static const std::string aSubShapesID = "subshapes_to_keep";
 
+// LCOV_EXCL_START
   if(theFeature->getKind() != "Remove_SubShapes") {
     theError = "Error: Feature \"%1\" does not supported by this validator.";
     theError.arg(theFeature->getKind());
@@ -826,6 +992,7 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(
     theError.arg(aSubShapesID);
     return false;
   }
+// LCOV_EXCL_STOP
 
   // Copy base shape.
   GeomShapePtr aBaseShape = aShapeAttrSelection->value();
@@ -857,6 +1024,7 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(
 }
 
 //==================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttribute,
                                                      const std::list<std::string>& theArguments,
                                                      Events_InfoMessage& theError) const
@@ -892,8 +1060,8 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr
       return false;
     }
 
-    ResultCompSolidPtr aResult =
-      std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aContext);
+    ResultBodyPtr aResult =
+      std::dynamic_pointer_cast<ModelAPI_ResultBody>(aContext);
     if(!aResult.get()) {
       continue;
     }
@@ -906,6 +1074,7 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr
 
   return true;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
 bool FeaturesPlugin_ValidatorUnionArguments::isValid(
@@ -913,6 +1082,7 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid(
   const std::list<std::string>& theArguments,
   Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   // Check feature kind.
   if(theFeature->getKind() != FeaturesPlugin_Union::ID()) {
     theError = "Error: This validator supports only \"%1\" feature.";
@@ -928,6 +1098,7 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid(
     theError.arg(FeaturesPlugin_Union::BASE_OBJECTS_ID());
     return false;
   }
+// LCOV_EXCL_STOP
 
   // Get all shapes.
   GeomAPI_Shape::ShapeType aType = GeomAPI_Shape::COMPSOLID;
@@ -945,14 +1116,10 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid(
 
   // Make compound and find connected.
   GeomShapePtr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseShapesList);
-  ListOfShape aCombined, aFree;
-  GeomAlgoAPI_ShapeTools::combineShapes(
-    aCompound,
-    aType,
-    aCombined,
-    aFree);
-
-  if(aFree.size() > 0 || aCombined.size() > 1) {
+  ListOfShape aResults;
+  GeomAlgoAPI_ShapeTools::combineShapes(aCompound, aType, aResults);
+
+  if(aResults.size() > 1 || (aResults.size() == 1 && aResults.front()->shapeType() > aType)) {
     theError = "Error: Not all shapes have shared topology.";
     return false;
   }
@@ -965,9 +1132,11 @@ bool FeaturesPlugin_ValidatorConcealedResult::isValid(const AttributePtr& theAtt
                                             Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeReference::typeId()) {
+// LCOV_EXCL_START
     theError = "Error: The attribute with the %1 type is not processed";
     theError.arg(theAttribute->attributeType());
     return false;
+// LCOV_EXCL_STOP
   }
 
   AttributeReferencePtr aRefAttribute = std::dynamic_pointer_cast<ModelAPI_AttributeReference>
@@ -1028,81 +1197,52 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
   const std::list<std::string>& theArguments,
   Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if (theArguments.size() != 2)
   {
     theError = "Wrong number of arguments (expected 2).";
     return false;
   }
+// LCOV_EXCL_STOP
 
-  int anObjectsNb = 0, aToolsNb = 0;
-  //int anOperationType = 0;
+  int anObjectsToolsNb[2] = { 0,  0 };
 
   std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
 
   bool isAllInSameCompSolid = true;
-  ResultCompSolidPtr aCompSolid;
-
-  AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
-  if (anAttrSelList)
-  {
-    anObjectsNb = anAttrSelList->size();
-    for (int anIndex = 0; anIndex < anObjectsNb; ++anIndex)
-    {
-      AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-      ResultPtr aContext = anAttr->context();
-      ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
-      if (aResCompSolidPtr.get())
-      {
-        if (aCompSolid.get())
-        {
-          isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
-        }
-        else
-        {
-          aCompSolid = aResCompSolidPtr;
-        }
-      }
-      else
-      {
-        isAllInSameCompSolid = false;
-        break;
-      }
-    }
-  }
-  anIt++;
-
+  ResultBodyPtr aCompSolid;
 
-  anAttrSelList = theFeature->selectionList(*anIt);
-  if (anAttrSelList)
-  {
-    aToolsNb = anAttrSelList->size();
-    if (isAllInSameCompSolid)
+  for (int* anArgNbIt = anObjectsToolsNb; anIt != aLast; ++anIt, ++anArgNbIt) {
+    AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
+    if (anAttrSelList)
     {
-      for (int anIndex = 0; anIndex < aToolsNb; ++anIndex)
-      {
-        AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-        ResultPtr aContext = anAttr->context();
-        ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
-        if (aResCompSolidPtr.get())
+      *anArgNbIt = anAttrSelList->size();
+      if (isAllInSameCompSolid) {
+        for (int anIndex = 0; anIndex < *anArgNbIt; ++anIndex)
         {
-          if (aCompSolid.get())
+          AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
+          ResultPtr aContext = anAttr->context();
+          ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
+          if (aResCompSolidPtr.get())
           {
-            isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+            if (aCompSolid.get())
+            {
+              isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+            }
+            else
+            {
+              aCompSolid = aResCompSolidPtr;
+            }
           }
           else
           {
-            aCompSolid = aResCompSolidPtr;
+            isAllInSameCompSolid = false;
+            break;
           }
         }
-        else
-        {
-          isAllInSameCompSolid = false;
-          break;
-        }
       }
     }
   }
-  anIt++;
 
   std::shared_ptr<FeaturesPlugin_Boolean> aFeature =
     std::dynamic_pointer_cast<FeaturesPlugin_Boolean>(theFeature);
@@ -1111,7 +1251,7 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
   if (anOperationType == FeaturesPlugin_Boolean::BOOL_FUSE)
   {
     // Fuse operation
-    if (anObjectsNb + aToolsNb < 2)
+    if (anObjectsToolsNb[0] + anObjectsToolsNb[1] < 2)
     {
       theError = "Not enough arguments for Fuse operation.";
       return false;
@@ -1124,12 +1264,12 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
   }
   else
   {
-    if (anObjectsNb < 1)
+    if (anObjectsToolsNb[0] < 1) // check number of objects
     {
       theError = "Objects not selected.";
       return false;
     }
-    if (aToolsNb < 1)
+    if (anObjectsToolsNb[1] < 1) // check number of tools
     {
       theError = "Tools not selected.";
       return false;
@@ -1145,6 +1285,7 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
 }
 
 //=================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorBooleanArguments::isNotObligatory(std::string theFeature,
                                                                std::string theAttribute)
 {
@@ -1155,6 +1296,7 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isNotObligatory(std::string theFe
 
   return false;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
 bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
@@ -1168,9 +1310,11 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if (!aFeature.get() || !anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: Validator used in wrong feature or attribute";
     return false;
+// LCOV_EXCL_STOP
   }
 
   AttributeSelectionListPtr anOtherAttrSelectionList;
@@ -1188,16 +1332,25 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
 
   for (int anIndex = 0; anIndex < anOtherAttrSelectionList->size(); ++anIndex) {
     AttributeSelectionPtr anAttrSelection = anOtherAttrSelectionList->value(anIndex);
+
+    if (anAttrSelection->contextFeature().get()) {
+      theError = "Error: Features not allowed for selection.";
+      return false;
+    }
+
     ResultPtr aContext = anAttrSelection->context();
     std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
-    GeomShapePtr aContextShape = aContext->shape();
     if (!aShape.get()) {
-      aShape = aContextShape;
+      if (!aContext.get()) {
+        theError = "Error: Empty selection.";
+        return false;
+      }
+      aShape = aContext->shape();
     }
 
     if (aShape->isSolid() || aShape->isCompSolid()) {
       aSelectedShapesType = GeomAPI_Shape::SOLID;
-      ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
+      ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
       if (aResCompSolidPtr.get()) {
         GeomShapePtr aCompSolidShape = aResCompSolidPtr->shape();
         aSelectedCompSolidsInOtherList.bind(aCompSolidShape, aCompSolidShape);
@@ -1216,11 +1369,21 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
       theError = "Error: Empty attribute selection.";
       return false;
     }
-    ResultPtr aContext = anAttrSelection->context();
-    if (!aContext.get()) {
-      theError = "Error: Empty selection context.";
+
+    if (anAttrSelection->contextFeature().get()) {
+      theError = "Error: Features not allowed for selection.";
       return false;
     }
+
+    ResultPtr aContext = anAttrSelection->context();
+    if(!aContext.get()) {
+      FeaturePtr aContFeat = anAttrSelection->contextFeature();
+      if (!aContFeat.get() || !aContFeat->results().size() ||
+          aContFeat->firstResult()->groupName() != ModelAPI_ResultBody::group()) {
+        theError = "Error: Empty selection context.";
+        return false;
+      }
+    }
     ResultConstructionPtr aResultConstruction =
       std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
     if (aResultConstruction.get()) {
@@ -1262,15 +1425,6 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
         theError = "Error: Selected shapes should have the same type.";
         return false;
       }
-
-      ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
-      if (aResCompSolidPtr.get()) {
-        GeomShapePtr aCompSolidShape = aResCompSolidPtr->shape();
-        if (aSelectedCompSolidsInOtherList.isBound(aCompSolidShape)) {
-          theError = "Error: Solids from compsolid in other list not allowed.";
-          return false;
-        }
-      }
     } else {
       GeomAPI_Face aFace(aShape);
       GeomPlanePtr aPln = aFace.getPlane();
@@ -1289,3 +1443,343 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
 
   return true;
 }
+
+//==================================================================================================
+// LCOV_EXCL_START
+bool FeaturesPlugin_IntersectionSelection::isValid(const AttributePtr& theAttribute,
+                                                   const std::list<std::string>& theArguments,
+                                                   Events_InfoMessage& theError) const
+{
+  if (!theAttribute.get()) {
+    theError = "Error: empty selection.";
+    return false;
+  }
+  FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
+  AttributeSelectionListPtr anAttrSelectionList =
+    std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+  for (int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
+    AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
+    if (!anAttrSelection.get()) {
+      theError = "Error: empty attribute selection.";
+      return false;
+    }
+    ResultPtr aContext = anAttrSelection->context();
+    if(!aContext.get()) {
+      FeaturePtr aContFeat = anAttrSelection->contextFeature();
+      if (!aContFeat.get() || !aContFeat->results().size() ||
+          aContFeat->firstResult()->groupName() != ModelAPI_ResultBody::group()) {
+        theError = "Error: Empty selection context.";
+        return false;
+      }
+    }
+    FeaturePtr aFeature = anAttrSelection->contextFeature().get() ?
+      anAttrSelection->contextFeature() : ModelAPI_Feature::feature(aContext);
+    if (!aFeature.get()) {
+      theError = "Error: empty feature.";
+      return false;
+    }
+    std::string aFeatureKind = aFeature->getKind();
+    if (aFeatureKind == "Sketch" ||
+        aFeatureKind == "Plane" ||
+        aFeatureKind == "Axis") {
+      theError = "Error: %1 shape is not allowed for selection.";
+      theError.arg(aFeatureKind);
+      return false;
+    }
+    std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
+    if (!aShape.get()) {
+      GeomShapePtr aContextShape = aContext->shape();
+      aShape = aContextShape;
+    }
+    if (!aShape.get()) {
+      theError = "Error: empty shape.";
+      return false;
+    }
+    if (aContext.get() && !aShape->isEqual(aContext->shape())) {
+      theError = "Error: Local selection not allowed.";
+      return false;
+    }
+
+    int aShapeType = aShape->shapeType();
+    // Allow to select edges, faces and solids.
+    if (aShapeType != GeomAPI_Shape::EDGE &&
+        aShapeType != GeomAPI_Shape::FACE &&
+        aShapeType != GeomAPI_Shape::SOLID &&
+        aShapeType != GeomAPI_Shape::COMPSOLID &&
+        aShapeType != GeomAPI_Shape::COMPOUND) {
+      theError = "Error: selected shape has the wrong type.";
+      return false;
+    }
+  }
+
+  return true;
+}
+// LCOV_EXCL_STOP
+
+//==================================================================================================
+// LCOV_EXCL_START
+bool FeaturesPlugin_ValidatorBooleanFuseSelection::isValid(
+  const AttributePtr& theAttribute,
+  const std::list<std::string>& theArguments,
+  Events_InfoMessage& theError) const
+{
+  AttributeSelectionListPtr anAttrSelectionList =
+    std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+  if (!anAttrSelectionList.get()) {
+    theError =
+      "Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
+    return false;
+  }
+
+  for (int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
+    AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
+    if (!anAttrSelection.get()) {
+      theError = "Error: Empty attribute selection.";
+      return false;
+    }
+    ResultPtr aContext = anAttrSelection->context();
+    if(!aContext.get()) {
+      FeaturePtr aContFeat = anAttrSelection->contextFeature();
+      if (!aContFeat.get() || !aContFeat->results().size() ||
+          aContFeat->firstResult()->groupName() != ModelAPI_ResultBody::group()) {
+        theError = "Error: Empty selection context.";
+        return false;
+      }
+    }
+    ResultConstructionPtr aResultConstruction =
+      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+    if (aResultConstruction.get()) {
+      theError = "Error: Result construction not allowed for selection.";
+      return false;
+    }
+    std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
+    if (!aShape.get()) {
+      GeomShapePtr aContextShape = aContext->shape();
+      aShape = aContextShape;
+    }
+    if (!aShape.get()) {
+      theError = "Error: Empty shape.";
+      return false;
+    }
+    if (aContext.get() && !aShape->isEqual(aContext->shape())) {
+      theError = "Error: Local selection not allowed.";
+      return false;
+    }
+  }
+
+  return true;
+}
+// LCOV_EXCL_STOP
+
+//=================================================================================================
+bool FeaturesPlugin_ValidatorBooleanFuseArguments::isValid(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<std::string>& theArguments,
+  Events_InfoMessage& theError) const
+{
+// LCOV_EXCL_START
+  if (theArguments.size() != 2) {
+    theError = "Wrong number of arguments (expected 2).";
+    return false;
+  }
+// LCOV_EXCL_STOP
+
+  std::shared_ptr<FeaturesPlugin_BooleanFuse> aFeature =
+    std::dynamic_pointer_cast<FeaturesPlugin_BooleanFuse>(theFeature);
+
+  int anObjectsNb = 0, aToolsNb = 0;
+
+  std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
+
+  bool isAllInSameCompSolid = true;
+  ResultBodyPtr aCompSolid;
+
+  AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
+  if (anAttrSelList) {
+    anObjectsNb = anAttrSelList->size();
+    for (int anIndex = 0; anIndex < anObjectsNb; ++anIndex) {
+      AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
+      ResultPtr aContext = anAttr->context();
+      ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
+      if (aResCompSolidPtr.get()) {
+        if (aCompSolid.get()) {
+          isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+        } else {
+          aCompSolid = aResCompSolidPtr;
+        }
+      } else {
+        isAllInSameCompSolid = false;
+        break;
+      }
+    }
+  }
+  anIt++;
+
+  if (aFeature->string(FeaturesPlugin_BooleanFuse::CREATION_METHOD())->value()
+      == FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED()) {
+    anAttrSelList = theFeature->selectionList(*anIt);
+    if (anAttrSelList) {
+      aToolsNb = anAttrSelList->size();
+      if (isAllInSameCompSolid) {
+        for (int anIndex = 0; anIndex < aToolsNb; ++anIndex) {
+          AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
+          ResultPtr aContext = anAttr->context();
+          ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
+          if (aResCompSolidPtr.get()) {
+            if (aCompSolid.get()) {
+              isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+            } else {
+              aCompSolid = aResCompSolidPtr;
+            }
+          } else {
+            isAllInSameCompSolid = false;
+            break;
+          }
+        }
+      }
+    }
+  }
+
+  anIt++;
+
+  if (anObjectsNb + aToolsNb < 2) {
+    theError = "Not enough arguments for Fuse operation.";
+    return false;
+  } else if (isAllInSameCompSolid) {
+    theError = "Operations only between sub-shapes of the same shape not allowed.";
+    return false;
+  }
+
+  return true;
+}
+
+//=================================================================================================
+// LCOV_EXCL_START
+bool FeaturesPlugin_ValidatorBooleanFuseArguments::isNotObligatory(
+  std::string theFeature,
+  std::string theAttribute)
+{
+  if (theAttribute == "main_objects" || theAttribute == "tool_objects") {
+    return true;
+  }
+
+  return false;
+}
+// LCOV_EXCL_STOP
+
+//==================================================================================================
+// LCOV_EXCL_START
+bool FeaturesPlugin_ValidatorBooleanCommonSelection::isValid(
+  const AttributePtr& theAttribute,
+  const std::list<std::string>& theArguments,
+  Events_InfoMessage& theError) const
+{
+  AttributeSelectionListPtr anAttrSelectionList =
+    std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+  if (!anAttrSelectionList.get()) {
+    theError =
+      "Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
+    return false;
+  }
+
+  for (int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
+    AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
+    if (!anAttrSelection.get()) {
+      theError = "Error: Empty attribute selection.";
+      return false;
+    }
+    ResultPtr aContext = anAttrSelection->context();
+    if (!aContext.get() && !anAttrSelection->contextFeature().get()) {
+      theError = "Error: Empty selection context.";
+      return false;
+    }
+    ResultConstructionPtr aResultConstruction =
+      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+    if (aResultConstruction.get()) {
+      if (theAttribute->id() != FeaturesPlugin_BooleanCommon::TOOL_LIST_ID()) {
+        theError = "Error: Result construction not allowed for selection.";
+        return false;
+      }
+    }
+    std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
+    GeomShapePtr aContextShape;
+    if (aContext.get()) {
+      aContextShape = aContext->shape();
+    }
+    if (!aShape.get()) {
+      aShape = aContextShape;
+    }
+    if (!aShape.get()) {
+      theError = "Error: Empty shape.";
+      return false;
+    }
+    if (aContextShape.get() && !aShape->isEqual(aContextShape)) {
+      theError = "Error: Local selection not allowed.";
+      return false;
+    }
+
+    if (aResultConstruction.get() && aShape->shapeType() != GeomAPI_Shape::FACE) {
+      theError = "Error: Result construction should be plane.";
+      return false;
+    }
+  }
+
+  return true;
+}
+// LCOV_EXCL_STOP
+
+//=================================================================================================
+bool FeaturesPlugin_ValidatorBooleanCommonArguments::isValid(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<std::string>& theArguments,
+  Events_InfoMessage& theError) const
+{
+  if (theArguments.size() != 2) {
+// LCOV_EXCL_START
+    theError = "Wrong number of arguments (expected 2).";
+    return false;
+// LCOV_EXCL_STOP
+  }
+
+  std::shared_ptr<FeaturesPlugin_BooleanCommon> aFeature =
+    std::dynamic_pointer_cast<FeaturesPlugin_BooleanCommon>(theFeature);
+
+  int anObjectsNb = 0, aToolsNb = 0;
+
+  std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
+
+  bool isAllInSameCompSolid = true;
+  ResultBodyPtr aCompSolid;
+
+  AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
+  if (anAttrSelList) {
+    anObjectsNb = anAttrSelList->size();
+  }
+
+  bool isSimpleMode = aFeature->string(FeaturesPlugin_BooleanCommon::CREATION_METHOD())->value()
+                      == FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE();
+
+  if (!isSimpleMode) {
+    anAttrSelList = theFeature->selectionList(*anIt);
+    if (anAttrSelList) {
+      aToolsNb = anAttrSelList->size();
+    }
+  }
+
+  if ((isSimpleMode && anObjectsNb < 2)
+      || (!isSimpleMode && (anObjectsNb == 0 || aToolsNb == 0))) {
+    theError = "Not enough arguments for Fuse operation.";
+    return false;
+  }
+  return true;
+}
+
+//=================================================================================================
+// LCOV_EXCL_START
+bool FeaturesPlugin_ValidatorBooleanCommonArguments::isNotObligatory(
+  std::string theFeature,
+  std::string theAttribute)
+{
+  return false;
+}
+// LCOV_EXCL_STOP