#include <test_HYDROData_LandCoverMap.h>
#include <HYDROData_Document.h>
#include <HYDROData_LandCoverMap.h>
+#include <HYDROData_ImmersibleZone.h>
#include <HYDROData_PolylineXY.h>
#include <HYDROData_StricklerTable.h>
#include <HYDROData_Tool.h>
//TODO: compare files
}
+
+void test_HYDROData_LandCoverMap::test_transparent_prs()
+{
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
+
+ Handle(HYDROData_StricklerTable) aTable =
+ Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) );
+ CPPUNIT_ASSERT_EQUAL( true, aTable->Import( DEF_STR_PATH ) );
+
+ Handle(HYDROData_PolylineXY) aPoly =
+ Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) );
+ aPoly->AddSection( "", HYDROData_PolylineXY::SECTION_SPLINE, true );
+ aPoly->AddPoint( 0, gp_XY( 0, 0 ) );
+ aPoly->AddPoint( 0, gp_XY( 20, 0 ) );
+ aPoly->AddPoint( 0, gp_XY( 10, 10 ) );
+ aPoly->Update();
+
+ Handle(HYDROData_ImmersibleZone) aZone =
+ Handle(HYDROData_ImmersibleZone)::DownCast( aDoc->CreateObject( KIND_IMMERSIBLE_ZONE ) );
+ aZone->SetPolyline( aPoly );
+ aZone->Update();
+
+ Handle(HYDROData_LandCoverMap) aMap =
+ Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
+ aMap->LocalPartition( Face( QList<double>() << 1 << 1 << 10 << 10 << 10 << 20 ), "Zones de champs cultivé à végétation haute" );
+ aMap->LocalPartition( Face( QList<double>() << 5 << 5 << 10 << 5 << 10 << 8 << 5 << 12 << 5 << 8 ), "Zones de champs cultivé à végétation haute" );
+ aMap->SetName( "test_LCM" );
+
+ TestViewer::show( aZone->GetTopShape(), AIS_Shaded, true, "LandCoverMap_TransparentPrs" );
+
+ Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap );
+ aPrs->SetTable( aTable );
+ aPrs->SetTransparency( 0.5 );
+ TestViewer::show( aPrs, AIS_Shaded, 0, true, "" );
+
+ CPPUNIT_ASSERT_IMAGES
+}
CPPUNIT_TEST( test_land_cover_prs_by_types );
CPPUNIT_TEST( test_land_cover_prs_by_coeff );
CPPUNIT_TEST( test_dump_python );
+ CPPUNIT_TEST( test_transparent_prs );
CPPUNIT_TEST_SUITE_END();
public:
void test_land_cover_prs_by_types();
void test_land_cover_prs_by_coeff();
void test_dump_python();
+ void test_transparent_prs();
};
CPPUNIT_TEST_SUITE_REGISTRATION( test_HYDROData_LandCoverMap );