Salome HOME
Fix for the bug #45: check and warning when the same image is used in 2 arguments.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Displayer.cxx
index d42b31423cc094855c8bf18a243f2a7626bf62de..548f5e47953bf70b5ac697f2499f2718aaa39bec 100644 (file)
@@ -108,6 +108,7 @@ void HYDROGUI_Displayer::Erase( const HYDROData_SequenceOfObjects& theObjs,
       if( HYDROGUI_Prs* aPrs = HYDROGUI_Tool::GetPresentation( anObj, anObjectList ) )
       {
         aViewPort->removeItem( aPrs );
+        anObjectList.removeAll( aPrs );
         delete aPrs;
       }
     }
@@ -116,7 +117,8 @@ void HYDROGUI_Displayer::Erase( const HYDROData_SequenceOfObjects& theObjs,
 
 void HYDROGUI_Displayer::Display( const HYDROData_SequenceOfObjects& theObjs,
                                   const int theViewerId,
-                                  const bool theIsForced )
+                                  const bool theIsForced,
+                                  const bool theDoFitAll)
 {
   GraphicsView_Viewer* aViewer = module()->getViewer( theViewerId );
   if( !aViewer )
@@ -154,7 +156,10 @@ void HYDROGUI_Displayer::Display( const HYDROData_SequenceOfObjects& theObjs,
   }
 
   aViewPort->onBoundingRectChanged(); // specific of HYDRO module
-  aViewPort->fitAll();
+  if ( theDoFitAll )
+  {
+    aViewPort->fitAll();
+  }
 }
 
 void HYDROGUI_Displayer::purgeObjects( const int theViewerId )
@@ -196,7 +201,7 @@ HYDROGUI_PrsDriver* HYDROGUI_Displayer::getDriver( const Handle(HYDROData_Entity
       case KIND_IMAGE:
         aDriver = new HYDROGUI_PrsImageDriver();
         break;
-      case KIND_POLYLINE:
+      case KIND_POLYLINEXY:
         aDriver = new HYDROGUI_PrsPolylineDriver();
         break;
       case KIND_ZONE:
@@ -212,3 +217,8 @@ HYDROGUI_PrsDriver* HYDROGUI_Displayer::getDriver( const Handle(HYDROData_Entity
 
   return aDriver;
 }
+
+QString HYDROGUI_Displayer::GetType() const
+{
+  return GraphicsView_Viewer::Type();
+}