Salome HOME
Merge commit '9dd90968eb8ad86e7e6ae67f48bb6110bd4ffbdc' into BR_LCM_COMP
[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    * Update the shape presentations of stream.
32    */
33   void UpdatePrs();
34
35   /**
36    * Returns default filling color for new stream.
37    */
38   virtual QColor DefaultFillingColor() const;
39
40   /**
41    * Returns default border color for new stream.
42    */
43   virtual QColor DefaultBorderColor() const;
44
45   /**
46    * Returns true if given polyline can be used as stream axis.
47    */
48   static bool IsValidAsAxis( HYDROData_PolylineXY theAxis ) 
49   [bool ( const Handle_HYDROData_PolylineXY& )];
50   %MethodCode
51     Handle(HYDROData_PolylineXY) aRef =
52       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
53     if ( !aRef.IsNull() )
54     {
55       Py_BEGIN_ALLOW_THREADS
56       sipRes = HYDROData_Stream::IsValidAsAxis( aRef );
57       Py_END_ALLOW_THREADS
58     }
59   %End
60
61 public:      
62   // Public methods to work with Stream data fields
63
64   /**
65    * Sets reference hydraulic axis object for stream.
66    */
67   bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
68   [bool ( const Handle_HYDROData_PolylineXY& )];
69   %MethodCode
70     Handle(HYDROData_PolylineXY) aRef =
71       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
72     if ( !aRef.IsNull() )
73     {
74       Py_BEGIN_ALLOW_THREADS
75       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ):
76                                sipCpp->SetHydraulicAxis( aRef );
77       Py_END_ALLOW_THREADS
78     }
79   %End
80
81   /**
82    * Returns reference hydraulic axis object of stream.
83    */
84   HYDROData_PolylineXY GetHydraulicAxis() const
85   [Handle_HYDROData_PolylineXY ()];
86   %MethodCode
87     Handle(HYDROData_PolylineXY) aRef;
88     
89     Py_BEGIN_ALLOW_THREADS
90     aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() : 
91                            sipCpp->GetHydraulicAxis();
92     Py_END_ALLOW_THREADS
93     
94     sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
95   %End
96
97   /**
98    * Remove reference hydraulic axis object from stream.
99    */
100   void RemoveHydraulicAxis();
101
102   /**
103    * Add new one reference profile object for stream.
104    */
105   bool AddProfile( HYDROData_Profile theProfile )
106   [bool ( const Handle_HYDROData_Profile& )];
107   %MethodCode
108     Handle(HYDROData_Profile) aRef =
109       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
110     if ( !aRef.IsNull() )
111     {
112       Py_BEGIN_ALLOW_THREADS
113       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::AddProfile( aRef ):
114                                sipCpp->AddProfile( aRef );
115       Py_END_ALLOW_THREADS
116     }
117   %End
118
119   /**
120    * Returns all reference profile objects of stream.
121    */
122   HYDROData_SequenceOfObjects GetProfiles() const;
123
124   /**
125    * Removes reference profile object from stream.
126    */
127   bool RemoveProfile( HYDROData_Profile theProfile )
128   [bool ( const Handle_HYDROData_Profile& )];
129   %MethodCode
130     Handle(HYDROData_Profile) aRef =
131       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
132     if ( !aRef.IsNull() )
133     {
134       Py_BEGIN_ALLOW_THREADS
135       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::RemoveProfile( aRef ):
136                                sipCpp->RemoveProfile( aRef );
137       Py_END_ALLOW_THREADS
138     }
139   %End
140
141   /**
142    * Removes all reference profile objects from stream.
143    */
144   void RemoveProfiles();
145
146   /**
147    * Generates bottom polyline for stream or update the existing bottom polyline.
148    */
149   bool GenerateBottomPolyline();
150
151   /**
152    * Returns reference bottom polyline object of stream.
153    */
154   HYDROData_Polyline3D GetBottomPolyline() const
155   [Handle_HYDROData_Polyline3D ()];
156   %MethodCode
157     Handle(HYDROData_Polyline3D) aRef;
158     
159     Py_BEGIN_ALLOW_THREADS
160     aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetBottomPolyline() : 
161                            sipCpp->GetBottomPolyline();
162     Py_END_ALLOW_THREADS
163     
164     sipRes = (HYDROData_Polyline3D*)createPointer( aRef );
165   %End
166   
167   /**
168    * Sets reference bottom polyline object for stream.
169    */
170   bool SetBottomPolyline( HYDROData_Polyline3D theBottom )
171   [bool ( const Handle_HYDROData_Polyline3D& )];
172   %MethodCode
173     Handle(HYDROData_Polyline3D) aRef =
174       Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) );
175     if ( !aRef.IsNull() )
176     {
177       Py_BEGIN_ALLOW_THREADS
178       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetBottomPolyline( aRef ):
179                                sipCpp->SetBottomPolyline( aRef );
180       Py_END_ALLOW_THREADS
181     }
182   %End
183
184   /**
185    * Add interpolated profiles into the stream.
186    * \param theInterpolator the interpolator
187    * \return true in case of success
188    */
189   virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
190
191 protected:
192   /**
193    * Creates new object in the internal data structure. Use higher level objects 
194    * to create objects with real content.
195    */
196   HYDROData_Stream();
197
198   /**
199    * Destructs properties of the object and object itself, removes it from the document.
200    */
201   virtual ~HYDROData_Stream();
202 };