From: cg246364 Date: Fri, 18 Dec 2020 15:24:35 +0000 (+0100) Subject: #20517 : change type of group for compound or compsolid X-Git-Tag: V9_7_0a1~44^2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6114455e15bf3526f6a8e5101ec8272550d18c63;p=modules%2Fshaper.git #20517 : change type of group for compound or compsolid --- 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; } }