BRepCheck_Analyzer aCheck1( aMap->GetShape() );
CPPUNIT_ASSERT_EQUAL( true, (bool)aCheck1.IsValid() );
-
+
CPPUNIT_ASSERT_EQUAL( true, aMap->Merge( aList, "test" ) );
BRepCheck_Analyzer aCheck2( aMap->GetShape() );
BRepCheck_Analyzer aBCA(aMergedFace);
CPPUNIT_ASSERT(aBCA.IsValid());
}
+
}
CPPUNIT_ASSERT(!ff3.IsNull());
//Test mergeFaces() func // circles // USD == true
- {
+ {
TopTools_ListOfShape Faces;
Faces.Append(ff1);
Faces.Append(ff2);
aMap->Add(aPolyline, "");
TopoDS_Face aLC1 = Face2d( QList<double>() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 );
CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) );
-
+
CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) );
QList<int> Inds = QList<int>() << 1 << 2 << 3;
aMap->ImportDBF(aFileName, "TESTFIELD1", aDBFV, aST, Inds);
aDoc->Close();
}
+
#include <QTest>
+
void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types()
{
Handle(HYDROData_Document) aDoc = HYDROData_Document::Document();
127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 );
CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, QString::fromUtf8("Zones de champs, prairies, sans cultures")) );
- // build presentation object
+ // build presentation object
Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap );
aPrs->SetTable( aTable );
// show presentation in viewer
TestViewer::show( aPrs, AIS_Shaded, 4, true, "LandCoverMap_PrsByTypes" );
// select one of faces (first)
- TestViewer::select( 200, 300 );
+ TestViewer::select( 40, 20 );
QTest::qWait(1000);
- TestViewer::select( 220, 300 );
+ TestViewer::select( 40, 60 );
QTest::qWait(1000);
- TestViewer::select( 250, 300 );
+ TestViewer::select( 80, 60 );
QTest::qWait(1000);
- TestViewer::select( 300, 300 );
+ TestViewer::select( 80, 100 );
QTest::qWait(1000);
- TestViewer::select( 200, 350 );
+ TestViewer::select( 130, 40 );
QTest::qWait(1000);
- TestViewer::select( 200, 500 );
+ TestViewer::select( 130, 60 );
QTest::qWait(1000);
- TestViewer::select( 250, 400 );
+ TestViewer::select( 80, 20 );
QTest::qWait(1000);
- TestViewer::select( 300, 99 );
+ TestViewer::select( 40, 80 );
QTest::qWait(1000);
CPPUNIT_ASSERT_IMAGES
- TestViewer::eraseAll(true, true);
aDoc->Close();
}
TestViewer::show( aPrs, AIS_Shaded, 0, true, "" );
CPPUNIT_ASSERT_IMAGES
+
aDoc->Close();
}
CPPUNIT_ASSERT(aStat == 1);
CPPUNIT_ASSERT_EQUAL(5, Type);
CPPUNIT_ASSERT_EQUAL(268, PolygonFaces.Length());
-
+
Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
HYDROData_MapOfFaceToStricklerType aMapFace2ST;
for ( int i = 1; i <= 20; i++ )
{
TopoDS_Shape aShape = PolygonFaces(i);
- if ( aShape.IsNull() )
+ if ( aShape.IsNull() )
continue;
aMapFace2ST.Add( TopoDS::Face( aShape ), "" );
}
LCM->StoreLandCovers(aMapFace2ST);
TestViewer::show( LCM->GetShape(), AIS_Shaded, true, "cyprus_natural_all" );
CPPUNIT_ASSERT_IMAGES
+
aDoc->Close();
}
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 = 150; i <= 160; i++ )
{
TopoDS_Shape aShape = PolygonFaces(i);
- if ( aShape.IsNull() )
+ if ( aShape.IsNull() )
continue;
aMapFace2ST.Add( TopoDS::Face( aShape ), "" );
}
LCM->StoreLandCovers(aMapFace2ST);
TestViewer::show( LCM->GetShape(), AIS_Shaded, true, "clc_dec_150_350" );
CPPUNIT_ASSERT_IMAGES
+
aDoc->Close();
}
CPPUNIT_ASSERT(aStat == 1);
CPPUNIT_ASSERT_EQUAL(5, Type);
CPPUNIT_ASSERT_EQUAL(127, PolygonFaces.Length());
-
+
Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
HYDROData_MapOfFaceToStricklerType aMapFace2ST;
for ( int i = 1; i <= PolygonFaces.Length(); i++ )
{
TopoDS_Shape aShape = PolygonFaces(i);
- if ( aShape.IsNull() )
+ if ( aShape.IsNull() )
continue;
aMapFace2ST.Add( TopoDS::Face( aShape ), "" );
}
LCM->StoreLandCovers(aMapFace2ST);
TestViewer::show( LCM->GetShape(), AIS_Shaded, true, "NLD_water_areas_dcw" );
CPPUNIT_ASSERT_IMAGES
+
aDoc->Close();
}
QString aFFileName = REF_DATA_PATH + "/CLC06-cut_1.shp";
QString aSFileName = REF_DATA_PATH + "/CLC06-cut_1_res.shp";
- //This test verify only some geom data (shp+shx) without any dbf reading/writing
+ //This test verify only some geom data (shp+shx) without any dbf reading/writing
{
//DEBTRACE("aFFileName: " << aFFileName.toStdString());
//DEBTRACE("aSFileName: " << aSFileName.toStdString());
aDoc->Close();
}
CPPUNIT_ASSERT_EQUAL(0, remove(aSFileName.toStdString().c_str()));
+ TestViewer::eraseAll(true, true);
+
}
void test_HYDROData_LandCoverMap::test_add_2_section_poly()
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 = SI; i <= EI; i++ )
{
TopoDS_Shape aShape = PolygonFaces(i);
- if ( aShape.IsNull() )
+ if ( aShape.IsNull() )
continue;
aMapFace2ST.Add( TopoDS::Face( aShape ), "ST_" + QString::number(i) );
}
}
}
OSD_Timer aTimer;
- std::vector<std::set <QString> > TRes;
+ std::vector<std::set <QString> > TRes;
aTimer.Start();
LCM->ClassifyPoints(pnts, TRes);
aTimer.Stop();
aMapFace2ST.Add( TopoDS::Face( PolygonFaces(187) ), "Vignobles" );
aMapFace2ST.Add( TopoDS::Face( PolygonFaces(190) ), "Oliveraies" );
aMapFace2ST.Add( TopoDS::Face( PolygonFaces(196) ), "Estuaires" );
-
+
LCM->StoreLandCovers(aMapFace2ST);
TopoDS_Shape Sh = LCM->GetShape();
pnts.push_back(gp_XY(470350, 6384700));
pnts.push_back(gp_XY(469279.642874048, 6385132.45048612 ));
- std::vector<std::set <QString> > TRes;
+ std::vector<std::set <QString> > TRes;
LCM->ClassifyPoints(pnts, TRes);
CPPUNIT_ASSERT (TRes[0].empty());
Poly_Sens_TrigoP->AddPoint( 0, gp_XY( 252.16, 239.58 ) );
Poly_Sens_TrigoP->AddPoint( 0, gp_XY( 240.95, 498.99 ) );
Poly_Sens_TrigoP->AddPoint( 0, gp_XY( 119.26, 510.20 ) );
- Poly_Sens_TrigoP->AddPoint( 0, gp_XY( 141.67, 378.89 ) );
+ Poly_Sens_TrigoP->AddPoint( 0, gp_XY( 141.67, 378.89 ) );
Poly_Sens_TrigoP->Update();
Handle(HYDROData_PolylineXY) Polyline_Sens_HoraireP =