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