From: dbv Date: Fri, 24 Jun 2016 13:52:03 +0000 (+0300) Subject: Fixed validators for Boolean and Intersection X-Git-Tag: V_2.4.0~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=64981a525f8bc2c450475822e96dcc2766454ad3;p=modules%2Fshaper.git Fixed validators for Boolean and Intersection --- 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 &&