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