Salome HOME
Update copyrights 2014.
[modules/med.git] / src / MEDCouplingCorba_Swig / MEDCouplingCorba.i
1 // Copyright (C) 2007-2014  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 "MEDCouplingCurveLinearMeshServant.hxx"
34 #include "DataArrayDoubleServant.hxx"
35 #include "DataArrayIntServant.hxx"
36 #include "MEDCouplingCorbaTypemaps.i"
37
38 using namespace ParaMEDMEM;
39 %}
40
41 %include "MEDCouplingCommon.i"
42
43 namespace ParaMEDMEM
44 {
45   class MEDCouplingFieldDoubleServant
46   {
47   public:
48     %extend
49        {
50          static PyObject *_this(const MEDCouplingFieldDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
51          {
52            return buildServantAndActivate<MEDCouplingFieldDoubleServant>(cppPointerOfMesh);
53          }
54          
55          static PyObject *_this2(const MEDCouplingFieldDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
56          {
57            return buildServantAndActivate2<MEDCouplingFieldDoubleServant>(cppPointerOfMesh);
58          }
59        }
60   };
61
62   class MEDCouplingFieldTemplateServant
63   {
64   public:
65     %extend
66        {
67          static PyObject *_this(const MEDCouplingFieldTemplate *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
68          {
69            return buildServantAndActivate<MEDCouplingFieldTemplateServant>(cppPointerOfMesh);
70          }
71          
72          static PyObject *_this2(const MEDCouplingFieldTemplate *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
73          {
74            return buildServantAndActivate2<MEDCouplingFieldTemplateServant>(cppPointerOfMesh);
75          }
76        }
77   };
78
79   class MEDCouplingMultiFieldsServant
80   {
81   public:
82     %extend
83        {
84          static PyObject *_this(const MEDCouplingMultiFields *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
85          {
86            return buildServantAndActivate<MEDCouplingMultiFieldsServant>(cppPointerOfMesh);
87          }
88
89          static PyObject *_this2(const MEDCouplingMultiFields *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
90          {
91            return buildServantAndActivate2<MEDCouplingMultiFieldsServant>(cppPointerOfMesh);
92          }
93        }
94   };
95
96   class MEDCouplingFieldOverTimeServant
97   {
98   public:
99     %extend
100        {
101          static PyObject *_this(const MEDCouplingFieldOverTime *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
102          {
103            return buildServantAndActivate<MEDCouplingFieldOverTimeServant>(cppPointerOfMesh);
104          }
105
106          static PyObject *_this2(const MEDCouplingFieldOverTime *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
107          {
108            return buildServantAndActivate2<MEDCouplingFieldOverTimeServant>(cppPointerOfMesh);
109          }
110        }
111   };
112
113   class MEDCouplingMeshServant
114   {
115   public:
116     %extend
117        {
118          static PyObject *_this(const MEDCouplingMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
119          {
120            if(!cppPointerOfMesh)
121              throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this : input pointer is NULL !");
122            if(dynamic_cast<const MEDCouplingUMesh *>(cppPointerOfMesh))
123              return buildServantAndActivate<MEDCouplingUMeshServant>(dynamic_cast<const MEDCouplingUMesh *>(cppPointerOfMesh));
124            if(dynamic_cast<const MEDCoupling1SGTUMesh *>(cppPointerOfMesh))
125              return buildServantAndActivate<MEDCoupling1SGTUMeshServant>(dynamic_cast<const MEDCoupling1SGTUMesh *>(cppPointerOfMesh));
126            if(dynamic_cast<const MEDCoupling1DGTUMesh *>(cppPointerOfMesh))
127              return buildServantAndActivate<MEDCoupling1DGTUMeshServant>(dynamic_cast<const MEDCoupling1DGTUMesh *>(cppPointerOfMesh));
128            if(dynamic_cast<const MEDCouplingExtrudedMesh *>(cppPointerOfMesh))
129              return buildServantAndActivate<MEDCouplingExtrudedMeshServant>(dynamic_cast<const MEDCouplingExtrudedMesh *>(cppPointerOfMesh));
130            if(dynamic_cast<const MEDCouplingCMesh *>(cppPointerOfMesh))
131              return buildServantAndActivate<MEDCouplingCMeshServant>(dynamic_cast<const MEDCouplingCMesh *>(cppPointerOfMesh));
132            if(dynamic_cast<const MEDCouplingCurveLinearMesh *>(cppPointerOfMesh))
133              return buildServantAndActivate<MEDCouplingCurveLinearMeshServant>(dynamic_cast<const MEDCouplingCurveLinearMesh *>(cppPointerOfMesh));
134            throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this : unrecognized type (or not managed type) of Mesh in input !");
135          }
136
137          static PyObject *_this2(const MEDCouplingMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
138          {
139            if(!cppPointerOfMesh)
140              throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this2 : input pointer is NULL !");
141            if(dynamic_cast<const MEDCouplingUMesh *>(cppPointerOfMesh))
142              return buildServantAndActivate2<MEDCouplingUMeshServant>(dynamic_cast<const MEDCouplingUMesh *>(cppPointerOfMesh));
143            if(dynamic_cast<const MEDCoupling1SGTUMesh *>(cppPointerOfMesh))
144              return buildServantAndActivate2<MEDCoupling1SGTUMeshServant>(dynamic_cast<const MEDCoupling1SGTUMesh *>(cppPointerOfMesh));
145            if(dynamic_cast<const MEDCoupling1DGTUMesh *>(cppPointerOfMesh))
146              return buildServantAndActivate2<MEDCoupling1DGTUMeshServant>(dynamic_cast<const MEDCoupling1DGTUMesh *>(cppPointerOfMesh));
147            if(dynamic_cast<const MEDCouplingExtrudedMesh *>(cppPointerOfMesh))
148              return buildServantAndActivate2<MEDCouplingExtrudedMeshServant>(dynamic_cast<const MEDCouplingExtrudedMesh *>(cppPointerOfMesh));
149            if(dynamic_cast<const MEDCouplingCMesh *>(cppPointerOfMesh))
150              return buildServantAndActivate2<MEDCouplingCMeshServant>(dynamic_cast<const MEDCouplingCMesh *>(cppPointerOfMesh));
151            if(dynamic_cast<const MEDCouplingCurveLinearMesh *>(cppPointerOfMesh))
152              return buildServantAndActivate2<MEDCouplingCurveLinearMeshServant>(dynamic_cast<const MEDCouplingCurveLinearMesh *>(cppPointerOfMesh));
153            throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this2 : unrecognized type (or not managed type) of Mesh in input !");
154          }
155        }
156   };
157
158   class MEDCouplingUMeshServant
159   {
160   public:
161     %extend
162        {
163          static PyObject *_this(const MEDCouplingUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
164          {
165            return buildServantAndActivate<MEDCouplingUMeshServant>(cppPointerOfMesh);
166          }
167
168          static PyObject *_this2(const MEDCouplingUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
169          {
170            return buildServantAndActivate2<MEDCouplingUMeshServant>(cppPointerOfMesh);
171          }
172        }
173   };
174
175   class MEDCoupling1SGTUMeshServant
176   {
177   public:
178     %extend
179        {
180          static PyObject *_this(const MEDCoupling1SGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
181          {
182            return buildServantAndActivate<MEDCoupling1SGTUMeshServant>(cppPointerOfMesh);
183          }
184
185          static PyObject *_this2(const MEDCoupling1SGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
186          {
187            return buildServantAndActivate2<MEDCoupling1SGTUMeshServant>(cppPointerOfMesh);
188          }
189        }
190   };
191
192   class MEDCoupling1DGTUMeshServant
193   {
194   public:
195     %extend
196        {
197          static PyObject *_this(const MEDCoupling1DGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
198          {
199            return buildServantAndActivate<MEDCoupling1DGTUMeshServant>(cppPointerOfMesh);
200          }
201
202          static PyObject *_this2(const MEDCoupling1DGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
203          {
204            return buildServantAndActivate2<MEDCoupling1DGTUMeshServant>(cppPointerOfMesh);
205          }
206        }
207   };
208
209   class MEDCouplingExtrudedMeshServant
210   {
211   public:
212     %extend
213        {
214          static PyObject *_this(const MEDCouplingExtrudedMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
215          {
216            return buildServantAndActivate<MEDCouplingExtrudedMeshServant>(cppPointerOfMesh);
217          }
218
219          static PyObject *_this2(const MEDCouplingExtrudedMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
220          {
221            return buildServantAndActivate2<MEDCouplingExtrudedMeshServant>(cppPointerOfMesh);
222          }
223        }
224   };
225
226   class MEDCouplingCMeshServant
227   {
228   public:
229     %extend
230        {
231          static PyObject *_this(const MEDCouplingCMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
232          {
233            return buildServantAndActivate<MEDCouplingCMeshServant>(cppPointerOfMesh);
234          }
235          
236          static PyObject *_this2(const MEDCouplingCMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
237          {
238            return buildServantAndActivate2<MEDCouplingCMeshServant>(cppPointerOfMesh);
239          }
240        }
241   };
242
243   class MEDCouplingCurveLinearMeshServant
244   {
245   public:
246     %extend
247        {
248          static PyObject *_this(const MEDCouplingCurveLinearMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
249          {
250            return buildServantAndActivate<MEDCouplingCurveLinearMeshServant>(cppPointerOfMesh);
251          }
252
253          static PyObject *_this2(const MEDCouplingCurveLinearMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
254          {
255            return buildServantAndActivate2<MEDCouplingCurveLinearMeshServant>(cppPointerOfMesh);
256          }
257        }
258   };
259
260   class DataArrayDoubleServant
261   {
262   public:
263     %extend
264        {
265          static PyObject *_this(const DataArrayDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
266          {
267            return buildServantAndActivate<DataArrayDoubleServant>(cppPointerOfMesh);
268          }
269
270          static PyObject *_this2(const DataArrayDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
271          {
272            return buildServantAndActivate2<DataArrayDoubleServant>(cppPointerOfMesh);
273          }
274        }
275   };
276
277   class DataArrayIntServant
278   {
279   public:
280     %extend
281        {
282          static PyObject *_this(const DataArrayInt *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
283          {
284            return buildServantAndActivate<DataArrayIntServant>(cppPointerOfMesh);
285          }
286
287          static PyObject *_this2(const DataArrayInt *cppPointerOfMesh) throw(INTERP_KERNEL::Exception)
288          {
289            return buildServantAndActivate2<DataArrayIntServant>(cppPointerOfMesh);
290          }
291        }
292   };
293 }
294
295 %pythoncode %{
296 def ParaMEDMEMDataArrayDoubleIadd(self,*args):
297     import _MEDCouplingCorba
298     return _MEDCouplingCorba.DataArrayDouble____iadd___(self, self, *args)
299 def ParaMEDMEMDataArrayDoubleIsub(self,*args):
300     import _MEDCouplingCorba
301     return _MEDCouplingCorba.DataArrayDouble____isub___(self, self, *args)
302 def ParaMEDMEMDataArrayDoubleImul(self,*args):
303     import _MEDCouplingCorba
304     return _MEDCouplingCorba.DataArrayDouble____imul___(self, self, *args)
305 def ParaMEDMEMDataArrayDoubleIdiv(self,*args):
306     import _MEDCouplingCorba
307     return _MEDCouplingCorba.DataArrayDouble____idiv___(self, self, *args)
308 def ParaMEDMEMDataArrayDoubleIpow(self,*args):
309     import _MEDCouplingCorba
310     return _MEDCouplingCorba.DataArrayDouble____ipow___(self, self, *args)
311 def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args):
312     import _MEDCouplingCorba
313     return _MEDCouplingCorba.MEDCouplingFieldDouble____iadd___(self, self, *args)
314 def ParaMEDMEMMEDCouplingFieldDoubleIsub(self,*args):
315     import _MEDCouplingCorba
316     return _MEDCouplingCorba.MEDCouplingFieldDouble____isub___(self, self, *args)
317 def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args):
318     import _MEDCouplingCorba
319     return _MEDCouplingCorba.MEDCouplingFieldDouble____imul___(self, self, *args)
320 def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args):
321     import _MEDCouplingCorba
322     return _MEDCouplingCorba.MEDCouplingFieldDouble____idiv___(self, self, *args)
323 def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args):
324     import _MEDCouplingCorba
325     return _MEDCouplingCorba.MEDCouplingFieldDouble____ipow___(self, self, *args)
326 def ParaMEDMEMDataArrayIntIadd(self,*args):
327     import _MEDCouplingCorba
328     return _MEDCouplingCorba.DataArrayInt____iadd___(self, self, *args)
329 def ParaMEDMEMDataArrayIntIsub(self,*args):
330     import _MEDCouplingCorba
331     return _MEDCouplingCorba.DataArrayInt____isub___(self, self, *args)
332 def ParaMEDMEMDataArrayIntImul(self,*args):
333     import _MEDCouplingCorba
334     return _MEDCouplingCorba.DataArrayInt____imul___(self, self, *args)
335 def ParaMEDMEMDataArrayIntIdiv(self,*args):
336     import _MEDCouplingCorba
337     return _MEDCouplingCorba.DataArrayInt____idiv___(self, self, *args)
338 def ParaMEDMEMDataArrayIntImod(self,*args):
339     import _MEDCouplingCorba
340     return _MEDCouplingCorba.DataArrayInt____imod___(self, self, *args)
341 def ParaMEDMEMDataArrayIntIpow(self,*args):
342     import _MEDCouplingCorba
343     return _MEDCouplingCorba.DataArrayInt____ipow___(self, self, *args)
344 def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args):
345     import _MEDCouplingCorba
346     return _MEDCouplingCorba.DataArrayDoubleTuple____iadd___(self, self, *args)
347 def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args):
348     import _MEDCouplingCorba
349     return _MEDCouplingCorba.DataArrayDoubleTuple____isub___(self, self, *args)
350 def ParaMEDMEMDataArrayDoubleTupleImul(self,*args):
351     import _MEDCouplingCorba
352     return _MEDCouplingCorba.DataArrayDoubleTuple____imul___(self, self, *args)
353 def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
354     import _MEDCouplingCorba
355     return _MEDCouplingCorba.DataArrayDoubleTuple____idiv___(self, self, *args)
356 def ParaMEDMEMDataArrayIntTupleIadd(self,*args):
357     import _MEDCouplingCorba
358     return _MEDCouplingCorba.DataArrayIntTuple____iadd___(self, self, *args)
359 def ParaMEDMEMDataArrayIntTupleIsub(self,*args):
360     import _MEDCouplingCorba
361     return _MEDCouplingCorba.DataArrayIntTuple____isub___(self, self, *args)
362 def ParaMEDMEMDataArrayIntTupleImul(self,*args):
363     import _MEDCouplingCorba
364     return _MEDCouplingCorba.DataArrayIntTuple____imul___(self, self, *args)
365 def ParaMEDMEMDataArrayIntTupleIdiv(self,*args):
366     import _MEDCouplingCorba
367     return _MEDCouplingCorba.DataArrayIntTuple____idiv___(self, self, *args)
368 def ParaMEDMEMDataArrayIntTupleImod(self,*args):
369     import _MEDCouplingCorba
370     return _MEDCouplingCorba.DataArrayIntTuple____imod___(self, self, *args)
371 %}
372
373 %include "MEDCouplingFinalize.i"