Salome HOME
Porting on OCCT 7.0 and Qt 5. Make compilable version.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ShapeBathymetry.cxx
index 5763843592c37e8823c1693ced4aa78d6eac9354..72150112d50b35710a8ccfecce7fafe66ebba4c7 100644 (file)
@@ -1,12 +1,8 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include <HYDROData_Bathymetry.h>
 
 #include <AIS_InteractiveContext.hxx>
-#include <AIS_Drawer.hxx>
-#include <Aspect_ColorScale.hxx>
+#include <AIS_ColorScale.hxx>
 #include <Prs3d_PointAspect.hxx>
 
 HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer*                theDisplayer,
                                                     const Handle(AIS_InteractiveContext)& theContext,
-                                                    const Handle_HYDROData_Bathymetry&    theBathymetry,
+                                                    const Handle(HYDROData_Bathymetry)&   theBathymetry,
                                                     const int                             theZLayer )
 : HYDROGUI_Shape( theContext, theBathymetry, theZLayer ),
   myDisplayer( theDisplayer )
 {
+  setDisplayMode( AIS_PointCloud::DM_Points );
 }
 
 HYDROGUI_ShapeBathymetry::~HYDROGUI_ShapeBathymetry()
@@ -62,13 +58,16 @@ void HYDROGUI_ShapeBathymetry::update( bool theIsUpdateViewer, bool isDeactivate
 }
 
 
-Handle_AIS_InteractiveObject HYDROGUI_ShapeBathymetry::createShape() const
+Handle(AIS_InteractiveObject) HYDROGUI_ShapeBathymetry::createShape() const
 {
-  Handle_HYDROData_Bathymetry aBath = Handle_HYDROData_Bathymetry::DownCast( getObject() );
+  Handle(AIS_InteractiveObject) aPntCloud;
+
+  Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( getObject() );
   if( !aBath.IsNull() )
   {
-    Handle_AIS_PointCloud aPntCloud = new HYDROGUI_BathymetryPrs();
-    aPntCloud->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 1.0));
+    aPntCloud = new HYDROGUI_BathymetryPrs();
+    aPntCloud->SetHilightMode( AIS_PointCloud::DM_BndBox );
+    aPntCloud->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 2.0));
 
     const HYDROData_Bathymetry::AltitudePoints& aBathPoints = aBath->GetAltitudePoints();
     int aLower = aBathPoints.Lower();
@@ -79,11 +78,9 @@ Handle_AIS_InteractiveObject HYDROGUI_ShapeBathymetry::createShape() const
     aThat->myColors = new Quantity_HArray1OfColor( aLower, anUpper );
     for( int i=aLower; i<=anUpper; i++ )
       aThat->myCoords->SetValue( i, aBathPoints.Value( i ) );
-
-    return aPntCloud;
   }
-  else
-    return Handle_AIS_InteractiveObject();
+
+  return aPntCloud;
 }
 
 void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const
@@ -105,7 +102,7 @@ void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const
   }
 }
 
-void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(Aspect_ColorScale)& theColorScale )
+void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale)& theColorScale )
 {
   for( int i=myCoords->Lower(), n=myCoords->Upper(); i<=n; i++ )
   {
@@ -114,7 +111,7 @@ void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(Aspect_ColorSc
     theColorScale->FindColor( z, aColor );
     myColors->SetValue( i, aColor );
   }
-  Handle_AIS_PointCloud aPntCloud = Handle_AIS_PointCloud::DownCast( getAISObject() );
+  Handle(AIS_PointCloud) aPntCloud = Handle(AIS_PointCloud)::DownCast( getAISObject() );
   aPntCloud->SetPoints( myCoords, myColors );
   getContext()->Redisplay( aPntCloud, Standard_False );
 }