Salome HOME
Merge branch 'BR_H2018_3' into BR_2018_V8_5
[modules/hydro.git] / src / HYDROPy / HYDROData_Stream.sip
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.
6 //
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.
11 //
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
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 %ExportedHeaderCode
20 #include "HYDROData_Stream.h"
21 %End
22
23 class HYDROData_Stream : public HYDROData_NaturalObject
24 {
25 %TypeHeaderCode
26 #include "HYDROData_Stream.h"
27 %End
28
29 public:
30   /**
31    * Returns default filling color for new stream.
32    */
33   virtual QColor DefaultFillingColor() const;
34
35   /**
36    * Returns default border color for new stream.
37    */
38   virtual QColor DefaultBorderColor() const;
39
40   /**
41    * Returns true if given polyline can be used as stream axis.
42    */
43   static bool IsValidAsAxis( HYDROData_PolylineXY theAxis )
44   [bool ( const Handle_HYDROData_PolylineXY& )];
45   %MethodCode
46     Handle(HYDROData_PolylineXY) aRef =
47       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
48     if ( !aRef.IsNull() )
49     {
50       Py_BEGIN_ALLOW_THREADS
51       sipRes = HYDROData_Stream::IsValidAsAxis( aRef );
52       Py_END_ALLOW_THREADS
53     }
54   %End
55
56 public:
57   // Public methods to work with Stream data fields
58
59   /**
60    * Sets reference hydraulic axis object for stream.
61    */
62   bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
63   [bool ( const opencascade::handle<HYDROData_PolylineXY>& )];
64   %MethodCode
65     Handle(HYDROData_PolylineXY) aRef =
66       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
67     if ( !aRef.IsNull() )
68     {
69       Py_BEGIN_ALLOW_THREADS
70       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ):
71                                sipCpp->SetHydraulicAxis( aRef );
72       Py_END_ALLOW_THREADS
73     }
74   %End
75
76   /**
77    * Returns reference hydraulic axis object of stream.
78    */
79   HYDROData_PolylineXY GetHydraulicAxis() const
80   [opencascade::handle<HYDROData_PolylineXY> ()];
81   %MethodCode
82     Handle(HYDROData_PolylineXY) aRef;
83
84     Py_BEGIN_ALLOW_THREADS
85     aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() :
86                            sipCpp->GetHydraulicAxis();
87     Py_END_ALLOW_THREADS
88
89     sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
90   %End
91
92   /**
93    * Remove reference hydraulic axis object from stream.
94    */
95   void RemoveHydraulicAxis();
96
97   /**
98    * Add new one reference profile object for stream.
99    */
100   bool AddProfile( HYDROData_Profile theProfile )
101   [bool ( const opencascade::handle<HYDROData_Profile>& )];
102   %MethodCode
103     Handle(HYDROData_Profile) aRef =
104       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
105     if ( !aRef.IsNull() )
106     {
107       Py_BEGIN_ALLOW_THREADS
108       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::AddProfile( aRef ):
109                                sipCpp->AddProfile( aRef );
110       Py_END_ALLOW_THREADS
111     }
112   %End
113
114   /**
115    * Returns all reference profile objects of stream.
116    */
117   HYDROData_SequenceOfObjects GetProfiles() const;
118
119   /**
120    * Removes reference profile object from stream.
121    */
122   bool RemoveProfile( HYDROData_Profile theProfile )
123   [bool ( const opencascade::handle<HYDROData_Profile>& )];
124   %MethodCode
125     Handle(HYDROData_Profile) aRef =
126       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
127     if ( !aRef.IsNull() )
128     {
129       Py_BEGIN_ALLOW_THREADS
130       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::RemoveProfile( aRef ):
131                                sipCpp->RemoveProfile( aRef );
132       Py_END_ALLOW_THREADS
133     }
134   %End
135
136   /**
137    * Removes all reference profile objects from stream.
138    */
139   void RemoveProfiles();
140
141   /**
142    * Generates bottom polyline for stream or update the existing bottom polyline.
143    */
144   bool GenerateBottomPolyline();
145
146   /**
147    * Returns reference bottom polyline object of stream.
148    */
149   HYDROData_Polyline3D GetBottomPolyline() const
150   [opencascade::handle<HYDROData_Polyline3D> ()];
151   %MethodCode
152     Handle(HYDROData_Polyline3D) aRef;
153
154     Py_BEGIN_ALLOW_THREADS
155     aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetBottomPolyline() :
156                            sipCpp->GetBottomPolyline();
157     Py_END_ALLOW_THREADS
158
159     sipRes = (HYDROData_Polyline3D*)createPointer( aRef );
160   %End
161
162   /**
163    * Sets reference bottom polyline object for stream.
164    */
165   bool SetBottomPolyline( HYDROData_Polyline3D theBottom )
166   [bool ( const opencascade::handle<HYDROData_Polyline3D>& )];
167   %MethodCode
168     Handle(HYDROData_Polyline3D) aRef =
169       Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) );
170     if ( !aRef.IsNull() )
171     {
172       Py_BEGIN_ALLOW_THREADS
173       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetBottomPolyline( aRef ):
174                                sipCpp->SetBottomPolyline( aRef );
175       Py_END_ALLOW_THREADS
176     }
177   %End
178
179   /**
180    * Sets the left bank object for stream. (LISM method only)
181    */
182   void SetLeftBank( HYDROData_PolylineXY theBank )
183   [void ( const opencascade::handle<HYDROData_PolylineXY>& )];
184   %MethodCode
185     Handle(HYDROData_PolylineXY) aRef =
186       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
187     if ( !aRef.IsNull() )
188     {
189       Py_BEGIN_ALLOW_THREADS
190       sipSelfWasArg ? sipCpp->HYDROData_Stream::SetLeftBank( aRef ):
191                       sipCpp->SetLeftBank( aRef );
192       Py_END_ALLOW_THREADS
193     }
194   %End
195
196   /**
197    * Returns the left bank object of stream. (LISM method only)
198    */
199   HYDROData_PolylineXY GetLeftBank() const
200   [opencascade::handle<HYDROData_PolylineXY> ()];
201   %MethodCode
202     Handle(HYDROData_PolylineXY) aRef;
203
204     Py_BEGIN_ALLOW_THREADS
205     aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetLeftBank() :
206                            sipCpp->GetLeftBank();
207     Py_END_ALLOW_THREADS
208
209     sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
210   %End
211
212   /**
213    * Sets the right bank object for stream. (LISM method only)
214    */
215   void SetRightBank( HYDROData_PolylineXY theBank )
216   [void ( const opencascade::handle<HYDROData_PolylineXY>& )];
217   %MethodCode
218     Handle(HYDROData_PolylineXY) aRef =
219       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
220     if ( !aRef.IsNull() )
221     {
222       Py_BEGIN_ALLOW_THREADS
223       sipSelfWasArg ? sipCpp->HYDROData_Stream::SetRightBank( aRef ):
224                       sipCpp->SetRightBank( aRef );
225       Py_END_ALLOW_THREADS
226     }
227   %End
228
229   /**
230    * Returns the right bank object of stream. (LISM method only)
231    */
232   HYDROData_PolylineXY GetRightBank() const
233   [opencascade::handle<HYDROData_PolylineXY> ()];
234   %MethodCode
235     Handle(HYDROData_PolylineXY) aRef;
236
237     Py_BEGIN_ALLOW_THREADS
238     aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetRightBank() :
239                            sipCpp->GetRightBank();
240     Py_END_ALLOW_THREADS
241
242     sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
243   %End
244
245   /**
246    * Add interpolated profiles into the stream.
247    * \param theInterpolator the interpolator
248    * \return true in case of success
249    */
250   virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
251
252   /**
253    * Set vertical slicing step for profiles interpolation. (DTM method only)
254    */
255   void   SetDDZ( double theDDZ );
256
257   /**
258    * Set horizontal step for profiles interpolation. (DTM method only)
259    */
260   void   SetSpatialStep( double theSpatialStep );
261
262   /**
263    * Set interpolation method (DTM or LISM).
264    */
265   void   SetInterpolationMethod( int theMode );
266
267   /**
268    * Set horizontal step on hydr. axis for profiles interpolation. (LISM method)
269    */
270   void   SetHaxStep( double theHaxStep );
271
272   /**
273    * Set number of points on profiles to insert (LISM method)
274    */
275   void   SetNbProfilePoints( int theNbPoints );
276
277 protected:
278   /**
279    * Creates new object in the internal data structure. Use higher level objects
280    * to create objects with real content.
281    */
282   HYDROData_Stream();
283
284   /**
285    * Destructs properties of the object and object itself, removes it from the document.
286    */
287   virtual ~HYDROData_Stream();
288 };