]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/RENUMBER_Swig/MEDRenumberCommon.i
Salome HOME
Update copyrights
[tools/medcoupling.git] / src / RENUMBER_Swig / MEDRenumberCommon.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 %include std_vector.i
22 %include std_string.i
23
24 %include "MEDCouplingCommon.i"
25
26 %{
27 #ifndef WIN32
28 #include "MEDCouplingMemArray.txx"
29 #endif
30 #include "MCAuto.hxx"
31 #include "MEDCouplingDataArrayTypemaps.i"
32
33 using namespace MEDCoupling;
34 using namespace INTERP_KERNEL;
35 %}
36
37 %template(ivec) std::vector<int>;
38 %template(dvec) std::vector<double>;
39 %template(svec) std::vector<std::string>;
40
41 #ifdef WITH_NUMPY
42 %init %{ import_array(); %}
43 #endif
44
45 %init %{ initializeMe_renumber(); %}
46
47 %feature("autodoc", "1");
48 %feature("docstring");
49
50 %nodefaultctor;
51
52 %rename (InterpKernelException) INTERP_KERNEL::Exception;
53
54 %include "MEDCouplingRefCountObject.i"
55 %include "MEDCouplingMemArray.i"
56
57 %{
58   void initializeMe_renumber()
59   {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
60     SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
61     SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
62   }
63 %}
64
65 %include "MEDRenumberImpl.i"
66
67 %pythoncode %{
68 import os
69 __filename=os.environ.get('PYTHONSTARTUP')
70 if __filename and os.path.isfile(__filename):
71   exec(open(__filename).read())
72   pass
73 %}