Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Validators.cpp
index 411a6470ba67a5ef1daa2270d86c70a7e8482df9..ccb43b40643951035c1df9b12e70711e5bcb9576 100644 (file)
@@ -141,12 +141,6 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const AttributePtr& theAttri
         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() && aContext.get()) {
       GeomShapePtr aContextShape = aContext->shape();
@@ -553,6 +547,11 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
       if(aContext.get()) {
         aDirShape = aContext->shape();
       }
+
+      if (aDirShape.get() && aDirShape->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aDirShape);
+        aDirShape = anIt.current();
+      }
     }
   }
 
@@ -1691,8 +1690,10 @@ bool FeaturesPlugin_ValidatorBooleanCommonSelection::isValid(
     }
     std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
     GeomShapePtr aContextShape;
-    if (!aShape.get() && aContext.get()) {
+    if (aContext.get()) {
       aContextShape = aContext->shape();
+    }
+    if (!aShape.get()) {
       aShape = aContextShape;
     }
     if (!aShape.get()) {