From 3b6027a83768bb776f6577b84c31c860fdb83505 Mon Sep 17 00:00:00 2001 From: adv Date: Fri, 17 Jan 2014 06:34:54 +0000 Subject: [PATCH] Dump to python corrected. --- src/HYDROData/HYDROData_Polyline3D.cxx | 29 +++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/HYDROData/HYDROData_Polyline3D.cxx b/src/HYDROData/HYDROData_Polyline3D.cxx index d5a9425e..c8549930 100644 --- a/src/HYDROData/HYDROData_Polyline3D.cxx +++ b/src/HYDROData/HYDROData_Polyline3D.cxx @@ -34,19 +34,34 @@ HYDROData_Polyline3D::~HYDROData_Polyline3D() QStringList HYDROData_Polyline3D::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const { QStringList aResList = dumpObjectCreation( theTreatedObjects ); - QString aName = GetObjPyName(); + QString aPolylineName = GetObjPyName(); Handle(HYDROData_PolylineXY) aRefPolyline = GetPolylineXY(); setPythonReferenceObject( theTreatedObjects, aResList, aRefPolyline, "SetPolylineXY" ); - Handle(HYDROData_ProfileUZ) aRefProfile = GetProfileUZ(); - setPythonReferenceObject( theTreatedObjects, aResList, aRefProfile, "SetProfileUZ" ); - - Handle(HYDROData_IAltitudeObject) aRefBathymetry = GetAltitudeObject(); - setPythonReferenceObject( theTreatedObjects, aResList, aRefBathymetry, "SetAltitudeObject" ); + Handle(HYDROData_ProfileUZ) aRefProfileUZ = GetProfileUZ(); + if ( !aRefProfileUZ.IsNull() ) + { + Handle(HYDROData_Profile) aProfile = + Handle(HYDROData_Profile)::DownCast( aRefProfileUZ->GetFatherObject() ); + if ( !aProfile.IsNull() ) + { + QString aProfileName = aProfile->GetObjPyName(); + if ( !aProfileName.isEmpty() ) + { + aResList << QString( "%1.SetProfileUZ( %2.GetProfileUZ() );" ) + .arg( aPolylineName ).arg( aProfileName ); + } + } + } + else + { + Handle(HYDROData_IAltitudeObject) aRefBathymetry = GetAltitudeObject(); + setPythonReferenceObject( theTreatedObjects, aResList, aRefBathymetry, "SetAltitudeObject" ); + } aResList << QString( "" ); - aResList << QString( "%1.Update();" ).arg( aName ); + aResList << QString( "%1.Update();" ).arg( aPolylineName ); aResList << QString( "" ); return aResList; -- 2.39.2