Salome HOME
Merge branch 'BR_HYDRO_IMPS_2016' of ssh://gitolite3@git.salome-platform.org/modules...
[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    * Add interpolated profiles into the stream.
181    * \param theInterpolator the interpolator
182    * \return true in case of success
183    */
184   virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
185
186   /**
187    * Set vertical slicing step for profiles interpolation.
188    */
189   void   SetDDZ( double theDDZ );
190
191   /**
192    * Set horizontal step for profiles interpolation.
193    */
194   void   SetSpatialStep( double theSpatialStep );
195
196 protected:
197   /**
198    * Creates new object in the internal data structure. Use higher level objects
199    * to create objects with real content.
200    */
201   HYDROData_Stream();
202
203   /**
204    * Destructs properties of the object and object itself, removes it from the document.
205    */
206   virtual ~HYDROData_Stream();
207 };