From 8bdd48817135caf36283891381985b805e90ac95 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 10 Sep 2018 16:50:51 +0300 Subject: [PATCH] Allow to select faces features as a common argument (in the frames of issue #2563) --- src/FeaturesPlugin/FeaturesPlugin_Validators.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index 320191996..e28008720 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -1592,7 +1592,7 @@ bool FeaturesPlugin_ValidatorBooleanCommonSelection::isValid( return false; } ResultPtr aContext = anAttrSelection->context(); - if (!aContext.get()) { + if (!aContext.get() && !anAttrSelection->contextFeature().get()) { theError = "Error: Empty selection context."; return false; } @@ -1605,15 +1605,16 @@ bool FeaturesPlugin_ValidatorBooleanCommonSelection::isValid( } } std::shared_ptr aShape = anAttrSelection->value(); - GeomShapePtr aContextShape = aContext->shape(); - if (!aShape.get()) { + GeomShapePtr aContextShape; + if (!aShape.get() && aContext.get()) { + aContextShape = aContext->shape(); aShape = aContextShape; } if (!aShape.get()) { theError = "Error: Empty shape."; return false; } - if (!aShape->isEqual(aContextShape)) { + if (aContextShape.get() && !aShape->isEqual(aContextShape)) { theError = "Error: Local selection not allowed."; return false; } -- 2.30.2