Salome HOME
Drawing of zones in OCC view improved.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Displayer.cxx
index 7a254ac8b191a4460bd0881d5ea345486a774703..7f91a6a9afbbab095a16aa958099b0528bd331a4 100644 (file)
@@ -27,6 +27,7 @@
 #include "HYDROGUI_Prs.h"
 #include "HYDROGUI_PrsImageDriver.h"
 #include "HYDROGUI_PrsPolylineDriver.h"
+#include "HYDROGUI_PrsZoneDriver.h"
 #include "HYDROGUI_Tool.h"
 
 #include <GraphicsView_Viewer.h>
@@ -98,7 +99,7 @@ void HYDROGUI_Displayer::DisplayAll( const int theViewerId,
                                      const bool theIsForced )
 {
   HYDROData_SequenceOfObjects aSeq;
-  HYDROGUI_Tool::GetPrsSubObjects( myModule, theViewerId, aSeq );
+  HYDROGUI_Tool::GetPrsSubObjects( myModule, aSeq );
   Update( aSeq, theViewerId, theIsForced );
 }
 
@@ -189,11 +190,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();
 }
 
@@ -235,15 +237,20 @@ HYDROGUI_PrsDriver* HYDROGUI_Displayer::getDriver( const Handle(HYDROData_Object
     {
       case KIND_IMAGE:
         aDriver = new HYDROGUI_PrsImageDriver();
-        myPrsDriversMap[ aKind ] = aDriver;
         break;
       case KIND_POLYLINE:
         aDriver = new HYDROGUI_PrsPolylineDriver();
-        myPrsDriversMap[ aKind ] = aDriver;
+        break;
+      case KIND_ZONE:
+        aDriver = new HYDROGUI_PrsZoneDriver();
         break;
       default:
         break;
     }
+
+    if ( aDriver )
+      myPrsDriversMap[ aKind ] = aDriver;
   }
+
   return aDriver;
 }