Salome HOME
Merge branch 'BR_HYDRO_IMPS_2016' of ssh://gitolite3@git.salome-platform.org/modules...
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_DTM.cxx
index 66547b5e7b219dad8730e955c5684129e679c710..fb60fbae955106161263e3661e0cf8a4922a4d84 100644 (file)
@@ -31,7 +31,7 @@
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_PointCloud.hxx>
 #include <HYDROGUI_ShapeBathymetry.h>
-#include <Aspect_ColorScale.hxx>
+#include <AIS_ColorScale.hxx>
 #include <QGraphicsItem>
 #include <QGraphicsScene>
 #include <QGraphicsView>
@@ -201,7 +201,7 @@ void test_HYDROData_DTM::test_hydraulic_axis()
   profiles.push_back( aProfile2 );
   profiles.push_back( aProfile3 );
 
-  Handle_Geom2d_BSplineCurve HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
+  Handle(Geom2d_BSplineCurve) HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
   CPPUNIT_ASSERT_EQUAL( false, (bool)HA.IsNull() );
   CPPUNIT_ASSERT_EQUAL( 3, (int)distances.size() );
 
@@ -245,8 +245,8 @@ void test_HYDROData_DTM::test_profile_conversion_to_2d()
          aUMin2 = aUMin1,
          aUMax2 = aUMax1;
   gp_Vec2d aProfileDir;
-  std::vector<Handle_Geom2d_Curve> curves1 = HYDROData_DTM::ProfileToParametric( aProfile1, aUMin1, aUMax1, aProfileDir );
-  std::vector<Handle_Geom2d_Curve> curves2 = HYDROData_DTM::ProfileToParametric( aProfile2, aUMin2, aUMax2, aProfileDir );
+  std::vector<Handle(Geom2d_Curve)> curves1 = HYDROData_DTM::ProfileToParametric( aProfile1, aUMin1, aUMax1, aProfileDir );
+  std::vector<Handle(Geom2d_Curve)> curves2 = HYDROData_DTM::ProfileToParametric( aProfile2, aUMin2, aUMax2, aProfileDir );
 
   gp_Pnt2d aFirst, aLast;
   CPPUNIT_ASSERT_EQUAL( 3, (int)curves1.size() );
@@ -497,7 +497,7 @@ void test_HYDROData_DTM::test_curve_to_3d()
   profiles.push_back( aProfile1 );
   profiles.push_back( aProfile2 );
 
-  Handle_Geom2d_BSplineCurve HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
+  Handle(Geom2d_BSplineCurve) HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
   HYDROData_DTM::AltitudePoints points;
   HYDROData_DTM::CurveUZ mid( 5.0, gp_Vec2d(-10,10), 0 );
   mid.push_back( HYDROData_DTM::PointUZ( 0, 5 ) );
@@ -550,13 +550,13 @@ void test_HYDROData_DTM::test_presentation()
   
   CPPUNIT_ASSERT_EQUAL( 9177, (int)DTM->GetAltitudePoints().size() ); 
 
-  Handle_AIS_InteractiveContext aContext = TestViewer::context();
+  Handle(AIS_InteractiveContext) aContext = TestViewer::context();
   HYDROGUI_ShapeBathymetry* aBathPrs = new HYDROGUI_ShapeBathymetry( 0, aContext, DTM );
   aBathPrs->update( true, false );
 
   bool ColorScaleIsDisp = TestViewer::ColorScaleIsDisplayed();
   TestViewer::showColorScale( true );
-  Handle_Aspect_ColorScale aCS = TestViewer::colorScale();
+  Handle(AIS_ColorScale) aCS = TestViewer::colorScale();
   aCS->SetMin( 0.0 );
   aCS->SetMax( 5.0 );
   aCS->SetNumberOfIntervals( 10 );
@@ -603,14 +603,14 @@ void test_HYDROData_DTM::test_garonne()
   
   CPPUNIT_ASSERT_EQUAL( 282338, (int)DTM->GetAltitudePoints().size() ); 
   
-  Handle_AIS_InteractiveContext aContext = TestViewer::context();
+  Handle(AIS_InteractiveContext) aContext = TestViewer::context();
   HYDROGUI_ShapeBathymetry* aBathPrs = new HYDROGUI_ShapeBathymetry( 0, aContext, DTM );
   aBathPrs->update( true, false );
   
   bool ColorScaleIsDisp = TestViewer::ColorScaleIsDisplayed();
 
   TestViewer::showColorScale( true );
-  Handle_Aspect_ColorScale aCS = TestViewer::colorScale();
+  Handle(AIS_ColorScale) aCS = TestViewer::colorScale();
   aCS->SetMin( 0.0 );
   aCS->SetMax( 25.0 );
   aCS->SetNumberOfIntervals( 30 );
@@ -638,18 +638,27 @@ void test_HYDROData_DTM::test_classifier_1()
   points.push_back( gp_XY( 43.4842, 3.33176  ) );
   points.push_back( gp_XY( -125.777, 2.24728 ) );
   points.push_back( gp_XY( -60.1628, 168.262 ) );
+  points.push_back( gp_XY( 21.8055587645, 154.699344457 ) );
+  points.push_back( gp_XY( -84.4764138524, 79.2606012276 ) );
+  points.push_back( gp_XY( -73.4132070504, 69.7096313266 ) );
 
   std::vector<double> values = aCase->GetStricklerCoefficientForPoints( points, 0.0, true );
-  CPPUNIT_ASSERT_EQUAL( 3, (int)values.size() );
+  CPPUNIT_ASSERT_EQUAL( 6, (int)values.size() );
   CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0123, values[0], EPS );
   CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0123, values[1], EPS );
   CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0221, values[2], EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0123, values[3], EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0123, values[4], EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0123, values[5], EPS );
 
   std::vector<int> types = aCase->GetStricklerTypeForPoints( points );
-  CPPUNIT_ASSERT_EQUAL( 3, (int)types.size() );
+  CPPUNIT_ASSERT_EQUAL( 6, (int)types.size() );
   CPPUNIT_ASSERT_EQUAL( 123, types[0] );
   CPPUNIT_ASSERT_EQUAL( 123, types[1] );
   CPPUNIT_ASSERT_EQUAL( 221, types[2] );
+  CPPUNIT_ASSERT_EQUAL( 123, types[3] );
+  CPPUNIT_ASSERT_EQUAL( 123, types[4] );
+  CPPUNIT_ASSERT_EQUAL( 123, types[5] );
 
   aDoc->Close();
 }