-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015 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
ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh,owner);
if(dynamic_cast<ParaMEDMEM::MEDCouplingCurveLinearMesh *>(mesh))
ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh,owner);
+ if(dynamic_cast<ParaMEDMEM::MEDCouplingIMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingIMesh,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of mesh on downcast !");
return ret;
return ret;
}
+static PyObject *convertPartDefinition(ParaMEDMEM::PartDefinition *pd, int owner) throw(INTERP_KERNEL::Exception)
+{
+ PyObject *ret=0;
+ if(!pd)
+ {
+ Py_XINCREF(Py_None);
+ return Py_None;
+ }
+ if(dynamic_cast<ParaMEDMEM::DataArrayPartDefinition *>(pd))
+ ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_ParaMEDMEM__DataArrayPartDefinition,owner);
+ else
+ ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_ParaMEDMEM__SlicePartDefinition,owner);
+ return ret;
+}
+
+static PyObject *convertCartesianAMRMesh(ParaMEDMEM::MEDCouplingCartesianAMRMeshGen *mesh, int owner) throw(INTERP_KERNEL::Exception)
+{
+ if(!mesh)
+ {
+ Py_XINCREF(Py_None);
+ return Py_None;
+ }
+ if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRMeshSub *>(mesh))
+ {
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(mesh),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRMeshSub,owner);
+ }
+ if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRMesh *>(mesh))
+ {
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(mesh),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRMesh,owner);
+ }
+ throw INTERP_KERNEL::Exception("convertCartesianAMRMesh wrap : unrecognized type of cartesian AMR mesh !");
+}
+
+static PyObject *convertDataForGodFather(ParaMEDMEM::MEDCouplingDataForGodFather *data, int owner) throw(INTERP_KERNEL::Exception)
+{
+ if(!data)
+ {
+ Py_XINCREF(Py_None);
+ return Py_None;
+ }
+ if(dynamic_cast<ParaMEDMEM::MEDCouplingAMRAttribute *>(data))
+ {
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(data),SWIGTYPE_p_ParaMEDMEM__MEDCouplingAMRAttribute,owner);
+ }
+ throw INTERP_KERNEL::Exception("convertDataForGodFather wrap : unrecognized data type for AMR !");
+}
+
+static PyObject *convertCartesianAMRPatch(ParaMEDMEM::MEDCouplingCartesianAMRPatchGen *patch, int owner) throw(INTERP_KERNEL::Exception)
+{
+ if(!patch)
+ {
+ Py_XINCREF(Py_None);
+ return Py_None;
+ }
+ if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRPatchGF *>(patch))
+ {
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(patch),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRPatchGF,owner);
+ }
+ if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRPatch *>(patch))
+ {
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(patch),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRPatch,owner);
+ }
+ throw INTERP_KERNEL::Exception("convertCartesianAMRPatch wrap : unrecognized type of cartesian AMR patch !");
+}
+
static ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__add__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
{ throw INTERP_KERNEL::Exception(msg); }
}
}
+
+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;
+}