1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 #include "HYDROData_Stream.h"
27 class HYDROData_Stream : public HYDROData_NaturalObject
30 #include "HYDROData_Stream.h"
35 * Update the shape presentations of stream.
37 virtual void UpdatePrs();
40 * Returns default filling color for new stream.
42 static QColor DefaultFillingColor();
45 * Returns default border color for new stream.
47 static QColor DefaultBorderColor();
50 * Returns true if given polyline can be used as stream axis.
52 static bool IsValidAsAxis( const Handle(HYDROData_PolylineXY)& theAxis );
55 // Public methods to work with Stream presentation
58 * Returns the left edge of the stream.
60 // virtual TopoDS_Shape GetLeftShape() const;
63 * Returns the right edge of the stream.
65 // virtual TopoDS_Shape GetRightShape() const;
68 * Returns the inlet edge of the stream.
70 // virtual TopoDS_Shape GetInletShape() const;
73 * Returns the outlet edge of the stream.
75 // virtual TopoDS_Shape GetOutletShape() const;
79 // Public methods to work with Stream data fields
82 * Sets reference hydraulic axis object for stream.
84 virtual bool SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis );
87 * Returns reference hydraulic axis object of stream.
89 virtual Handle(HYDROData_PolylineXY) GetHydraulicAxis() const;
92 * Remove reference hydraulic axis object from stream.
94 virtual void RemoveHydraulicAxis();
97 * Returns true if profile has the intersection with the given hydraulic axis.
98 * Returns the parameter of inresection point on axis if axis is presented by one curve,
99 * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point.
101 static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis,
102 const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
103 Standard_Real& outPar);
106 * Returns true if profile has the intersection with reference hydraulic axis.
107 * Returns the parameter of inresection point on axis if axis is presented by one curve,
108 * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point.
110 virtual bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
111 Standard_Real& outPar) const;
114 * Builds a planar face
116 virtual bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const;
119 * Add new one reference profile object for stream.
121 virtual bool AddProfile( const Handle(HYDROData_Profile)& theProfile );
124 * Returns all reference profile objects of stream.
126 virtual HYDROData_SequenceOfObjects GetProfiles() const;
129 * Removes reference profile object from stream.
131 virtual bool RemoveProfile( const Handle(HYDROData_Profile)& theProfile );
134 * Removes all reference profile objects from stream.
136 virtual void RemoveProfiles();
140 * Creates new object in the internal data structure. Use higher level objects
141 * to create objects with real content.
146 * Destructs properties of the object and object itself, removes it from the document.
148 virtual ~HYDROData_Stream();