1 // Copyright (C) 2007-2015 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, or (at your option) any later version.
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 data fields
69 * Sets reference hydraulic axis object for stream.
71 bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
72 [bool ( const Handle_HYDROData_PolylineXY& )];
74 Handle(HYDROData_PolylineXY) aRef =
75 Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
78 Py_BEGIN_ALLOW_THREADS
79 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ):
80 sipCpp->SetHydraulicAxis( aRef );
86 * Returns reference hydraulic axis object of stream.
88 HYDROData_PolylineXY GetHydraulicAxis() const
89 [Handle_HYDROData_PolylineXY ()];
91 Handle(HYDROData_PolylineXY) aRef;
93 Py_BEGIN_ALLOW_THREADS
94 aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() :
95 sipCpp->GetHydraulicAxis();
98 sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
102 * Remove reference hydraulic axis object from stream.
104 void RemoveHydraulicAxis();
107 * Add new one reference profile object for stream.
109 bool AddProfile( HYDROData_Profile theProfile )
110 [bool ( const Handle_HYDROData_Profile& )];
112 Handle(HYDROData_Profile) aRef =
113 Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
114 if ( !aRef.IsNull() )
116 Py_BEGIN_ALLOW_THREADS
117 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::AddProfile( aRef ):
118 sipCpp->AddProfile( aRef );
124 * Returns all reference profile objects of stream.
126 HYDROData_SequenceOfObjects GetProfiles() const;
129 * Removes reference profile object from stream.
131 bool RemoveProfile( HYDROData_Profile theProfile )
132 [bool ( const Handle_HYDROData_Profile& )];
134 Handle(HYDROData_Profile) aRef =
135 Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
136 if ( !aRef.IsNull() )
138 Py_BEGIN_ALLOW_THREADS
139 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::RemoveProfile( aRef ):
140 sipCpp->RemoveProfile( aRef );
146 * Removes all reference profile objects from stream.
148 void RemoveProfiles();
151 * Generates bottom polyline for stream or update the existing bottom polyline.
153 bool GenerateBottomPolyline();
156 * Returns reference bottom polyline object of stream.
158 HYDROData_Polyline3D GetBottomPolyline() const
159 [Handle_HYDROData_Polyline3D ()];
161 Handle(HYDROData_Polyline3D) aRef;
163 Py_BEGIN_ALLOW_THREADS
164 aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetBottomPolyline() :
165 sipCpp->GetBottomPolyline();
168 sipRes = (HYDROData_Polyline3D*)createPointer( aRef );
172 * Sets reference bottom polyline object for stream.
174 bool SetBottomPolyline( HYDROData_Polyline3D theBottom )
175 [bool ( const Handle_HYDROData_Polyline3D& )];
177 Handle(HYDROData_Polyline3D) aRef =
178 Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) );
179 if ( !aRef.IsNull() )
181 Py_BEGIN_ALLOW_THREADS
182 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetBottomPolyline( aRef ):
183 sipCpp->SetBottomPolyline( aRef );
189 * Add interpolated profiles into the stream.
190 * \param theInterpolator the interpolator
191 * \return true in case of success
193 virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
197 * Creates new object in the internal data structure. Use higher level objects
198 * to create objects with real content.
203 * Destructs properties of the object and object itself, removes it from the document.
205 virtual ~HYDROData_Stream();