X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModuleBase%2FModuleBase_WidgetSelector.cpp;h=59e836e47229cbfd0d4da1051a68ad8d2b53e37b;hb=2ab502106663ac32f9a5d87e4fdc950f5ac6f6b7;hp=7d701aaf55616c5e93f9c54a17a02be658caf427;hpb=a5e8dd0b6eae6660f0d10e659b2b604a4bbed65b;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index 7d701aaf5..59e836e47 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -209,7 +209,9 @@ bool ModuleBase_WidgetSelector::isValidSelectionCustom(const ModuleBase_ViewerPr { GeomShapePtr aShape = myWorkshop->selection()->getShape(thePrs); ResultPtr aResult = myWorkshop->selection()->getResult(thePrs); - bool aValid = acceptSubShape(aShape, aResult); + bool aValid = aResult.get(); + if (!isWholeResultAllowed()) + aValid = acceptSubShape(aShape, aResult); if (aValid) { // In order to avoid selection of the same object @@ -252,3 +254,16 @@ void ModuleBase_WidgetSelector::deactivate() aSelectAttr->removeTemporaryValues(); } } + +//******************************************************************** +bool ModuleBase_WidgetSelector::isWholeResultAllowed() const +{ + AttributePtr anAttribute = attribute(); + if (anAttribute.get()) { + AttributeSelectionListPtr aSelAttr = + std::dynamic_pointer_cast(anAttribute); + if (aSelAttr.get()) + return aSelAttr->isWholeResultAllowed(); + } + return false; +}