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;