]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #461: hide scalar bar if no bathymetry presentation
authorasl <asl@opencascade.com>
Thu, 18 Sep 2014 05:34:04 +0000 (05:34 +0000)
committerasl <asl@opencascade.com>
Thu, 18 Sep 2014 05:34:04 +0000 (05:34 +0000)
src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx
src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.h

index 97815262b84980fb0a757efdcbcd4ab17f9c0ca1..00009b4792bf596416698b75d8e24e893ad370e8 100644 (file)
@@ -90,6 +90,43 @@ void HYDROGUI_VTKPrsDisplayer::SetToUpdate( const HYDROData_SequenceOfObjects& t
   }
 }
 
+void HYDROGUI_VTKPrsDisplayer::DisplayAll( const int theViewerId,
+                                           const bool theIsForced,
+                                           const bool theDoFitAll )
+{
+  HYDROGUI_AbstractDisplayer::DisplayAll( theViewerId, theIsForced, theDoFitAll );
+
+  bool isEraseScalarBar = true;
+
+  SVTK_Viewer* aViewer = module()->getVTKViewer( theViewerId );
+  if( aViewer )
+  {
+    SALOME_ListIO aListIO;
+    aViewer->GetVisible( aListIO );
+    
+    HYDROGUI_VTKPrs* aPrs;
+    SALOME_ListIteratorOfListIO anIter( aListIO );
+    for( ; anIter.More(); anIter.Next() )
+    {
+      Handle(SALOME_InteractiveObject) aPrsObj = anIter.Value();
+      if ( !aPrsObj.IsNull() )
+      {
+        Handle(HYDROData_Entity) anObj = 
+          module()->getDataModel()->objectByEntry( aPrsObj->getEntry() );
+        aPrs = module()->getObjectVTKPrs( (size_t)aViewer, anObj );
+        if( aPrs->needScalarBar() )
+        {
+          isEraseScalarBar = false;
+          break;
+        }
+      }
+    }
+  }
+
+  if( isEraseScalarBar )
+    EraseScalarBar( theViewerId );
+}
+
 void HYDROGUI_VTKPrsDisplayer::EraseAll( const int theViewerId )
 {
   SVTK_Viewer* aViewer = module()->getVTKViewer( theViewerId );
index 66e2f75111e7c47356c5178e309c620d0bbb5105..def7b8a4a0c8f8deee3d4b38560ad46bfd37b257 100644 (file)
@@ -78,6 +78,11 @@ public:
   void             EraseScalarBar( const int theViewerId, const bool theIsDelete = false );
 
 protected:
+
+  virtual void     DisplayAll( const int theViewerId,
+                               const bool theIsForced,
+                               const bool theDoFitAll );
+
   /**
    * \brief Erase all viewer objects.
    * \param theViewerId viewer identifier