-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015 EDF-R&D
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
%End
public:
- /**
- * Update the shape presentations of stream.
- */
- virtual void UpdatePrs();
-
/**
* Returns default filling color for new stream.
*/
- static QColor DefaultFillingColor();
+ virtual QColor DefaultFillingColor() const;
/**
* Returns default border color for new stream.
*/
- static QColor DefaultBorderColor();
+ virtual QColor DefaultBorderColor() const;
/**
* 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 data fields
-public:
- // Public methods to work with Stream presentation
-
/**
- * Returns the left edge of the stream.
+ * Sets reference hydraulic axis object for stream.
*/
-// virtual TopoDS_Shape GetLeftShape() const;
+ bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
+ [bool ( const opencascade::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 the right edge of the stream.
+ * Returns reference hydraulic axis object of stream.
*/
-// virtual TopoDS_Shape GetRightShape() const;
+ HYDROData_PolylineXY GetHydraulicAxis() const
+ [opencascade::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
/**
- * Returns the inlet edge of the stream.
+ * Remove reference hydraulic axis object from stream.
*/
-// virtual TopoDS_Shape GetInletShape() const;
+ void RemoveHydraulicAxis();
/**
- * Returns the outlet edge of the stream.
+ * Add new one reference profile object for stream.
*/
-// virtual TopoDS_Shape GetOutletShape() const;
-
-
-public:
- // Public methods to work with Stream data fields
+ bool AddProfile( HYDROData_Profile theProfile )
+ [bool ( const opencascade::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
/**
- * Sets reference hydraulic axis object for stream.
+ * Returns all reference profile objects of stream.
*/
- virtual bool SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis );
+ HYDROData_SequenceOfObjects GetProfiles() const;
/**
- * Returns reference hydraulic axis object of stream.
+ * Removes reference profile object from stream.
*/
- virtual Handle(HYDROData_PolylineXY) GetHydraulicAxis() const;
+ bool RemoveProfile( HYDROData_Profile theProfile )
+ [bool ( const opencascade::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
/**
- * Remove reference hydraulic axis object from stream.
+ * Removes all reference profile objects from stream.
*/
- virtual void RemoveHydraulicAxis();
+ void RemoveProfiles();
/**
- * 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 <outPar> returns a common length of segments till the intersection point.
+ * Generates bottom polyline for stream or update the existing bottom polyline.
*/
- static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis,
- const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
- Standard_Real& outPar);
+ bool GenerateBottomPolyline();
/**
- * 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 <outPar> returns a common length of segments till the intersection point.
+ * Returns reference bottom polyline object of stream.
*/
- virtual bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
- Standard_Real& outPar) const;
+ HYDROData_Polyline3D GetBottomPolyline() const
+ [opencascade::handle<HYDROData_Polyline3D> ()];
+ %MethodCode
+ Handle(HYDROData_Polyline3D) aRef;
- /**
- * Builds a planar face
- */
- virtual bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const;
+ Py_BEGIN_ALLOW_THREADS
+ aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetBottomPolyline() :
+ sipCpp->GetBottomPolyline();
+ Py_END_ALLOW_THREADS
+
+ sipRes = (HYDROData_Polyline3D*)createPointer( aRef );
+ %End
/**
- * Add new one reference profile object for stream.
+ * Sets reference bottom polyline object for stream.
*/
- virtual bool AddProfile( const Handle(HYDROData_Profile)& theProfile );
+ bool SetBottomPolyline( HYDROData_Polyline3D theBottom )
+ [bool ( const opencascade::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_Stream::SetBottomPolyline( aRef ):
+ sipCpp->SetBottomPolyline( aRef );
+ Py_END_ALLOW_THREADS
+ }
+ %End
/**
- * Returns all reference profile objects of stream.
+ * Add interpolated profiles into the stream.
+ * \param theInterpolator the interpolator
+ * \return true in case of success
*/
- virtual HYDROData_SequenceOfObjects GetProfiles() const;
+ virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
/**
- * Removes reference profile object from stream.
+ * Set vertical slicing step for profiles interpolation.
*/
- virtual bool RemoveProfile( const Handle(HYDROData_Profile)& theProfile );
+ void SetDDZ( double theDDZ );
/**
- * Removes all reference profile objects from stream.
+ * Set horizontal step for profiles interpolation.
*/
- virtual void RemoveProfiles();
-
+ void SetSpatialStep( double theSpatialStep );
+
protected:
/**
- * Creates new object in the internal data structure. Use higher level objects
+ * Creates new object in the internal data structure. Use higher level objects
* to create objects with real content.
*/
HYDROData_Stream();