From 2396bb1dcf012a09bb9492c69da1f30c84c76fe7 Mon Sep 17 00:00:00 2001 From: asl Date: Wed, 14 Oct 2015 18:25:15 +0300 Subject: [PATCH] unified access to default colors --- src/HYDROData/HYDROData_Channel.cxx | 14 ++------------ src/HYDROData/HYDROData_Channel.h | 15 ++------------- src/HYDROData/HYDROData_Digue.cxx | 14 ++------------ src/HYDROData/HYDROData_Digue.h | 16 ++-------------- src/HYDROData/HYDROData_IPolyline.h | 4 ++-- src/HYDROData/HYDROData_ImmersibleZone.cxx | 14 ++------------ src/HYDROData/HYDROData_ImmersibleZone.h | 16 ++-------------- src/HYDROData/HYDROData_LandCover.cxx | 4 ++-- src/HYDROData/HYDROData_LandCover.h | 4 ++-- src/HYDROData/HYDROData_Object.cxx | 12 ++++++------ src/HYDROData/HYDROData_Object.h | 14 ++------------ src/HYDROData/HYDROData_Obstacle.cxx | 14 ++------------ src/HYDROData/HYDROData_Obstacle.h | 15 ++------------- src/HYDROData/HYDROData_Polyline3D.cxx | 14 ++------------ src/HYDROData/HYDROData_Polyline3D.h | 15 ++------------- src/HYDROData/HYDROData_Profile.cxx | 16 +++------------- src/HYDROData/HYDROData_Profile.h | 15 ++------------- src/HYDROData/HYDROData_ShapeFile.cxx | 2 +- src/HYDROData/HYDROData_Stream.cxx | 14 ++------------ src/HYDROData/HYDROData_Stream.h | 14 ++------------ src/HYDROGUI/HYDROGUI_CalculationOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_ChannelOp.cxx | 18 ++++-------------- src/HYDROGUI/HYDROGUI_ChannelOp.h | 4 ---- src/HYDROGUI/HYDROGUI_DigueOp.cxx | 13 ++----------- src/HYDROGUI/HYDROGUI_DigueOp.h | 4 ---- src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx | 8 ++++---- src/HYDROGUI/HYDROGUI_ImportGeomObjectOp.cxx | 4 ++-- src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx | 8 ++++---- .../HYDROGUI_ImportObstacleFromFileOp.cxx | 4 ++-- src/HYDROGUI/HYDROGUI_LandCoverOp.cxx | 8 ++++---- src/HYDROGUI/HYDROGUI_Poly3DOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_ProfileOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_Shape.cxx | 4 ++-- src/HYDROGUI/HYDROGUI_StreamOp.cxx | 8 ++++---- src/HYDROGUI/HYDROGUI_Tool.cxx | 2 +- src/HYDROPy/HYDROData_Channel.sip | 4 ++-- src/HYDROPy/HYDROData_Digue.sip | 4 ++-- src/HYDROPy/HYDROData_Obstacle.sip | 4 ++-- src/HYDROPy/HYDROData_Polyline3D.sip | 4 ++-- src/HYDROPy/HYDROData_PolylineXY.sip | 2 +- src/HYDROPy/HYDROData_Profile.sip | 4 ++-- src/HYDROPy/HYDROData_Stream.sip | 4 ++-- 42 files changed, 89 insertions(+), 274 deletions(-) diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx index 33cd9d81..9efffe94 100644 --- a/src/HYDROData/HYDROData_Channel.cxx +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -343,26 +343,16 @@ bool HYDROData_Channel::IsHas2dPrs() const return true; } -QColor HYDROData_Channel::DefaultFillingColor() +QColor HYDROData_Channel::DefaultFillingColor() const { return QColor( Qt::blue ); } -QColor HYDROData_Channel::DefaultBorderColor() +QColor HYDROData_Channel::DefaultBorderColor() const { return QColor( Qt::transparent ); } -QColor HYDROData_Channel::getDefaultFillingColor() const -{ - return DefaultFillingColor(); -} - -QColor HYDROData_Channel::getDefaultBorderColor() const -{ - return DefaultBorderColor(); -} - bool HYDROData_Channel::SetGuideLine( const Handle(HYDROData_Polyline3D)& theGuideLine ) { Handle(HYDROData_Polyline3D) aPrevGuideLine = GetGuideLine(); diff --git a/src/HYDROData/HYDROData_Channel.h b/src/HYDROData/HYDROData_Channel.h index 6707cfea..86ed56b0 100644 --- a/src/HYDROData/HYDROData_Channel.h +++ b/src/HYDROData/HYDROData_Channel.h @@ -114,12 +114,12 @@ public: /** * Returns default filling color for new channel. */ - HYDRODATA_EXPORT static QColor DefaultFillingColor(); + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; /** * Returns default border color for new channel. */ - HYDRODATA_EXPORT static QColor DefaultBorderColor(); + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; public: @@ -158,17 +158,6 @@ public: protected: - - /** - * Returns default filling color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; - - /** - * Returns default border color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; - /** * Returns the type of child altitude object. * Reimplemented to create chanel altitude object. diff --git a/src/HYDROData/HYDROData_Digue.cxx b/src/HYDROData/HYDROData_Digue.cxx index c6f4d56e..4ba967ac 100644 --- a/src/HYDROData/HYDROData_Digue.cxx +++ b/src/HYDROData/HYDROData_Digue.cxx @@ -38,23 +38,13 @@ HYDROData_Digue::~HYDROData_Digue() { } -QColor HYDROData_Digue::DefaultFillingColor() +QColor HYDROData_Digue::DefaultFillingColor() const { return QColor( Qt::red ); } -QColor HYDROData_Digue::DefaultBorderColor() +QColor HYDROData_Digue::DefaultBorderColor() const { return QColor( Qt::transparent ); } -QColor HYDROData_Digue::getDefaultFillingColor() const -{ - return DefaultFillingColor(); -} - -QColor HYDROData_Digue::getDefaultBorderColor() const -{ - return DefaultBorderColor(); -} - diff --git a/src/HYDROData/HYDROData_Digue.h b/src/HYDROData/HYDROData_Digue.h index 3fe73d5c..c72abf39 100644 --- a/src/HYDROData/HYDROData_Digue.h +++ b/src/HYDROData/HYDROData_Digue.h @@ -49,24 +49,12 @@ public: /** * Returns default filling color for new digue. */ - HYDRODATA_EXPORT static QColor DefaultFillingColor(); + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; /** * Returns default border color for new digue. */ - HYDRODATA_EXPORT static QColor DefaultBorderColor(); - -protected: - - /** - * Returns default filling color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; - - /** - * Returns default border color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; protected: diff --git a/src/HYDROData/HYDROData_IPolyline.h b/src/HYDROData/HYDROData_IPolyline.h index c423f30a..88f54780 100644 --- a/src/HYDROData/HYDROData_IPolyline.h +++ b/src/HYDROData/HYDROData_IPolyline.h @@ -190,8 +190,8 @@ public: */ HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const = 0; - TopoDS_Shape GetShape() const; - void SetShape( const TopoDS_Shape& theShape ); + HYDRODATA_EXPORT TopoDS_Shape GetShape() const; + HYDRODATA_EXPORT void SetShape( const TopoDS_Shape& theShape ); protected: void RemovePolylineShape(); diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index 6a90bfff..aaed2418 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -234,26 +234,16 @@ TopoDS_Shape HYDROData_ImmersibleZone::GetShape3D() const return GetTopShape(); } -QColor HYDROData_ImmersibleZone::DefaultFillingColor() +QColor HYDROData_ImmersibleZone::DefaultFillingColor() const { return QColor( Qt::darkBlue ); } -QColor HYDROData_ImmersibleZone::DefaultBorderColor() +QColor HYDROData_ImmersibleZone::DefaultBorderColor() const { return QColor( Qt::transparent ); } -QColor HYDROData_ImmersibleZone::getDefaultFillingColor() const -{ - return DefaultFillingColor(); -} - -QColor HYDROData_ImmersibleZone::getDefaultBorderColor() const -{ - return DefaultBorderColor(); -} - void HYDROData_ImmersibleZone::SetPolyline( const Handle(HYDROData_PolylineXY)& thePolyline ) { if( IsEqual( GetPolyline(), thePolyline ) ) diff --git a/src/HYDROData/HYDROData_ImmersibleZone.h b/src/HYDROData/HYDROData_ImmersibleZone.h index c888645b..0a9cf542 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.h +++ b/src/HYDROData/HYDROData_ImmersibleZone.h @@ -78,12 +78,12 @@ public: /** * Returns default filling color for new zone. */ - HYDRODATA_EXPORT static QColor DefaultFillingColor(); + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; /** * Returns default border color for new zone. */ - HYDRODATA_EXPORT static QColor DefaultBorderColor(); + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; /** * Sets reference polyline object for zone. @@ -103,18 +103,6 @@ public: HYDRODATA_EXPORT TopoDS_Shape generateTopShape() const; HYDRODATA_EXPORT static TopoDS_Shape generateTopShape( const Handle(HYDROData_PolylineXY)& ); -protected: - - /** - * Returns default filling color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; - - /** - * Returns default border color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; - private: /** diff --git a/src/HYDROData/HYDROData_LandCover.cxx b/src/HYDROData/HYDROData_LandCover.cxx index 4423c83f..410f93e4 100644 --- a/src/HYDROData/HYDROData_LandCover.cxx +++ b/src/HYDROData/HYDROData_LandCover.cxx @@ -164,12 +164,12 @@ QColor HYDROData_LandCover::GetBorderColor() const return GetColor( DefaultBorderColor(), DataTag_BorderColor ); } -QColor HYDROData_LandCover::DefaultFillingColor() +QColor HYDROData_LandCover::DefaultFillingColor() const { return QColor( Qt::magenta ); } -QColor HYDROData_LandCover::DefaultBorderColor() +QColor HYDROData_LandCover::DefaultBorderColor() const { return QColor( Qt::transparent ); } diff --git a/src/HYDROData/HYDROData_LandCover.h b/src/HYDROData/HYDROData_LandCover.h index 8df5e516..645c81cb 100644 --- a/src/HYDROData/HYDROData_LandCover.h +++ b/src/HYDROData/HYDROData_LandCover.h @@ -119,12 +119,12 @@ public: /** * Returns default filling color for new land cover. */ - HYDRODATA_EXPORT static QColor DefaultFillingColor(); + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; /** * Returns default border color for new land cover. */ - HYDRODATA_EXPORT static QColor DefaultBorderColor(); + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; /** * Build the shape presentation of the land cover. diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 95d0efeb..4a094521 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -230,7 +230,7 @@ void HYDROData_Object::SetFillingColor( const QColor& theColor ) QColor HYDROData_Object::GetFillingColor() const { - return GetColor( getDefaultFillingColor(), DataTag_FillingColor ); + return GetColor( DefaultFillingColor(), DataTag_FillingColor ); } void HYDROData_Object::SetBorderColor( const QColor& theColor ) @@ -240,15 +240,15 @@ void HYDROData_Object::SetBorderColor( const QColor& theColor ) QColor HYDROData_Object::GetBorderColor() const { - return GetColor( getDefaultBorderColor(), DataTag_BorderColor ); + return GetColor( DefaultBorderColor(), DataTag_BorderColor ); } -QColor HYDROData_Object::getDefaultFillingColor() const +QColor HYDROData_Object::DefaultFillingColor() const { return QColor( Qt::yellow ); } -QColor HYDROData_Object::getDefaultBorderColor() const +QColor HYDROData_Object::DefaultBorderColor() const { return QColor( Qt::transparent ); } @@ -262,10 +262,10 @@ QStringList HYDROData_Object::dumpObjectCreation( MapOfTreatedObjects& theTreate QStringList aColorsDef; QColor aFillingColor = GetFillingColor(); - setPythonObjectColor( aColorsDef, aFillingColor, getDefaultFillingColor(), "SetFillingColor" ); + setPythonObjectColor( aColorsDef, aFillingColor, DefaultFillingColor(), "SetFillingColor" ); QColor aBorderColor = GetBorderColor(); - setPythonObjectColor( aColorsDef, aBorderColor, getDefaultBorderColor(), "SetBorderColor" ); + setPythonObjectColor( aColorsDef, aBorderColor, DefaultBorderColor(), "SetBorderColor" ); if ( !aColorsDef.isEmpty() ) { diff --git a/src/HYDROData/HYDROData_Object.h b/src/HYDROData/HYDROData_Object.h index 4f582fd9..3b653ce7 100644 --- a/src/HYDROData/HYDROData_Object.h +++ b/src/HYDROData/HYDROData_Object.h @@ -160,18 +160,6 @@ public: HYDRODATA_EXPORT bool IsSubmersible() const; HYDRODATA_EXPORT void SetIsSubmersible( bool ) const; -protected: - - /** - * Returns default filling color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; - - /** - * Returns default border color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; - protected: /** @@ -186,6 +174,8 @@ protected: virtual HYDRODATA_EXPORT ~HYDROData_Object(); protected: + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; /** * Dump the initial object creation to a Python script. diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index 43f468e5..0c1d8e69 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -142,12 +142,12 @@ void HYDROData_Obstacle::SetShape3D( const TopoDS_Shape& theShape ) HYDROData_ArtificialObject::SetTopShape( aShape2d ); } -QColor HYDROData_Obstacle::DefaultFillingColor() +QColor HYDROData_Obstacle::DefaultFillingColor() const { return QColor( Qt::yellow ); } -QColor HYDROData_Obstacle::DefaultBorderColor() +QColor HYDROData_Obstacle::DefaultBorderColor() const { return QColor( Qt::transparent ); } @@ -457,16 +457,6 @@ TopoDS_Shape HYDROData_Obstacle::ImportSTEP( const QString& theFilePath ) const return aResShape; } -QColor HYDROData_Obstacle::getDefaultFillingColor() const -{ - return DefaultFillingColor(); -} - -QColor HYDROData_Obstacle::getDefaultBorderColor() const -{ - return DefaultBorderColor(); -} - ObjectKind HYDROData_Obstacle::getAltitudeObjectType() const { return KIND_OBSTACLE_ALTITUDE; diff --git a/src/HYDROData/HYDROData_Obstacle.h b/src/HYDROData/HYDROData_Obstacle.h index c0ac5822..3c792a16 100644 --- a/src/HYDROData/HYDROData_Obstacle.h +++ b/src/HYDROData/HYDROData_Obstacle.h @@ -70,12 +70,12 @@ public: /** * Returns default filling color for new obstacle. */ - HYDRODATA_EXPORT static QColor DefaultFillingColor(); + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; /** * Returns default border color for new obstacle. */ - HYDRODATA_EXPORT static QColor DefaultBorderColor(); + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; /** @@ -141,17 +141,6 @@ public: const double theDz ); protected: - - /** - * Returns default filling color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; - - /** - * Returns default border color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; - /** * Returns the type of child altitude object. * Reimplemented to create obstacle altitude object. diff --git a/src/HYDROData/HYDROData_Polyline3D.cxx b/src/HYDROData/HYDROData_Polyline3D.cxx index 73545b0f..743e5f56 100644 --- a/src/HYDROData/HYDROData_Polyline3D.cxx +++ b/src/HYDROData/HYDROData_Polyline3D.cxx @@ -199,26 +199,16 @@ void HYDROData_Polyline3D::Update() SetShape3D( aResWire ); } -QColor HYDROData_Polyline3D::DefaultFillingColor() +QColor HYDROData_Polyline3D::DefaultFillingColor() const { return QColor( Qt::transparent ); } -QColor HYDROData_Polyline3D::DefaultBorderColor() +QColor HYDROData_Polyline3D::DefaultBorderColor() const { return QColor( Qt::red ); } -QColor HYDROData_Polyline3D::getDefaultFillingColor() const -{ - return DefaultFillingColor(); -} - -QColor HYDROData_Polyline3D::getDefaultBorderColor() const -{ - return DefaultBorderColor(); -} - bool HYDROData_Polyline3D::SetPolylineXY( const Handle(HYDROData_PolylineXY)& thePolyline, const bool theIsUpdateProfile ) { diff --git a/src/HYDROData/HYDROData_Polyline3D.h b/src/HYDROData/HYDROData_Polyline3D.h index c7d6cd04..2506681e 100644 --- a/src/HYDROData/HYDROData_Polyline3D.h +++ b/src/HYDROData/HYDROData_Polyline3D.h @@ -77,12 +77,12 @@ public: /** * Returns default filling color for new 3D polyline. */ - HYDRODATA_EXPORT static QColor DefaultFillingColor(); + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; /** * Returns default border color for new 3D polyline. */ - HYDRODATA_EXPORT static QColor DefaultBorderColor(); + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; public: @@ -151,17 +151,6 @@ public: HYDRODATA_EXPORT Polyline3DPoints GetPoints() const; protected: - - /** - * Returns default filling color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; - - /** - * Returns default border color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; - /** * Checks and if necessary create child 3D object. * Reimplemented to prevent creation of 3D child object. diff --git a/src/HYDROData/HYDROData_Profile.cxx b/src/HYDROData/HYDROData_Profile.cxx index f78b4cbc..f8dc8a33 100755 --- a/src/HYDROData/HYDROData_Profile.cxx +++ b/src/HYDROData/HYDROData_Profile.cxx @@ -191,26 +191,16 @@ void HYDROData_Profile::Update() SetShape3D( aShape ); } -QColor HYDROData_Profile::DefaultFillingColor() +QColor HYDROData_Profile::DefaultFillingColor() const { return QColor( Qt::transparent ); } -QColor HYDROData_Profile::DefaultBorderColor() +QColor HYDROData_Profile::DefaultBorderColor() const { return QColor( Qt::black ); } -QColor HYDROData_Profile::getDefaultFillingColor() const -{ - return DefaultFillingColor(); -} - -QColor HYDROData_Profile::getDefaultBorderColor() const -{ - return DefaultBorderColor(); -} - bool HYDROData_Profile::IsValid() const { gp_XY aFirstPoint, aLastPoint; @@ -537,7 +527,7 @@ int HYDROData_Profile::ImportFromFile( const Handle(HYDROData_Document)& theDoc, aProfile->SetFilePath( theFileName ); - aProfile->SetBorderColor( HYDROData_Profile::DefaultBorderColor() ); + aProfile->SetBorderColor( aProfile->DefaultBorderColor() ); } return aCreatedProfiles.Length(); diff --git a/src/HYDROData/HYDROData_Profile.h b/src/HYDROData/HYDROData_Profile.h index 997c617c..f1f52380 100644 --- a/src/HYDROData/HYDROData_Profile.h +++ b/src/HYDROData/HYDROData_Profile.h @@ -87,12 +87,12 @@ public: /** * Returns default filling color for new profile. */ - HYDRODATA_EXPORT static QColor DefaultFillingColor(); + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; /** * Returns default border color for new profile. */ - HYDRODATA_EXPORT static QColor DefaultBorderColor(); + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; public: @@ -247,17 +247,6 @@ public: bool* theIsRead = 0 ); protected: - - /** - * Returns default filling color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; - - /** - * Returns default border color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; - /** * Checks and if necessary create child 3D object. * Reimplemented to prevent creation of 3D child object. diff --git a/src/HYDROData/HYDROData_ShapeFile.cxx b/src/HYDROData/HYDROData_ShapeFile.cxx index 16f72c78..15ef8739 100644 --- a/src/HYDROData/HYDROData_ShapeFile.cxx +++ b/src/HYDROData/HYDROData_ShapeFile.cxx @@ -491,7 +491,7 @@ void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, aPolylineObj->SetPolylineXY (aPolylineXY, false); aPolylineObj->SetAltitudeObject(aBath); - aPolylineObj->SetBorderColor( HYDROData_Polyline3D::DefaultBorderColor() ); + aPolylineObj->SetBorderColor( aPolylineObj->DefaultBorderColor() ); aPolylineObj->SetName( aPoly3DName ); aPolylineObj->Update(); diff --git a/src/HYDROData/HYDROData_Stream.cxx b/src/HYDROData/HYDROData_Stream.cxx index b5b58b69..9a6f335f 100644 --- a/src/HYDROData/HYDROData_Stream.cxx +++ b/src/HYDROData/HYDROData_Stream.cxx @@ -269,12 +269,12 @@ void HYDROData_Stream::UpdatePrs() anOutGroup->AddShape( aResultPrs.myOutlet ); } -QColor HYDROData_Stream::DefaultFillingColor() +QColor HYDROData_Stream::DefaultFillingColor() const { return QColor( Qt::green ); } -QColor HYDROData_Stream::DefaultBorderColor() +QColor HYDROData_Stream::DefaultBorderColor() const { return QColor( Qt::transparent ); } @@ -317,16 +317,6 @@ TopoDS_Shape HYDROData_Stream::GetOutletShape() const return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 4); } -QColor HYDROData_Stream::getDefaultFillingColor() const -{ - return DefaultFillingColor(); -} - -QColor HYDROData_Stream::getDefaultBorderColor() const -{ - return DefaultBorderColor(); -} - bool HYDROData_Stream::SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis ) { if ( !IsValidAsAxis( theAxis ) ) diff --git a/src/HYDROData/HYDROData_Stream.h b/src/HYDROData/HYDROData_Stream.h index 1aa0b30f..cfcd6a11 100644 --- a/src/HYDROData/HYDROData_Stream.h +++ b/src/HYDROData/HYDROData_Stream.h @@ -133,12 +133,12 @@ public: /** * Returns default filling color for new stream. */ - HYDRODATA_EXPORT static QColor DefaultFillingColor(); + HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const; /** * Returns default border color for new stream. */ - HYDRODATA_EXPORT static QColor DefaultBorderColor(); + HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const; /** * Returns true if given polyline can be used as stream axis. @@ -289,16 +289,6 @@ protected: static Handle(Geom_BSplineCurve) buildInterpolationCurve( const Handle(TColgp_HArray1OfPnt)& theArrayOfPnt ); - /** - * Returns default filling color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; - - /** - * Returns default border color for new object. - */ - HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; - private: void setParametersArray( const TColStd_Array1OfReal& theArray ); diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index edce573b..29150b4f 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -1339,7 +1339,7 @@ QColor HYDROGUI_CalculationOp::GenerateDefaultZonesColor( int theIndex, int r = aColor.red(); int g = aColor.green(); int b = aColor.blue(); - return ( aColor.isValid() ? aColor : HYDROData_ImmersibleZone::DefaultFillingColor() ); + return ( aColor.isValid() ? aColor : Qt::darkBlue ); } void HYDROGUI_CalculationOp::setRules( HYDROData_CalculationCase::DataTag theDataTag ) diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx index f00d5804..958d9b8a 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx @@ -175,8 +175,8 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags, if ( !myIsEdit ) { - myEditedObject->SetFillingColor( getDefaultFillingColor() ); - myEditedObject->SetBorderColor( getDefaultBorderColor() ); + myEditedObject->SetFillingColor( myEditedObject->DefaultFillingColor() ); + myEditedObject->SetBorderColor( myEditedObject->DefaultBorderColor() ); } QString aGuideLineName = aPanel->getGuideLineName(); @@ -235,16 +235,6 @@ Handle(HYDROData_Channel) HYDROGUI_ChannelOp::createNewObject() const return Handle(HYDROData_Channel)::DownCast( doc()->CreateObject( KIND_CHANNEL ) ); } -QColor HYDROGUI_ChannelOp::getDefaultFillingColor() const -{ - return HYDROData_Channel::DefaultFillingColor(); -} - -QColor HYDROGUI_ChannelOp::getDefaultBorderColor() const -{ - return HYDROData_Channel::DefaultBorderColor(); -} - void HYDROGUI_ChannelOp::onCreatePreview() { HYDROGUI_ChannelDlg* aPanel = ::qobject_cast( inputPanel() ); @@ -277,8 +267,8 @@ void HYDROGUI_ChannelOp::onCreatePreview() { myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() ); - QColor aFillingColor = getDefaultFillingColor(); - QColor aBorderColor = getDefaultBorderColor(); + QColor aFillingColor = myEditedObject->DefaultFillingColor(); + QColor aBorderColor = myEditedObject->DefaultBorderColor(); if ( !myEditedObject.IsNull() ) { aFillingColor = myEditedObject->GetFillingColor(); diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.h b/src/HYDROGUI/HYDROGUI_ChannelOp.h index ec7c9272..d7925f9a 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.h +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.h @@ -54,10 +54,6 @@ protected: virtual Handle(HYDROData_Channel) createNewObject() const; - virtual QColor getDefaultFillingColor() const; - - virtual QColor getDefaultBorderColor() const; - virtual HYDROGUI_Shape* getPreviewShape() const { return myPreviewPrs; }; protected: diff --git a/src/HYDROGUI/HYDROGUI_DigueOp.cxx b/src/HYDROGUI/HYDROGUI_DigueOp.cxx index 6131334d..30e48c0b 100644 --- a/src/HYDROGUI/HYDROGUI_DigueOp.cxx +++ b/src/HYDROGUI/HYDROGUI_DigueOp.cxx @@ -58,8 +58,8 @@ bool HYDROGUI_DigueOp::processApply( int& theUpdateFlags, if ( !myIsEdit ) { - myEditedObject->SetFillingColor( HYDROData_Digue::DefaultFillingColor() ); - myEditedObject->SetBorderColor( HYDROData_Digue::DefaultBorderColor() ); + myEditedObject->SetFillingColor( myEditedObject->DefaultFillingColor() ); + myEditedObject->SetBorderColor( myEditedObject->DefaultBorderColor() ); } return true; @@ -77,12 +77,3 @@ Handle(HYDROData_Channel) HYDROGUI_DigueOp::createNewObject() const return Handle(HYDROData_Digue)::DownCast( doc()->CreateObject( KIND_DIGUE ) ); } -QColor HYDROGUI_DigueOp::getDefaultFillingColor() const -{ - return HYDROData_Digue::DefaultFillingColor(); -} - -QColor HYDROGUI_DigueOp::getDefaultBorderColor() const -{ - return HYDROData_Digue::DefaultBorderColor(); -} diff --git a/src/HYDROGUI/HYDROGUI_DigueOp.h b/src/HYDROGUI/HYDROGUI_DigueOp.h index a733960b..c08d1b73 100644 --- a/src/HYDROGUI/HYDROGUI_DigueOp.h +++ b/src/HYDROGUI/HYDROGUI_DigueOp.h @@ -43,10 +43,6 @@ protected: virtual Handle(HYDROData_Channel) createNewObject() const; - virtual QColor getDefaultFillingColor() const; - - virtual QColor getDefaultBorderColor() const; - private: }; diff --git a/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx b/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx index 678d8059..2e1c844d 100644 --- a/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx @@ -183,8 +183,8 @@ bool HYDROGUI_ImmersibleZoneOp::processApply( int& theUpdateFlags, if ( !myIsEdit ) { - aZoneObj->SetFillingColor( HYDROData_ImmersibleZone::DefaultFillingColor() ); - aZoneObj->SetBorderColor( HYDROData_ImmersibleZone::DefaultBorderColor() ); + aZoneObj->SetFillingColor( aZoneObj->DefaultFillingColor() ); + aZoneObj->SetBorderColor( aZoneObj->DefaultBorderColor() ); } aZoneObj->SetPolyline( aZonePolyline ); @@ -242,8 +242,8 @@ void HYDROGUI_ImmersibleZoneOp::onCreatePreview( const QString& thePolylineName if ( aViewManager && myPreviewPrs ) { - QColor aFillingColor = HYDROData_ImmersibleZone::DefaultFillingColor(); - QColor aBorderColor = HYDROData_ImmersibleZone::DefaultBorderColor(); + QColor aFillingColor = myEditedObject->DefaultFillingColor(); + QColor aBorderColor = myEditedObject->DefaultBorderColor(); if ( !myEditedObject.IsNull() ) { aFillingColor = myEditedObject->GetFillingColor(); aBorderColor = myEditedObject->GetBorderColor(); diff --git a/src/HYDROGUI/HYDROGUI_ImportGeomObjectOp.cxx b/src/HYDROGUI/HYDROGUI_ImportGeomObjectOp.cxx index 9f965563..70f4da94 100644 --- a/src/HYDROGUI/HYDROGUI_ImportGeomObjectOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportGeomObjectOp.cxx @@ -210,8 +210,8 @@ bool HYDROGUI_ImportGeomObjectOp::processApply( int& theUpdateFlags, if ( myOpType == ImportCreatedAsObstacle || myOpType == ImportSelectedAsObstacle ) { anObject = doc()->CreateObject( KIND_OBSTACLE ); Handle(HYDROData_Obstacle) anObstacle = Handle(HYDROData_Obstacle)::DownCast( anObject ); - anObstacle->SetFillingColor( HYDROData_Obstacle::DefaultFillingColor() ); - anObstacle->SetBorderColor( HYDROData_Obstacle::DefaultBorderColor() ); + anObstacle->SetFillingColor( anObstacle->DefaultFillingColor() ); + anObstacle->SetBorderColor( anObstacle->DefaultBorderColor() ); anObstacle->SetGeomObjectEntry( anEntry.toLatin1().constData() ); } else if ( myOpType == ImportSelectedAsPolyline ) { anObject = doc()->CreateObject( KIND_POLYLINEXY ); diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx index ef7afcfc..d7ff0024 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx @@ -160,8 +160,8 @@ bool HYDROGUI_ImportLandCoverOp::processApply( int& theUpdateFlags, for( ;HYDROGUI_Tool::FindObjectByName(module(), aLCName); i++) aLCName = aPanel->getObjectName() + "_polygon_" + QString::number(i); aLC->SetName( aLCName ); - aLC->SetFillingColor( HYDROData_LandCover::DefaultFillingColor() ); - aLC->SetBorderColor( HYDROData_LandCover::DefaultBorderColor() ); + aLC->SetFillingColor( aLC->DefaultFillingColor() ); + aLC->SetBorderColor( aLC->DefaultBorderColor() ); aLC->SetShape(aResShape); aLC->Show(); @@ -253,8 +253,8 @@ void HYDROGUI_ImportLandCoverOp::onFileSelected() { HYDROGUI_Shape* aShape = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() ); - aShape->setFillingColor( HYDROData_LandCover::DefaultFillingColor(), false, false ); - aShape->setBorderColor( HYDROData_LandCover::DefaultBorderColor(), false, false ); + aShape->setFillingColor( aLC->DefaultFillingColor(), false, false ); + aShape->setBorderColor( aLC->DefaultBorderColor(), false, false ); if( !aFace.IsNull() ) aShape->setShape( aLC->GetShape() ); myPolygonName2PrsShape.insert( "polygon_" + QString::number(i), aShape); diff --git a/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx b/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx index b330b3b0..3ad303ca 100644 --- a/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx @@ -152,8 +152,8 @@ bool HYDROGUI_ImportObstacleFromFileOp::processApply( int& theUpdateFlags, if ( anObstacle.IsNull() ) { anObstacle = Handle(HYDROData_Obstacle)::DownCast( doc()->CreateObject(KIND_OBSTACLE) ); - anObstacle->SetFillingColor( HYDROData_Obstacle::DefaultFillingColor() ); - anObstacle->SetBorderColor( HYDROData_Obstacle::DefaultBorderColor() ); + anObstacle->SetFillingColor( anObstacle->DefaultFillingColor() ); + anObstacle->SetBorderColor( anObstacle->DefaultBorderColor() ); } if ( !anObstacle.IsNull() ) { diff --git a/src/HYDROGUI/HYDROGUI_LandCoverOp.cxx b/src/HYDROGUI/HYDROGUI_LandCoverOp.cxx index 17ac4487..76f4aec9 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverOp.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverOp.cxx @@ -217,8 +217,8 @@ bool HYDROGUI_LandCoverOp::processApply( int& theUpdateFlags, if ( !myIsEdit ) { - aZoneObj->SetFillingColor( HYDROData_LandCover::DefaultFillingColor() ); - aZoneObj->SetBorderColor( HYDROData_LandCover::DefaultBorderColor() ); + aZoneObj->SetFillingColor( aZoneObj->DefaultFillingColor() ); + aZoneObj->SetBorderColor( aZoneObj->DefaultBorderColor() ); } aZoneObj->SetPolylines( aZonePolylines ); @@ -281,8 +281,8 @@ void HYDROGUI_LandCoverOp::onCreatePreview( const QStringList& thePolylineNames if ( aViewManager && myPreviewPrs ) { - QColor aFillingColor = HYDROData_LandCover::DefaultFillingColor(); - QColor aBorderColor = HYDROData_LandCover::DefaultBorderColor(); + QColor aFillingColor = myEditedObject->DefaultFillingColor(); + QColor aBorderColor = myEditedObject->DefaultBorderColor(); if ( !myEditedObject.IsNull() ) { aFillingColor = myEditedObject->GetFillingColor(); aBorderColor = myEditedObject->GetBorderColor(); diff --git a/src/HYDROGUI/HYDROGUI_Poly3DOp.cxx b/src/HYDROGUI/HYDROGUI_Poly3DOp.cxx index 0c1f2b2f..9c22b419 100644 --- a/src/HYDROGUI/HYDROGUI_Poly3DOp.cxx +++ b/src/HYDROGUI/HYDROGUI_Poly3DOp.cxx @@ -173,7 +173,7 @@ bool HYDROGUI_Poly3DOp::processApply( int& theUpdateFlags, if( !myIsEdit ) { - aResult->SetBorderColor( HYDROData_Polyline3D::DefaultBorderColor() ); + aResult->SetBorderColor( aResult->DefaultBorderColor() ); } aResult->Update(); diff --git a/src/HYDROGUI/HYDROGUI_ProfileOp.cxx b/src/HYDROGUI/HYDROGUI_ProfileOp.cxx index 759795a5..3148703a 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileOp.cxx @@ -228,7 +228,7 @@ bool HYDROGUI_ProfileOp::processApply( int& theUpdateFlags, if ( !myIsEdit ) { - aProfileObj->SetBorderColor( HYDROData_Profile::DefaultBorderColor() ); + aProfileObj->SetBorderColor( aProfileObj->DefaultBorderColor() ); } // At first we update the child u,z profile object diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index 7e7f3314..d8f5ab5e 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -224,8 +224,8 @@ void HYDROGUI_Shape::update( bool isUpdateViewer, } else { - // Set the filling color for zone - setFillingColor( aZone->GetColor(HYDROData_ImmersibleZone::DefaultFillingColor()) ); + // Set the filling color for zone + setFillingColor( aZone->GetColor( Qt::darkBlue ) ); } } else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Profile) ) ) diff --git a/src/HYDROGUI/HYDROGUI_StreamOp.cxx b/src/HYDROGUI/HYDROGUI_StreamOp.cxx index 6162acb8..c7070ef2 100755 --- a/src/HYDROGUI/HYDROGUI_StreamOp.cxx +++ b/src/HYDROGUI/HYDROGUI_StreamOp.cxx @@ -250,8 +250,8 @@ bool HYDROGUI_StreamOp::processApply( int& theUpdateFlags, if ( !myIsEdit ) { - myEditedObject->SetFillingColor( HYDROData_Stream::DefaultFillingColor() ); - myEditedObject->SetBorderColor( HYDROData_Stream::DefaultBorderColor() ); + myEditedObject->SetFillingColor( myEditedObject->DefaultFillingColor() ); + myEditedObject->SetBorderColor( myEditedObject->DefaultBorderColor() ); } // Erase preview @@ -291,8 +291,8 @@ void HYDROGUI_StreamOp::createPreview() { myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() ); - QColor aFillingColor = HYDROData_Stream::DefaultFillingColor(); - QColor aBorderColor = HYDROData_Stream::DefaultBorderColor(); + QColor aFillingColor = myEditedObject->DefaultFillingColor(); + QColor aBorderColor = myEditedObject->DefaultBorderColor(); if ( !myEditedObject.IsNull() ) { aFillingColor = myEditedObject->GetFillingColor(); diff --git a/src/HYDROGUI/HYDROGUI_Tool.cxx b/src/HYDROGUI/HYDROGUI_Tool.cxx index 41458254..1f0b4d69 100644 --- a/src/HYDROGUI/HYDROGUI_Tool.cxx +++ b/src/HYDROGUI/HYDROGUI_Tool.cxx @@ -680,7 +680,7 @@ QColor HYDROGUI_Tool::GenerateFillingColor( HYDROGUI_Module* theModule, QColor HYDROGUI_Tool::GenerateFillingColor( const Handle(HYDROData_Document)& theDoc, const QStringList& theZoneNames ) { - QColor aFillingColor( HYDROData_ImmersibleZone::DefaultFillingColor() ); + QColor aFillingColor( Qt::darkBlue ); int aCounter = 0; int aR = 0, aG = 0, aB = 0; diff --git a/src/HYDROPy/HYDROData_Channel.sip b/src/HYDROPy/HYDROData_Channel.sip index 3ea42ec5..9c52de3d 100644 --- a/src/HYDROPy/HYDROData_Channel.sip +++ b/src/HYDROPy/HYDROData_Channel.sip @@ -48,12 +48,12 @@ public: /** * Returns default filling color for new channel. */ - static QColor DefaultFillingColor(); + virtual QColor DefaultFillingColor() const; /** * Returns default border color for new channel. */ - static QColor DefaultBorderColor(); + virtual QColor DefaultBorderColor() const; public: diff --git a/src/HYDROPy/HYDROData_Digue.sip b/src/HYDROPy/HYDROData_Digue.sip index 3d3fbc0f..3c6ae7ca 100644 --- a/src/HYDROPy/HYDROData_Digue.sip +++ b/src/HYDROPy/HYDROData_Digue.sip @@ -30,12 +30,12 @@ public: /** * Returns default filling color for new digue. */ - static QColor DefaultFillingColor(); + virtual QColor DefaultFillingColor() const; /** * Returns default border color for new digue. */ - static QColor DefaultBorderColor(); + virtual QColor DefaultBorderColor() const; protected: /** diff --git a/src/HYDROPy/HYDROData_Obstacle.sip b/src/HYDROPy/HYDROData_Obstacle.sip index f480fc93..1a2c505c 100644 --- a/src/HYDROPy/HYDROData_Obstacle.sip +++ b/src/HYDROPy/HYDROData_Obstacle.sip @@ -30,12 +30,12 @@ public: /** * Returns default filling color for new obstacle. */ - static QColor DefaultFillingColor(); + virtual QColor DefaultFillingColor() const; /** * Returns default border color for new obstacle. */ - static QColor DefaultBorderColor(); + virtual QColor DefaultBorderColor() const; public: diff --git a/src/HYDROPy/HYDROData_Polyline3D.sip b/src/HYDROPy/HYDROData_Polyline3D.sip index b6b067b2..58de3fd6 100644 --- a/src/HYDROPy/HYDROData_Polyline3D.sip +++ b/src/HYDROPy/HYDROData_Polyline3D.sip @@ -30,12 +30,12 @@ public: /** * Returns default filling color for new 3D polyline. */ - static QColor DefaultFillingColor(); + virtual QColor DefaultFillingColor() const; /** * Returns default border color for new 3D polyline. */ - static QColor DefaultBorderColor(); + virtual QColor DefaultBorderColor() const; public: diff --git a/src/HYDROPy/HYDROData_PolylineXY.sip b/src/HYDROPy/HYDROData_PolylineXY.sip index f4dc0df5..a32e3f18 100644 --- a/src/HYDROPy/HYDROData_PolylineXY.sip +++ b/src/HYDROPy/HYDROData_PolylineXY.sip @@ -45,7 +45,7 @@ public: /** * Returns default wire color for new polyline. */ - static QColor DefaultWireColor(); + static QColor DefaultWireColor() const; /** * Returns the presentation of polyline section in Qt maner. diff --git a/src/HYDROPy/HYDROData_Profile.sip b/src/HYDROPy/HYDROData_Profile.sip index abbc24bd..9ecd88d0 100644 --- a/src/HYDROPy/HYDROData_Profile.sip +++ b/src/HYDROPy/HYDROData_Profile.sip @@ -34,12 +34,12 @@ public: /** * Returns default filling color for new profile. */ - static QColor DefaultFillingColor(); + virtual QColor DefaultFillingColor() const; /** * Returns default border color for new profile. */ - static QColor DefaultBorderColor(); + virtual QColor DefaultBorderColor() const; public: diff --git a/src/HYDROPy/HYDROData_Stream.sip b/src/HYDROPy/HYDROData_Stream.sip index e9e5b02d..4bb209e6 100644 --- a/src/HYDROPy/HYDROData_Stream.sip +++ b/src/HYDROPy/HYDROData_Stream.sip @@ -35,12 +35,12 @@ public: /** * Returns default filling color for new stream. */ - static QColor DefaultFillingColor(); + virtual QColor DefaultFillingColor() const; /** * Returns default border color for new stream. */ - static QColor DefaultBorderColor(); + virtual QColor DefaultBorderColor() const; /** * Returns true if given polyline can be used as stream axis. -- 2.39.2