From: vsv Date: Wed, 9 Oct 2019 08:53:51 +0000 (+0300) Subject: Provide selection of features for invisible objects X-Git-Tag: V9_5_0a1~167^2~93 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f5115e0c402aa5d4d070f970ddc79c0a4a9c04ac;p=modules%2Fshaper.git Provide selection of features for invisible objects --- diff --git a/src/ModuleBase/ModuleBase_ISelection.cpp b/src/ModuleBase/ModuleBase_ISelection.cpp index 73999c601..635991721 100644 --- a/src/ModuleBase/ModuleBase_ISelection.cpp +++ b/src/ModuleBase/ModuleBase_ISelection.cpp @@ -20,6 +20,7 @@ #include "ModuleBase_ISelection.h" #include "ModuleBase_ViewerPrs.h" +#include "ModelAPI_Feature.h" #include #include @@ -53,8 +54,16 @@ ResultPtr ModuleBase_ISelection::getResult(const ModuleBase_ViewerPrsPtr& thePrs { ResultPtr aResult; - if (thePrs->object().get()) - aResult = std::dynamic_pointer_cast(thePrs->object()); + if (thePrs->object().get()) { + ObjectPtr aObject = thePrs->object(); + aResult = std::dynamic_pointer_cast(aObject); + if (!aResult.get()) { + FeaturePtr aFeature = std::dynamic_pointer_cast(aObject); + if (aFeature.get()) { + aResult = aFeature->firstResult(); + } + } + } else if (!thePrs->owner().IsNull()) { ObjectPtr anObject = getSelectableObject(thePrs->owner()); aResult = std::dynamic_pointer_cast(anObject);