Salome HOME
refs #1825 refs #1823 refs #1819
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportBathymetryOp.cxx
index 71fd99e0d585874f4ab140e74c04f882ca237831..ed80b1d248a6bf0b3c6bb6839f85f7947f7e32f2 100644 (file)
@@ -26,6 +26,8 @@
 #include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
+#include <HYDROGUI_OCCDisplayer.h>
+
 #include <HYDROData_Bathymetry.h>
 
 #include <LightApp_Application.h>
 #include <SUIT_ViewManager.h>
 #include <SVTK_ViewModel.h>
 
+#include <OCCViewer_ViewManager.h>
 #include <QFileInfo>
 #include <QSet>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Desktop.h>
+#include <HYDROGUI_ShapeBathymetry.h>
 
 
 HYDROGUI_ImportBathymetryOp::HYDROGUI_ImportBathymetryOp( HYDROGUI_Module* theModule, 
@@ -272,6 +276,19 @@ bool HYDROGUI_ImportBathymetryOp::processApply( int& theUpdateFlags,
       aVTKMgr = module()->getApp()->viewManager( SVTK_Viewer::Type() );
     }
   }
+    
+  OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>(aViewMgr);
+  OCCViewer_Viewer* occ_viewer = mgr->getOCCViewer();
+  int aViewerId = (size_t)(occ_viewer);
+
+  HYDROGUI_Shape* aObjSh = module()->getObjectShape( aViewerId, myEditedObject );
+  HYDROGUI_ShapeBathymetry* aBathSh = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aObjSh );
+  if (aBathSh)
+  {
+    aBathSh->update(false, false);
+    aBathSh->RescaleDefault();
+    module()->getOCCDisplayer()->UpdateColorScale( occ_viewer );
+  }
 
   theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced |
     UF_VTKViewer | UF_VTK_Forced;