From: rkv Date: Fri, 10 Jan 2014 06:22:59 +0000 (+0000) Subject: SIP: HYDROData_Channel is included. X-Git-Tag: BR_hydro_v_1_0~120 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e1bfba349657ca901df4e56100bf9f19b2470bf2;p=modules%2Fhydro.git SIP: HYDROData_Channel is included. --- diff --git a/CMake/UsePyQt4EXT.cmake b/CMake/UsePyQt4EXT.cmake index 2055e4e7..3ac815a2 100644 --- a/CMake/UsePyQt4EXT.cmake +++ b/CMake/UsePyQt4EXT.cmake @@ -94,6 +94,9 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles) LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc) + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Channel.cc) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Channel.cc) + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc) diff --git a/src/HYDROData/HYDROData_Channel.h b/src/HYDROData/HYDROData_Channel.h index 269d0db9..72a4621e 100644 --- a/src/HYDROData/HYDROData_Channel.h +++ b/src/HYDROData/HYDROData_Channel.h @@ -124,7 +124,7 @@ protected: * Returns the type of child altitude object. * Reimplemented to create chanel altitude object. */ - virtual ObjectKind getAltitudeObjectType() const; + HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const; protected: diff --git a/src/HYDROPy/CMakeLists.txt b/src/HYDROPy/CMakeLists.txt index b5a3cc41..6dc46a3d 100644 --- a/src/HYDROPy/CMakeLists.txt +++ b/src/HYDROPy/CMakeLists.txt @@ -96,6 +96,7 @@ SET(_sip_files2 HYDROData_PolylineXY.sip HYDROData_ArtificialObject.sip HYDROData_Obstacle.sip + HYDROData_Channel.sip HYDROData_NaturalObject.sip HYDROData_River.sip HYDROData_Image.sip diff --git a/src/HYDROPy/HYDROData.sip b/src/HYDROPy/HYDROData.sip index 57525ea3..e3146295 100644 --- a/src/HYDROPy/HYDROData.sip +++ b/src/HYDROPy/HYDROData.sip @@ -68,7 +68,7 @@ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com %Include HYDROData_PolylineXY.sip %Include HYDROData_ArtificialObject.sip %Include HYDROData_Obstacle.sip -//Include HYDROData_Channel.sip +%Include HYDROData_Channel.sip //Include HYDROData_Digue.sip %Include HYDROData_NaturalObject.sip %Include HYDROData_River.sip diff --git a/src/HYDROPy/HYDROData_ArtificialObject.sip b/src/HYDROPy/HYDROData_ArtificialObject.sip index 3172a728..084f730c 100644 --- a/src/HYDROPy/HYDROData_ArtificialObject.sip +++ b/src/HYDROPy/HYDROData_ArtificialObject.sip @@ -39,6 +39,12 @@ class HYDROData_ArtificialObject : HYDROData_Object /Abstract/ sipClass = sipClass_HYDROData_Obstacle; break; + case KIND_CHANNEL: + { + sipClass = sipClass_HYDROData_Channel; + break; + } + case KIND_UNKNOWN: sipClass = sipClass_HYDROData_ArtificialObject; break; diff --git a/src/HYDROPy/HYDROData_Channel.sip b/src/HYDROPy/HYDROData_Channel.sip index 6c81449e..827d62ef 100644 --- a/src/HYDROPy/HYDROData_Channel.sip +++ b/src/HYDROPy/HYDROData_Channel.sip @@ -48,33 +48,79 @@ public: /** * Sets reference guide line object for channel. */ - virtual bool SetGuideLine( const Handle(HYDROData_Polyline3D)& theGuideLine ); + bool SetGuideLine( HYDROData_Polyline3D theGuideLine ) + [bool ( const Handle_HYDROData_Polyline3D& )]; + %MethodCode + Handle(HYDROData_Polyline3D) aRef = + Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) ); + if ( !aRef.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_Channel::SetGuideLine( aRef ): + sipCpp->SetGuideLine( aRef ); + Py_END_ALLOW_THREADS + } + %End /** * Returns reference guide line object of channel. */ - virtual Handle(HYDROData_Polyline3D) GetGuideLine() const; + HYDROData_Polyline3D GetGuideLine() const + [Handle_HYDROData_Polyline3D ()]; + %MethodCode + Handle(HYDROData_Polyline3D) aRef; + + Py_BEGIN_ALLOW_THREADS + aRef = sipSelfWasArg ? sipCpp->HYDROData_Channel::GetGuideLine() : + sipCpp->GetGuideLine(); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_Polyline3D*)createPointer( aRef ); + %End /** * Remove reference guide line object from channel. */ - virtual void RemoveGuideLine(); + void RemoveGuideLine(); /** * Sets reference profile object for channel. */ - virtual bool SetProfile( const Handle(HYDROData_Profile)& theProfile ); + bool SetProfile( HYDROData_Profile theProfile ) + [bool ( const Handle_HYDROData_Profile& )]; + %MethodCode + Handle(HYDROData_Profile) aRef = + Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) ); + if ( !aRef.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_Channel::SetProfile( aRef ): + sipCpp->SetProfile( aRef ); + Py_END_ALLOW_THREADS + } + %End /** * Returns reference profile object of channel. */ - virtual Handle(HYDROData_Profile) GetProfile() const; + HYDROData_Profile GetProfile() const + [Handle_HYDROData_Profile ()]; + %MethodCode + Handle(HYDROData_Profile) aRef; + + Py_BEGIN_ALLOW_THREADS + aRef = sipSelfWasArg ? sipCpp->HYDROData_Channel::GetProfile() : + sipCpp->GetProfile(); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_Profile*)createPointer( aRef ); + %End /** * Remove reference profile object from channel. */ - virtual void RemoveProfile(); + void RemoveProfile(); protected: diff --git a/src/HYDROPy/HYDROData_Document.sip b/src/HYDROPy/HYDROData_Document.sip index ca96f19d..182ec3ca 100644 --- a/src/HYDROPy/HYDROData_Document.sip +++ b/src/HYDROPy/HYDROData_Document.sip @@ -127,6 +127,11 @@ class HYDROData_Document aRes = new HYDROData_Zone( *dynamic_cast( theObject ) ); break; } + case KIND_CHANNEL: + { + aRes = new HYDROData_Channel( *dynamic_cast( theObject ) ); + break; + } } return aRes; diff --git a/src/HYDROPy/HYDROData_Entity.sip b/src/HYDROPy/HYDROData_Entity.sip index 5371a05a..856b29c0 100644 --- a/src/HYDROPy/HYDROData_Entity.sip +++ b/src/HYDROPy/HYDROData_Entity.sip @@ -79,6 +79,10 @@ class HYDROData_Entity sipClass = sipClass_HYDROData_ImmersibleZone; break; + case KIND_CHANNEL: + sipClass = sipClass_HYDROData_Channel; + break; + case KIND_CALCULATION: sipClass = sipClass_HYDROData_CalculationCase; break; diff --git a/src/HYDROPy/HYDROData_Object.sip b/src/HYDROPy/HYDROData_Object.sip index a8af933e..5aa78969 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_CHANNEL: + sipClass = sipClass_HYDROData_Channel; + break; + case KIND_POLYLINE: sipClass = sipClass_HYDROData_Polyline3D; break;