Salome HOME
Displaying of objects corrected (Bug #359).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationOp.cxx
index 377e821bd26123f93e0aed521f49c743bc0f86ac..f6bd84498bef201b439aa22cf2c74f8d8cbe49dd 100644 (file)
@@ -797,8 +797,15 @@ void HYDROGUI_CalculationOp::setAvailableGroups()
       aGroupsNames.append( aGroup->GetName() );
     }
   }
-  if( myEditedObject->IsMustBeUpdated() )
-    myEditedObject->RemoveGeometryGroups();
+  if( myEditedObject->IsMustBeUpdated() ) {
+    for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ ) {
+      Handle(HYDROData_ShapesGroup) aGeomGroup =
+        Handle(HYDROData_ShapesGroup)::DownCast( aSeq.Value( anIndex ) );
+      if ( !aGeomGroup.IsNull() && !aGroupsNames.contains( aGeomGroup->GetName() ) ) {
+        myEditedObject->RemoveGeometryGroup( aGeomGroup );
+      }
+    }
+  }
 
   aPanel->setAvailableGroups( aGroupsNames );
   aPanel->includeGroups( aList );