Salome HOME
Minir changes.
[modules/hydro.git] / src / HYDROPy / HYDROData_Calculation.sip
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 %ExportedHeaderCode
24 #include <HYDROData_Calculation.h>
25 %End
26
27 class HYDROData_Calculation : HYDROData_Object
28 {
29
30 %TypeHeaderCode
31 #include <HYDROData_Calculation.h>
32 %End
33
34 %ConvertToSubClassCode
35     switch ( sipCpp->GetKind() )
36     {
37       case KIND_CALCULATION:
38         sipClass = sipClass_HYDROData_Calculation;
39         break;
40
41       default:
42         // We don't recognise the type.
43         sipClass = NULL;
44     }
45 %End
46
47 public:      
48
49   /**
50    * Split reference geometry objects to non-intersected regions.
51    */
52   void SplitGeometryObjects();
53
54   /**
55    * Returns number of geometry objects for calculation case.
56    */
57   int NbGeometryObjects() const;
58
59   /**
60    * dd new one geometry object for calculation case.
61    */
62   void AddGeometryObject( HYDROData_Object theRegion ) [void (const Handle_HYDROData_Object&)];
63   %MethodCode
64
65     Handle(HYDROData_Object) aGeomObj =
66       Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
67     if ( !aGeomObj.IsNull() )
68     {
69       Py_BEGIN_ALLOW_THREADS
70       sipSelfWasArg ? sipCpp->HYDROData_Calculation::AddGeometryObject( aGeomObj ) : 
71                       sipCpp->AddGeometryObject( aGeomObj );
72       Py_END_ALLOW_THREADS
73     }
74
75   %End
76
77   /**
78    * Replace the geometry object for calculation case.
79    */
80   void SetGeometryObject( const int        theIndex, 
81                           HYDROData_Object theObject ) [void (const int, const Handle_HYDROData_Object&)];
82   %MethodCode
83
84     Handle(HYDROData_Object) aGeomObj =
85       Handle(HYDROData_Object)::DownCast( createHandle( a1 ) );
86     if ( !aGeomObj.IsNull() )
87     {
88       Py_BEGIN_ALLOW_THREADS
89       sipSelfWasArg ? sipCpp->HYDROData_Calculation::SetGeometryObject( a0, aGeomObj ) : 
90                       sipCpp->SetGeometryObject( a0, aGeomObj );
91       Py_END_ALLOW_THREADS
92     }
93
94   %End
95
96   /**
97    * Sets the geometry object for calculation case.
98    */
99   //void SetGeometryObjects( const HYDROData_SequenceOfObjects& theObjects );
100
101   /**
102    * Returns geometry object of calculation case by index.
103    */
104   HYDROData_Object GetGeometryObject( const int theIndex ) const [Handle_HYDROData_Object (const int)];
105   %MethodCode
106
107     Handle(HYDROData_Object) aGeomObj;
108     
109     Py_BEGIN_ALLOW_THREADS
110     aGeomObj = sipSelfWasArg ? sipCpp->HYDROData_Calculation::GetGeometryObject( a0 ) : 
111                                sipCpp->GetGeometryObject( a0 );
112     Py_END_ALLOW_THREADS
113     
114     sipRes = (HYDROData_Object*)createPointer( aGeomObj );
115   
116   %End
117
118   /**
119    * Returns all geometry objects of calculation case.
120    */
121   //HYDROData_SequenceOfObjects GetGeometryObjects() const;
122
123   /**
124    * Removes all geometry objects from calculation case.
125    */
126   void RemoveGeometryObjects();
127
128
129   /**
130    * Add new one region for calculation case.
131    * The new region is not added into the list of reference regions.
132    */
133   HYDROData_Region AddNewRegion() [Handle_HYDROData_Region ()];
134   %MethodCode
135
136     Handle(HYDROData_Region) aNewRegion;
137     
138     Py_BEGIN_ALLOW_THREADS
139     aNewRegion = sipSelfWasArg ? sipCpp->HYDROData_Calculation::AddNewRegion() : 
140                                  sipCpp->AddNewRegion();
141     Py_END_ALLOW_THREADS
142     
143     sipRes = (HYDROData_Region*)createPointer( aNewRegion );
144
145   %End
146
147   /**
148    * Removes all child regions from calculation case.
149    */
150   void RemoveChildRegions();
151
152
153   /**
154    * Returns number of reference regions for calculation case.
155    */
156   int NbRegions() const;
157
158   /**
159    * Add new one reference region for calculation case.
160    */
161   void AddRegion( HYDROData_Region theRegion ) [void (const Handle_HYDROData_Region&)];
162   %MethodCode
163
164     Handle(HYDROData_Region) aRegion =
165       Handle(HYDROData_Region)::DownCast( createHandle( a0 ) );
166     if ( !aRegion.IsNull() )
167     {
168       Py_BEGIN_ALLOW_THREADS
169       sipSelfWasArg ? sipCpp->HYDROData_Calculation::AddRegion( aRegion ) : 
170                       sipCpp->AddRegion( aRegion );
171       Py_END_ALLOW_THREADS
172     }
173
174   %End
175
176   /**
177    * Replace the reference region for calculation case.
178    */
179   void SetRegion( const int        theIndex, 
180                   HYDROData_Region theRegion ) [void (const int, const Handle_HYDROData_Region&)];
181   %MethodCode
182
183     Handle(HYDROData_Region) aRegion =
184       Handle(HYDROData_Region)::DownCast( createHandle( a1 ) );
185     if ( !aRegion.IsNull() )
186     {
187       Py_BEGIN_ALLOW_THREADS
188       sipSelfWasArg ? sipCpp->HYDROData_Calculation::SetRegion( a0, aRegion ) : 
189                       sipCpp->SetRegion( a0, aRegion );
190       Py_END_ALLOW_THREADS
191     }
192
193   %End
194
195   /**
196    * Inserts the reference region for calculation case before given index.
197    */
198   void InsertRegion( const int        theBeforeIndex, 
199                      HYDROData_Region theRegion ) [void (const int, const Handle_HYDROData_Region&)];
200   %MethodCode
201
202     Handle(HYDROData_Region) aRegion =
203       Handle(HYDROData_Region)::DownCast( createHandle( a1 ) );
204     if ( !aRegion.IsNull() )
205     {
206       Py_BEGIN_ALLOW_THREADS
207       sipSelfWasArg ? sipCpp->HYDROData_Calculation::InsertRegion( a0, aRegion ) : 
208                       sipCpp->InsertRegion( a0, aRegion );
209       Py_END_ALLOW_THREADS
210     }
211
212   %End
213
214   /**
215    * Sets reference regions for calculation case.
216    */
217   //void SetRegions( const HYDROData_SequenceOfObjects& theRegions );
218
219   /**
220    * Returns reference region of calculation case by index.
221    */
222   HYDROData_Region GetRegion( const int theIndex ) const [Handle_HYDROData_Region (const int)];
223   %MethodCode
224
225     Handle(HYDROData_Region) aRefRegion;
226     
227     Py_BEGIN_ALLOW_THREADS
228     aRefRegion = sipSelfWasArg ? sipCpp->HYDROData_Calculation::GetRegion( a0 ) : 
229                                  sipCpp->GetRegion( a0 );
230     Py_END_ALLOW_THREADS
231     
232     sipRes = (HYDROData_Region*)createPointer( aRefRegion );
233   
234   %End
235
236   /**
237    * Returns all reference regions of calculation case.
238    */
239   //void HYDROData_SequenceOfObjects GetRegions() const;
240
241   /**
242    * Removes reference region from calculation case.
243    */
244   void RemoveRegion( HYDROData_Region theRegion ) [void (const Handle_HYDROData_Region&)];
245   %MethodCode
246
247     Handle(HYDROData_Region) aRegion =
248       Handle(HYDROData_Region)::DownCast( createHandle( a0 ) );
249     if ( !aRegion.IsNull() )
250     {
251       Py_BEGIN_ALLOW_THREADS
252       sipSelfWasArg ? sipCpp->HYDROData_Calculation::RemoveRegion( aRegion ) : 
253                       sipCpp->RemoveRegion( aRegion );
254       Py_END_ALLOW_THREADS
255     }
256
257   %End
258
259   /**
260    * Removes region from calculation case by it index.
261    */
262   void RemoveRegion( const int theIndex );
263
264   /**
265    * Removes all reference regions from calculation case.
266    */
267   void RemoveRegions();
268
269
270 protected:
271
272   /**
273    * Creates new object in the internal data structure. Use higher level objects 
274    * to create objects with real content.
275    */
276   HYDROData_Calculation();
277
278   /**
279    * Destructs properties of the object and object itself, removes it from the document.
280    */
281   ~HYDROData_Calculation();
282 };
283
284