Salome HOME
Fix for the bug #255: VTK viewer is not updated after modification of objects.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_OCCDisplayer.cxx
index 51dfa2f38e6a04d08a3132b10cae89a69c08e8d2..39810702fbeaccabbfdbc72d8898469c6b6a041b 100644 (file)
@@ -89,6 +89,7 @@ void HYDROGUI_OCCDisplayer::Erase( const HYDROData_SequenceOfObjects& theObjs,
 
     module()->removeObjectShape( (size_t)aViewer, anObj );
   }
+  aViewer->update();
 }
 
 HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int                             theViewerId,
@@ -99,14 +100,7 @@ HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int
   if ( theContext.IsNull() || theObject.IsNull() )
     return aResShape;
 
-  ObjectKind anObjectKind = theObject->GetKind();
-  if ( anObjectKind != KIND_IMAGE &&
-       anObjectKind != KIND_POLYLINEXY &&
-       anObjectKind != KIND_IMMERSIBLE_ZONE &&
-       anObjectKind != KIND_REGION &&
-       anObjectKind != KIND_ZONE &&
-       anObjectKind != KIND_OBSTACLE &&
-       anObjectKind != KIND_PROFILE )
+  if ( !HYDROGUI_Tool::IsObjectHasPresentation( theObject, OCCViewer_Viewer::Type() ) )
     return aResShape;
 
   aResShape = new HYDROGUI_Shape( theContext, theObject );