Salome HOME
refs #1327: debug of scaling operations
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ShapeLandCoverMap.cxx
index 0a6b59abe3394840719ac12413ed4943f8e4c2c0..3446545e3db4973a5ed49219077f8079eaa82aa3 100644 (file)
@@ -34,7 +34,7 @@
 
 HYDROGUI_ShapeLandCoverMap::HYDROGUI_ShapeLandCoverMap( HYDROGUI_OCCDisplayer* theDisplayer,
                                                         const Handle(AIS_InteractiveContext)& theContext,
-                                                        const Handle_HYDROData_LandCoverMap&  theLandCoverMap,
+                                                        const Handle(HYDROData_LandCoverMap)& theLandCoverMap,
                                                         const int                             theZLayer,
                                                         const bool                            theIsScalarMode )
 : HYDROGUI_Shape( theContext, theLandCoverMap, theZLayer ),
@@ -91,7 +91,7 @@ void HYDROGUI_ShapeLandCoverMap::displayShape( const bool theIsUpdateViewer )
   myDisplayer->SetToUpdateColorScale();
 }
 
-Handle_AIS_InteractiveObject HYDROGUI_ShapeLandCoverMap::createShape() const
+Handle(AIS_InteractiveObject) HYDROGUI_ShapeLandCoverMap::createShape() const
 {
   Handle(HYDROData_LandCoverMap) aLandCoverMap = Handle(HYDROData_LandCoverMap)::DownCast( getObject() );
   if ( !aLandCoverMap.IsNull() )
@@ -115,13 +115,7 @@ Handle_AIS_InteractiveObject HYDROGUI_ShapeLandCoverMap::createShape() const
             aLandCoverMapPrs->SetTable( aTable );
 
           // Set color scale
-          OCCViewer_ViewWindow* aWnd = dynamic_cast<OCCViewer_ViewWindow*>( aViewer->getViewManager()->getActiveView() );
-          Handle(V3d_View) aView = aWnd->getViewPort()->getView();
-          if( !aView.IsNull() )
-          {
-            Handle(Aspect_ColorScale) aColorScale = aView->ColorScale();
-            aLandCoverMapPrs->SetColorScale( aColorScale );
-          }
+          aLandCoverMapPrs->SetColorScale( myDisplayer->GetColorScale( aViewerId) );
         }
       }
     }