From: jfa Date: Wed, 7 Apr 2021 08:40:50 +0000 (+0300) Subject: Bos #24043: EDF 23094 - problem with dump. X-Git-Tag: V9_7_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=935f47b49a24bebd9537a394ae4697a2210b3718;p=modules%2Fshaper.git Bos #24043: EDF 23094 - problem with dump. --- diff --git a/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp b/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp index 024e2d019..8e44be6a9 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp @@ -476,7 +476,19 @@ void ModuleBase_WidgetSelectionFilter::onSelect() bool isValid = aSession->filters()->isValid(myFeature, aBody, aSubShape); if (isValid) { aBuilder.Add(aComp, aTShape); - ModuleBase_ViewerPrsPtr aValue(new ModuleBase_ViewerPrs(aObj, aSubShape)); + // bos #24043: Naming on a compsolid works wrong. + // Find a simple sub-result for the ViewerPrs context: + ObjectPtr aSubResultObj = aObj; + for (int aSubIndex = 0; aSubIndex < aBody->numberOfSubs(); aSubIndex++) { + ResultBodyPtr aSubResult = aBody->subResult(aSubIndex); + GeomShapePtr aSubResultShape = aSubResult->shape(); + if (aSubResultShape->isSubShape(aSubShape)) { + aSubResultObj = aSubResult; + break; + } + } + ModuleBase_ViewerPrsPtr aValue(new ModuleBase_ViewerPrs(aSubResultObj, aSubShape)); + //ModuleBase_ViewerPrsPtr aValue(new ModuleBase_ViewerPrs(aObj, aSubShape)); myValues.append(aValue); } }