From: asl Date: Wed, 21 Oct 2015 12:35:59 +0000 (+0300) Subject: test for channel presentation X-Git-Tag: v1.5~75^2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=07ccf1206abd36c104230ae2051110e8e2bf27c0;p=modules%2Fhydro.git test for channel presentation --- diff --git a/src/HYDRO_tests/CMakeLists.txt b/src/HYDRO_tests/CMakeLists.txt index feb497da..7f1e99b1 100644 --- a/src/HYDRO_tests/CMakeLists.txt +++ b/src/HYDRO_tests/CMakeLists.txt @@ -3,6 +3,7 @@ include(ExternalFiles.cmake) set(PROJECT_HEADERS test_HYDROData_Bathymetry.h + test_HYDROData_Channel.h test_HYDROData_Document.h test_HYDROData_Entity.h test_HYDROData_Image.h @@ -16,6 +17,7 @@ set(PROJECT_HEADERS test_HYDROGUI_ListModel.h test_Dependencies.h + TestShape.h TestViewer.h TestLib_Listener.h TestLib_Runner.h @@ -23,6 +25,7 @@ set(PROJECT_HEADERS set(PROJECT_SOURCES test_HYDROData_Bathymetry.cxx + test_HYDROData_Channel.cxx test_HYDROData_Document.cxx test_HYDROData_Entity.cxx test_HYDROData_Image.cxx @@ -37,6 +40,7 @@ set(PROJECT_SOURCES test_HYDROGUI_ListModel.cxx test_Dependencies.cxx + TestShape.cxx TestViewer.cxx TestLib_Listener.cxx TestLib_Runner.cxx diff --git a/src/HYDRO_tests/TestShape.cxx b/src/HYDRO_tests/TestShape.cxx new file mode 100644 index 00000000..106ee9b5 --- /dev/null +++ b/src/HYDRO_tests/TestShape.cxx @@ -0,0 +1,43 @@ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +TopoDS_Edge Edge( const QList& theXYList, bool isClosed ) +{ + int n = theXYList.size()/2; + Handle(TColgp_HArray1OfPnt) aPointsArray = new TColgp_HArray1OfPnt( 1, n ); + for( int i=1; i<=n; i++ ) + { + double x = theXYList[2*i-2]; + double y = theXYList[2*i-1]; + gp_Pnt aPnt( x, y, 0 ); + aPointsArray->SetValue( i, aPnt ); + } + GeomAPI_Interpolate anInterpolator( aPointsArray, isClosed, 1E-3 ); + anInterpolator.Perform(); + bool aResult = anInterpolator.IsDone() == Standard_True; + if( aResult ) + { + Handle( Geom_BSplineCurve ) aCurve = anInterpolator.Curve(); + return BRepBuilderAPI_MakeEdge( aCurve ).Edge(); + } + else + return TopoDS_Edge(); +} + +TopoDS_Wire Wire( const QList& theXYList, bool isClosed ) +{ + return BRepBuilderAPI_MakeWire( Edge( theXYList, isClosed ) ).Wire(); +} + +TopoDS_Face Face( const QList& theXYList ) +{ + return BRepBuilderAPI_MakeFace( Wire( theXYList, true ), Standard_True ).Face(); +} diff --git a/src/HYDRO_tests/TestShape.h b/src/HYDRO_tests/TestShape.h new file mode 100644 index 00000000..d5bb2220 --- /dev/null +++ b/src/HYDRO_tests/TestShape.h @@ -0,0 +1,13 @@ + +#pragma once + +#include + +class TopoDS_Edge; +class TopoDS_Wire; +class TopoDS_Face; + +TopoDS_Edge Edge( const QList& theXYList, bool isClosed = false ); +TopoDS_Wire Wire( const QList& theXYList, bool isClosed = false ); +TopoDS_Face Face( const QList& theXYList ); + diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index f3bd5105..d6ae86ff 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -125,6 +125,7 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey ) { + context()->CloseLocalContext(); context()->EraseAll( Standard_False ); myKey = theKey; diff --git a/src/HYDRO_tests/reference_data/Channel.png b/src/HYDRO_tests/reference_data/Channel.png new file mode 100644 index 00000000..f30b4949 Binary files /dev/null and b/src/HYDRO_tests/reference_data/Channel.png differ diff --git a/src/HYDRO_tests/test_HYDROData_Channel.cxx b/src/HYDRO_tests/test_HYDROData_Channel.cxx new file mode 100644 index 00000000..82ca4336 --- /dev/null +++ b/src/HYDRO_tests/test_HYDROData_Channel.cxx @@ -0,0 +1,84 @@ +// 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +TopoDS_Edge Spline( const QList& theXYList, bool isClosed = false ); + +void test_HYDROData_Channel::test_2d_prs() +{ + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + + Handle(HYDROData_PolylineXY) aPolyline2d = + Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); + aPolyline2d->SetName( "polyline2d_1" ); + aPolyline2d->AddSection( "", HYDROData_IPolyline::SECTION_SPLINE, false ); + + Handle(HYDROData_Polyline3D) aPolyline3d = + Handle(HYDROData_Polyline3D)::DownCast( aDoc->CreateObject( KIND_POLYLINE ) ); + aPolyline3d->SetName( "polyline3d_1" ); + aPolyline3d->SetPolylineXY( aPolyline2d ); + + QList aCoords = QList() << 10 << 10 << 20 << 10 << 20 << 20 << 10 << 20; + TopoDS_Wire aWire = Wire( aCoords, false ); + aPolyline2d->SetShape( aWire ); + aPolyline3d->SetTopShape( aWire ); + aPolyline3d->SetShape3D( aWire ); + + Handle(HYDROData_Profile) aProfile = + Handle(HYDROData_Profile)::DownCast( aDoc->CreateObject( KIND_PROFILE ) ); + aProfile->SetName( "profile_1" ); + + QList aCoordsPr = QList() << 0.0 << 0.1 << 0.5 << 0.0 << 1.0 << 0.1; + TopoDS_Wire aWirePr = Wire( aCoordsPr, false ); + aProfile->SetTopShape( aWirePr ); + aProfile->SetShape3D( aWirePr ); + + + Handle(HYDROData_Channel) aChannel = + Handle(HYDROData_Channel)::DownCast( aDoc->CreateObject( KIND_CHANNEL ) ); + aChannel->SetName( "channel_1" ); + + aChannel->SetGuideLine( aPolyline3d ); + aChannel->SetProfile( aProfile ); + aChannel->Update(); + CPPUNIT_ASSERT_EQUAL( false, (bool)aChannel->GetTopShape().IsNull() ); + CPPUNIT_ASSERT_EQUAL( false, (bool)aChannel->GetShape3D().IsNull() ); + + TestViewer::show( aChannel->GetTopShape(), AIS_Shaded, true, "Channel" ); + TestViewer::show( aChannel->GetLeftShape(), AIS_WireFrame, true, Qt::red ); + TestViewer::show( aChannel->GetRightShape(), AIS_WireFrame, true, Qt::red ); + //TestViewer::show( aWire, AIS_Shaded, true, "Channel" ); + CPPUNIT_ASSERT_IMAGES + + aDoc->Close(); +} diff --git a/src/HYDRO_tests/test_HYDROData_Channel.h b/src/HYDRO_tests/test_HYDROData_Channel.h new file mode 100644 index 00000000..c4e22a89 --- /dev/null +++ b/src/HYDRO_tests/test_HYDROData_Channel.h @@ -0,0 +1,33 @@ +// 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include + +class test_HYDROData_Channel : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE( test_HYDROData_Channel ); + CPPUNIT_TEST( test_2d_prs ); + CPPUNIT_TEST_SUITE_END(); + +private: + +public: + void test_2d_prs(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( test_HYDROData_Channel ); +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( test_HYDROData_Channel, "HYDROData_Channel"); diff --git a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index 5726f296..5e7e8fca 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -26,12 +26,8 @@ #include #include #include -#include -#include -#include -#include -#include #include +#include #include #include #include @@ -44,40 +40,6 @@ const QString REF_DATA_PATH = qgetenv( "HYDRO_REFERENCE_DATA" ); const QString DEF_STR_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/share/salome/resources/hydro/def_strickler_table.txt"; -TopoDS_Edge Spline( const QList& theXYList, bool isClosed = false ) -{ - int n = theXYList.size()/2; - Handle(TColgp_HArray1OfPnt) aPointsArray = new TColgp_HArray1OfPnt( 1, n ); - for( int i=1; i<=n; i++ ) - { - double x = theXYList[2*i-2]; - double y = theXYList[2*i-1]; - gp_Pnt aPnt( x, y, 0 ); - aPointsArray->SetValue( i, aPnt ); - } - GeomAPI_Interpolate anInterpolator( aPointsArray, isClosed, 1E-3 ); - anInterpolator.Perform(); - bool aResult = anInterpolator.IsDone() == Standard_True; - if( aResult ) - { - Handle( Geom_BSplineCurve ) aCurve = anInterpolator.Curve(); - return BRepBuilderAPI_MakeEdge( aCurve ).Edge(); - } - else - return TopoDS_Edge(); -} - -TopoDS_Face LandCover( const QList& theXYList ) -{ - TopoDS_Edge anEdge = Spline( theXYList, true ); - if( anEdge.IsNull() ) - return TopoDS_Face(); - - TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( anEdge ).Wire(); - TopoDS_Face aFace = BRepBuilderAPI_MakeFace( aWire, Standard_True ).Face(); - return aFace; -} - void test_HYDROData_LandCoverMap::test_add_2_objects() { Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); @@ -87,10 +49,10 @@ void test_HYDROData_LandCoverMap::test_add_2_objects() CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() ); - TopoDS_Face aLC1 = LandCover( QList() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 ); + TopoDS_Face aLC1 = Face( QList() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) ); - TopoDS_Face aLC2 = LandCover( QList() << 30 << 20 << 60 << 10 << 70 << 35 << 40 << 40 ); + TopoDS_Face aLC2 = Face( QList() << 30 << 20 << 60 << 10 << 70 << 35 << 40 << 40 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "test2" ) ); TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Add_2_Objects" ); @@ -117,12 +79,12 @@ void test_HYDROData_LandCoverMap::test_split() CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() ); - TopoDS_Face aLC = LandCover( QList() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 ); + TopoDS_Face aLC = Face( QList() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC, "test1" ) ); Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); - TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( Spline( QList() << 10 << 40 << 30 << 10 << 40 << 10 << 60 << 10 ) ).Wire(); + TopoDS_Wire aWire = Wire( QList() << 10 << 40 << 30 << 10 << 40 << 10 << 60 << 10, false ); aPolyline->SetShape( aWire ); CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) ); @@ -152,12 +114,12 @@ void test_HYDROData_LandCoverMap::test_incomplete_split() CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() ); - TopoDS_Face aLC = LandCover( QList() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 ); + TopoDS_Face aLC = Face( QList() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC, "test1" ) ); Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); - TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( Spline( QList() << 10 << 40 << 30 << 10 << 40 << 10 ) ).Wire(); + TopoDS_Wire aWire = Wire( QList() << 10 << 40 << 30 << 10 << 40 << 10, false ); aPolyline->SetShape( aWire ); CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) ); @@ -184,18 +146,18 @@ void test_HYDROData_LandCoverMap::test_merge() CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() ); - TopoDS_Face aLC1 = LandCover( QList() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); + TopoDS_Face aLC1 = Face( QList() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) ); - TopoDS_Face aLC2 = LandCover( QList() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 << - 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 << - 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << - 31 << 114 ); + TopoDS_Face aLC2 = Face( QList() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 << + 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 << + 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << + 31 << 114 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "test2" ) ); - TopoDS_Face aLC3 = LandCover( QList() << 4 << 54 << 1 << 47 << 51 << 45 << - 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); + TopoDS_Face aLC3 = Face( QList() << 4 << 54 << 1 << 47 << 51 << 45 << + 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "test3" ) ); //TestViewer::show( aMap->GetShape(), AIS_Shaded, true ); @@ -229,18 +191,18 @@ void test_HYDROData_LandCoverMap::test_remove() CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() ); - TopoDS_Face aLC1 = LandCover( QList() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); + TopoDS_Face aLC1 = Face( QList() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) ); - TopoDS_Face aLC2 = LandCover( QList() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 << - 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 << - 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << - 31 << 114 ); + TopoDS_Face aLC2 = Face( QList() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 << + 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 << + 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << + 31 << 114 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "test2" ) ); - TopoDS_Face aLC3 = LandCover( QList() << 4 << 54 << 1 << 47 << 51 << 45 << - 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); + TopoDS_Face aLC3 = Face( QList() << 4 << 54 << 1 << 47 << 51 << 45 << + 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "test3" ) ); QString aType1, aType2; @@ -471,11 +433,11 @@ void test_HYDROData_LandCoverMap::test_import_dbf() // aST.size() == aDBFV.size()!! Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); - TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( Spline( QList() << 10 << 40 << 30 << 10 << 40 << 10 << 60 << 10 ) ).Wire(); + TopoDS_Wire aWire = Wire( QList() << 10 << 40 << 30 << 10 << 40 << 10 << 60 << 10 ); aPolyline->SetShape( aWire ); for (int i = 0; i < 3; i++) aMap->Add(aPolyline, ""); - TopoDS_Face aLC1 = LandCover( QList() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 ); + TopoDS_Face aLC1 = Face( QList() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) ); CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) ); @@ -503,17 +465,17 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types() Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); - TopoDS_Face aLC1 = LandCover( QList() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); + TopoDS_Face aLC1 = Face( QList() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Zones de champs cultivé à végétation basse" ) ); - TopoDS_Face aLC2 = LandCover( QList() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 << - 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 << - 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << - 31 << 114 ); + TopoDS_Face aLC2 = Face( QList() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 << + 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 << + 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << + 31 << 114 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "Zones de champs cultivé à végétation haute" ) ); - TopoDS_Face aLC3 = LandCover( QList() << 4 << 54 << 1 << 47 << 51 << 45 << - 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); + TopoDS_Face aLC3 = Face( QList() << 4 << 54 << 1 << 47 << 51 << 45 << + 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "Zones de champs, prairies, sans cultures" ) ); Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap ); @@ -535,17 +497,17 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_coeff() Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); - TopoDS_Face aLC1 = LandCover( QList() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); + TopoDS_Face aLC1 = Face( QList() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Zones de champs cultivé à végétation basse" ) ); - TopoDS_Face aLC2 = LandCover( QList() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 << - 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 << - 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << - 31 << 114 ); + TopoDS_Face aLC2 = Face( QList() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 << + 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 << + 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << + 31 << 114 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "Zones de champs cultivé à végétation haute" ) ); - TopoDS_Face aLC3 = LandCover( QList() << 4 << 54 << 1 << 47 << 51 << 45 << - 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); + TopoDS_Face aLC3 = Face( QList() << 4 << 54 << 1 << 47 << 51 << 45 << + 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "Zones de champs, prairies, sans cultures" ) ); Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap ); diff --git a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx index ee08e8bb..ff966ddc 100644 --- a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx +++ b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx @@ -28,18 +28,12 @@ #include #include +#include #include -#include -#include #include #include #include -TopoDS_Edge Spline( const QList& theXYList, bool isClosed = false ); - - - - void test_HYDROData_PolylineXY::testPolyline() { Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); @@ -98,7 +92,7 @@ void test_HYDROData_PolylineXY::testSplit_refs_624() aPolyline->SetName( "test" ); QList aCoords = QList() << 10 << 10 << 20 << 10 << 20 << 20 << 10 << 20; - TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( Spline( aCoords, true ) ).Wire(); + TopoDS_Wire aWire = Wire( aCoords, true ); aPolyline->SetShape( aWire ); gp_Pnt2d aPnt( 20, 20 );