Salome HOME
Displaying of objects corrected (Bug #359).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationOp.cxx
index 9ebcae43c9d47725d0ba35ac81e05eef135e21cc..f6bd84498bef201b439aa22cf2c74f8d8cbe49dd 100644 (file)
@@ -505,7 +505,7 @@ bool HYDROGUI_CalculationOp::processApply( int&     theUpdateFlags,
   if ( !aPanel )
     return false;
 
-  theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced;
+  theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init;
 
   return true;
 }
@@ -715,7 +715,7 @@ void HYDROGUI_CalculationOp::createPreview()
       }
 
       //Process the draw events for viewer
-      QApplication::processEvents();
+      QApplication::processEvents( QEventLoop::ExcludeUserInputEvents );
       if ( OCCViewer_ViewWindow* vw = (OCCViewer_ViewWindow*)myPreviewViewManager->getActiveView() )
         vw->onTopView();
     }
@@ -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 );