From: mpv Date: Mon, 10 Sep 2018 13:50:51 +0000 (+0300) Subject: Allow to select faces features as a common argument (in the frames of issue #2563) X-Git-Tag: V9_2_0a1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8bdd48817135caf36283891381985b805e90ac95;p=modules%2Fshaper.git Allow to select faces features as a common argument (in the frames of issue #2563) --- 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; }