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.
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( HYDROData_PolylineXY theAxis )
53 [bool ( const Handle_HYDROData_PolylineXY& )];
55 Handle(HYDROData_PolylineXY) aRef =
56 Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
59 Py_BEGIN_ALLOW_THREADS
60 sipRes = HYDROData_Stream::IsValidAsAxis( aRef );
66 // Public methods to work with Stream presentation
69 * Returns the left edge of the stream.
71 // virtual TopoDS_Shape GetLeftShape() const;
74 * Returns the right edge of the stream.
76 // virtual TopoDS_Shape GetRightShape() const;
79 * Returns the inlet edge of the stream.
81 // virtual TopoDS_Shape GetInletShape() const;
84 * Returns the outlet edge of the stream.
86 // virtual TopoDS_Shape GetOutletShape() const;
90 // Public methods to work with Stream data fields
93 * Sets reference hydraulic axis object for stream.
95 bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
96 [bool ( const Handle_HYDROData_PolylineXY& )];
98 Handle(HYDROData_PolylineXY) aRef =
99 Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
100 if ( !aRef.IsNull() )
102 Py_BEGIN_ALLOW_THREADS
103 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ):
104 sipCpp->SetHydraulicAxis( aRef );
110 * Returns reference hydraulic axis object of stream.
112 HYDROData_PolylineXY GetHydraulicAxis() const
113 [Handle_HYDROData_PolylineXY ()];
115 Handle(HYDROData_PolylineXY) aRef;
117 Py_BEGIN_ALLOW_THREADS
118 aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() :
119 sipCpp->GetHydraulicAxis();
122 sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
126 * Remove reference hydraulic axis object from stream.
128 void RemoveHydraulicAxis();
131 * Returns true if profile has the intersection with the given hydraulic axis.
132 * Returns the parameter of inresection point on axis if axis is presented by one curve,
133 * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point.
135 // static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis,
136 // const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
137 // Standard_Real& outPar);
140 * Returns true if profile has the intersection with reference hydraulic axis.
141 * Returns the parameter of inresection point on axis if axis is presented by one curve,
142 * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point.
144 // bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
145 // Standard_Real& outPar) const;
148 * Builds a planar face
150 // bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const;
153 * Add new one reference profile object for stream.
155 bool AddProfile( HYDROData_Profile theProfile )
156 [bool ( const Handle_HYDROData_Profile& )];
158 Handle(HYDROData_Profile) aRef =
159 Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
160 if ( !aRef.IsNull() )
162 Py_BEGIN_ALLOW_THREADS
163 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::AddProfile( aRef ):
164 sipCpp->AddProfile( aRef );
170 * Returns all reference profile objects of stream.
172 HYDROData_SequenceOfObjects GetProfiles() const;
175 * Removes reference profile object from stream.
177 bool RemoveProfile( HYDROData_Profile theProfile )
178 [bool ( const Handle_HYDROData_Profile& )];
180 Handle(HYDROData_Profile) aRef =
181 Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
182 if ( !aRef.IsNull() )
184 Py_BEGIN_ALLOW_THREADS
185 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::RemoveProfile( aRef ):
186 sipCpp->RemoveProfile( aRef );
192 * Removes all reference profile objects from stream.
194 void RemoveProfiles();
198 * Creates new object in the internal data structure. Use higher level objects
199 * to create objects with real content.
204 * Destructs properties of the object and object itself, removes it from the document.
206 virtual ~HYDROData_Stream();