Salome HOME
Dump Image data to python script (Feature #13).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Displayer.cxx
index 2947e10a268274091462ab55cef8b7cbed827839..d979bfbea840e1bba3529214336400ff9f6c07f8 100644 (file)
@@ -26,6 +26,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Prs.h"
 #include "HYDROGUI_PrsImageDriver.h"
+#include "HYDROGUI_PrsPolylineDriver.h"
 #include "HYDROGUI_Tool.h"
 
 #include <GraphicsView_Viewer.h>
@@ -96,13 +97,9 @@ void HYDROGUI_Displayer::EraseAll( const int theViewerId )
 void HYDROGUI_Displayer::DisplayAll( const int theViewerId,
                                      const bool theIsForced )
 {
-  HYDROGUI_DataModel* aModel = (HYDROGUI_DataModel*)myModule->dataModel();
-  if( aModel ) 
-  {
-    HYDROData_SequenceOfObjects aSeq;
-    HYDROGUI_Tool::GetPrsSubObjects( aModel, theViewerId, aSeq );
-    Update( aSeq, theViewerId, theIsForced );
-  }
+  HYDROData_SequenceOfObjects aSeq;
+  HYDROGUI_Tool::GetPrsSubObjects( myModule, aSeq );
+  Update( aSeq, theViewerId, theIsForced );
 }
 
 void HYDROGUI_Displayer::Update( const HYDROData_SequenceOfObjects& theObjs,
@@ -192,11 +189,12 @@ void HYDROGUI_Displayer::Display( const HYDROData_SequenceOfObjects& theObjs,
 
     if( aPrs )
     {
-      bool anIsVisible = anObj->GetVisibility();
+      bool anIsVisible = myModule->isObjectVisible( (size_t)aViewer, anObj );
       aPrs->setVisible( anIsVisible );
     }
   }
 
+  aViewPort->onBoundingRectChanged(); // specific of HYDRO module
   aViewPort->fitAll();
 }
 
@@ -240,6 +238,10 @@ HYDROGUI_PrsDriver* HYDROGUI_Displayer::getDriver( const Handle(HYDROData_Object
         aDriver = new HYDROGUI_PrsImageDriver();
         myPrsDriversMap[ aKind ] = aDriver;
         break;
+      case KIND_POLYLINE:
+        aDriver = new HYDROGUI_PrsPolylineDriver();
+        myPrsDriversMap[ aKind ] = aDriver;
+        break;
       default:
         break;
     }