Salome HOME
Merge branch 'BR_H2018_3' into BR_2018_V8_5
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_LandCoverMap.cxx
index 43320fc973aaf49e440ba0819e6107a425e1b643..b1eb3e1a6e58335323f5f3df18a6c698d906f4e1 100644 (file)
@@ -569,7 +569,7 @@ void test_HYDROData_LandCoverMap::test_import_dbf()
 
   aDoc->Close();
 }
-
+#include <QTest>
 void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types()
 {
   Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
@@ -600,7 +600,23 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types()
   // show presentation in viewer
   TestViewer::show( aPrs, AIS_Shaded, 4, true, "LandCoverMap_PrsByTypes" );
   // select one of faces (first)
-  TestViewer::select( 200, 300 );
+ TestViewer::select( 200, 300 );
+  QTest::qWait(1000);
+   TestViewer::select( 220, 300 );
+  QTest::qWait(1000);
+   TestViewer::select( 250, 300 );
+  QTest::qWait(1000);
+   TestViewer::select( 300, 300 );
+  QTest::qWait(1000);
+   TestViewer::select( 200, 350 );
+  QTest::qWait(1000);
+   TestViewer::select( 200, 500 );
+  QTest::qWait(1000);
+   TestViewer::select( 250, 400 );
+  QTest::qWait(1000);
+   TestViewer::select( 300, 99 );
+  QTest::qWait(1000);
+
   CPPUNIT_ASSERT_IMAGES
   TestViewer::eraseAll(true, true);
   aDoc->Close();
@@ -635,6 +651,7 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_coeff()
   TestViewer::showColorScale( true );
   aPrs->SetColorScale( TestViewer::colorScale() );
   TestViewer::show( aPrs, AIS_Shaded, 4, true, "LandCoverMap_PrsByCoeff" );
+
   CPPUNIT_ASSERT_IMAGES
 
   TestViewer::showColorScale( false );
@@ -818,8 +835,9 @@ void test_HYDROData_LandCoverMap::test_shp_import_cyp()
   HYDROData_ShapeFile anImporter;
   QStringList PolygonList;
   TopTools_SequenceOfShape PolygonFaces;
-  int Type = -1;
-  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
+
+  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces);
+  int Type = anImporter.GetShapeType();
   CPPUNIT_ASSERT(aStat == 1);
   CPPUNIT_ASSERT_EQUAL(5, Type);
   CPPUNIT_ASSERT_EQUAL(268, PolygonFaces.Length());
@@ -848,8 +866,9 @@ void test_HYDROData_LandCoverMap::test_shp_import_clc_dec()
   HYDROData_ShapeFile anImporter;
   QStringList PolygonList;
   TopTools_SequenceOfShape PolygonFaces;
-  int Type = -1;
-  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
+  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces);
+    int Type = anImporter.GetShapeType();
+
   CPPUNIT_ASSERT(aStat == 1);
   CPPUNIT_ASSERT_EQUAL(5, Type);
   CPPUNIT_ASSERT_EQUAL(625, PolygonFaces.Length());
@@ -878,8 +897,8 @@ void test_HYDROData_LandCoverMap::test_shp_import_nld_areas()
   HYDROData_ShapeFile anImporter;
   QStringList PolygonList;
   TopTools_SequenceOfShape PolygonFaces;
-  int Type = -1;
-  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
+  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces);
+  int Type = anImporter.GetShapeType();
   CPPUNIT_ASSERT(aStat == 1);
   CPPUNIT_ASSERT_EQUAL(5, Type);
   CPPUNIT_ASSERT_EQUAL(127, PolygonFaces.Length());
@@ -914,10 +933,9 @@ void test_HYDROData_LandCoverMap::test_shp_loop_back()
     HYDROData_ShapeFile anImporter;
     QStringList PolygonList;
     TopTools_SequenceOfShape PolygonFaces;
-    int Type = -1;
 
     //import LCM from file (#2-4; #12-14 polygons)
-    CPPUNIT_ASSERT( anImporter.ImportPolygons(aDoc, aFFileName, PolygonList, PolygonFaces, Type));
+    CPPUNIT_ASSERT( anImporter.ImportPolygons(aDoc, aFFileName, PolygonList, PolygonFaces));
     Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
     HYDROData_MapOfFaceToStricklerType aMapFace2ST;
 
@@ -948,10 +966,8 @@ void test_HYDROData_LandCoverMap::test_shp_loop_back()
     HYDROData_ShapeFile anImporter;
     QStringList PolygonList;
     TopTools_SequenceOfShape PolygonFaces;
-    int Type = -1;
-
     //import all
-    CPPUNIT_ASSERT( anImporter.ImportPolygons(aDoc, aSFileName, PolygonList, PolygonFaces, Type));
+    CPPUNIT_ASSERT( anImporter.ImportPolygons(aDoc, aSFileName, PolygonList, PolygonFaces));
     Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
     HYDROData_MapOfFaceToStricklerType aMapFace2ST;
     CPPUNIT_ASSERT_EQUAL(PolygonFaces.Length(), 6);
@@ -1166,8 +1182,8 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_perf()
   HYDROData_ShapeFile anImporter;
   QStringList PolygonList;
   TopTools_SequenceOfShape PolygonFaces;
-  int Type = -1;
-  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
+  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces);
+  int Type = anImporter.GetShapeType();
   CPPUNIT_ASSERT(aStat == 1);
   CPPUNIT_ASSERT_EQUAL(5, Type);
   CPPUNIT_ASSERT_EQUAL(625, PolygonFaces.Length());
@@ -1233,8 +1249,7 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_check()
   HYDROData_ShapeFile anImporter;
   QStringList PolygonList;
   TopTools_SequenceOfShape PolygonFaces;
-  int Type = -1;
-  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
+  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces);
   CPPUNIT_ASSERT(aStat == 1);
   Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
   HYDROData_MapOfFaceToStricklerType aMapFace2ST;