extern QString REF_DATA_PATH;
const QString DEF_STR_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/share/salome/resources/hydro/def_strickler_table_06.txt";
+extern QString TMP_DIR;
void test_HYDROData_LandCoverMap::test_add_2_objects()
{
aDoc->Close();
}
-
+#include <QTest>
void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types()
{
Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
// 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();
TestViewer::showColorScale( true );
aPrs->SetColorScale( TestViewer::colorScale() );
TestViewer::show( aPrs, AIS_Shaded, 4, true, "LandCoverMap_PrsByCoeff" );
+
CPPUNIT_ASSERT_IMAGES
TestViewer::showColorScale( false );
QString aBaseName = "lc_dump.py";
QString aBaseShp = "lc_dump.shp";
QString aBaseDbf = "lc_dump.dbf";
- QString aTmpPath = QDir::tempPath() + "/" + aBaseName;
+ QString aTmpPath = TMP_DIR + "/" + aBaseName;
CPPUNIT_ASSERT_EQUAL( true, aDoc->DumpToPython( aTmpPath, false ) );
//TODO: CPPUNIT_ASSERT_SCRIPTS_EQUAL( aBaseName, true, false, 20 );
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());
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());
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());
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;
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);
CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, type9 ) );
QString aTmpFileName = "test.telemac";
-#ifdef WIN32
- QString aTmpPath = QDir::tempPath() + "/" + aTmpFileName;
-#else
- QString aTmpPath = QDir::tempPath() + "/hydro/" + aTmpFileName;
-#endif
+ QString aTmpPath = TMP_DIR + "/" + aTmpFileName;
QString messStat;
CPPUNIT_ASSERT_EQUAL( true, aMap->ExportTelemac( aTmpPath, 1E-4, aTable, messStat ) );
CPPUNIT_ASSERT_SCRIPTS_EQUAL( aTmpFileName, true, true, 0 );
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());
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;