Salome HOME
Update copyrights
[modules/med.git] / src / MEDCouplingCorba_Swig / MEDCouplingCorba.i
1 // Copyright (C) 2007-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 %module MEDCouplingCorba
22
23 %{
24 #include "MEDCouplingFieldDoubleServant.hxx"  
25 #include "MEDCouplingFieldTemplateServant.hxx"
26 #include "MEDCouplingMultiFieldsServant.hxx"
27 #include "MEDCouplingFieldOverTimeServant.hxx"
28 #include "MEDCouplingUMeshServant.hxx"
29 #include "MEDCoupling1SGTUMeshServant.hxx"
30 #include "MEDCoupling1DGTUMeshServant.hxx"
31 #include "MEDCouplingExtrudedMeshServant.hxx"
32 #include "MEDCouplingCMeshServant.hxx"
33 #include "MEDCouplingIMeshServant.hxx"
34 #include "MEDCouplingCurveLinearMeshServant.hxx"
35 #include "DataArrayDoubleServant.hxx"
36 #include "DataArrayIntServant.hxx"
37 #include "MEDCouplingCorbaTypemaps.i"
38
39 using namespace MEDCoupling;
40 %}
41
42 %include "MEDCouplingCommon.i"
43
44 namespace MEDCoupling
45 {
46   class MEDCouplingFieldDoubleServant
47   {
48   public:
49     %extend
50        {
51          static PyObject *_this(const MEDCouplingFieldDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
52          {
53            return buildServantAndActivate<MEDCouplingFieldDoubleServant>(cppPointerOfMesh);
54          }
55          
56          static PyObject *_this2(const MEDCouplingFieldDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
57          {
58            return buildServantAndActivate2<MEDCouplingFieldDoubleServant>(cppPointerOfMesh);
59          }
60        }
61   };
62
63   class MEDCouplingFieldTemplateServant
64   {
65   public:
66     %extend
67        {
68          static PyObject *_this(const MEDCouplingFieldTemplate *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
69          {
70            return buildServantAndActivate<MEDCouplingFieldTemplateServant>(cppPointerOfMesh);
71          }
72          
73          static PyObject *_this2(const MEDCouplingFieldTemplate *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
74          {
75            return buildServantAndActivate2<MEDCouplingFieldTemplateServant>(cppPointerOfMesh);
76          }
77        }
78   };
79
80   class MEDCouplingMultiFieldsServant
81   {
82   public:
83     %extend
84        {
85          static PyObject *_this(const MEDCouplingMultiFields *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
86          {
87            return buildServantAndActivate<MEDCouplingMultiFieldsServant>(cppPointerOfMesh);
88          }
89
90          static PyObject *_this2(const MEDCouplingMultiFields *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
91          {
92            return buildServantAndActivate2<MEDCouplingMultiFieldsServant>(cppPointerOfMesh);
93          }
94        }
95   };
96
97   class MEDCouplingFieldOverTimeServant
98   {
99   public:
100     %extend
101        {
102          static PyObject *_this(const MEDCouplingFieldOverTime *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
103          {
104            return buildServantAndActivate<MEDCouplingFieldOverTimeServant>(cppPointerOfMesh);
105          }
106
107          static PyObject *_this2(const MEDCouplingFieldOverTime *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
108          {
109            return buildServantAndActivate2<MEDCouplingFieldOverTimeServant>(cppPointerOfMesh);
110          }
111        }
112   };
113
114   class MEDCouplingMeshServant
115   {
116   public:
117     %extend
118        {
119          static PyObject *_this(const MEDCouplingMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
120          {
121            if(!cppPointerOfMesh)
122              throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this : input pointer is NULL !");
123            if(dynamic_cast<const MEDCouplingUMesh *>(cppPointerOfMesh))
124              return buildServantAndActivate<MEDCouplingUMeshServant>(dynamic_cast<const MEDCouplingUMesh *>(cppPointerOfMesh));
125            if(dynamic_cast<const MEDCoupling1SGTUMesh *>(cppPointerOfMesh))
126              return buildServantAndActivate<MEDCoupling1SGTUMeshServant>(dynamic_cast<const MEDCoupling1SGTUMesh *>(cppPointerOfMesh));
127            if(dynamic_cast<const MEDCoupling1DGTUMesh *>(cppPointerOfMesh))
128              return buildServantAndActivate<MEDCoupling1DGTUMeshServant>(dynamic_cast<const MEDCoupling1DGTUMesh *>(cppPointerOfMesh));
129            if(dynamic_cast<const MEDCouplingMappedExtrudedMesh *>(cppPointerOfMesh))
130              return buildServantAndActivate<MEDCouplingExtrudedMeshServant>(dynamic_cast<const MEDCouplingMappedExtrudedMesh *>(cppPointerOfMesh));
131            if(dynamic_cast<const MEDCouplingCMesh *>(cppPointerOfMesh))
132              return buildServantAndActivate<MEDCouplingCMeshServant>(dynamic_cast<const MEDCouplingCMesh *>(cppPointerOfMesh));
133            if(dynamic_cast<const MEDCouplingIMesh *>(cppPointerOfMesh))
134              return buildServantAndActivate<MEDCouplingIMeshServant>(dynamic_cast<const MEDCouplingIMesh *>(cppPointerOfMesh));
135            if(dynamic_cast<const MEDCouplingCurveLinearMesh *>(cppPointerOfMesh))
136              return buildServantAndActivate<MEDCouplingCurveLinearMeshServant>(dynamic_cast<const MEDCouplingCurveLinearMesh *>(cppPointerOfMesh));
137            throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this : unrecognized type (or not managed type) of Mesh in input !");
138          }
139
140          static PyObject *_this2(const MEDCouplingMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
141          {
142            if(!cppPointerOfMesh)
143              throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this2 : input pointer is NULL !");
144            if(dynamic_cast<const MEDCouplingUMesh *>(cppPointerOfMesh))
145              return buildServantAndActivate2<MEDCouplingUMeshServant>(dynamic_cast<const MEDCouplingUMesh *>(cppPointerOfMesh));
146            if(dynamic_cast<const MEDCoupling1SGTUMesh *>(cppPointerOfMesh))
147              return buildServantAndActivate2<MEDCoupling1SGTUMeshServant>(dynamic_cast<const MEDCoupling1SGTUMesh *>(cppPointerOfMesh));
148            if(dynamic_cast<const MEDCoupling1DGTUMesh *>(cppPointerOfMesh))
149              return buildServantAndActivate2<MEDCoupling1DGTUMeshServant>(dynamic_cast<const MEDCoupling1DGTUMesh *>(cppPointerOfMesh));
150            if(dynamic_cast<const MEDCouplingMappedExtrudedMesh *>(cppPointerOfMesh))
151              return buildServantAndActivate2<MEDCouplingExtrudedMeshServant>(dynamic_cast<const MEDCouplingMappedExtrudedMesh *>(cppPointerOfMesh));
152            if(dynamic_cast<const MEDCouplingCMesh *>(cppPointerOfMesh))
153              return buildServantAndActivate2<MEDCouplingCMeshServant>(dynamic_cast<const MEDCouplingCMesh *>(cppPointerOfMesh));
154            if(dynamic_cast<const MEDCouplingIMesh *>(cppPointerOfMesh))
155              return buildServantAndActivate2<MEDCouplingIMeshServant>(dynamic_cast<const MEDCouplingIMesh *>(cppPointerOfMesh));
156            if(dynamic_cast<const MEDCouplingCurveLinearMesh *>(cppPointerOfMesh))
157              return buildServantAndActivate2<MEDCouplingCurveLinearMeshServant>(dynamic_cast<const MEDCouplingCurveLinearMesh *>(cppPointerOfMesh));
158            throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this2 : unrecognized type (or not managed type) of Mesh in input !");
159          }
160        }
161   };
162
163   class MEDCouplingUMeshServant
164   {
165   public:
166     %extend
167        {
168          static PyObject *_this(const MEDCouplingUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
169          {
170            return buildServantAndActivate<MEDCouplingUMeshServant>(cppPointerOfMesh);
171          }
172
173          static PyObject *_this2(const MEDCouplingUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
174          {
175            return buildServantAndActivate2<MEDCouplingUMeshServant>(cppPointerOfMesh);
176          }
177        }
178   };
179
180   class MEDCoupling1SGTUMeshServant
181   {
182   public:
183     %extend
184        {
185          static PyObject *_this(const MEDCoupling1SGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
186          {
187            return buildServantAndActivate<MEDCoupling1SGTUMeshServant>(cppPointerOfMesh);
188          }
189
190          static PyObject *_this2(const MEDCoupling1SGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
191          {
192            return buildServantAndActivate2<MEDCoupling1SGTUMeshServant>(cppPointerOfMesh);
193          }
194        }
195   };
196
197   class MEDCoupling1DGTUMeshServant
198   {
199   public:
200     %extend
201        {
202          static PyObject *_this(const MEDCoupling1DGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
203          {
204            return buildServantAndActivate<MEDCoupling1DGTUMeshServant>(cppPointerOfMesh);
205          }
206
207          static PyObject *_this2(const MEDCoupling1DGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
208          {
209            return buildServantAndActivate2<MEDCoupling1DGTUMeshServant>(cppPointerOfMesh);
210          }
211        }
212   };
213
214   class MEDCouplingExtrudedMeshServant
215   {
216   public:
217     %extend
218        {
219          static PyObject *_this(const MEDCouplingMappedExtrudedMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
220          {
221            return buildServantAndActivate<MEDCouplingExtrudedMeshServant>(cppPointerOfMesh);
222          }
223
224          static PyObject *_this2(const MEDCouplingMappedExtrudedMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
225          {
226            return buildServantAndActivate2<MEDCouplingExtrudedMeshServant>(cppPointerOfMesh);
227          }
228        }
229   };
230
231   class MEDCouplingCMeshServant
232   {
233   public:
234     %extend
235        {
236          static PyObject *_this(const MEDCouplingCMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
237          {
238            return buildServantAndActivate<MEDCouplingCMeshServant>(cppPointerOfMesh);
239          }
240          
241          static PyObject *_this2(const MEDCouplingCMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
242          {
243            return buildServantAndActivate2<MEDCouplingCMeshServant>(cppPointerOfMesh);
244          }
245        }
246   };
247   
248   class MEDCouplingIMeshServant
249   {
250   public:
251     %extend
252        {
253          static PyObject *_this(const MEDCouplingIMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
254          {
255            return buildServantAndActivate<MEDCouplingIMeshServant>(cppPointerOfMesh);
256          }
257          
258          static PyObject *_this2(const MEDCouplingIMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
259          {
260            return buildServantAndActivate2<MEDCouplingIMeshServant>(cppPointerOfMesh);
261          }
262        }
263   };
264
265   class MEDCouplingCurveLinearMeshServant
266   {
267   public:
268     %extend
269        {
270          static PyObject *_this(const MEDCouplingCurveLinearMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
271          {
272            return buildServantAndActivate<MEDCouplingCurveLinearMeshServant>(cppPointerOfMesh);
273          }
274
275          static PyObject *_this2(const MEDCouplingCurveLinearMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
276          {
277            return buildServantAndActivate2<MEDCouplingCurveLinearMeshServant>(cppPointerOfMesh);
278          }
279        }
280   };
281
282   class DataArrayDoubleServant
283   {
284   public:
285     %extend
286        {
287          static PyObject *_this(const DataArrayDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
288          {
289            return buildServantAndActivate<DataArrayDoubleServant>(cppPointerOfMesh);
290          }
291
292          static PyObject *_this2(const DataArrayDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
293          {
294            return buildServantAndActivate2<DataArrayDoubleServant>(cppPointerOfMesh);
295          }
296        }
297   };
298
299   class DataArrayIntServant
300   {
301   public:
302     %extend
303        {
304          static PyObject *_this(const DataArrayInt *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
305          {
306            return buildServantAndActivate<DataArrayIntServant>(cppPointerOfMesh);
307          }
308
309          static PyObject *_this2(const DataArrayInt *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
310          {
311            return buildServantAndActivate2<DataArrayIntServant>(cppPointerOfMesh);
312          }
313        }
314   };
315 }
316
317 %pythoncode %{
318 def MEDCouplingDataArrayDoubleIadd(self,*args):
319     import _MEDCouplingCorba
320     return _MEDCouplingCorba.DataArrayDouble____iadd___(self, self, *args)
321 def MEDCouplingDataArrayDoubleIsub(self,*args):
322     import _MEDCouplingCorba
323     return _MEDCouplingCorba.DataArrayDouble____isub___(self, self, *args)
324 def MEDCouplingDataArrayDoubleImul(self,*args):
325     import _MEDCouplingCorba
326     return _MEDCouplingCorba.DataArrayDouble____imul___(self, self, *args)
327 def MEDCouplingDataArrayDoubleIdiv(self,*args):
328     import _MEDCouplingCorba
329     return _MEDCouplingCorba.DataArrayDouble____idiv___(self, self, *args)
330 def MEDCouplingDataArrayDoubleIpow(self,*args):
331     import _MEDCouplingCorba
332     return _MEDCouplingCorba.DataArrayDouble____ipow___(self, self, *args)
333 def MEDCouplingFieldDoubleIadd(self,*args):
334     import _MEDCouplingCorba
335     return _MEDCouplingCorba.MEDCouplingFieldDouble____iadd___(self, self, *args)
336 def MEDCouplingFieldDoubleIsub(self,*args):
337     import _MEDCouplingCorba
338     return _MEDCouplingCorba.MEDCouplingFieldDouble____isub___(self, self, *args)
339 def MEDCouplingFieldDoubleImul(self,*args):
340     import _MEDCouplingCorba
341     return _MEDCouplingCorba.MEDCouplingFieldDouble____imul___(self, self, *args)
342 def MEDCouplingFieldDoubleIdiv(self,*args):
343     import _MEDCouplingCorba
344     return _MEDCouplingCorba.MEDCouplingFieldDouble____idiv___(self, self, *args)
345 def MEDCouplingFieldDoubleIpow(self,*args):
346     import _MEDCouplingCorba
347     return _MEDCouplingCorba.MEDCouplingFieldDouble____ipow___(self, self, *args)
348 def MEDCouplingDataArrayIntIadd(self,*args):
349     import _MEDCouplingCorba
350     return _MEDCouplingCorba.DataArrayInt____iadd___(self, self, *args)
351 def MEDCouplingDataArrayIntIsub(self,*args):
352     import _MEDCouplingCorba
353     return _MEDCouplingCorba.DataArrayInt____isub___(self, self, *args)
354 def MEDCouplingDataArrayIntImul(self,*args):
355     import _MEDCouplingCorba
356     return _MEDCouplingCorba.DataArrayInt____imul___(self, self, *args)
357 def MEDCouplingDataArrayIntIdiv(self,*args):
358     import _MEDCouplingCorba
359     return _MEDCouplingCorba.DataArrayInt____idiv___(self, self, *args)
360 def MEDCouplingDataArrayIntImod(self,*args):
361     import _MEDCouplingCorba
362     return _MEDCouplingCorba.DataArrayInt____imod___(self, self, *args)
363 def MEDCouplingDataArrayIntIpow(self,*args):
364     import _MEDCouplingCorba
365     return _MEDCouplingCorba.DataArrayInt____ipow___(self, self, *args)
366 def MEDCouplingDataArrayFloatIadd(self,*args):
367     import _MEDCouplingCorba
368     return _MEDCouplingCorba.DataArrayFloat____iadd___(self, self, *args)
369 def MEDCouplingDataArrayFloatIsub(self,*args):
370     import _MEDCouplingCorba
371     return _MEDCouplingCorba.DataArrayFloat____isub___(self, self, *args)
372 def MEDCouplingDataArrayFloatImul(self,*args):
373     import _MEDCouplingCorba
374     return _MEDCouplingCorba.DataArrayFloat____imul___(self, self, *args)
375 def MEDCouplingDataArrayFloatIdiv(self,*args):
376     import _MEDCouplingCorba
377     return _MEDCouplingCorba.DataArrayFloat____idiv___(self, self, *args)
378 def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
379     import _MEDCouplingCorba
380     return _MEDCouplingCorba.DataArrayDoubleTuple____iadd___(self, self, *args)
381 def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
382     import _MEDCouplingCorba
383     return _MEDCouplingCorba.DataArrayDoubleTuple____isub___(self, self, *args)
384 def MEDCouplingDataArrayDoubleTupleImul(self,*args):
385     import _MEDCouplingCorba
386     return _MEDCouplingCorba.DataArrayDoubleTuple____imul___(self, self, *args)
387 def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
388     import _MEDCouplingCorba
389     return _MEDCouplingCorba.DataArrayDoubleTuple____idiv___(self, self, *args)
390 def MEDCouplingDataArrayIntTupleIadd(self,*args):
391     import _MEDCouplingCorba
392     return _MEDCouplingCorba.DataArrayIntTuple____iadd___(self, self, *args)
393 def MEDCouplingDataArrayIntTupleIsub(self,*args):
394     import _MEDCouplingCorba
395     return _MEDCouplingCorba.DataArrayIntTuple____isub___(self, self, *args)
396 def MEDCouplingDataArrayIntTupleImul(self,*args):
397     import _MEDCouplingCorba
398     return _MEDCouplingCorba.DataArrayIntTuple____imul___(self, self, *args)
399 def MEDCouplingDataArrayIntTupleIdiv(self,*args):
400     import _MEDCouplingCorba
401     return _MEDCouplingCorba.DataArrayIntTuple____idiv___(self, self, *args)
402 def MEDCouplingDataArrayIntTupleImod(self,*args):
403     import _MEDCouplingCorba
404     return _MEDCouplingCorba.DataArrayIntTuple____imod___(self, self, *args)
405 def MEDCouplingDenseMatrixIadd(self,*args):
406     import _MEDCouplingCorba
407     return _MEDCouplingCorba.DenseMatrix____iadd___(self, self, *args)
408 def MEDCouplingDenseMatrixIsub(self,*args):
409     import _MEDCouplingCorba
410     return _MEDCouplingCorba.DenseMatrix____isub___(self, self, *args)
411 %}
412
413 %include "MEDCouplingFinalize.i"