Handle(HYDROData_LandCoverMap) HYDROData_CalculationCase::GetLandCoverMap() const
{
- // TODO
- Handle(HYDROData_LandCoverMap) aLandCoverMap = NULL;
- return aLandCoverMap;
+ Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast(
+ GetReferenceObject( DataTag_LandCoverMap ) );
+ return aMap;
+}
+
+void HYDROData_CalculationCase::SetLandCoverMap( const Handle(HYDROData_LandCoverMap)& theMap )
+{
+ SetReferenceObject( theMap, DataTag_LandCoverMap );
}
Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
DataTag_CustomLandCoverRules_Obsolete, ///< custom rules for land covers priority
DataTag_AssignmentLandCoverMode_Obsolete, ///< assignment mode of land covers priority
DataTag_ChildLandCoverRegion_Obsolete, ///< child land cover regions
- DataTag_LandCoverRegion_Obsolete ///< reference land cover regions
+ DataTag_LandCoverRegion_Obsolete, ///< reference land cover regions
+ DataTag_LandCoverMap, ///< reference to land cover map
};
public:
* Returns reference Land Cover Map of calculation case.
* \return the referenced Land Cover Map
*/
- HYDRODATA_EXPORT virtual Handle(HYDROData_LandCoverMap) GetLandCoverMap() const;
+ HYDRODATA_EXPORT Handle(HYDROData_LandCoverMap) GetLandCoverMap() const;
+
+ HYDRODATA_EXPORT void SetLandCoverMap( const Handle(HYDROData_LandCoverMap)& );
/**
* Add new one child region for calculation case.
//
#include <test_HYDROData_LandCoverMap.h>
+#include <HYDROData_CalculationCase.h>
#include <HYDROData_Document.h>
#include <HYDROData_LandCoverMap.h>
#include <HYDROData_ImmersibleZone.h>
aDoc->Close();
}
+
+void test_HYDROData_LandCoverMap::test_assign_to_calc_case()
+{
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
+
+ Handle(HYDROData_LandCoverMap) aMap =
+ Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
+ Handle(HYDROData_CalculationCase) aCalcCase =
+ Handle(HYDROData_CalculationCase)::DownCast( aDoc->CreateObject( KIND_CALCULATION ) );
+
+ aCalcCase->SetLandCoverMap( aMap );
+ CPPUNIT_ASSERT_EQUAL( aMap->myLab, aCalcCase->GetLandCoverMap()->myLab );
+
+ aDoc->Close();
+}
CPPUNIT_TEST( test_land_cover_prs_by_coeff );
CPPUNIT_TEST( test_dump_python );
CPPUNIT_TEST( test_transparent_prs );
+ CPPUNIT_TEST( test_assign_to_calc_case );
CPPUNIT_TEST_SUITE_END();
public:
void test_land_cover_prs_by_coeff();
void test_dump_python();
void test_transparent_prs();
+ void test_assign_to_calc_case();
};
CPPUNIT_TEST_SUITE_REGISTRATION( test_HYDROData_LandCoverMap );