From: rkv Date: Fri, 10 Jan 2014 08:10:16 +0000 (+0000) Subject: SIP: HYDROData_Stream is included. X-Git-Tag: BR_hydro_v_1_0~118 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=373b25511ebe691dc0e332996521c0de189f6db2;p=modules%2Fhydro.git SIP: HYDROData_Stream is included. --- diff --git a/CMake/UsePyQt4EXT.cmake b/CMake/UsePyQt4EXT.cmake index 94d43d86..50746cdc 100644 --- a/CMake/UsePyQt4EXT.cmake +++ b/CMake/UsePyQt4EXT.cmake @@ -99,7 +99,7 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles) LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Digue.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Digue.cc) - + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc) @@ -112,6 +112,9 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles) LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc) + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Stream.cc) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Stream.cc) + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc) diff --git a/src/HYDROData/HYDROData_Stream.h b/src/HYDROData/HYDROData_Stream.h index bba1d0a6..b1ee6f48 100644 --- a/src/HYDROData/HYDROData_Stream.h +++ b/src/HYDROData/HYDROData_Stream.h @@ -185,7 +185,7 @@ protected: * Returns the type of child altitude object. * Reimplemented to create stream altitude object. */ - virtual ObjectKind getAltitudeObjectType() const; + HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const; /** * Builds b-spline using interpolation algorithm. @@ -195,12 +195,12 @@ protected: /** * Returns default filling color for new object. */ - virtual QColor getDefaultFillingColor() const; + HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const; /** * Returns default border color for new object. */ - virtual QColor getDefaultBorderColor() const; + HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const; private: diff --git a/src/HYDROPy/CMakeLists.txt b/src/HYDROPy/CMakeLists.txt index 47ac660d..f39075f7 100644 --- a/src/HYDROPy/CMakeLists.txt +++ b/src/HYDROPy/CMakeLists.txt @@ -53,31 +53,6 @@ SET(_sip_files HYDROData.sip ) -#TODO: new files include like this: -# HYDROData_Entity.sip -# HYDROData_IPolyline.sip -# HYDROData_IAltitudeObject.sip -## HYDROData_ObstacleAltitude.sip -# HYDROData_Object.sip -## HYDROData_Profile.sip -## HYDROData_Polyline3D.sip -# HYDROData_ProfileUZ.sip -# HYDROData_PolylineXY.sip -# HYDROData_ArtificialObject.sip -# HYDROData_Obstacle.sip -## HYDROData_Channel.sip -## HYDROData_Digue.sip -# HYDROData_NaturalObject.sip -# HYDROData_River.sip -## HYDROData_Stream.sip -# HYDROData_Image.sip -# HYDROData_Bathymetry.sip -# HYDROData_ImmersibleZone.sip -# HYDROData_Zone.sip -# HYDROData_Region.sip -# HYDROData_CalculationCase.sip -# HYDROData_Document.sip - SET(_sip_files2 CAS/gp_XY.sip CAS/gp_XYZ.sip @@ -100,6 +75,7 @@ SET(_sip_files2 HYDROData_Digue.sip HYDROData_NaturalObject.sip HYDROData_River.sip + HYDROData_Stream.sip HYDROData_Image.sip HYDROData_Bathymetry.sip HYDROData_ImmersibleZone.sip diff --git a/src/HYDROPy/HYDROData.sip b/src/HYDROPy/HYDROData.sip index 801d1674..a0ec3a37 100644 --- a/src/HYDROPy/HYDROData.sip +++ b/src/HYDROPy/HYDROData.sip @@ -72,7 +72,7 @@ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com %Include HYDROData_Digue.sip %Include HYDROData_NaturalObject.sip %Include HYDROData_River.sip -//Include HYDROData_Stream.sip +%Include HYDROData_Stream.sip %Include HYDROData_Image.sip %Include HYDROData_PolylineXY.sip %Include HYDROData_Bathymetry.sip diff --git a/src/HYDROPy/HYDROData_Document.sip b/src/HYDROPy/HYDROData_Document.sip index 16437bba..adfd9acd 100644 --- a/src/HYDROPy/HYDROData_Document.sip +++ b/src/HYDROPy/HYDROData_Document.sip @@ -137,6 +137,11 @@ class HYDROData_Document aRes = new HYDROData_Channel( *dynamic_cast( theObject ) ); break; } + case KIND_STREAM: + { + aRes = new HYDROData_Stream( *dynamic_cast( theObject ) ); + break; + } } return aRes; diff --git a/src/HYDROPy/HYDROData_Entity.sip b/src/HYDROPy/HYDROData_Entity.sip index c5cf31d2..c07ecc35 100644 --- a/src/HYDROPy/HYDROData_Entity.sip +++ b/src/HYDROPy/HYDROData_Entity.sip @@ -107,6 +107,10 @@ class HYDROData_Entity sipClass = sipClass_HYDROData_Region; break; + case KIND_STREAM: + sipClass = sipClass_HYDROData_Stream; + break; + case KIND_ZONE: sipClass = sipClass_HYDROData_Zone; break; diff --git a/src/HYDROPy/HYDROData_NaturalObject.sip b/src/HYDROPy/HYDROData_NaturalObject.sip index d0ec9300..53bcce3c 100644 --- a/src/HYDROPy/HYDROData_NaturalObject.sip +++ b/src/HYDROPy/HYDROData_NaturalObject.sip @@ -38,6 +38,10 @@ class HYDROData_NaturalObject : HYDROData_Object /Abstract/ case KIND_IMMERSIBLE_ZONE: sipClass = sipClass_HYDROData_ImmersibleZone; break; + + case KIND_STREAM: + sipClass = sipClass_HYDROData_Stream; + break; case KIND_UNKNOWN: sipClass = sipClass_HYDROData_NaturalObject; diff --git a/src/HYDROPy/HYDROData_Object.sip b/src/HYDROPy/HYDROData_Object.sip index 5a0057ff..a1736308 100644 --- a/src/HYDROPy/HYDROData_Object.sip +++ b/src/HYDROPy/HYDROData_Object.sip @@ -58,6 +58,10 @@ class HYDROData_Object : HYDROData_Entity /Abstract/ sipClass = sipClass_HYDROData_Profile; break; + case KIND_STREAM: + sipClass = sipClass_HYDROData_Stream; + break; + case KIND_UNKNOWN: sipClass = sipClass_HYDROData_Entity; break; diff --git a/src/HYDROPy/HYDROData_Stream.sip b/src/HYDROPy/HYDROData_Stream.sip index 0fcd433c..6fc7a002 100644 --- a/src/HYDROPy/HYDROData_Stream.sip +++ b/src/HYDROPy/HYDROData_Stream.sip @@ -34,7 +34,7 @@ public: /** * Update the shape presentations of stream. */ - virtual void UpdatePrs(); + void UpdatePrs(); /** * Returns default filling color for new stream. @@ -49,7 +49,18 @@ public: /** * Returns true if given polyline can be used as stream axis. */ - static bool IsValidAsAxis( const Handle(HYDROData_PolylineXY)& theAxis ); + static bool IsValidAsAxis( HYDROData_PolylineXY theAxis ) + [bool ( const Handle_HYDROData_PolylineXY& )]; + %MethodCode + Handle(HYDROData_PolylineXY) aRef = + Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); + if ( !aRef.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = HYDROData_Stream::IsValidAsAxis( aRef ); + Py_END_ALLOW_THREADS + } + %End public: // Public methods to work with Stream presentation @@ -81,59 +92,106 @@ public: /** * Sets reference hydraulic axis object for stream. */ - virtual bool SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis ); + bool SetHydraulicAxis( HYDROData_PolylineXY theAxis ) + [bool ( const Handle_HYDROData_PolylineXY& )]; + %MethodCode + Handle(HYDROData_PolylineXY) aRef = + Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); + if ( !aRef.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ): + sipCpp->SetHydraulicAxis( aRef ); + Py_END_ALLOW_THREADS + } + %End /** * Returns reference hydraulic axis object of stream. */ - virtual Handle(HYDROData_PolylineXY) GetHydraulicAxis() const; + HYDROData_PolylineXY GetHydraulicAxis() const + [Handle_HYDROData_PolylineXY ()]; + %MethodCode + Handle(HYDROData_PolylineXY) aRef; + + Py_BEGIN_ALLOW_THREADS + aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() : + sipCpp->GetHydraulicAxis(); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_PolylineXY*)createPointer( aRef ); + %End /** * Remove reference hydraulic axis object from stream. */ - virtual void RemoveHydraulicAxis(); + void RemoveHydraulicAxis(); /** * Returns true if profile has the intersection with the given hydraulic axis. * Returns the parameter of inresection point on axis if axis is presented by one curve, * if axis presented by set of edges the returns a common length of segments till the intersection point. */ - static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis, - const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane, - Standard_Real& outPar); +// static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis, +// const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane, +// Standard_Real& outPar); /** * Returns true if profile has the intersection with reference hydraulic axis. * Returns the parameter of inresection point on axis if axis is presented by one curve, * if axis presented by set of edges the returns a common length of segments till the intersection point. */ - virtual bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane, - Standard_Real& outPar) const; +// bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane, +// Standard_Real& outPar) const; /** * Builds a planar face */ - virtual bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const; +// bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const; /** * Add new one reference profile object for stream. */ - virtual bool AddProfile( const Handle(HYDROData_Profile)& theProfile ); + bool AddProfile( 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_Stream::AddProfile( aRef ): + sipCpp->AddProfile( aRef ); + Py_END_ALLOW_THREADS + } + %End /** * Returns all reference profile objects of stream. */ - virtual HYDROData_SequenceOfObjects GetProfiles() const; + HYDROData_SequenceOfObjects GetProfiles() const; /** * Removes reference profile object from stream. */ - virtual bool RemoveProfile( const Handle(HYDROData_Profile)& theProfile ); + bool RemoveProfile( 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_Stream::RemoveProfile( aRef ): + sipCpp->RemoveProfile( aRef ); + Py_END_ALLOW_THREADS + } + %End /** * Removes all reference profile objects from stream. */ - virtual void RemoveProfiles(); + void RemoveProfiles(); protected: /**