From 29527ae70e9cc00e9f7017f9ab4f7af4091dbf7f Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 15 Jan 2014 10:46:23 +0000 Subject: [PATCH] Common part of dump to python is moved to HYDROData_Entity. --- src/HYDROData/HYDROData_AltitudeObject.cxx | 2 +- src/HYDROData/HYDROData_Bathymetry.cxx | 2 +- src/HYDROData/HYDROData_CalculationCase.cxx | 2 +- src/HYDROData/HYDROData_Channel.cxx | 2 +- src/HYDROData/HYDROData_Confluence.cxx | 2 +- src/HYDROData/HYDROData_Digue.cxx | 2 +- src/HYDROData/HYDROData_Entity.cxx | 6 ++++++ src/HYDROData/HYDROData_Entity.h | 10 ++++++++++ src/HYDROData/HYDROData_Image.cxx | 2 +- src/HYDROData/HYDROData_ImmersibleZone.cxx | 2 +- src/HYDROData/HYDROData_Obstacle.cxx | 2 +- src/HYDROData/HYDROData_ObstacleAltitude.cxx | 2 +- src/HYDROData/HYDROData_Polyline3D.cxx | 2 +- src/HYDROData/HYDROData_PolylineXY.cxx | 2 +- src/HYDROData/HYDROData_Profile.cxx | 2 +- src/HYDROData/HYDROData_Region.cxx | 2 +- src/HYDROData/HYDROData_River.cxx | 2 +- src/HYDROData/HYDROData_Stream.cxx | 2 +- src/HYDROData/HYDROData_StreamAltitude.cxx | 2 +- src/HYDROData/HYDROData_Zone.cxx | 2 +- 20 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/HYDROData/HYDROData_AltitudeObject.cxx b/src/HYDROData/HYDROData_AltitudeObject.cxx index 8c140e43..941582f9 100644 --- a/src/HYDROData/HYDROData_AltitudeObject.cxx +++ b/src/HYDROData/HYDROData_AltitudeObject.cxx @@ -18,7 +18,7 @@ HYDROData_AltitudeObject::~HYDROData_AltitudeObject() QStringList HYDROData_AltitudeObject::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); QString anAltitudeName = GetName(); // TODO diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index 86f403fd..7ac8a237 100644 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -40,7 +40,7 @@ HYDROData_Bathymetry::~HYDROData_Bathymetry() QStringList HYDROData_Bathymetry::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); QString aBathymetryName = GetName(); aResList << QString( "%1.SetAltitudesInverted( %2 );" ) diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index eb3026c0..a6bc84e7 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -102,7 +102,7 @@ void HYDROData_CalculationCase::SetName( const QString& theName ) QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); QString aCalculName = GetName(); HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects(); diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx index 9a564715..b2e9d1cc 100644 --- a/src/HYDROData/HYDROData_Channel.cxx +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -45,7 +45,7 @@ HYDROData_Channel::~HYDROData_Channel() QStringList HYDROData_Channel::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_Confluence.cxx b/src/HYDROData/HYDROData_Confluence.cxx index fd2535e5..5d20481c 100644 --- a/src/HYDROData/HYDROData_Confluence.cxx +++ b/src/HYDROData/HYDROData_Confluence.cxx @@ -22,7 +22,7 @@ HYDROData_Confluence::~HYDROData_Confluence() QStringList HYDROData_Confluence::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_Digue.cxx b/src/HYDROData/HYDROData_Digue.cxx index f63247e1..8fb46694 100644 --- a/src/HYDROData/HYDROData_Digue.cxx +++ b/src/HYDROData/HYDROData_Digue.cxx @@ -23,7 +23,7 @@ HYDROData_Digue::~HYDROData_Digue() QStringList HYDROData_Digue::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index 8931dfe6..2e194aa9 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -49,6 +49,12 @@ void HYDROData_Entity::SetName(const QString& theName) } QStringList HYDROData_Entity::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const +{ + QStringList anEmptyList; + return anEmptyList; +} + +QStringList HYDROData_Entity::dumpObjectCreation( MapOfTreatedObjects& theTreatedObjects ) const { QStringList aResList; diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index d0a9088d..a0af6b11 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -328,6 +328,16 @@ protected: const Handle(HYDROData_Entity)& theRefObject, const QString& theMethod ) const; + /** + * Dump the initial object creation to a Python script. + * You should call it from DumpToPython implementation before + * dumping fields of the object. + */ + QStringList dumpObjectCreation( MapOfTreatedObjects& theTreatedObjects ) const; + + /** + * Returns an object type name as a string for dumping to Python. + */ QString HYDROData_Entity::getPyTypeID() const; protected: diff --git a/src/HYDROData/HYDROData_Image.cxx b/src/HYDROData/HYDROData_Image.cxx index 88e1a3b0..108ba642 100644 --- a/src/HYDROData/HYDROData_Image.cxx +++ b/src/HYDROData/HYDROData_Image.cxx @@ -39,7 +39,7 @@ HYDROData_Image::~HYDROData_Image() QStringList HYDROData_Image::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); QString anImageName = GetName(); QString aFilePath = GetFilePath(); diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index 20424a33..69cfebdd 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -42,7 +42,7 @@ HYDROData_ImmersibleZone::~HYDROData_ImmersibleZone() QStringList HYDROData_ImmersibleZone::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); QString aZoneName = GetName(); QColor aFillingColor = GetFillingColor(); diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index 370b80c7..5572a892 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -52,7 +52,7 @@ HYDROData_Obstacle::~HYDROData_Obstacle() QStringList HYDROData_Obstacle::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_ObstacleAltitude.cxx b/src/HYDROData/HYDROData_ObstacleAltitude.cxx index d74ea473..0b62773b 100644 --- a/src/HYDROData/HYDROData_ObstacleAltitude.cxx +++ b/src/HYDROData/HYDROData_ObstacleAltitude.cxx @@ -18,7 +18,7 @@ HYDROData_ObstacleAltitude::~HYDROData_ObstacleAltitude() QStringList HYDROData_ObstacleAltitude::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_Polyline3D.cxx b/src/HYDROData/HYDROData_Polyline3D.cxx index 2cc3e3af..3931be8f 100644 --- a/src/HYDROData/HYDROData_Polyline3D.cxx +++ b/src/HYDROData/HYDROData_Polyline3D.cxx @@ -33,7 +33,7 @@ HYDROData_Polyline3D::~HYDROData_Polyline3D() QStringList HYDROData_Polyline3D::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 65cd2e00..f462bff3 100755 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -106,7 +106,7 @@ HYDROData_PolylineXY::~HYDROData_PolylineXY() QStringList HYDROData_PolylineXY::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); QString aPolylineName = GetName(); // Set polilyne data diff --git a/src/HYDROData/HYDROData_Profile.cxx b/src/HYDROData/HYDROData_Profile.cxx index 50228619..03c6ba85 100755 --- a/src/HYDROData/HYDROData_Profile.cxx +++ b/src/HYDROData/HYDROData_Profile.cxx @@ -42,7 +42,7 @@ HYDROData_Profile::~HYDROData_Profile() QStringList HYDROData_Profile::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); //TODO diff --git a/src/HYDROData/HYDROData_Region.cxx b/src/HYDROData/HYDROData_Region.cxx index 8c19d65e..b5e05cb7 100644 --- a/src/HYDROData/HYDROData_Region.cxx +++ b/src/HYDROData/HYDROData_Region.cxx @@ -43,7 +43,7 @@ HYDROData_Region::~HYDROData_Region() QStringList HYDROData_Region::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); QString aRegionName = GetName(); HYDROData_SequenceOfObjects aZones = GetZones(); diff --git a/src/HYDROData/HYDROData_River.cxx b/src/HYDROData/HYDROData_River.cxx index 851b5322..27be9ea9 100644 --- a/src/HYDROData/HYDROData_River.cxx +++ b/src/HYDROData/HYDROData_River.cxx @@ -22,7 +22,7 @@ HYDROData_River::~HYDROData_River() QStringList HYDROData_River::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_Stream.cxx b/src/HYDROData/HYDROData_Stream.cxx index d01c043d..07bf9971 100644 --- a/src/HYDROData/HYDROData_Stream.cxx +++ b/src/HYDROData/HYDROData_Stream.cxx @@ -85,7 +85,7 @@ HYDROData_Stream::~HYDROData_Stream() QStringList HYDROData_Stream::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_StreamAltitude.cxx b/src/HYDROData/HYDROData_StreamAltitude.cxx index dc51dbe1..bbcbb566 100644 --- a/src/HYDROData/HYDROData_StreamAltitude.cxx +++ b/src/HYDROData/HYDROData_StreamAltitude.cxx @@ -46,7 +46,7 @@ HYDROData_StreamAltitude::~HYDROData_StreamAltitude() QStringList HYDROData_StreamAltitude::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); // TODO diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index 752af3af..f90f0287 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -30,7 +30,7 @@ HYDROData_Zone::~HYDROData_Zone() QStringList HYDROData_Zone::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { - QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects ); + QStringList aResList = dumpObjectCreation( theTreatedObjects ); HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects(); HYDROData_SequenceOfObjects::Iterator aGeomObjsIter( aGeomObjects ); -- 2.39.2