From: mzn Date: Wed, 20 Nov 2013 07:40:31 +0000 (+0000) Subject: Move color tags to the base geometrical object class. X-Git-Tag: BR_hydro_v_0_3_1~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d5ab854432d2b0ec5a504b7f5bbf67d12bec472a;p=modules%2Fhydro.git Move color tags to the base geometrical object class. --- diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index b66b6460..f113ba31 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -97,31 +97,11 @@ QColor HYDROData_ImmersibleZone::DefaultFillingColor() return QColor( Qt::green ); } -void HYDROData_ImmersibleZone::SetFillingColor( const QColor& theColor ) -{ - return SetColor( theColor, DataTag_FillingColor ); -} - -QColor HYDROData_ImmersibleZone::GetFillingColor() const -{ - return GetColor( DefaultFillingColor(), DataTag_FillingColor ); -} - QColor HYDROData_ImmersibleZone::DefaultBorderColor() { return QColor( Qt::transparent ); } -void HYDROData_ImmersibleZone::SetBorderColor( const QColor& theColor ) -{ - return SetColor( theColor, DataTag_BorderColor ); -} - -QColor HYDROData_ImmersibleZone::GetBorderColor() const -{ - return GetColor( DefaultBorderColor(), DataTag_BorderColor ); -} - void HYDROData_ImmersibleZone::SetPolyline( const Handle(HYDROData_Polyline)& thePolyline ) { SetReferenceObject( thePolyline, DataTag_Polyline ); diff --git a/src/HYDROData/HYDROData_ImmersibleZone.h b/src/HYDROData/HYDROData_ImmersibleZone.h index 8f9e2fc9..c540574c 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.h +++ b/src/HYDROData/HYDROData_ImmersibleZone.h @@ -21,8 +21,6 @@ protected: enum DataTag { DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve - DataTag_FillingColor, ///< filling color of immersible zone - DataTag_BorderColor, ///< border color of immersible zone DataTag_Polyline, ///< reference polyline }; @@ -49,39 +47,16 @@ public: */ HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; - /** * Returns default filling color for new zone. */ HYDRODATA_EXPORT static QColor DefaultFillingColor(); - /** - * Sets filling color for zone. - */ - HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor ); - - /** - * Returns filling color of zone. - */ - HYDRODATA_EXPORT virtual QColor GetFillingColor() const; - - /** * Returns default border color for new zone. */ HYDRODATA_EXPORT static QColor DefaultBorderColor(); - /** - * Sets border color for zone. - */ - HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor ); - - /** - * Returns border color of zone. - */ - HYDRODATA_EXPORT virtual QColor GetBorderColor() const; - - /** * Sets reference polyline object for zone. */ diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 87ffb2df..4bc6d235 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -8,6 +8,8 @@ #include +#include + IMPLEMENT_STANDARD_HANDLE(HYDROData_Object,HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Object,HYDROData_Entity) @@ -64,3 +66,32 @@ TopoDS_Shape HYDROData_Object::getShape3D() const return TopoDS_Shape(); } +void HYDROData_Object::SetFillingColor( const QColor& theColor ) +{ + return SetColor( theColor, DataTag_FillingColor ); +} + +QColor HYDROData_Object::GetFillingColor() const +{ + return GetColor( DefaultFillingColor(), DataTag_FillingColor ); +} + +void HYDROData_Object::SetBorderColor( const QColor& theColor ) +{ + return SetColor( theColor, DataTag_BorderColor ); +} + +QColor HYDROData_Object::GetBorderColor() const +{ + return GetColor( DefaultBorderColor(), DataTag_BorderColor ); +} + +QColor HYDROData_Object::DefaultFillingColor() +{ + return QColor( Qt::yellow ); +} + +QColor HYDROData_Object::DefaultBorderColor() +{ + return QColor( Qt::transparent ); +} \ No newline at end of file diff --git a/src/HYDROData/HYDROData_Object.h b/src/HYDROData/HYDROData_Object.h index fec76b16..594bbd60 100644 --- a/src/HYDROData/HYDROData_Object.h +++ b/src/HYDROData/HYDROData_Object.h @@ -26,6 +26,8 @@ protected: DataTag_TopShape, DataTag_Shape3D, DataTag_Bathymetry, ///< reference bathymetry + DataTag_FillingColor, ///< filling color of geometrical object + DataTag_BorderColor ///< border color of geometrical object }; public: @@ -67,6 +69,35 @@ public: */ HYDRODATA_EXPORT virtual void RemoveBathymetry(); + /** + * Sets filling color for object. + */ + HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor ); + + /** + * Returns filling color of object. + */ + HYDRODATA_EXPORT virtual QColor GetFillingColor() const; + + /** + * Sets border color for object. + */ + HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor ); + + /** + * Returns border color of object. + */ + HYDRODATA_EXPORT virtual QColor GetBorderColor() const; + + /** + * Returns default filling color for new object. + */ + HYDRODATA_EXPORT static QColor DefaultFillingColor(); + + /** + * Returns default border color for new object. + */ + HYDRODATA_EXPORT static QColor DefaultBorderColor(); protected: