QStringList HYDROData_Polyline3D::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aPolylineName = GetObjPyName();
- // TODO
+ Handle(HYDROData_PolylineXY) aRefPolyline = GetPolylineXY();
+ setPythonReferenceObject( theTreatedObjects, aResList, aRefPolyline, "SetPolylineXY" );
+
+ 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( aPolylineName );
+ aResList << QString( "" );
return aResList;
}
aProfileUZ = aProfile->GetProfileUZ();
- Handle(HYDROData_Polyline3D) me = this;
+ HYDROData_Polyline3D* me = const_cast<HYDROData_Polyline3D*>( this ); // Temporary to be revised
me->SetReferenceObject( aProfileUZ, DataTag_ChildProfileUZ );
return aProfileUZ;