1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include <test_HYDROData_LandCoverMap.h>
20 #include <HYDROData_Document.h>
21 #include <HYDROData_LandCoverMap.h>
22 #include <HYDROData_PolylineXY.h>
23 #include <HYDROData_StricklerTable.h>
24 #include <HYDROData_Tool.h>
25 #include <HYDROGUI_LandCoverMapPrs.h>
26 #include <TopoDS_Edge.hxx>
27 #include <TopoDS_Wire.hxx>
28 #include <TopoDS_Face.hxx>
29 #include <TColgp_HArray1OfPnt.hxx>
30 #include <GeomAPI_Interpolate.hxx>
31 #include <BRepBuilderAPI_MakeEdge.hxx>
32 #include <BRepBuilderAPI_MakeFace.hxx>
33 #include <BRepBuilderAPI_MakeWire.hxx>
34 #include <TestViewer.h>
35 #include <TopTools_ListOfShape.hxx>
36 #include <AIS_DisplayMode.hxx>
37 #include <Aspect_ColorScale.hxx>
41 #include <BRepTools.hxx>
42 #include <BRep_Builder.hxx>
44 const QString REF_DATA_PATH = qgetenv( "HYDRO_REFERENCE_DATA" );
45 const QString DEF_STR_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/share/salome/resources/hydro/def_strickler_table.txt";
47 TopoDS_Edge Spline( const QList<double>& theXYList, bool isClosed = false )
49 int n = theXYList.size()/2;
50 Handle(TColgp_HArray1OfPnt) aPointsArray = new TColgp_HArray1OfPnt( 1, n );
51 for( int i=1; i<=n; i++ )
53 double x = theXYList[2*i-2];
54 double y = theXYList[2*i-1];
55 gp_Pnt aPnt( x, y, 0 );
56 aPointsArray->SetValue( i, aPnt );
58 GeomAPI_Interpolate anInterpolator( aPointsArray, isClosed, 1E-3 );
59 anInterpolator.Perform();
60 bool aResult = anInterpolator.IsDone() == Standard_True;
63 Handle( Geom_BSplineCurve ) aCurve = anInterpolator.Curve();
64 return BRepBuilderAPI_MakeEdge( aCurve ).Edge();
70 TopoDS_Face LandCover( const QList<double>& theXYList )
72 TopoDS_Edge anEdge = Spline( theXYList, true );
76 TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( anEdge ).Wire();
77 TopoDS_Face aFace = BRepBuilderAPI_MakeFace( aWire, Standard_True ).Face();
81 void test_HYDROData_LandCoverMap::test_add_2_objects()
83 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
85 Handle(HYDROData_LandCoverMap) aMap =
86 Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
88 CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() );
90 TopoDS_Face aLC1 = LandCover( QList<double>() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 );
91 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) );
93 TopoDS_Face aLC2 = LandCover( QList<double>() << 30 << 20 << 60 << 10 << 70 << 35 << 40 << 40 );
94 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "test2" ) );
96 TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Add_2_Objects" );
99 HYDROData_LandCoverMap::Iterator anIt( aMap );
100 CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
101 CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
103 CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
104 CPPUNIT_ASSERT_EQUAL( QString( "test2" ), anIt.StricklerType() );
106 CPPUNIT_ASSERT_EQUAL( false, anIt.More() );
111 void test_HYDROData_LandCoverMap::test_split()
113 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
115 Handle(HYDROData_LandCoverMap) aMap =
116 Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
118 CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() );
120 TopoDS_Face aLC = LandCover( QList<double>() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 );
121 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC, "test1" ) );
123 Handle(HYDROData_PolylineXY) aPolyline =
124 Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) );
125 TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( Spline( QList<double>() << 10 << 40 << 30 << 10 << 40 << 10 << 60 << 10 ) ).Wire();
126 aPolyline->SetShape( aWire );
128 CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) );
130 TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Split_1" );
131 TestViewer::show( aWire, 0, true, Qt::blue );
132 CPPUNIT_ASSERT_IMAGES
134 HYDROData_LandCoverMap::Iterator anIt( aMap );
135 CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
136 CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
138 CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
139 CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
141 CPPUNIT_ASSERT_EQUAL( false, anIt.More() );
146 void test_HYDROData_LandCoverMap::test_incomplete_split()
148 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
150 Handle(HYDROData_LandCoverMap) aMap =
151 Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
153 CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() );
155 TopoDS_Face aLC = LandCover( QList<double>() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 );
156 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC, "test1" ) );
158 Handle(HYDROData_PolylineXY) aPolyline =
159 Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) );
160 TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( Spline( QList<double>() << 10 << 40 << 30 << 10 << 40 << 10 ) ).Wire();
161 aPolyline->SetShape( aWire );
163 CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) );
165 TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Split_2" );
166 TestViewer::show( aWire, 0, true, Qt::green );
167 CPPUNIT_ASSERT_IMAGES
169 HYDROData_LandCoverMap::Iterator anIt( aMap );
170 CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
171 CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
173 CPPUNIT_ASSERT_EQUAL( false, anIt.More() );
178 void test_HYDROData_LandCoverMap::test_merge()
180 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
182 Handle(HYDROData_LandCoverMap) aMap =
183 Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
185 CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() );
187 TopoDS_Face aLC1 = LandCover( QList<double>() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 );
189 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) );
191 TopoDS_Face aLC2 = LandCover( QList<double>() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 <<
192 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 <<
193 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 <<
195 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "test2" ) );
197 TopoDS_Face aLC3 = LandCover( QList<double>() << 4 << 54 << 1 << 47 << 51 << 45 <<
198 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 );
199 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "test3" ) );
201 //TestViewer::show( aMap->GetShape(), AIS_Shaded, true );
202 //TestViewer::AssertEqual( "LandCoverMap_Before_Merge" );
204 //BRepTools::Write( aMap->GetShape(), "c:\\map.brep" );
206 QString aType1, aType2;
207 gp_Pnt2d aPnt1( 25, 35 );
208 gp_Pnt2d aPnt2( 45, 55 );
209 //gp_Pnt2d aPnt3( 45, 10 );
210 //gp_Pnt2d aPnt4( 45, 80 );
211 TopTools_ListOfShape aList;
212 aList.Append( aMap->FindByPoint( aPnt1, aType1 ) );
213 aList.Append( aMap->FindByPoint( aPnt2, aType2 ) );
214 CPPUNIT_ASSERT_EQUAL( true, aMap->Merge( aList, "new" ) );
216 TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Merge_1" );
217 //TestViewer::show( BRepBuilderAPI_MakeEdge( gp_Pnt(aPnt1.X(), aPnt1.Y(), 0), gp_Pnt(aPnt2.X(), aPnt2.Y(), 0) ).Edge(), QColor( Qt::blue ), AIS_Shaded );
218 CPPUNIT_ASSERT_IMAGES
223 void test_HYDROData_LandCoverMap::test_remove()
225 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
227 Handle(HYDROData_LandCoverMap) aMap =
228 Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
230 CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() );
232 TopoDS_Face aLC1 = LandCover( QList<double>() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 );
234 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) );
236 TopoDS_Face aLC2 = LandCover( QList<double>() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 <<
237 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 <<
238 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 <<
240 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "test2" ) );
242 TopoDS_Face aLC3 = LandCover( QList<double>() << 4 << 54 << 1 << 47 << 51 << 45 <<
243 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 );
244 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "test3" ) );
246 QString aType1, aType2;
247 gp_Pnt2d aPnt1( 25, 35 );
248 gp_Pnt2d aPnt2( 45, 55 );
249 TopTools_ListOfShape aList;
250 aList.Append( aMap->FindByPoint( aPnt1, aType1 ) );
251 aList.Append( aMap->FindByPoint( aPnt2, aType2 ) );
252 CPPUNIT_ASSERT_EQUAL( true, aMap->Remove( aList ) );
254 TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Remove_1" );
255 CPPUNIT_ASSERT_IMAGES
260 void test_HYDROData_LandCoverMap::test_merge_faces_boxes()
262 TopoDS_Shape pp1, pp2, pp3, pp4;
264 BRepTools::Read(pp1, (REF_DATA_PATH + "/pp1.brep").toStdString().c_str(), BB);
265 BRepTools::Read(pp2, (REF_DATA_PATH + "/pp2.brep").toStdString().c_str(), BB);
266 BRepTools::Read(pp3, (REF_DATA_PATH + "/pp3.brep").toStdString().c_str(), BB);
267 BRepTools::Read(pp4, (REF_DATA_PATH + "/pp4.brep").toStdString().c_str(), BB);
269 CPPUNIT_ASSERT(!pp1.IsNull());
270 CPPUNIT_ASSERT(!pp2.IsNull());
271 CPPUNIT_ASSERT(!pp3.IsNull());
272 CPPUNIT_ASSERT(!pp4.IsNull());
274 //Test mergeFaces() func // boxes // USD == true
276 TopTools_ListOfShape Faces;
279 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
280 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs11" );
281 CPPUNIT_ASSERT_IMAGES
282 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_FACE);
285 TopTools_ListOfShape Faces;
288 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
289 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs12" );
290 CPPUNIT_ASSERT_IMAGES
291 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
294 TopTools_ListOfShape Faces;
298 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
299 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs13" );
300 CPPUNIT_ASSERT_IMAGES
301 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
304 TopTools_ListOfShape Faces;
309 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
310 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs14" );
311 CPPUNIT_ASSERT_IMAGES
312 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_FACE);
316 //Test mergeFaces() func // boxes // USD == false
318 TopTools_ListOfShape Faces;
321 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
322 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs21" );
323 CPPUNIT_ASSERT_IMAGES
324 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
327 TopTools_ListOfShape Faces;
330 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
331 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs22" );
332 CPPUNIT_ASSERT_IMAGES
333 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
336 TopTools_ListOfShape Faces;
340 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
341 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs23" );
342 CPPUNIT_ASSERT_IMAGES
343 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
346 TopTools_ListOfShape Faces;
351 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
352 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs24" );
353 CPPUNIT_ASSERT_IMAGES
354 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
359 void test_HYDROData_LandCoverMap::test_merge_faces_circles()
361 TopoDS_Shape ff1, ff2, ff3;
363 BRepTools::Read(ff1, (REF_DATA_PATH + "/ff1.brep").toStdString().c_str(), BB);
364 BRepTools::Read(ff2, (REF_DATA_PATH + "/ff2.brep").toStdString().c_str(), BB);
365 BRepTools::Read(ff3, (REF_DATA_PATH + "/ff3.brep").toStdString().c_str(), BB);
367 CPPUNIT_ASSERT(!ff1.IsNull());
368 CPPUNIT_ASSERT(!ff2.IsNull());
369 CPPUNIT_ASSERT(!ff3.IsNull());
371 //Test mergeFaces() func // circles // USD == true
373 TopTools_ListOfShape Faces;
376 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
377 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs11_c" );
378 CPPUNIT_ASSERT_IMAGES
379 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_FACE);
382 TopTools_ListOfShape Faces;
385 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
386 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs12_c" );
387 CPPUNIT_ASSERT_IMAGES
388 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
391 TopTools_ListOfShape Faces;
395 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
396 TestViewer::show( aMergedFace, AIS_Shaded, true, "_cs13" );
397 CPPUNIT_ASSERT_IMAGES
398 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
401 TopTools_ListOfShape Faces;
405 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
406 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs14_c" );
407 CPPUNIT_ASSERT_IMAGES
408 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
412 //Test mergeFaces() func // circles // USD == false
414 TopTools_ListOfShape Faces;
417 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
418 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs21_c" );
419 CPPUNIT_ASSERT_IMAGES
420 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
423 TopTools_ListOfShape Faces;
426 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
427 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs22_c" );
428 CPPUNIT_ASSERT_IMAGES
429 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
432 TopTools_ListOfShape Faces;
436 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
437 TestViewer::show( aMergedFace, AIS_Shaded, true, "_cs23" );
438 CPPUNIT_ASSERT_IMAGES
439 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
442 TopTools_ListOfShape Faces;
446 TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
447 TestViewer::show( aMergedFace, AIS_Shaded, true, "cs24_c" );
448 CPPUNIT_ASSERT_IMAGES
449 CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
453 void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types()
455 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
457 Handle(HYDROData_StricklerTable) aTable =
458 Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) );
459 CPPUNIT_ASSERT_EQUAL( true, aTable->Import( DEF_STR_PATH ) );
461 Handle(HYDROData_LandCoverMap) aMap =
462 Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
464 TopoDS_Face aLC1 = LandCover( QList<double>() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 );
465 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Zones de champs cultivé à végétation basse" ) );
467 TopoDS_Face aLC2 = LandCover( QList<double>() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 <<
468 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 <<
469 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 <<
471 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "Zones de champs cultivé à végétation haute" ) );
473 TopoDS_Face aLC3 = LandCover( QList<double>() << 4 << 54 << 1 << 47 << 51 << 45 <<
474 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 );
475 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "Zones de champs, prairies, sans cultures" ) );
477 Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap );
478 aPrs->SetTable( aTable );
479 TestViewer::show( aPrs, AIS_Shaded, 1, true, "LandCoverMap_PrsByTypes" );
480 CPPUNIT_ASSERT_IMAGES
485 void test_HYDROData_LandCoverMap::test_land_cover_prs_by_coeff()
487 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
489 Handle(HYDROData_StricklerTable) aTable =
490 Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) );
491 CPPUNIT_ASSERT_EQUAL( true, aTable->Import( DEF_STR_PATH ) );
493 Handle(HYDROData_LandCoverMap) aMap =
494 Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
496 TopoDS_Face aLC1 = LandCover( QList<double>() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 );
497 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Zones de champs cultivé à végétation basse" ) );
499 TopoDS_Face aLC2 = LandCover( QList<double>() << 21 << 34 << 24 << 25 << 37 << 37 << 40 << 61 <<
500 44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 <<
501 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 <<
503 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "Zones de champs cultivé à végétation haute" ) );
505 TopoDS_Face aLC3 = LandCover( QList<double>() << 4 << 54 << 1 << 47 << 51 << 45 <<
506 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 );
507 CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "Zones de champs, prairies, sans cultures" ) );
509 Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap );
510 aPrs->SetTable( aTable );
511 aPrs->SetColorScale( TestViewer::showColorScale() );
512 TestViewer::show( aPrs, AIS_Shaded, 1, true, "LandCoverMap_PrsByCoeff" );
513 CPPUNIT_ASSERT_IMAGES