From e11216ab3e621518fd7a16daf7aaee48f1ac8c46 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 22 Apr 2016 18:06:08 +0300 Subject: [PATCH] Issue #1433: Show CompSolid sub objects --- src/XGUI/XGUI_SelectionMgr.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index ff8e2da7f..3f692ff25 100755 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -107,10 +108,21 @@ void XGUI_SelectionMgr::onObjectBrowserSelection() aFeature = std::dynamic_pointer_cast(aObject); if (aFeature.get()) { const std::list> aResList = aFeature->results(); + ResultPtr aResult; + ResultCompSolidPtr aCompSolid; std::list::const_iterator aIt; for (aIt = aResList.cbegin(); aIt != aResList.cend(); ++aIt) { - aSelectedPrs.append(std::shared_ptr( - new ModuleBase_ViewerPrs((*aIt), GeomShapePtr(), NULL))); + aResult = (*aIt); + aCompSolid = std::dynamic_pointer_cast(aResult); + if (aCompSolid.get()) { + for (int i = 0; i < aCompSolid->numberOfSubs(); i++) { + aSelectedPrs.append(std::shared_ptr( + new ModuleBase_ViewerPrs(aCompSolid->subResult(i), GeomShapePtr(), NULL))); + } + } else { + aSelectedPrs.append(std::shared_ptr( + new ModuleBase_ViewerPrs(aResult, GeomShapePtr(), NULL))); + } } } } -- 2.39.2