From: rkv Date: Wed, 8 Jan 2014 13:08:27 +0000 (+0000) Subject: SIP: HYDROData_Polyline3D is included. X-Git-Tag: BR_hydro_v_0_8~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b60a48c43d8cce2dffe69ae6fb825379ab988f9b;p=modules%2Fhydro.git SIP: HYDROData_Polyline3D is included. --- diff --git a/CMake/UsePyQt4EXT.cmake b/CMake/UsePyQt4EXT.cmake index 76a77962..2055e4e7 100644 --- a/CMake/UsePyQt4EXT.cmake +++ b/CMake/UsePyQt4EXT.cmake @@ -88,6 +88,9 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles) LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Profile.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Profile.cc) + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Polyline3D.cc) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Polyline3D.cc) + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc) diff --git a/src/HYDROPy/CMakeLists.txt b/src/HYDROPy/CMakeLists.txt index 19bcb5d2..b5a3cc41 100644 --- a/src/HYDROPy/CMakeLists.txt +++ b/src/HYDROPy/CMakeLists.txt @@ -91,6 +91,7 @@ SET(_sip_files2 HYDROData_ObstacleAltitude.sip HYDROData_Object.sip HYDROData_Profile.sip + HYDROData_Polyline3D.sip HYDROData_ProfileUZ.sip HYDROData_PolylineXY.sip HYDROData_ArtificialObject.sip diff --git a/src/HYDROPy/HYDROData.sip b/src/HYDROPy/HYDROData.sip index 0f463874..57525ea3 100644 --- a/src/HYDROPy/HYDROData.sip +++ b/src/HYDROPy/HYDROData.sip @@ -63,7 +63,7 @@ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com %Include HYDROData_ObstacleAltitude.sip %Include HYDROData_Object.sip %Include HYDROData_Profile.sip -//Include HYDROData_Polyline3D.sip +%Include HYDROData_Polyline3D.sip %Include HYDROData_ProfileUZ.sip %Include HYDROData_PolylineXY.sip %Include HYDROData_ArtificialObject.sip diff --git a/src/HYDROPy/HYDROData_Document.sip b/src/HYDROPy/HYDROData_Document.sip index a5c3872e..ca96f19d 100644 --- a/src/HYDROPy/HYDROData_Document.sip +++ b/src/HYDROPy/HYDROData_Document.sip @@ -72,6 +72,11 @@ class HYDROData_Document aRes = new HYDROData_Bathymetry( *dynamic_cast( theObject ) ); break; } +/* case KIND_ALTITUDE: + { + aRes = new HYDROData_AltitudeObject( *dynamic_cast( theObject ) ); + break; + }*/ case KIND_OBSTACLE_ALTITUDE: { aRes = new HYDROData_ObstacleAltitude( *dynamic_cast( theObject ) ); @@ -82,6 +87,11 @@ class HYDROData_Document aRes = new HYDROData_ImmersibleZone( *dynamic_cast( theObject ) ); break; } + case KIND_POLYLINE: + { + aRes = new HYDROData_Polyline3D( *dynamic_cast( theObject ) ); + break; + } case KIND_PROFILE: { aRes = new HYDROData_Profile( *dynamic_cast( theObject ) ); diff --git a/src/HYDROPy/HYDROData_Entity.sip b/src/HYDROPy/HYDROData_Entity.sip index f5b75504..c216fb94 100644 --- a/src/HYDROPy/HYDROData_Entity.sip +++ b/src/HYDROPy/HYDROData_Entity.sip @@ -63,6 +63,10 @@ class HYDROData_Entity sipClass = sipClass_HYDROData_PolylineXY; break; + case KIND_PROFILEUZ: + sipClass = sipClass_HYDROData_ProfileUZ; + break; + case KIND_BATHYMETRY: sipClass = sipClass_HYDROData_Bathymetry; break; @@ -83,6 +87,10 @@ class HYDROData_Entity sipClass = sipClass_HYDROData_Obstacle; break; + case KIND_POLYLINE: + sipClass = sipClass_HYDROData_Polyline3D; + break; + case KIND_PROFILE: sipClass = sipClass_HYDROData_Profile; break; diff --git a/src/HYDROPy/HYDROData_IAltitudeObject.sip b/src/HYDROPy/HYDROData_IAltitudeObject.sip index 66c176ae..99cc265e 100644 --- a/src/HYDROPy/HYDROData_IAltitudeObject.sip +++ b/src/HYDROPy/HYDROData_IAltitudeObject.sip @@ -38,6 +38,10 @@ class HYDROData_IAltitudeObject : HYDROData_Entity /Abstract/ sipClass = sipClass_HYDROData_ObstacleAltitude; break; +/* case KIND_ALTITUDE: + sipClass = sipClass_HYDROData_AltitudeObject; + break;*/ + default: // We don't recognise the type. sipClass = NULL; diff --git a/src/HYDROPy/HYDROData_Object.sip b/src/HYDROPy/HYDROData_Object.sip index a451938a..a8af933e 100644 --- a/src/HYDROPy/HYDROData_Object.sip +++ b/src/HYDROPy/HYDROData_Object.sip @@ -42,6 +42,10 @@ class HYDROData_Object : HYDROData_Entity /Abstract/ sipClass = sipClass_HYDROData_ImmersibleZone; break; + case KIND_POLYLINE: + sipClass = sipClass_HYDROData_Polyline3D; + break; + case KIND_PROFILE: sipClass = sipClass_HYDROData_Profile; break; diff --git a/src/HYDROPy/HYDROData_Polyline3D.sip b/src/HYDROPy/HYDROData_Polyline3D.sip index a690c3bb..a9e2e63d 100644 --- a/src/HYDROPy/HYDROData_Polyline3D.sip +++ b/src/HYDROPy/HYDROData_Polyline3D.sip @@ -48,29 +48,76 @@ public: /** * Sets reference x,y polyline object for 3D polyline. */ - virtual bool SetPolylineXY( const Handle(HYDROData_PolylineXY)& thePolyline, - const bool theIsUpdateProfile = true ); + bool SetPolylineXY( HYDROData_PolylineXY thePolyline, + const bool theIsUpdateProfile = true ) + [bool ( const Handle_HYDROData_PolylineXY&, + const bool = true )]; + %MethodCode + Handle(HYDROData_PolylineXY) aRef = + Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); + if ( !aRef.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_Polyline3D::SetPolylineXY( aRef, a1 ): + sipCpp->SetPolylineXY( aRef, a1 ); + Py_END_ALLOW_THREADS + } + %End /** * Returns reference x,y polyline object of 3D polyline. */ - virtual Handle(HYDROData_PolylineXY) GetPolylineXY() const; + HYDROData_PolylineXY GetPolylineXY() const + [Handle_HYDROData_PolylineXY ()]; + %MethodCode + Handle(HYDROData_PolylineXY) aRef; + + Py_BEGIN_ALLOW_THREADS + aRef = sipSelfWasArg ? sipCpp->HYDROData_Polyline3D::GetPolylineXY() : + sipCpp->GetPolylineXY(); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_PolylineXY*)createPointer( aRef ); + %End /** * Remove reference x,y polyline object from 3D polyline. */ - virtual void RemovePolylineXY(); + void RemovePolylineXY(); /** * Sets reference u,z profile object for 3D polyline. */ - virtual bool SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile ); + bool SetProfileUZ( HYDROData_ProfileUZ theProfile ) + [bool ( const Handle_HYDROData_ProfileUZ& )]; + %MethodCode + Handle(HYDROData_ProfileUZ) aRef = + Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) ); + if ( !aRef.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_Polyline3D::SetProfileUZ( aRef ): + sipCpp->SetProfileUZ( aRef ); + Py_END_ALLOW_THREADS + } + %End /** * Returns reference u,z profile object of 3D polyline. */ - virtual Handle(HYDROData_ProfileUZ) GetProfileUZ() const; + HYDROData_ProfileUZ GetProfileUZ() const + [Handle_HYDROData_ProfileUZ ()]; + %MethodCode + Handle(HYDROData_ProfileUZ) aRef; + + Py_BEGIN_ALLOW_THREADS + aRef = sipSelfWasArg ? sipCpp->HYDROData_Polyline3D::GetProfileUZ() : + sipCpp->GetProfileUZ(); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_ProfileUZ*)createPointer( aRef ); + %End /** * Remove reference u,z profile object from 3D polyline. @@ -82,19 +129,42 @@ public: * Set reference bathymetry object for geometry object. * Reimplemented to remove reference u,z profile. */ - virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude ); + bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) + [bool ( const Handle_HYDROData_IAltitudeObject& )]; + %MethodCode + Handle(HYDROData_IAltitudeObject) aRef = + Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) ); + if ( !aRef.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_Polyline3D::SetAltitudeObject( aRef ): + sipCpp->SetAltitudeObject( aRef ); + Py_END_ALLOW_THREADS + } + %End /** * Clear the reference bathymetry object for geometry object. * Reimplemented to remove child u,z profile. */ - virtual void RemoveAltitudeObject(); + void RemoveAltitudeObject(); /** * Returns the child u,z profile which has been generated from bathymetry. */ - Handle(HYDROData_ProfileUZ) GetChildProfileUZ( const bool theIsCreate = true ) const; + HYDROData_ProfileUZ GetChildProfileUZ( const bool theIsCreate = true ) const + [Handle_HYDROData_ProfileUZ ( const bool = true )]; + %MethodCode + Handle(HYDROData_ProfileUZ) aRef; + + Py_BEGIN_ALLOW_THREADS + aRef = sipSelfWasArg ? sipCpp->HYDROData_Polyline3D::GetChildProfileUZ( a0 ) : + sipCpp->GetChildProfileUZ( a0 ); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_ProfileUZ*)createPointer( aRef ); + %End protected: diff --git a/src/HYDROPy/HYDROData_Profile.sip b/src/HYDROPy/HYDROData_Profile.sip index 6b11c594..d94a1c9d 100644 --- a/src/HYDROPy/HYDROData_Profile.sip +++ b/src/HYDROPy/HYDROData_Profile.sip @@ -175,7 +175,7 @@ public: * \param theFileName the path to file * \return \c number of successfully imported profiles */ - static int ImportFromFile( HYDROData_Document theDoc, + static int ImportFromFile( const HYDROData_Document theDoc, const TCollection_AsciiString& theFileName, NCollection_Sequence& theBadProfilesIds ) [int ( const Handle_HYDROData_Document& ,