]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
correct test refs; new test (draft!) for pnts classification.
authorisn <isn@opencascade.com>
Wed, 31 Aug 2016 14:17:19 +0000 (17:17 +0300)
committerisn <isn@opencascade.com>
Wed, 31 Aug 2016 14:17:19 +0000 (17:17 +0300)
49 files changed:
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/reference_data/CLC06-cut_1_res.png
src/HYDRO_tests/reference_data/Channel.png
src/HYDRO_tests/reference_data/Extraction_Channel.png
src/HYDRO_tests/reference_data/Extraction_ImmZone.png
src/HYDRO_tests/reference_data/LCM_copied.png
src/HYDRO_tests/reference_data/LCM_split_2a.png
src/HYDRO_tests/reference_data/LCM_split_2b.png
src/HYDRO_tests/reference_data/LandCoverMap_Add_2_Objects.png
src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png
src/HYDRO_tests/reference_data/LandCoverMap_Merge_2.png
src/HYDRO_tests/reference_data/LandCoverMap_PrsByCoeff.png
src/HYDRO_tests/reference_data/LandCoverMap_PrsByTypes.png
src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png
src/HYDRO_tests/reference_data/LandCoverMap_Split_1.png
src/HYDRO_tests/reference_data/LandCoverMap_Split_2.png
src/HYDRO_tests/reference_data/LandCoverMap_Split_Polyline.png
src/HYDRO_tests/reference_data/LandCoverMap_TransparentPrs.png
src/HYDRO_tests/reference_data/LandCover_Triangles.png
src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png
src/HYDRO_tests/reference_data/Merge_Polylines.png
src/HYDRO_tests/reference_data/NLD_water_areas_dcw.png
src/HYDRO_tests/reference_data/Polyline_Presentation.png
src/HYDRO_tests/reference_data/Shape_preview_im_zone.png
src/HYDRO_tests/reference_data/Split_Polylines_Colors.png
src/HYDRO_tests/reference_data/Split_Straight.png
src/HYDRO_tests/reference_data/clc_dec_150_350.png
src/HYDRO_tests/reference_data/cyprus_natural_all.png
src/HYDRO_tests/reference_data/lcm_poly_2_sections.png
src/HYDRO_tests/reference_data/merge_faces_boxes_11.png
src/HYDRO_tests/reference_data/merge_faces_boxes_12.png
src/HYDRO_tests/reference_data/merge_faces_boxes_13.png
src/HYDRO_tests/reference_data/merge_faces_boxes_14.png
src/HYDRO_tests/reference_data/merge_faces_boxes_21.png
src/HYDRO_tests/reference_data/merge_faces_boxes_22.png
src/HYDRO_tests/reference_data/merge_faces_boxes_23.png
src/HYDRO_tests/reference_data/merge_faces_boxes_24.png
src/HYDRO_tests/reference_data/merge_faces_circles_11.png
src/HYDRO_tests/reference_data/merge_faces_circles_12.png
src/HYDRO_tests/reference_data/merge_faces_circles_13.png
src/HYDRO_tests/reference_data/merge_faces_circles_14.png
src/HYDRO_tests/reference_data/merge_faces_circles_21.png
src/HYDRO_tests/reference_data/merge_faces_circles_22.png
src/HYDRO_tests/reference_data/merge_faces_circles_23.png
src/HYDRO_tests/reference_data/merge_faces_circles_24.png
src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx
src/HYDRO_tests/test_HYDROData_LandCoverMap.h
src/HYDRO_tests/test_HYDROData_Main.cxx
src/HYDRO_tests/test_HYDROData_ShapeFile.cxx

index 196df1f00f03fccce966f71e650f982229db214b..a8599d348b432d1b0085d1e534d7d3a51984170d 100644 (file)
@@ -261,7 +261,7 @@ bool TestViewer::AssertImages( QString& theMessage )
 {
   QImage anActualImage = viewWindow()->dumpView();
 
-  QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO";
+  QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test";
   anExpectedRefFilePath += "/" + myKey + ".png";
   QImage anExpectedRefImage; 
   anExpectedRefImage.load( anExpectedRefFilePath );
@@ -286,6 +286,8 @@ bool TestViewer::AssertImages( QString& theMessage )
   QString aDiffFilePath = QDir::tempPath() + "/" + myKey + "_diff.png";
   aDiff.save( aDiffFilePath );
 
+  anExpectedRefImage.save( QDir::tempPath() + "/" + myKey + "_1.png");
+
   return false;
 }
 
index db50aef88b24ee5a2f424dda318c50f8f7331245..d58c9fb86e721631ada2a57161a8be55b1f98a31 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/CLC06-cut_1_res.png and b/src/HYDRO_tests/reference_data/CLC06-cut_1_res.png differ
index 4f8b7d18a3eb1be0a5afbffb8e006430c533f5cc..de597b4034db3a4cce239a9eac55dfaace89f6f4 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Channel.png and b/src/HYDRO_tests/reference_data/Channel.png differ
index 67cc84e4ce6d01847ed00c0f7bdeb654ff6dbef7..09ce9a9eb97971885e11b01d9cb174d3f96356c1 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Extraction_Channel.png and b/src/HYDRO_tests/reference_data/Extraction_Channel.png differ
index d0e58c019cdf43de4c272c694c9ae1cfe1ec7024..9e9197879742bc966e5eecd8dff67ea01321a589 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Extraction_ImmZone.png and b/src/HYDRO_tests/reference_data/Extraction_ImmZone.png differ
index 4494edf5323d1fda95e4906508c5aff64ce55e0b..f02db52fcf895856b4eb356494849eb9d7945d0c 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LCM_copied.png and b/src/HYDRO_tests/reference_data/LCM_copied.png differ
index b725e864cd331c96daf131ae9519c708f4962372..4a7e44191640b24ea86717f2cf03462b75233e1f 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LCM_split_2a.png and b/src/HYDRO_tests/reference_data/LCM_split_2a.png differ
index bdcd3ad9818de3cb21dc8738ed8023cd17c826ae..e85c19ac6159d8f3b9eff48a9c25354de111925f 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LCM_split_2b.png and b/src/HYDRO_tests/reference_data/LCM_split_2b.png differ
index 462d62c4bf041fe87e1aec60d4a01abf3a280a67..fa0e260c51c13145958388f9a5825811eeb4dc75 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Add_2_Objects.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Add_2_Objects.png differ
index 565bbef1639e06072506a60e2d1ae0257ff323f2..7288a5f8f087f22148c6ff200d15d7a748bbf5e2 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png differ
index 6028686ba465e8bac6bdd65cea7bd6d4eea3dae1..4f6daf9ad7e2fa1d77e732dc604d2a3f6ad46353 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Merge_2.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Merge_2.png differ
index 434e98eae40032093499933623c0c023ec36f601..03b73fbeba3e84ffaa2d6aa1752a6c7830a5b74a 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_PrsByCoeff.png and b/src/HYDRO_tests/reference_data/LandCoverMap_PrsByCoeff.png differ
index 28b79a469d273987eefa91f97aca4c47422b1a9b..f940570fcc50c2393663ffd1b1caf281bdeb2075 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_PrsByTypes.png and b/src/HYDRO_tests/reference_data/LandCoverMap_PrsByTypes.png differ
index ee5f9f9430c540a8197ddc0ad5de7b6ef211164d..dce48726dc041ddbabd7586cb1d7f1b0602172fe 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png differ
index 95b07befe66494782dcb3dbc3686cdb7dc12ef24..877688be257276cdc849f907a43d63a56ddb4c0c 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Split_1.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Split_1.png differ
index f955b1373f64f3838ab062bb12224fa00d212a93..b34f64775e94f1ce3770d6e7cc7bc174d2153806 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Split_2.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Split_2.png differ
index a5b80362276c0365ab080416bd43d68672d5ce5a..98c5e924fc372473b77e5369631f12e84364d8e0 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Split_Polyline.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Split_Polyline.png differ
index 69335a2e5e4d8d77303908a2bf77f8d08bdac7b4..e9ac5eec258b9dce23e5336e3754e49f539665c4 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_TransparentPrs.png and b/src/HYDRO_tests/reference_data/LandCoverMap_TransparentPrs.png differ
index a8fa3c1f3426861b33b3dfda980cb18c02278cf2..b015ee5df1408d44e86d53dff421b141f47cb23a 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCover_Triangles.png and b/src/HYDRO_tests/reference_data/LandCover_Triangles.png differ
index bb59e2324f738a2931ea5af0f20a68f8a6653811..175785ebf5862224cf0e8f97e8c449a9ecf55bff 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png and b/src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png differ
index baed02ce05628644575faf7c3497291ec15c0e3f..46e68bed7cd2cd138acb0825ebcabb9563d6ba05 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Merge_Polylines.png and b/src/HYDRO_tests/reference_data/Merge_Polylines.png differ
index 519f94a141b7ec9ab97bf85ca94c45c8930ec554..34154fd5da59d9a0940a3e06efb7ca85418246d0 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/NLD_water_areas_dcw.png and b/src/HYDRO_tests/reference_data/NLD_water_areas_dcw.png differ
index 938f6f62323d87693a75ccb47e6e20f14a67958e..1a4f14fdff8e0e089bbb72736205a6e533a3f08b 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Polyline_Presentation.png and b/src/HYDRO_tests/reference_data/Polyline_Presentation.png differ
index 9aba0e4a43f6439b503c87a0cb4ec54a2985b00a..fd1d1233d2898dada0cdce6f6fb6df15143a1209 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Shape_preview_im_zone.png and b/src/HYDRO_tests/reference_data/Shape_preview_im_zone.png differ
index 67aca119b82907b651c0bcc8046327f895f8ed64..1915908fe69d167401f085ac2e5d2e5dd886fb3c 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Split_Polylines_Colors.png and b/src/HYDRO_tests/reference_data/Split_Polylines_Colors.png differ
index 8e109a55912cd0f7919ac5a822300f2f9f36b23d..c93ac4692de956e0ac5eabd0ffc8b05d0dfe049e 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Split_Straight.png and b/src/HYDRO_tests/reference_data/Split_Straight.png differ
index 2e143f826e46e6dd6d4acc1a1ddd35f200a3db12..cca57191e7c3397f9d5acb687ad555a117df04ff 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/clc_dec_150_350.png and b/src/HYDRO_tests/reference_data/clc_dec_150_350.png differ
index 4edc22e933a8f9f09d4f40fbfc64c95bbe07dd1c..edd084aad0747b8d207a47cd11c314ef6646a94b 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cyprus_natural_all.png and b/src/HYDRO_tests/reference_data/cyprus_natural_all.png differ
index a98e002e4ad188c0ad62c77f78713bfc78fede90..7b7d7fcb8545b2bf513aae6f44519a569fb09bf3 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/lcm_poly_2_sections.png and b/src/HYDRO_tests/reference_data/lcm_poly_2_sections.png differ
index 1ae7be537e4f84ae055f7b87be83422c8837025a..437fd5042b8ef35589b556f5bba861c8f0bc3f61 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_11.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_11.png differ
index e2d0747fde28bfe979de356e0cd1aa6790403ee0..ee6ecb05f870581cc94fcc2889fb3ca2cc018bfb 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_12.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_12.png differ
index b7d0a3f101abac052b5e0a662a4b8b459781839b..341f77fa34cf651ed95ad9e5b789d7a82cc50798 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_13.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_13.png differ
index 99d05dfc9e376fab4c8a958d2cbe8b58467bdb40..96d4902ec02016f230753193085d55814d140c89 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_14.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_14.png differ
index 8c8d74d22064b707068eadaf3c874271d5619471..20a858ea420663b2b9a11dcbac2d89235c914036 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_21.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_21.png differ
index e2d0747fde28bfe979de356e0cd1aa6790403ee0..ee6ecb05f870581cc94fcc2889fb3ca2cc018bfb 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_22.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_22.png differ
index 09788d1eca0c5bbee1f7e5cf79d8789fa85876c6..10a0acda2476bc275f11ea036ea3b4708211334c 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_23.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_23.png differ
index a2889ae76642e6cbe875d7139ef72c712697675a..21de11a33a9ae96201359b10f629d0d94dc43164 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_24.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_24.png differ
index 81257c872fd82a1af69582f82463fc1107d1b04d..2ac1f68b9e07535e6716290a1acad7290fdcc22a 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_11.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_11.png differ
index dd7a7c2057796c27bd4e2f5f7f4d21974af3f592..9fcbd304a707560945e0263d600d807e500189b1 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_12.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_12.png differ
index 417ef34b4290b0b53a15561ff754c4720ca545c9..e9c116f90fa6cf7fa35d3176c7f6fc2d3b8125a4 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_13.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_13.png differ
index 417ef34b4290b0b53a15561ff754c4720ca545c9..e9c116f90fa6cf7fa35d3176c7f6fc2d3b8125a4 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_14.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_14.png differ
index 86a8172c2281f45614483a1d6f7dc7cdf21d721d..d1be8809ddafca84115c79549535cd6724ebc2b2 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_21.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_21.png differ
index dd7a7c2057796c27bd4e2f5f7f4d21974af3f592..9fcbd304a707560945e0263d600d807e500189b1 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_22.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_22.png differ
index f9d0686d2a3c02e611a75e8acac5c3a9c5a7d7f0..d0f68c449264b6b439be47857a68ca56ffe03b8b 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_23.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_23.png differ
index f9d0686d2a3c02e611a75e8acac5c3a9c5a7d7f0..d0f68c449264b6b439be47857a68ca56ffe03b8b 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_24.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_24.png differ
index 895a52b601a3cc7bd619854a5a3cd6ab4c55ab03..1b71f65242b6651c056e844b0da681ae4e128d68 100644 (file)
@@ -47,7 +47,7 @@
 #define _DEVDEBUG_
 #include "HYDRO_trace.hxx"
 
-const QString REF_DATA_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO";
+const QString REF_DATA_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test";
 const QString DEF_STR_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/share/salome/resources/hydro/def_strickler_table.txt";
 
 void test_HYDROData_LandCoverMap::test_add_2_objects()
@@ -1145,3 +1145,47 @@ void test_HYDROData_LandCoverMap::test_copy()
 
   aDoc->Close();
 }
+
+void test_HYDROData_LandCoverMap::test_shp_clc_classification()
+{
+  Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
+  QString aFileName = REF_DATA_PATH + "/CLC_decoupe.shp";
+  HYDROData_ShapeFile anImporter;
+  QStringList PolygonList;
+  TopTools_SequenceOfShape PolygonFaces;
+  int Type = -1;
+  int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
+  CPPUNIT_ASSERT(aStat == 1);
+  CPPUNIT_ASSERT_EQUAL(5, Type);
+  CPPUNIT_ASSERT_EQUAL(625, PolygonFaces.Length());
+  
+  Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
+  HYDROData_MapOfFaceToStricklerType aMapFace2ST;
+
+  for ( int i = 100; i <= 300; i++ )
+  {
+    TopoDS_Shape aShape = PolygonFaces(i);
+    if ( aShape.IsNull() ) 
+      continue;
+    aMapFace2ST.Add( TopoDS::Face( aShape ), "ST_" + QString::number(i) );
+  }
+
+  LCM->StoreLandCovers(aMapFace2ST);
+  //TopoDS_Shape aSh = LCM->GetShape();
+
+  std::vector<gp_Pnt2d> pnts;
+  int N = 100000;
+  pnts.reserve(N);
+  double x0 = 448646.91897505691;
+  double x1 = 487420.3990381231;
+  double y0 = 6373566.5122489957;
+  double y1 = 6392203.4117361344;
+  for (size_t i=0; i < N; i++)
+  {
+    double px = x0 + (x1-x0)/(double)N;
+    double py = y0 + (y1-y0)/(double)N;
+    pnts.push_back(gp_Pnt2d(px,py));
+  }
+  std::vector<std::set <QString> > TRes;
+  LCM->ClassifyPoints(pnts, TRes);
+}
index 85d34bc750777bbf0467e9ec53003ff74dbd349b..d03ead1bc504f314111a938da6401d690c7f3157 100644 (file)
@@ -50,6 +50,7 @@ class test_HYDROData_LandCoverMap : public CppUnit::TestFixture
   CPPUNIT_TEST( test_shp_import_clc_dec );
   CPPUNIT_TEST( test_shp_import_nld_areas );
   CPPUNIT_TEST( test_shp_loop_back );
+  CPPUNIT_TEST( test_shp_clc_classification );
 #endif
   CPPUNIT_TEST_SUITE_END();
 
@@ -77,6 +78,7 @@ public:
   void test_shp_loop_back();
   void test_export_telemac();
   void test_copy();
+  void test_shp_clc_classification();
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION( test_HYDROData_LandCoverMap );
index c6a979d04c3fbbea15a6d0f058726d9e988316bb..d50bdcf7831fcec5954238c6a03c7a52385c759b 100644 (file)
@@ -68,8 +68,8 @@ int main( int argc, char* argv[] )
     CppUnit::TestFactoryRegistry::getRegistry();
   // Add the top suite to the test runner
   TestLib_Runner runner;
-  //QString aPath = qgetenv( "HYDRO_SRC_DIR" ) + "/src/tests.cfg";
-  //runner.Load( aPath.toStdString() );
+  QString aPath = qgetenv( "HYDRO_SRC_DIR" ) + "/src/tests.cfg";
+  runner.Load( aPath.toStdString() );
   runner.addTest( registry.makeTest() );   
   try
   {
index b4007ceaab6b03cbaab3386bb72d37b7f12274aa..752811948dccf863a0a47f3764804645e97f23c3 100644 (file)
@@ -21,7 +21,7 @@
 #include <QStringList>
 #include <vector>
 
-const QString REF_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO";
+const QString REF_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test";
 
 bool test_HYDROData_ShapeFile::compare_two_files(const QString& File1, const QString& File2)
 {