Salome HOME
refs #1832
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_LandCoverMapPrs.cxx
index c9f09cf5f2a812879efda42d0d657b4bdaefd918..7888166a154e4fa55f84f2b97dc2b4e50d9edbe9 100644 (file)
 #include <AIS_DisplayMode.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <SelectMgr_SequenceOfOwner.hxx>
-#include <StdPrs_WFDeflectionShape.hxx>
+#include <StdPrs_WFShape.hxx>
 #include <StdSelect_BRepOwner.hxx>
 #include <TopoDS_Face.hxx>
 #include <QColor>
 #include <QString>
 
-const Quantity_Color EDGES_COLOR = Quantity_NOC_WHITE;
+const Quantity_Color EDGES_COLOR = Quantity_NOC_SLATEGRAY;
 const int HILIGHT_ISO_NB = 10;
 
-IMPLEMENT_STANDARD_HANDLE( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape )
 IMPLEMENT_STANDARD_RTTIEXT( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape )
 
 HYDROGUI_LandCoverMapPrs::HYDROGUI_LandCoverMapPrs( const Handle(HYDROData_LandCoverMap)& theMap )
@@ -79,12 +78,12 @@ void HYDROGUI_LandCoverMapPrs::UpdateColors()
   SetTransparency( myLCMap->GetTransparency() );
 }
 
-Handle(Aspect_ColorScale) HYDROGUI_LandCoverMapPrs::GetColorScale() const
+Handle(AIS_ColorScale) HYDROGUI_LandCoverMapPrs::GetColorScale() const
 {
   return myColorScale;
 }
 
-void HYDROGUI_LandCoverMapPrs::SetColorScale( const Handle(Aspect_ColorScale)& theColorScale )
+void HYDROGUI_LandCoverMapPrs::SetColorScale( const Handle(AIS_ColorScale)& theColorScale )
 {
   myColorScale = theColorScale;
   double aMin = 0, aMax = 0;
@@ -152,7 +151,7 @@ void HYDROGUI_LandCoverMapPrs::Compute( const Handle(PrsMgr_PresentationManager3
   }
 
   if( theMode==AIS_Shaded )
-    StdPrs_WFDeflectionShape::Add( thePresentation, Shape(), myDrawer );
+    StdPrs_WFShape::Add( thePresentation, Shape(), myDrawer );
 }
 
 void HYDROGUI_LandCoverMapPrs::HilightSelected( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
@@ -166,7 +165,7 @@ void HYDROGUI_LandCoverMapPrs::HilightSelected( const Handle(PrsMgr_Presentation
   {
     Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast( theOwners.Value( i ) );
     if( !anOwner.IsNull() )
-      StdPrs_WFDeflectionShape::Add( aSelectPrs, anOwner->Shape(), HilightAttributes() );
+      StdPrs_WFShape::Add( aSelectPrs, anOwner->Shape(), HilightAttributes() );
   }
 
   HilightAttributes()->UIsoAspect()->SetNumber( 0 );
@@ -178,6 +177,8 @@ void HYDROGUI_LandCoverMapPrs::HilightSelected( const Handle(PrsMgr_Presentation
 
 void HYDROGUI_LandCoverMapPrs::SetHilightAttributes( const Quantity_Color& theEdgesColor )
 {
+  if (HilightAttributes().IsNull())
+    AIS_ColoredShape::SetHilightAttributes(new Prs3d_Drawer());
   HilightAttributes()->UIsoAspect()->SetNumber( HILIGHT_ISO_NB );
   HilightAttributes()->UIsoAspect()->SetColor( theEdgesColor );
   HilightAttributes()->VIsoAspect()->SetNumber( HILIGHT_ISO_NB );