From b2793422d30042c499edd45b1a13e1b38f9189dd Mon Sep 17 00:00:00 2001 From: adv Date: Fri, 25 Oct 2013 05:55:55 +0000 Subject: [PATCH] The merging type of conflict bathymetries has been added for calculation region. --- src/HYDROData/HYDROData_Region.cxx | 23 +++++++++++++++++++++++ src/HYDROData/HYDROData_Region.h | 25 ++++++++++++++++++++++++- src/HYDROPy/HYDROData_Region.sip | 21 +++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/src/HYDROData/HYDROData_Region.cxx b/src/HYDROData/HYDROData_Region.cxx index 3a1c59ac..7f4fae7a 100644 --- a/src/HYDROData/HYDROData_Region.cxx +++ b/src/HYDROData/HYDROData_Region.cxx @@ -7,6 +7,8 @@ #include +#include + #define PYTHON_REGION_ID "KIND_REGION" IMPLEMENT_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity) @@ -14,7 +16,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity) HYDROData_Region::HYDROData_Region() + : HYDROData_Entity() { + SetMergeType( Merge_ZMIN ); } HYDROData_Region::~HYDROData_Region() @@ -65,6 +69,25 @@ void HYDROData_Region::RemoveChildZones() myLab.FindChild( ChildTag_Zone ).ForgetAllAttributes( true ); } +void HYDROData_Region::SetMergeType( const MergeBathymetriesType& theType ) +{ + Handle(TDataStd_Integer) anInt; + if ( !myLab.FindChild( DataTag_MergeType ).FindAttribute( TDataStd_Integer::GetID(), anInt ) ) + anInt = TDataStd_Integer::Set( myLab, 0 ); + anInt->Set( (int)theType ); +} + +HYDROData_Region::MergeBathymetriesType HYDROData_Region::GetMergeType() const +{ + MergeBathymetriesType aMergeType = Merge_ZMIN; + + Handle(TDataStd_Integer) anInt; + if ( myLab.FindChild( DataTag_MergeType ).FindAttribute( TDataStd_Integer::GetID(), anInt ) ) + aMergeType = (MergeBathymetriesType)anInt->Get(); + + return aMergeType; +} + int HYDROData_Region::NbZones() const { return NbReferenceObjects( DataTag_Zone ); diff --git a/src/HYDROData/HYDROData_Region.h b/src/HYDROData/HYDROData_Region.h index 1579be6c..e79f9394 100644 --- a/src/HYDROData/HYDROData_Region.h +++ b/src/HYDROData/HYDROData_Region.h @@ -15,6 +15,15 @@ class Handle(HYDROData_Zone); class HYDROData_Region : public HYDROData_Entity { +public: + + // Enumeration of mergin types for conflict bathymetries + enum MergeBathymetriesType + { + Merge_ZMIN, + Merge_ZMAX + }; + protected: /** @@ -23,7 +32,8 @@ protected: enum DataTag { DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve - DataTag_Zone ///< reference zones + DataTag_Zone, ///< reference zones + DataTag_MergeType, ///< mergin type of conflict bathymetries }; /** @@ -61,6 +71,19 @@ public: HYDRODATA_EXPORT virtual void RemoveChildZones(); + /** + * Sets the merging type for conflict bathymetries. + * By default it is set to Merge_ZMIN. + */ + HYDRODATA_EXPORT virtual void SetMergeType( const MergeBathymetriesType& theType ); + + /** + * Returns the merging type for conflict bathymetries. + */ + HYDRODATA_EXPORT virtual MergeBathymetriesType GetMergeType() const; + + + /** * Returns number of reference zones of region. */ diff --git a/src/HYDROPy/HYDROData_Region.sip b/src/HYDROPy/HYDROData_Region.sip index 44be2e0b..5566811b 100644 --- a/src/HYDROPy/HYDROData_Region.sip +++ b/src/HYDROPy/HYDROData_Region.sip @@ -44,6 +44,15 @@ class HYDROData_Region : HYDROData_Entity } %End +public: + + // Enumeration of mergin types for conflict bathymetries + enum MergeBathymetriesType + { + Merge_ZMIN, + Merge_ZMAX + }; + public: /** @@ -70,6 +79,18 @@ public: void RemoveChildZones(); + /** + * Sets the merging type for conflict bathymetries. + * By default it is set to Merge_ZMIN. + */ + void SetMergeType( const MergeBathymetriesType& theType ); + + /** + * Returns the merging type for conflict bathymetries. + */ + MergeBathymetriesType GetMergeType() const; + + /** * Returns number of reference zones of region. */ -- 2.39.2