From a524620a331c6bc1ffbf71c55ba1bf720f7689a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Wed, 16 Dec 2020 11:00:42 +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 d4bb5d218..cf0226329 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