From: adv Date: Fri, 17 Jan 2014 06:34:54 +0000 (+0000) Subject: Dump to python corrected. X-Git-Tag: BR_hydro_v_1_0~74 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3b6027a83768bb776f6577b84c31c860fdb83505;p=modules%2Fhydro.git Dump to python corrected. --- 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;