1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "HYDROData_Stream.h"
23 class HYDROData_Stream : public HYDROData_NaturalObject
26 #include "HYDROData_Stream.h"
31 * Returns default filling color for new stream.
33 virtual QColor DefaultFillingColor() const;
36 * Returns default border color for new stream.
38 virtual QColor DefaultBorderColor() const;
41 * Returns true if given polyline can be used as stream axis.
43 static bool IsValidAsAxis( HYDROData_PolylineXY theAxis )
44 [bool ( const Handle_HYDROData_PolylineXY& )];
46 Handle(HYDROData_PolylineXY) aRef =
47 Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
50 Py_BEGIN_ALLOW_THREADS
51 sipRes = HYDROData_Stream::IsValidAsAxis( aRef );
57 // Public methods to work with Stream data fields
60 * Sets reference hydraulic axis object for stream.
62 bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
63 [bool ( const opencascade::handle<HYDROData_PolylineXY>& )];
65 Handle(HYDROData_PolylineXY) aRef =
66 Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
69 Py_BEGIN_ALLOW_THREADS
70 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ):
71 sipCpp->SetHydraulicAxis( aRef );
77 * Returns reference hydraulic axis object of stream.
79 HYDROData_PolylineXY GetHydraulicAxis() const
80 [opencascade::handle<HYDROData_PolylineXY> ()];
82 Handle(HYDROData_PolylineXY) aRef;
84 Py_BEGIN_ALLOW_THREADS
85 aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() :
86 sipCpp->GetHydraulicAxis();
89 sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
93 * Remove reference hydraulic axis object from stream.
95 void RemoveHydraulicAxis();
98 * Add new one reference profile object for stream.
100 bool AddProfile( HYDROData_Profile theProfile )
101 [bool ( const opencascade::handle<HYDROData_Profile>& )];
103 Handle(HYDROData_Profile) aRef =
104 Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
105 if ( !aRef.IsNull() )
107 Py_BEGIN_ALLOW_THREADS
108 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::AddProfile( aRef ):
109 sipCpp->AddProfile( aRef );
115 * Returns all reference profile objects of stream.
117 HYDROData_SequenceOfObjects GetProfiles() const;
120 * Removes reference profile object from stream.
122 bool RemoveProfile( HYDROData_Profile theProfile )
123 [bool ( const opencascade::handle<HYDROData_Profile>& )];
125 Handle(HYDROData_Profile) aRef =
126 Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
127 if ( !aRef.IsNull() )
129 Py_BEGIN_ALLOW_THREADS
130 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::RemoveProfile( aRef ):
131 sipCpp->RemoveProfile( aRef );
137 * Removes all reference profile objects from stream.
139 void RemoveProfiles();
142 * Generates bottom polyline for stream or update the existing bottom polyline.
144 bool GenerateBottomPolyline();
147 * Returns reference bottom polyline object of stream.
149 HYDROData_Polyline3D GetBottomPolyline() const
150 [opencascade::handle<HYDROData_Polyline3D> ()];
152 Handle(HYDROData_Polyline3D) aRef;
154 Py_BEGIN_ALLOW_THREADS
155 aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetBottomPolyline() :
156 sipCpp->GetBottomPolyline();
159 sipRes = (HYDROData_Polyline3D*)createPointer( aRef );
163 * Sets reference bottom polyline object for stream.
165 bool SetBottomPolyline( HYDROData_Polyline3D theBottom )
166 [bool ( const opencascade::handle<HYDROData_Polyline3D>& )];
168 Handle(HYDROData_Polyline3D) aRef =
169 Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) );
170 if ( !aRef.IsNull() )
172 Py_BEGIN_ALLOW_THREADS
173 sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetBottomPolyline( aRef ):
174 sipCpp->SetBottomPolyline( aRef );
180 * Add interpolated profiles into the stream.
181 * \param theInterpolator the interpolator
182 * \return true in case of success
184 virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
187 * Set vertical slicing step for profiles interpolation.
189 void SetDDZ( double theDDZ );
192 * Set horizontal step for profiles interpolation.
194 void SetSpatialStep( double theSpatialStep );
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();