X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Stream.h;h=16d76503ebd1539b327ffcc0d4a335c4e4d3c837;hb=53ffa9fa57d352fcb5abc0e8a6bb79ea74e52621;hp=b1ee6f48ae1a929fa36ae1612d936a30c5c2921d;hpb=373b25511ebe691dc0e332996521c0de189f6db2;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Stream.h b/src/HYDROData/HYDROData_Stream.h index b1ee6f48..16d76503 100644 --- a/src/HYDROData/HYDROData_Stream.h +++ b/src/HYDROData/HYDROData_Stream.h @@ -1,22 +1,58 @@ +// 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef HYDROData_Stream_HeaderFile #define HYDROData_Stream_HeaderFile #include "HYDROData_NaturalObject.h" + #include +#include + #include + DEFINE_STANDARD_HANDLE(HYDROData_Stream, HYDROData_NaturalObject) class Handle(HYDROData_PolylineXY); +class Handle(HYDROData_Polyline3D); class Handle(HYDROData_Profile); +class HYDROData_IProfilesInterpolator; class TColStd_Array1OfReal; + /**\class HYDROData_Stream * \brief * */ class HYDROData_Stream : public HYDROData_NaturalObject { +public: + + struct PrsDefinition + { + TopoDS_Shape myPrs3D; + TopoDS_Shape myPrs2D; + TopoDS_Edge myLeftBank; + TopoDS_Edge myRightBank; + TopoDS_Edge myInlet; + TopoDS_Edge myOutlet; + }; + protected: /** * Enumeration of tags corresponding to the persistent object parameters. @@ -26,12 +62,25 @@ protected: DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve DataTag_HydraulicAxis, ///< reference hydraulic axis DataTag_Profile, ///< reference profiles - DataTag_ParamsArray ///< parameters array + DataTag_ParamsArray, ///< parameters array + DataTag_BottomPolyline ///< reference bottom polyline }; public: + DEFINE_STANDARD_RTTI(HYDROData_Stream); +public: + + /** + * Creates the presentations(2D and 3D) by given hydraulic axis and profiles. + */ + HYDRODATA_EXPORT static bool CreatePresentations( const Handle(HYDROData_PolylineXY)& theHydAxis, + const HYDROData_SequenceOfObjects& theProfiles, + PrsDefinition& thePrs ); + +public: + /** * Returns the kind of this object. Must be redefined in all objects of known type. */ @@ -63,11 +112,22 @@ public: */ 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. */ @@ -131,27 +191,36 @@ public: * if axis presented by set of edges the 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& outPar); + 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 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& outPar) const; + HYDRODATA_EXPORT virtual bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, + const TopoDS_Face& thePlane, + Standard_Real& theOutPar ) const; - /** - * Builds a planar face - */ - HYDRODATA_EXPORT virtual bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) 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. */ @@ -166,6 +235,31 @@ public: * 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: @@ -190,7 +284,8 @@ protected: /** * Builds b-spline using interpolation algorithm. */ - Handle(Geom_BSplineCurve) buildInterpolationCurve(const Handle(TColgp_HArray1OfPnt)& theArrayOfPnt); + static Handle(Geom_BSplineCurve) buildInterpolationCurve( + const Handle(TColgp_HArray1OfPnt)& theArrayOfPnt ); /** * Returns default filling color for new object. @@ -231,3 +326,5 @@ protected: }; #endif + +