From: mzn Date: Thu, 19 Dec 2013 07:37:24 +0000 (+0000) Subject: Minor changes. X-Git-Tag: BR_hydro_v_0_6~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8cb714686c401bfe986d867277822a820c82a657;p=modules%2Fhydro.git Minor changes. --- diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 3e6eca6a..55273f11 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -752,24 +752,26 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, } } - GEOM::GEOM_IGroupOperations_var aGroupOp = - theGeomEngine->GetIGroupOperations( theStudy->StudyId() ); - - foreach ( const QString& aGroupName, aGroupsData.keys() ) { - QSet aGroupIndexes = aGroupsData.value( aGroupName ); - - GEOM::GEOM_Object_var aGroup = aGroupOp->CreateGroup( aMainShape, TopAbs_EDGE ); - if ( !CORBA::is_nil(aGroup) && aGroupOp->IsDone() ) { - GEOM::ListOfLong_var anIndexes = new GEOM::ListOfLong; - int aListIndex = 0; - foreach ( const int anIndex, aGroupIndexes ) { - anIndexes[aListIndex++] = anIndex; - } + if ( !aGroupsData.isEmpty() ) { + GEOM::GEOM_IGroupOperations_var aGroupOp = + theGeomEngine->GetIGroupOperations( theStudy->StudyId() ); + + foreach ( const QString& aGroupName, aGroupsData.keys() ) { + QSet aGroupIndexes = aGroupsData.value( aGroupName ); + + GEOM::GEOM_Object_var aGroup = aGroupOp->CreateGroup( aMainShape, TopAbs_EDGE ); + if ( !CORBA::is_nil(aGroup) && aGroupOp->IsDone() ) { + GEOM::ListOfLong_var anIndexes = new GEOM::ListOfLong; + int aListIndex = 0; + foreach ( const int anIndex, aGroupIndexes ) { + anIndexes[aListIndex++] = anIndex; + } - aGroupOp->UnionIDs( aGroup, anIndexes ); - if ( aGroupOp->IsDone() ) { - SALOMEDS::SObject_var aGroupSO = - theGeomEngine->AddInStudy( theStudy, aGroup, qPrintable( aName ), aMainShape ); + aGroupOp->UnionIDs( aGroup, anIndexes ); + if ( aGroupOp->IsDone() ) { + SALOMEDS::SObject_var aGroupSO = + theGeomEngine->AddInStudy( theStudy, aGroup, qPrintable( aName ), aMainShape ); + } } } }