Salome HOME
Fixed validators for Boolean and Intersection
[modules/shaper.git] / src / GeomValidators / GeomValidators_IntersectionSelection.cpp
index ec2a886e0e8b687b69469f670c1e4c664580b55c..039b0eda7b8484991d5bb3ded885bf7147c864e8 100644 (file)
@@ -47,13 +47,19 @@ bool GeomValidators_IntersectionSelection::isValid(const AttributePtr& theAttrib
       return false;
     }
     std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
+    GeomShapePtr aContextShape = aContext->shape();
     if(!aShape.get()) {
-      aShape = aContext->shape();
+      aShape = aContextShape;
     }
     if(!aShape.get()) {
       theError = "Error: empty shape.";
       return false;
     }
+    if(!aShape->isEqual(aContextShape)) {
+      theError = "Error: Local selection not allowed.";
+      return false;
+    }
+
     int aShapeType = aShape->shapeType();
     // Allow to select edges, faces and solids.
     if(aShapeType != GeomAPI_Shape::EDGE &&