]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Minor changes.
authormzn <mzn@opencascade.com>
Thu, 19 Dec 2013 07:37:24 +0000 (07:37 +0000)
committermzn <mzn@opencascade.com>
Thu, 19 Dec 2013 07:37:24 +0000 (07:37 +0000)
src/HYDROData/HYDROData_CalculationCase.cxx

index 3e6eca6a46c42a9e299b36d8730efcadef9819c4..55273f11a7b4894509101b9653e7ada00b1f92fa 100644 (file)
@@ -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<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 );
+        }
       }
     }
   }