}
}
- GEOM::GEOM_IGroupOperations_var aGroupOp =
- theGeomEngine->GetIGroupOperations( theStudy->StudyId() );
-
- foreach ( const QString& aGroupName, aGroupsData.keys() ) {
- QSet<int> 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<int> 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 );
+ }
}
}
}