+ /**
+ * Update the profiles order and shape presentations of stream.
+ * Call this method whenever you made changes for stream data.
+ */
+ HYDRODATA_EXPORT virtual void Update();
+
+ /**
+ * Checks that object has 2D presentation. Reimlemented to retun true.
+ */
+ HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
+
+ /**
+ * Update the shape presentations of stream.
+ */
+ HYDRODATA_EXPORT virtual void UpdatePrs();
+
+ /**
+ *
+ */
+ HYDRODATA_EXPORT virtual void CopyTo( const Handle(HYDROData_Entity)& theDestination ) const;
+
+
+ /**
+ * Returns default filling color for new stream.
+ */
+ HYDRODATA_EXPORT static QColor DefaultFillingColor();
+
+ /**
+ * Returns default border color for new stream.
+ */
+ HYDRODATA_EXPORT static QColor DefaultBorderColor();
+
+ /**
+ * Returns true if given polyline can be used as stream axis.
+ */
+ HYDRODATA_EXPORT static bool IsValidAsAxis( const Handle(HYDROData_PolylineXY)& theAxis );
+
+public:
+ // Public methods to work with Stream presentation
+
+ /**
+ * Returns the left edge of the stream.
+ */
+ HYDRODATA_EXPORT virtual TopoDS_Shape GetLeftShape() const;
+
+ /**
+ * Returns the right edge of the stream.
+ */
+ HYDRODATA_EXPORT virtual TopoDS_Shape GetRightShape() const;
+
+ /**
+ * Returns the inlet edge of the stream.
+ */
+ HYDRODATA_EXPORT virtual TopoDS_Shape GetInletShape() const;
+
+ /**
+ * Returns the outlet edge of the stream.
+ */
+ HYDRODATA_EXPORT virtual TopoDS_Shape GetOutletShape() const;
+
+
+public:
+ // Public methods to work with Stream data fields
+
+ /**
+ * Sets reference hydraulic axis object for stream.
+ */
+ HYDRODATA_EXPORT virtual bool SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis );
+
+ /**
+ * Returns reference hydraulic axis object of stream.
+ */
+ HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetHydraulicAxis() const;
+
+ /**
+ * Remove reference hydraulic axis object from stream.
+ */
+ HYDRODATA_EXPORT virtual 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 <outPar> returns a common length of segments till the intersection point.
+ */
+ HYDRODATA_EXPORT static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis,
+ const Handle(HYDROData_Profile)& theProfile,
+ const TopoDS_Face& thePlane,
+ Standard_Real& theOutPar );
+
+ /**
+ * 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.
+ */
+ HYDRODATA_EXPORT virtual bool HasIntersection( const Handle(HYDROData_Profile)& theProfile,
+ const TopoDS_Face& thePlane,
+ Standard_Real& theOutPar ) const;
+
+ /**
+ * Builds a planar face
+ */
+ HYDRODATA_EXPORT static bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis,
+ TopoDS_Face& thePlane );
+
+ /**
+ * Add new one reference profile object for stream.
+ */
+ HYDRODATA_EXPORT virtual bool AddProfile( const Handle(HYDROData_Profile)& theProfile );
+
+ /**
+ * Add new one reference profile object for stream.
+ */
+ HYDRODATA_EXPORT virtual bool SetProfiles( const HYDROData_SequenceOfObjects& theProfiles,
+ const bool& theIsToOrder = true );
+
+ /**
+ * Returns all reference profile objects of stream.
+ */
+ HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetProfiles() const;
+
+ /**
+ * Removes reference profile object from stream.
+ */
+ HYDRODATA_EXPORT virtual bool RemoveProfile( const Handle(HYDROData_Profile)& theProfile );
+
+ /**
+ * Removes all reference profile objects from stream.
+ */
+ HYDRODATA_EXPORT virtual void RemoveProfiles();
+
+ /**
+ * Generates bottom polyline for stream or update the existing bottom polyline.
+ * \return true in case of success
+ */
+ HYDRODATA_EXPORT virtual bool GenerateBottomPolyline();
+
+ /**
+ * Returns reference bottom polyline object of stream.
+ */
+ HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline3D) GetBottomPolyline() const;
+
+ /**
+ * Sets reference bottom polyline object for stream.
+ * \param theBottom the polyline 3D
+ * \return true in case of success
+ */
+ HYDRODATA_EXPORT virtual bool SetBottomPolyline( const Handle(HYDROData_Polyline3D)& theBottom );
+
+ /**
+ * Add interpolated profiles into the stream.
+ * \param theInterpolator the interpolator
+ * \return true in case of success
+ */
+ HYDRODATA_EXPORT virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
+
+protected:
+
+ /**
+ * Insert one profile in to the stream profiles order.
+ */
+ void insertProfileInToOrder( const Handle(HYDROData_Profile)& theProfile,
+ const int theBeforeIndex = -1 );
+
+ /**
+ * Fully recompute the order of all profiles in accordance with reference hydraulic axis.
+ * If hydraulic axis is not set all profiles will be removed from order.
+ */
+ void updateProfilesOrder();
+
+ /**
+ * Returns the type of child altitude object.
+ * Reimplemented to create stream altitude object.
+ */
+ HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const;
+
+ /**
+ * Builds b-spline using interpolation algorithm.
+ */
+ static Handle(Geom_BSplineCurve) buildInterpolationCurve(
+ const Handle(TColgp_HArray1OfPnt)& theArrayOfPnt );
+
+ /**
+ * Returns default filling color for new object.
+ */
+ HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
+
+ /**
+ * Returns default border color for new object.
+ */
+ HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
+
+private:
+
+ void setParametersArray( const TColStd_Array1OfReal& theArray );
+
+ TColStd_Array1OfReal* getParametersArray() const;
+
+ void removeParametersArray();
+
+ int insertParameter( const Standard_Real& theParam );
+
+ void removeParameter( const int& theIndex );
+