From: adv Date: Fri, 17 Jan 2014 07:44:23 +0000 (+0000) Subject: Dump of 3D polyline defined on bathymetry corrected. X-Git-Tag: BR_hydro_v_1_0~71 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=46e9c3121cf0a1ffe99a62cbf9640eb2e1f716ba;p=modules%2Fhydro.git Dump of 3D polyline defined on bathymetry corrected. --- diff --git a/src/HYDROData/HYDROData_Polyline3D.cxx b/src/HYDROData/HYDROData_Polyline3D.cxx index c8549930..c55cbe07 100644 --- a/src/HYDROData/HYDROData_Polyline3D.cxx +++ b/src/HYDROData/HYDROData_Polyline3D.cxx @@ -57,7 +57,26 @@ QStringList HYDROData_Polyline3D::DumpToPython( MapOfTreatedObjects& theTreatedO else { Handle(HYDROData_IAltitudeObject) aRefBathymetry = GetAltitudeObject(); - setPythonReferenceObject( theTreatedObjects, aResList, aRefBathymetry, "SetAltitudeObject" ); + if ( !aRefBathymetry.IsNull() ) + { + Handle(HYDROData_ProfileUZ) aChildProfileUZ = GetChildProfileUZ(); + if ( !aChildProfileUZ.IsNull() ) + { + Handle(HYDROData_Profile) aProfile = + Handle(HYDROData_Profile)::DownCast( aChildProfileUZ->GetFatherObject() ); + if ( !aProfile.IsNull() ) + { + QString aProfileName = aProfile->GetObjPyName(); + if ( !aProfileName.isEmpty() ) + { + aResList << QString( "%1.SetChildProfileUZ( %2.GetProfileUZ() );" ) + .arg( aPolylineName ).arg( aProfileName ); + } + } + } + + setPythonReferenceObject( theTreatedObjects, aResList, aRefBathymetry, "SetAltitudeObject" ); + } } aResList << QString( "" ); @@ -307,11 +326,16 @@ Handle(HYDROData_ProfileUZ) HYDROData_Polyline3D::GetChildProfileUZ( const bool aProfileUZ = aProfile->GetProfileUZ(); HYDROData_Polyline3D* me = const_cast( this ); // Temporary to be revised - me->SetReferenceObject( aProfileUZ, DataTag_ChildProfileUZ ); + me->SetChildProfileUZ( aProfileUZ ); return aProfileUZ; } +void HYDROData_Polyline3D::SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile ) +{ + SetReferenceObject( theProfile, DataTag_ChildProfileUZ ); +} + HYDROData_IPolyline::PointsList generateProfileUZPoints( const Handle(HYDROData_PolylineXY)& thePolyline, const Handle(HYDROData_IAltitudeObject)& theAltitude ) diff --git a/src/HYDROData/HYDROData_Polyline3D.h b/src/HYDROData/HYDROData_Polyline3D.h index ad7a6e1a..ea550ca9 100644 --- a/src/HYDROData/HYDROData_Polyline3D.h +++ b/src/HYDROData/HYDROData_Polyline3D.h @@ -132,6 +132,11 @@ public: */ HYDRODATA_EXPORT Handle(HYDROData_ProfileUZ) GetChildProfileUZ( const bool theIsCreate = true ) const; + /** + * Sets the child u,z profile for polyline. + */ + HYDRODATA_EXPORT void SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile ); + protected: diff --git a/src/HYDROPy/HYDROData_Polyline3D.sip b/src/HYDROPy/HYDROData_Polyline3D.sip index a9e2e63d..299d3df4 100644 --- a/src/HYDROPy/HYDROData_Polyline3D.sip +++ b/src/HYDROPy/HYDROData_Polyline3D.sip @@ -167,6 +167,22 @@ public: %End + /** + * Sets the child u,z profile for polyline. + */ + void SetChildProfileUZ( HYDROData_ProfileUZ theProfile ) [void ( const Handle_HYDROData_ProfileUZ& )]; + %MethodCode + Handle(HYDROData_ProfileUZ) aRef = + Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) ); + if ( !aRef.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->HYDROData_Polyline3D::SetChildProfileUZ( aRef ): + sipCpp->SetChildProfileUZ( aRef ); + Py_END_ALLOW_THREADS + } + %End + protected: /**