From a863d01069107030d3e8eb37973fc84a281133f7 Mon Sep 17 00:00:00 2001 From: adv Date: Tue, 29 Oct 2013 11:06:35 +0000 Subject: [PATCH] Reference Bathymetry objects moved to base for geometry objects class. --- src/HYDROData/HYDROData_ImmersibleZone.cxx | 16 ---------------- src/HYDROData/HYDROData_ImmersibleZone.h | 18 ------------------ src/HYDROData/HYDROData_Object.cxx | 18 ++++++++++++++++++ src/HYDROData/HYDROData_Object.h | 19 +++++++++++++++++++ 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index 286cbaa3..a174aa92 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -138,20 +138,4 @@ void HYDROData_ImmersibleZone::RemovePolyline() ClearReferenceObjects( DataTag_Polyline ); } -void HYDROData_ImmersibleZone::SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry ) -{ - SetReferenceObject( theBathymetry, DataTag_Bathymetry ); -} - -Handle(HYDROData_Bathymetry) HYDROData_ImmersibleZone::GetBathymetry() const -{ - return Handle(HYDROData_Bathymetry)::DownCast( - GetReferenceObject( DataTag_Bathymetry ) ); -} - -void HYDROData_ImmersibleZone::RemoveBathymetry() -{ - ClearReferenceObjects( DataTag_Bathymetry ); -} - diff --git a/src/HYDROData/HYDROData_ImmersibleZone.h b/src/HYDROData/HYDROData_ImmersibleZone.h index 883b2fd1..8f9e2fc9 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.h +++ b/src/HYDROData/HYDROData_ImmersibleZone.h @@ -6,7 +6,6 @@ DEFINE_STANDARD_HANDLE(HYDROData_ImmersibleZone, HYDROData_NaturalObject) -class Handle(HYDROData_Bathymetry); class Handle(HYDROData_Polyline); /**\class HYDROData_ImmersibleZone @@ -25,7 +24,6 @@ protected: DataTag_FillingColor, ///< filling color of immersible zone DataTag_BorderColor, ///< border color of immersible zone DataTag_Polyline, ///< reference polyline - DataTag_Bathymetry, ///< reference bathymetry }; public: @@ -99,22 +97,6 @@ public: */ HYDRODATA_EXPORT virtual void RemovePolyline(); - - /** - * Set reference bathymetry object for zone. - */ - HYDRODATA_EXPORT virtual void SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry ); - - /** - * Returns reference bathymetry object of zone. - */ - HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry() const; - - /** - * Clear the bathymetry object for zone. - */ - HYDRODATA_EXPORT virtual void RemoveBathymetry(); - protected: friend class HYDROData_Iterator; diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index ee54ec62..87ffb2df 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -1,6 +1,8 @@ #include "HYDROData_Object.h" +#include "HYDROData_Bathymetry.h" + #include #include @@ -30,6 +32,22 @@ void HYDROData_Object::SetShape3D( const TopoDS_Shape& theShape ) aBuilder.Generated( theShape ); } +void HYDROData_Object::SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry ) +{ + SetReferenceObject( theBathymetry, DataTag_Bathymetry ); +} + +Handle(HYDROData_Bathymetry) HYDROData_Object::GetBathymetry() const +{ + return Handle(HYDROData_Bathymetry)::DownCast( + GetReferenceObject( DataTag_Bathymetry ) ); +} + +void HYDROData_Object::RemoveBathymetry() +{ + ClearReferenceObjects( DataTag_Bathymetry ); +} + TopoDS_Shape HYDROData_Object::getTopShape() const { Handle(TNaming_NamedShape) aNamedShape; diff --git a/src/HYDROData/HYDROData_Object.h b/src/HYDROData/HYDROData_Object.h index 805b593f..59ccfedb 100644 --- a/src/HYDROData/HYDROData_Object.h +++ b/src/HYDROData/HYDROData_Object.h @@ -8,6 +8,7 @@ class TopoDS_Shape; DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity) +class Handle(HYDROData_Bathymetry); /**\class HYDROData_Object * \brief The base class for all geometrical objects in the HYDRO module. @@ -24,6 +25,7 @@ protected: DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve DataTag_TopShape, DataTag_Shape3D, + DataTag_Bathymetry, ///< reference bathymetry }; /** @@ -57,6 +59,23 @@ public: */ HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0; + + /** + * Set reference bathymetry object for geometry object. + */ + HYDRODATA_EXPORT virtual void SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry ); + + /** + * Returns reference bathymetry object of geometry object. + */ + HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry() const; + + /** + * Clear the reference bathymetry object for geometry object. + */ + HYDRODATA_EXPORT virtual void RemoveBathymetry(); + + protected: /** -- 2.39.2