From 6114455e15bf3526f6a8e5101ec8272550d18c63 Mon Sep 17 00:00:00 2001 From: cg246364 Date: Fri, 18 Dec 2020 16:24:35 +0100 Subject: [PATCH] #20517 : change type of group for compound or compsolid --- .../ExchangePlugin_ImportFeature.cpp | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index 24c821f1c..c5d5953fa 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -282,8 +283,16 @@ void ExchangePlugin_ImportFeature::setColorGroup( if (!aColor.empty()){ if (aRes->get() && aColor == theColor) { - aSelectionList->setSelectionType(aShape->shapeTypeStr()); - aSelectionList->append(theResultBody,aShape); + if (aShape->isCompound() || aShape->isCompSolid()) { + GeomAPI_ShapeIterator anIt(aShape); + for (; anIt.more(); anIt.next()) { + aSelectionList->setSelectionType(anIt.current()->shapeTypeStr()); + aSelectionList->append(theResultBody,anIt.current()); + } + } else { + aSelectionList->setSelectionType(aShape->shapeTypeStr()); + aSelectionList->append(theResultBody,aShape); + } } } } @@ -322,8 +331,16 @@ void ExchangePlugin_ImportFeature::setMaterielGroup( aResMat != anIt->second.end(); ++aResMat) { if (aRes->get() && ((*aRes)->data()->name() == (*aResMat))) { - aSelectionList->append(theResultBody,aShape); - aSelectionList->setSelectionType(aShape->shapeTypeStr()); + if (aShape->isCompound() || aShape->isCompSolid()) { + GeomAPI_ShapeIterator anIt(aShape); + for (; anIt.more(); anIt.next()) { + aSelectionList->setSelectionType(anIt.current()->shapeTypeStr()); + aSelectionList->append(theResultBody,anIt.current()); + } + } else { + aSelectionList->setSelectionType(aShape->shapeTypeStr()); + aSelectionList->append(theResultBody,aShape); + } break; } } -- 2.39.2