From 64981a525f8bc2c450475822e96dcc2766454ad3 Mon Sep 17 00:00:00 2001 From: dbv Date: Fri, 24 Jun 2016 16:52:03 +0300 Subject: [PATCH] Fixed validators for Boolean and Intersection --- src/FeaturesPlugin/FeaturesPlugin_Validators.cpp | 8 +++++++- .../GeomValidators_IntersectionSelection.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index 58c77cdd4..ff7d8cb39 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -506,13 +506,19 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt return false; } std::shared_ptr 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(); if(anOperationType == 1) { // Fuse operation. Allow to select edges, faces and solids. diff --git a/src/GeomValidators/GeomValidators_IntersectionSelection.cpp b/src/GeomValidators/GeomValidators_IntersectionSelection.cpp index ec2a886e0..039b0eda7 100644 --- a/src/GeomValidators/GeomValidators_IntersectionSelection.cpp +++ b/src/GeomValidators/GeomValidators_IntersectionSelection.cpp @@ -47,13 +47,19 @@ bool GeomValidators_IntersectionSelection::isValid(const AttributePtr& theAttrib return false; } std::shared_ptr 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 && -- 2.30.2