Salome HOME
Update tests for Fedora-24 and Ubuntu-16.04
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingTypemaps.i
index 4aa51443f7c1dd8a0f389413318126ea0f5df5cb..6bb7ee801e85b22969d8a56ed04745beb999775c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // Author : Anthony Geay (CEA/DEN)
 
+#ifndef __MEDCOUPLINGTYPEMAPS_I__
+#define __MEDCOUPLINGTYPEMAPS_I__
+
 #include "MEDCouplingDataArrayTypemaps.i"
+#include "MEDCouplingUMesh.hxx"
+#include "MEDCouplingCMesh.hxx"
+#include "MEDCouplingIMesh.hxx"
+#include "MEDCouplingCurveLinearMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
+#include "MEDCoupling1GTUMesh.hxx"
+#include "MEDCouplingFieldDiscretization.hxx"
+#include "MEDCouplingMultiFields.hxx"
+#include "MEDCouplingPartDefinition.hxx"
+#include "MEDCouplingCartesianAMRMesh.hxx"
 
 static PyObject *convertMesh(MEDCoupling::MEDCouplingMesh *mesh, int owner) throw(INTERP_KERNEL::Exception)
 {
@@ -85,21 +98,6 @@ static PyObject* convertMultiFields(MEDCoupling::MEDCouplingMultiFields *mfs, in
   return ret;
 }
 
-static PyObject *convertPartDefinition(MEDCoupling::PartDefinition *pd, int owner) throw(INTERP_KERNEL::Exception)
-{
-  PyObject *ret=0;
-  if(!pd)
-    {
-      Py_XINCREF(Py_None);
-      return Py_None;
-    }
-  if(dynamic_cast<MEDCoupling::DataArrayPartDefinition *>(pd))
-    ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_MEDCoupling__DataArrayPartDefinition,owner);
-  else
-    ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_MEDCoupling__SlicePartDefinition,owner);
-  return ret;
-}
-
 static PyObject *convertCartesianAMRMesh(MEDCoupling::MEDCouplingCartesianAMRMeshGen *mesh, int owner) throw(INTERP_KERNEL::Exception)
 {
   if(!mesh)
@@ -428,30 +426,4 @@ MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rdiv__
     }
 }
 
-static PyObject *NewMethWrapCallInitOnlyIfEmptyDictInInput(PyObject *cls, PyObject *args, const char *clsName)
-{
-  if(!PyTuple_Check(args))
-    {
-      std::ostringstream oss; oss << clsName << ".__new__ : the args in input is expected to be a tuple !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
-    }
-  PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
-  PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
-  PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
-  //
-  PyObject *tmp0(PyTuple_New(1));
-  PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
-  PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
-  Py_DECREF(tmp0);
-  Py_DECREF(selfMeth);
-  if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==0 )
-    {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
-      PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
-      PyObject *tmp3(PyTuple_New(0));
-      PyObject *tmp2(PyObject_CallObject(initMeth,tmp3));
-      Py_XDECREF(tmp2);
-      Py_DECREF(tmp3);
-      Py_DECREF(initMeth);
-    }
-  return instance;
-}
+#endif