Salome HOME
debug of tests [colorScale]
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_DTM.cxx
index 153f3c44292eda3e1e7cfec5875706b422ef2577..b3fd50f788cc73bad2d997489398b8938b7ff55e 100644 (file)
@@ -338,7 +338,7 @@ void test_HYDROData_DTM::test_profile_discretization_polyline()
   aProfile->SetLeftPoint( gp_XY( 10, 10 ) );
   aProfile->SetRightPoint( gp_XY( 20, 20 ) );
 
-  HYDROData_DTM::CurveUZ aMid( 0.0 ), aWid( 0.0 );
+  HYDROData_DTM::CurveUZ aMid( 0.0, gp_Vec2d(), 0 ), aWid( 0.0, gp_Vec2d(), 0 );
   int dummy = 0;
   HYDROData_DTM::ProfileDiscretization( aProfile, 0.0, 0.0, 5.0, 0.5, aMid, aWid, dummy );
   CPPUNIT_ASSERT_EQUAL( 11, (int)aMid.size() );
@@ -376,7 +376,7 @@ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
   aProfile->SetLeftPoint( gp_XY( 10, 10 ) );
   aProfile->SetRightPoint( gp_XY( 20, 20 ) );
 
-  HYDROData_DTM::CurveUZ aMid( 0.0 ), aWid( 0.0 );
+  HYDROData_DTM::CurveUZ aMid( 0.0, gp_Vec2d(), 0 ), aWid( 0.0, gp_Vec2d(), 0 );
   int dummy = 0 ;
   HYDROData_DTM::ProfileDiscretization( aProfile, 0.0, 0.0, 5.0, 0.5, aMid, aWid, dummy );
   CPPUNIT_ASSERT_EQUAL( 11, (int)aMid.size() );
@@ -431,7 +431,7 @@ void operator << ( std::ostream& s, const HYDROData_DTM::CurveUZ& c )
 
 void test_HYDROData_DTM::test_curves_interpolation()
 {
-  HYDROData_DTM::CurveUZ A(1.0), B(2.0);
+  HYDROData_DTM::CurveUZ A(1.0, gp_Vec2d(), 0), B(2.0, gp_Vec2d(), 0);
   A.push_back( HYDROData_DTM::PointUZ( 0, 0 ) );
   A.push_back( HYDROData_DTM::PointUZ( 1, 1 ) );
   A.push_back( HYDROData_DTM::PointUZ( 2, 2 ) );
@@ -498,13 +498,13 @@ void test_HYDROData_DTM::test_curve_to_3d()
 
   Handle_Geom2d_BSplineCurve HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
   HYDROData_DTM::AltitudePoints points;
-  HYDROData_DTM::CurveUZ mid( 5.0, gp_Vec2d(-10,10) );
+  HYDROData_DTM::CurveUZ mid( 5.0, gp_Vec2d(-10,10), 0 );
   mid.push_back( HYDROData_DTM::PointUZ( 0, 5 ) );
   mid.push_back( HYDROData_DTM::PointUZ( 1, 6 ) );
-  HYDROData_DTM::CurveUZ wid( 5.0, gp_Vec2d(-10,10) );
+  HYDROData_DTM::CurveUZ wid( 5.0, gp_Vec2d(-10,10), 0 );
   wid.push_back( HYDROData_DTM::PointUZ( 2, 5 ) );
   wid.push_back( HYDROData_DTM::PointUZ( 6, 6 ) );
-  HYDROData_DTM::CurveTo3D( HA, mid, wid, points, 0.0 );
+  HYDROData_DTM::CurveTo3D( HA, mid, wid, points );
 
   CPPUNIT_ASSERT_EQUAL( 4, (int)points.size() );
   CPPUNIT_ASSERT_EQUAL( HYDROData_DTM::AltitudePoint( 16.380, -2.186, 6.0 ), points[0] );
@@ -590,8 +590,6 @@ void test_HYDROData_DTM::test_garonne()
 
   CPPUNIT_ASSERT_EQUAL( 11, (int)profiles.Size() );
 
-
-
   Handle(HYDROData_DTM) DTM = Handle(HYDROData_DTM)::DownCast( aDoc->CreateObject( KIND_DTM ) );
   DTM->SetProfiles( profiles );
   DTM->SetDDZ( 0.1 );
@@ -600,11 +598,13 @@ void test_HYDROData_DTM::test_garonne()
   CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, DTM->GetSpatialStep(), EPS );
   DTM->Update();
   
-  CPPUNIT_ASSERT_EQUAL( 275690, (int)DTM->GetAltitudePoints().size() ); 
-
+  CPPUNIT_ASSERT_EQUAL( 282338, (int)DTM->GetAltitudePoints().size() ); 
+  
   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();
@@ -615,7 +615,8 @@ void test_HYDROData_DTM::test_garonne()
   
   QImage aDTMPrs = draw_DTM( aBathPrs, 0.5, 600, 600 );
   CPPUNIT_ASSERT_IMAGES2( &aDTMPrs, "DTM_2" );
+  TestViewer::showColorScale( ColorScaleIsDisp );
   delete aBathPrs;
-
   aDoc->Close();
+
 }