#include <HYDROData_Profile.h>
#include <HYDROData_DTM.h>
#include <HYDROData_Iterator.h>
+#include <HYDROData_CalculationCase.h>
#include <Geom2d_Curve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <gp_XY.hxx>
TestViewer::showColorScale( ColorScaleIsDisp );
delete aBathPrs;
aDoc->Close();
+}
+void test_HYDROData_DTM::test_classifier_1()
+{
+ TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data();
+ fname += "/pb_1066.cbf";
+ CPPUNIT_ASSERT_EQUAL( DocError_OK, HYDROData_Document::Load( fname.ToCString(), 1 ) );
+
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
+
+ Handle(HYDROData_CalculationCase) aCase =
+ Handle(HYDROData_CalculationCase)::DownCast( aDoc->FindObjectByName( "Case_1" ) );
+ CPPUNIT_ASSERT_EQUAL( Standard_False, aCase.IsNull() );
+ std::vector<gp_XY> points;
+ 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 ) );
+
+ std::vector<double> values = aCase->GetStricklerCoefficientForPoints( points, 0.0, true );
+ CPPUNIT_ASSERT_EQUAL( 3, (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 );
+
+ aDoc->Close();
}
+
CPPUNIT_TEST( test_curve_to_3d );
CPPUNIT_TEST( test_presentation );
CPPUNIT_TEST( test_garonne );
+ CPPUNIT_TEST( test_classifier_1 );
CPPUNIT_TEST_SUITE_END();
public:
void test_curve_to_3d();
void test_presentation();
void test_garonne();
+ void test_classifier_1();
};
CPPUNIT_TEST_SUITE_REGISTRATION( test_HYDROData_DTM );