PyList_SetItem(res,2,SWIG_From_int(tmp2));
return res;
}
-
+
int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
{
double val;
std::vector<std::string> littleStrings;
self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
}
+
+ PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
+ {
+ PyObject *ret0(ParaMEDMEM_MEDCouplingMesh_getTinySerializationInformation(self));
+ PyObject *ret1(ParaMEDMEM_MEDCouplingMesh_serialize(self));
+ PyObject *ret(PyTuple_New(2));
+ PyTuple_SetItem(ret,0,ret0);
+ PyTuple_SetItem(ret,1,ret1);
+ return ret;
+ }
+
+ void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ {
+ static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
+ if(!PyTuple_Check(inp))
+ throw INTERP_KERNEL::Exception(MSG);
+ int sz(PyTuple_Size(inp));
+ if(sz!=2)
+ throw INTERP_KERNEL::Exception(MSG);
+ PyObject *elt0(PyTuple_GetItem(inp,0));
+ PyObject *elt1(PyTuple_GetItem(inp,1));
+ std::vector<double> a0;
+ std::vector<int> a1;
+ std::vector<std::string> a2;
+ DataArrayInt *b0(0);
+ DataArrayDouble *b1(0);
+ {
+ if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
+ throw INTERP_KERNEL::Exception(MSG);
+ PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
+ int tmp(-1);
+ fillArrayWithPyListDbl3(a0py,tmp,a0);
+ convertPyToNewIntArr3(a1py,a1);
+ fillStringVector(a2py,a2);
+ }
+ {
+ if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
+ throw INTERP_KERNEL::Exception(MSG);
+ PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
+ void *argp(0);
+ int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
+ if(!SWIG_IsOK(status))
+ throw INTERP_KERNEL::Exception(MSG);
+ b0=reinterpret_cast<DataArrayInt *>(argp);
+ status=SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+ if(!SWIG_IsOK(status))
+ throw INTERP_KERNEL::Exception(MSG);
+ b1=reinterpret_cast<DataArrayDouble *>(argp);
+ }
+ //
+ std::vector<std::string> uselessVector;
+ self->resizeForUnserialization(a1,b0,b1,uselessVector);
+ self->unserialization(a0,a1,b0,b1,a2);
+ }
static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
{
{
return MEDCouplingUMesh::New(meshName,meshDim);
}
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ static const char MSG[]="MEDCouplingUMesh.__new__ : the args in input is expected to be a tuple !";
+ if(!PyTuple_Check(args))
+ throw INTERP_KERNEL::Exception(MSG);
+ 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);
+ PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
+ int sz(PyTuple_Size(args));
+
+ if(PyTuple_Size(args)==2 && 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 *tmp3(PyTuple_New(0));
+ PyObject *tmp2(PyObject_CallObject(initMeth,tmp3));
+ Py_XDECREF(tmp2);
+ Py_DECREF(tmp3);
+ }
+ Py_DECREF(initMeth);
+ return instance;
+ }
+
+ PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
+ {// put an empty dict in input to say to __new__ to call __init__...
+ PyObject *ret(PyTuple_New(1));
+ PyObject *ret0(PyDict_New());
+ PyTuple_SetItem(ret,0,ret0);
+ return ret;
+ }
std::string __str__() const throw(INTERP_KERNEL::Exception)
{