X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingDataArrayTypemaps.i;h=cbd924d82eb38cdee3f473e5d1d29f77ab97bc18;hb=0b187729ac99d3e9e9bb9d2be8cb8600a783be6c;hp=2b58e63660ab4f1538b415b54388c1b14d608728;hpb=659f8c67d0348350e12fde38fe8c4de1ff95dffe;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i index 2b58e6366..cbd924d82 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i @@ -1,4 +1,4 @@ -// 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 @@ -20,8 +20,60 @@ #include "InterpKernelAutoPtr.hxx" +/*! + * This method is an extention of PySlice_GetIndices but less + * open than PySlice_GetIndicesEx that accepts too many situations. + */ +void GetIndicesOfSlice(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure) +{ + int ret(PySlice_GetIndices(slice,length,start,stop,step)); + if(ret==0) + return ; + if(*step>0 && *start==*stop && length==*start) + return ; + throw INTERP_KERNEL::Exception(msgInCaseOfFailure); +} + +/*! + * This method allows to retrieve slice info from \a slice. + */ +void GetIndicesOfSliceExplicitely(PySliceObject *slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure) +{ + int ret(PySlice_GetIndices(slice,std::numeric_limits::max(),start,stop,step)); + if(ret==0) + { + if(*start!=std::numeric_limits::max() && *stop!=std::numeric_limits::max()) + return ; + std::ostringstream oss; + oss << msgInCaseOfFailure << " The input slice contains some unknowns that can't be determined in static method ! The input slice must be explicit here !"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } + throw INTERP_KERNEL::Exception(msgInCaseOfFailure); +} + +int InterpreteNegativeInt(int val, int nbelem) +{ + if(val<0) + { + int newVal(nbelem+val); + if(newVal<0) + { + std::ostringstream oss; oss << "interpreteNegativeInt : request for negative int=" << val << " but number of elems is equal to " << nbelem << " !"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } + return newVal; + } + else + return val; +} + #ifdef WITH_NUMPY #include +#if NPY_API_VERSION <= 0x00000006 +# define MED_NUMPY_OWNDATA NPY_OWNDATA +#else +# define MED_NUMPY_OWNDATA NPY_ARRAY_OWNDATA +#endif // specific DataArray deallocator callback. This deallocator is used both in the constructor of DataArray and in the toNumPyArr // method. This dellocator uses weakref to determine if the linked numArr is still alive or not. If alive the ownership is given to it. @@ -35,7 +87,7 @@ void numarrdeal(void *pt, void *wron) { Py_XINCREF(obj); PyArrayObject *objC=reinterpret_cast(obj); - objC->flags|=NPY_OWNDATA; + objC->flags|=MED_NUMPY_OWNDATA; Py_XDECREF(weakRefOnOwner); Py_XDECREF(obj); } @@ -55,8 +107,8 @@ struct PyCallBackDataArraySt { MCData *_pt_mc; }; -typedef struct PyCallBackDataArraySt PyCallBackDataArrayInt; -typedef struct PyCallBackDataArraySt PyCallBackDataArrayDouble; +typedef struct PyCallBackDataArraySt PyCallBackDataArrayInt; +typedef struct PyCallBackDataArraySt PyCallBackDataArrayDouble; extern "C" { @@ -85,7 +137,7 @@ extern "C" { if(self->_pt_mc) { - ParaMEDMEM::MemArray& mma=self->_pt_mc->accessToMemArray(); + MEDCoupling::MemArray& mma=self->_pt_mc->accessToMemArray(); mma.destroy(); } Py_XINCREF(Py_None); @@ -98,7 +150,7 @@ extern "C" { if(self->_pt_mc) { - ParaMEDMEM::MemArray& mma=self->_pt_mc->accessToMemArray(); + MEDCoupling::MemArray& mma=self->_pt_mc->accessToMemArray(); mma.destroy(); } Py_XINCREF(Py_None); @@ -231,35 +283,47 @@ MCData *BuildNewInstance(PyObject *elt0, int npyObjectType, PyTypeObject *pytype if(itemSize!=PyArray_STRIDE(elt0,1)) throw INTERP_KERNEL::Exception("Input numpy array has stride that mismatches the item size ! Data are not packed in the right way for DataArrays for component #1 !"); const char *data=PyArray_BYTES(elt0); - typename ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr ret=MCData::New(); + typename MEDCoupling::MEDCouplingAutoRefCountObjectPtr ret=MCData::New(); if(PyArray_ISBEHAVED(elt0))//aligned and writeable and in machine byte-order { PyArrayObject *elt0C=reinterpret_cast(elt0); - PyArrayObject *eltOwning=(PyArray_FLAGS(elt0C) & NPY_OWNDATA)?elt0C:NULL; - int mask=NPY_OWNDATA; mask=~mask; + PyArrayObject *eltOwning=(PyArray_FLAGS(elt0C) & MED_NUMPY_OWNDATA)?elt0C:NULL; + int mask=MED_NUMPY_OWNDATA; mask=~mask; elt0C->flags&=mask; PyObject *deepestObj=elt0; PyObject *base=elt0C->base; if(base) deepestObj=base; + bool isSpetialCase(false); while(base) { if(PyArray_Check(base)) { PyArrayObject *baseC=reinterpret_cast(base); - eltOwning=(PyArray_FLAGS(baseC) & NPY_OWNDATA)?baseC:eltOwning; + eltOwning=(PyArray_FLAGS(baseC) & MED_NUMPY_OWNDATA)?baseC:eltOwning; baseC->flags&=mask; base=baseC->base; if(base) deepestObj=base; } else - break; + { + isSpetialCase=true; + break; + } + } + if(isSpetialCase) + {// this case is present for numpy arrayint coming from load of pickelized string. The owner of elt0 is not an array -> A copy is requested. + std::size_t nbOfElems(sz0*sz1); + T *dataCpy=(T*)malloc(sizeof(T)*nbOfElems); + std::copy(reinterpret_cast(data),reinterpret_cast(data)+nbOfElems,dataCpy); + ret->useArray(dataCpy,true,MEDCoupling::C_DEALLOC,sz0,sz1); + return ret.retn(); } - typename ParaMEDMEM::MemArray& mma=ret->accessToMemArray(); + typename MEDCoupling::MemArray& mma=ret->accessToMemArray(); if(eltOwning==NULL) { PyCallBackDataArraySt *cb=PyObject_GC_New(PyCallBackDataArraySt,pytype); cb->_pt_mc=ret; - ret->useArray(reinterpret_cast(data),true,ParaMEDMEM::C_DEALLOC,sz0,sz1); + ret->useArray(reinterpret_cast(data),true,MEDCoupling::C_DEALLOC,sz0,sz1); PyObject *ref=PyWeakref_NewRef(deepestObj,(PyObject *)cb); void **objs=new void *[2]; objs[0]=cb; objs[1]=ref; mma.setParameterForDeallocator(objs); @@ -268,15 +332,17 @@ MCData *BuildNewInstance(PyObject *elt0, int npyObjectType, PyTypeObject *pytype } else { - ret->useArray(reinterpret_cast(data),true,ParaMEDMEM::C_DEALLOC,sz0,sz1); + ret->useArray(reinterpret_cast(data),true,MEDCoupling::C_DEALLOC,sz0,sz1); PyObject *ref=PyWeakref_NewRef(reinterpret_cast(eltOwning),NULL); - void **objs=new void *[2]; objs[0]=ref; objs[1]=(void*) ParaMEDMEM::MemArray::CDeallocator; + typename MEDCoupling::MemArray::Deallocator tmp(MEDCoupling::MemArray::CDeallocator); + void **tmp2 = reinterpret_cast(&tmp); // MSVC2010 does not support constructor() + void **objs=new void *[2]; objs[0]=ref; objs[1]=*tmp2; mma.setParameterForDeallocator(objs); mma.setSpecificDeallocator(numarrdeal); } } else if(PyArray_ISBEHAVED_RO(elt0)) - ret->useArray(reinterpret_cast(data),false,ParaMEDMEM::CPP_DEALLOC,sz0,sz1); + ret->useArray(reinterpret_cast(data),false,MEDCoupling::CPP_DEALLOC,sz0,sz1); return ret.retn(); } @@ -314,7 +380,7 @@ int NumpyArrSetBaseObjectExt(PyArrayObject *arr, PyObject *obj) /* If this array owns its own data, stop collapsing */ - if (PyArray_CHKFLAGS(obj_arr, NPY_OWNDATA)) { + if (PyArray_CHKFLAGS(obj_arr, MED_NUMPY_OWNDATA )) { break; } @@ -350,15 +416,14 @@ int NumpyArrSetBaseObjectExt(PyArrayObject *arr, PyObject *obj) } template -PyObject *ToNumPyArray(MCData *self, int npyObjectType, const char *MCDataStr) +PyObject *ToNumPyArrayUnderground(MCData *self, int npyObjectType, const char *MCDataStr, int nbTuples, int nbComp) { if(!self->isAllocated()) { std::ostringstream oss; oss << MCDataStr << "::toNumPyArray : this is not allocated !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); } - ParaMEDMEM::MemArray& mem=self->accessToMemArray(); - int nbComp=self->getNumberOfComponents(); + MEDCoupling::MemArray& mem=self->accessToMemArray(); if(nbComp==0) { std::ostringstream oss; oss << MCDataStr << "::toNumPyArray : number of components of this is 0 ! Should be > 0 !"; @@ -366,15 +431,17 @@ PyObject *ToNumPyArray(MCData *self, int npyObjectType, const char *MCDataStr) } int nbDims=nbComp==1?1:2; npy_intp dim[2]; - dim[0]=(npy_intp)self->getNumberOfTuples(); dim[1]=nbComp; + dim[0]=(npy_intp)nbTuples; dim[1]=nbComp; const T *bg=self->getConstPointer(); - PyObject *ret=PyArray_SimpleNewFromData(nbDims,dim,npyObjectType,const_cast(bg)); + PyObject *ret(PyArray_SimpleNewFromData(nbDims,dim,npyObjectType,const_cast(bg))); if(mem.isDeallocatorCalled()) { if(mem.getDeallocator()!=numarrdeal) {// case for the first call of toNumPyArray - PyObject *ref=PyWeakref_NewRef(ret,NULL); - void **objs=new void *[2]; objs[0]=ref; objs[1]=(void*) mem.getDeallocator(); + PyObject *ref(PyWeakref_NewRef(ret,NULL)); + typename MEDCoupling::MemArray::Deallocator tmp(mem.getDeallocator()); + void **tmp2 = reinterpret_cast(&tmp); // MSVC2010 does not support constructor() + void **objs=new void *[2]; objs[0]=reinterpret_cast(ref); objs[1]=*tmp2; mem.setParameterForDeallocator(objs); mem.setSpecificDeallocator(numarrdeal); return ret; @@ -400,14 +467,20 @@ PyObject *ToNumPyArray(MCData *self, int npyObjectType, const char *MCDataStr) return ret; } -SWIGINTERN PyObject *ParaMEDMEM_DataArrayInt_toNumPyArray(ParaMEDMEM::DataArrayInt *self); -SWIGINTERN PyObject *ParaMEDMEM_DataArrayDouble_toNumPyArray(ParaMEDMEM::DataArrayDouble *self); +template +PyObject *ToNumPyArray(MCData *self, int npyObjectType, const char *MCDataStr) +{ + return ToNumPyArrayUnderground(self,npyObjectType,MCDataStr,self->getNumberOfTuples(),self->getNumberOfComponents()); +} + +SWIGINTERN PyObject *MEDCoupling_DataArrayInt_toNumPyArray(MEDCoupling::DataArrayInt *self); +SWIGINTERN PyObject *MEDCoupling_DataArrayDouble_toNumPyArray(MEDCoupling::DataArrayDouble *self); PyObject *ToCSRMatrix(const std::vector >& m, int nbCols) throw(INTERP_KERNEL::Exception) { int nbRows((int)m.size()); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr indPtr(ParaMEDMEM::DataArrayInt::New()),indices(ParaMEDMEM::DataArrayInt::New()); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr data(ParaMEDMEM::DataArrayDouble::New()); + MEDCoupling::MEDCouplingAutoRefCountObjectPtr indPtr(MEDCoupling::DataArrayInt::New()),indices(MEDCoupling::DataArrayInt::New()); + MEDCoupling::MEDCouplingAutoRefCountObjectPtr data(MEDCoupling::DataArrayDouble::New()); indPtr->alloc(nbRows+1,1); int *intPtr_ptr(indPtr->getPointer()); intPtr_ptr[0]=0; intPtr_ptr++; int sz2(0); @@ -425,7 +498,7 @@ PyObject *ToCSRMatrix(const std::vector >& m, int nbCols) t *indices_ptr=(*it1).first; *data_ptr=(*it1).second; } - PyObject *a(ParaMEDMEM_DataArrayDouble_toNumPyArray(data)),*b(ParaMEDMEM_DataArrayInt_toNumPyArray(indices)),*c(ParaMEDMEM_DataArrayInt_toNumPyArray(indPtr)); + PyObject *a(MEDCoupling_DataArrayDouble_toNumPyArray(data)),*b(MEDCoupling_DataArrayInt_toNumPyArray(indices)),*c(MEDCoupling_DataArrayInt_toNumPyArray(indPtr)); // PyObject *args(PyTuple_New(1)),*args0(PyTuple_New(3)),*kw(PyDict_New()),*kw1(PyTuple_New(2)); PyTuple_SetItem(args0,0,a); PyTuple_SetItem(args0,1,b); PyTuple_SetItem(args0,2,c); PyTuple_SetItem(args,0,args0); @@ -447,7 +520,7 @@ PyObject *ToCSRMatrix(const std::vector >& m, int nbCols) t #endif -static PyObject *convertDataArrayChar(ParaMEDMEM::DataArrayChar *dac, int owner) throw(INTERP_KERNEL::Exception) +static PyObject *convertDataArrayChar(MEDCoupling::DataArrayChar *dac, int owner) throw(INTERP_KERNEL::Exception) { PyObject *ret=0; if(!dac) @@ -455,16 +528,16 @@ static PyObject *convertDataArrayChar(ParaMEDMEM::DataArrayChar *dac, int owner) Py_XINCREF(Py_None); return Py_None; } - if(dynamic_cast(dac)) - ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayByte,owner); - if(dynamic_cast(dac)) - ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar,owner); + if(dynamic_cast(dac)) + ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayByte,owner); + if(dynamic_cast(dac)) + ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,owner); if(!ret) throw INTERP_KERNEL::Exception("Not recognized type of DataArrayChar on downcast !"); return ret; } -static PyObject *convertDataArray(ParaMEDMEM::DataArray *dac, int owner) throw(INTERP_KERNEL::Exception) +static PyObject *convertDataArray(MEDCoupling::DataArray *dac, int owner) throw(INTERP_KERNEL::Exception) { PyObject *ret=0; if(!dac) @@ -472,14 +545,14 @@ static PyObject *convertDataArray(ParaMEDMEM::DataArray *dac, int owner) throw(I Py_XINCREF(Py_None); return Py_None; } - if(dynamic_cast(dac)) - ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,owner); - if(dynamic_cast(dac)) - ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,owner); - if(dynamic_cast(dac)) - ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayByte,owner); - if(dynamic_cast(dac)) - ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar,owner); + if(dynamic_cast(dac)) + ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayDouble,owner); + if(dynamic_cast(dac)) + ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayInt,owner); + if(dynamic_cast(dac)) + ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayByte,owner); + if(dynamic_cast(dac)) + ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,owner); if(!ret) throw INTERP_KERNEL::Exception("Not recognized type of DataArray on downcast !"); return ret; @@ -573,6 +646,19 @@ static int *convertPyToNewIntArr2(PyObject *pyLi, int *size) throw(INTERP_KERNEL } } +static PyObject *convertFromVectorPairInt(const std::vector< std::pair >& arr) throw(INTERP_KERNEL::Exception) +{ + PyObject *ret=PyList_New(arr.size()); + for(std::size_t i=0;i >& arr) throw(INTERP_KERNEL::Exception) { const char msg[]="list must contain tuples of 2 integers only or tuple must contain tuples of 2 integers only !"; @@ -630,6 +716,63 @@ static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair >& arr) throw(INTERP_KERNEL::Exception) +{ + const char msg[]="convertPyToVectorPairStringInt : list must contain tuples of 2 integers only or tuple must contain tuples of 1 string and 1 integer only !"; + if(PyList_Check(pyLi)) + { + int size=PyList_Size(pyLi); + arr.resize(size); + for(int i=0;i& arr) throw(INTERP_KERNEL::Exception) { if(PyList_Check(pyLi)) @@ -888,6 +1031,156 @@ static bool fillStringVector(PyObject *pyLi, std::vector& vec) thro else return false; } +static void convertPyToVectorOfVectorOfString(PyObject *pyLi, std::vector< std::vector >& arr) throw(INTERP_KERNEL::Exception) +{ + const char msg[]="convertPyToVectorOfVectorOfString : expecting list of list of strings !"; + if(PyList_Check(pyLi)) + { + Py_ssize_t sz=PyList_Size(pyLi); + arr.resize(sz); + for(int i=0;i& vec) throw(INTERP_KERNEL::Exception) +{ + if(PyList_Check(pyLi)) + { + Py_ssize_t sz=PyList_Size(pyLi); + vec.resize(sz); + for(int i=0;i >& arr) throw(INTERP_KERNEL::Exception) +{ + const char msg[]="convertPyToVectorOfVectorOfInt : expecting list of list of strings !"; + if(PyList_Check(pyLi)) + { + Py_ssize_t sz=PyList_Size(pyLi); + arr.resize(sz); + for(int i=0;i > >& arr) throw(INTERP_KERNEL::Exception) +{ + const char msg[]="convertPyToVectorPairStringVecString : expecting list of tuples containing each exactly 2 items : one string and one vector of string !"; + if(PyList_Check(pyLi)) + { + Py_ssize_t sz=PyList_Size(pyLi); + arr.resize(sz); + for(int i=0;i > item; + PyObject *o_0=PyTuple_GetItem(o,0); + if(!PyString_Check(o_0)) + throw INTERP_KERNEL::Exception(msg); + item.first=PyString_AsString(o_0); + PyObject *o_1=PyTuple_GetItem(o,1); + if(!fillStringVector(o_1,item.second)) + throw INTERP_KERNEL::Exception(msg); + arr[i]=item; + } + else + throw INTERP_KERNEL::Exception(msg); + } + } + else if(PyTuple_Check(pyLi)) + { + Py_ssize_t sz=PyTuple_Size(pyLi); + arr.resize(sz); + for(int i=0;i > item; + PyObject *o_0=PyTuple_GetItem(o,0); + if(!PyString_Check(o_0)) + throw INTERP_KERNEL::Exception(msg); + item.first=PyString_AsString(o_0); + PyObject *o_1=PyTuple_GetItem(o,1); + if(!fillStringVector(o_1,item.second)) + throw INTERP_KERNEL::Exception(msg); + arr[i]=item; + } + else + throw INTERP_KERNEL::Exception(msg); + } + } + else + throw INTERP_KERNEL::Exception(msg); +} static PyObject *convertDblArrToPyList(const double *ptr, int size) throw(INTERP_KERNEL::Exception) { @@ -1088,7 +1381,7 @@ static std::vector fillArrayWithPyListDbl2(PyObject *pyLi, int& nbOfTupl return ret; } -//convertFromPyObjVectorOfObj(pyLi,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh") +//convertFromPyObjVectorOfObj(pyLi,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh") template static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, const char *typeStr, typename std::vector& ret) { @@ -1146,7 +1439,7 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons * * switch between (int,vector,DataArrayInt) */ -static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std::vector& stdvecTyypp, ParaMEDMEM::DataArrayInt *& daIntTyypp, ParaMEDMEM::DataArrayIntTuple *&daIntTuple) throw(INTERP_KERNEL::Exception) +static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std::vector& stdvecTyypp, MEDCoupling::DataArrayInt *& daIntTyypp, MEDCoupling::DataArrayIntTuple *&daIntTuple) throw(INTERP_KERNEL::Exception) { sw=-1; if(PyInt_Check(value)) @@ -1192,17 +1485,17 @@ static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std: return; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0); if(SWIG_IsOK(status)) { - daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp); + daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp); sw=3; return; } - status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0); + status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0); if(SWIG_IsOK(status)) { - daIntTuple=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp); + daIntTuple=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp); sw=4; return ; } @@ -1220,7 +1513,7 @@ static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std: * * switch between (int,vector,DataArrayInt) */ -static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, std::vector& stdvecTyypp, ParaMEDMEM::DataArrayDouble *& daIntTyypp) throw(INTERP_KERNEL::Exception) +static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, std::vector& stdvecTyypp, MEDCoupling::DataArrayDouble *& daIntTyypp) throw(INTERP_KERNEL::Exception) { sw=-1; if(PyFloat_Check(value)) @@ -1276,10 +1569,10 @@ static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, s return; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0); if(!SWIG_IsOK(status)) throw INTERP_KERNEL::Exception("5 types accepted : double float, integer, tuple of double float or int, list of double float or int, DataArrayDouble"); - daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp); + daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp); sw=3; } @@ -1294,7 +1587,7 @@ static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, s * * switch between (int,vector,DataArrayInt) */ -static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp, std::vector& stdvecTyypp, ParaMEDMEM::DataArrayDoubleTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception) +static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp, std::vector& stdvecTyypp, MEDCoupling::DataArrayDoubleTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception) { sw=-1; if(PyFloat_Check(value)) @@ -1350,10 +1643,10 @@ static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp, return; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0); if(!SWIG_IsOK(status)) throw INTERP_KERNEL::Exception("5 types accepted : double float, integer, tuple of double float or int, list of double float or int, DataArrayDoubleTuple"); - daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp); + daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp); sw=3; } @@ -1366,7 +1659,7 @@ static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp, * * switch between (int,vector,DataArrayInt) */ -static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector& stdvecTyypp, std::pair >& p, ParaMEDMEM::DataArrayInt *& daIntTyypp) throw(INTERP_KERNEL::Exception) +static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector& stdvecTyypp, std::pair >& p, MEDCoupling::DataArrayInt *& daIntTyypp) throw(INTERP_KERNEL::Exception) { const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayInt, DataArrayIntTuple"; sw=-1; @@ -1416,12 +1709,7 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& { Py_ssize_t strt=2,stp=2,step=2; PySliceObject *oC=reinterpret_cast(value); - if(PySlice_GetIndices(oC,nbelem,&strt,&stp,&step)!=0) - if(nbelem!=0 || strt!=0 || stp!=0) - { - std::ostringstream oss; oss << "Slice in subscriptable object DataArray invalid : number of elements is : " << nbelem; - throw INTERP_KERNEL::Exception(oss.str().c_str()); - } + GetIndicesOfSlice(oC,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !"); p.first=strt; p.second.first=stp; p.second.second=step; @@ -1429,10 +1717,10 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& return ; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0); if(SWIG_IsOK(status)) { - daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp); + daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp); if(!daIntTyypp) { std::ostringstream oss; oss << msg << " Instance in null !"; @@ -1441,10 +1729,10 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& sw=4; return ; } - status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0); + status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0); if(SWIG_IsOK(status)) { - ParaMEDMEM::DataArrayIntTuple *tmp=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp); + MEDCoupling::DataArrayIntTuple *tmp=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp); if(!tmp) { std::ostringstream oss; oss << msg << " Instance in null !"; @@ -1458,6 +1746,18 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& throw INTERP_KERNEL::Exception(msg); } +/*! + * Idem than convertObjToPossibleCpp2 + */ +static void convertObjToPossibleCpp2WithNegIntInterp(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector& stdvecTyypp, std::pair >& p, MEDCoupling::DataArrayInt *& daIntTyypp) throw(INTERP_KERNEL::Exception) +{ + convertObjToPossibleCpp2(value,nbelem,sw,iTyypp,stdvecTyypp,p,daIntTyypp); + if(sw==1) + { + iTyypp=InterpreteNegativeInt(iTyypp,nbelem); + } +} + /*! * if python int -> cpp int sw=1 * if python tuple[int] -> cpp vector sw=2 @@ -1465,7 +1765,7 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& * if python slice -> cpp pair sw=3 * if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4 . WARNING The returned pointer can be the null pointer ! */ -static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector& stdvecTyypp, std::pair >& p, ParaMEDMEM::DataArrayIntTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception) +static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector& stdvecTyypp, std::pair >& p, MEDCoupling::DataArrayIntTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception) { sw=-1; if(PyInt_Check(value)) @@ -1514,12 +1814,7 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& { Py_ssize_t strt=2,stp=2,step=2; PySliceObject *oC=reinterpret_cast(value); - if(PySlice_GetIndices(oC,nbelem,&strt,&stp,&step)!=0) - if(nbelem!=0 || strt!=0 || stp!=0) - { - std::ostringstream oss; oss << "Slice in subscriptable object DataArray invalid : number of elements is : " << nbelem; - throw INTERP_KERNEL::Exception(oss.str().c_str()); - } + GetIndicesOfSlice(oC,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !"); p.first=strt; p.second.first=stp; p.second.second=step; @@ -1527,10 +1822,10 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& return ; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0); if(!SWIG_IsOK(status)) throw INTERP_KERNEL::Exception("4 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIntTuple"); - daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp); + daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp); sw=4; } @@ -1541,7 +1836,7 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& * if python not null pointer of DataArrayChar -> cpp DataArrayChar sw=4 * switch between (int,string,vector,DataArrayChar) */ -static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::string& sType, std::vector& vsType, ParaMEDMEM::DataArrayChar *& dacType) throw(INTERP_KERNEL::Exception) +static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::string& sType, std::vector& vsType, MEDCoupling::DataArrayChar *& dacType) throw(INTERP_KERNEL::Exception) { const char *msg="4 types accepted : string, list or tuple of strings having same size, not null DataArrayChar instance."; sw=-1; @@ -1599,10 +1894,10 @@ static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std:: return; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayChar,0|0); if(SWIG_IsOK(status)) { - dacType=reinterpret_cast< ParaMEDMEM::DataArrayChar * >(argp); + dacType=reinterpret_cast< MEDCoupling::DataArrayChar * >(argp); if(!dacType) { std::ostringstream oss; oss << msg << " Instance in null !"; @@ -1645,11 +1940,11 @@ static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std:: */ static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo, int& sw, int& it, int& ic, std::vector& vt, std::vector& vc, std::pair >& pt, std::pair >& pc, - ParaMEDMEM::DataArrayInt *&dt, ParaMEDMEM::DataArrayInt *&dc) throw(INTERP_KERNEL::Exception) + MEDCoupling::DataArrayInt *&dt, MEDCoupling::DataArrayInt *&dc) throw(INTERP_KERNEL::Exception) { if(!PyTuple_Check(value)) { - convertObjToPossibleCpp2(value,nbTuple,sw,it,vt,pt,dt); + convertObjToPossibleCpp2WithNegIntInterp(value,nbTuple,sw,it,vt,pt,dt); return ; } else @@ -1659,9 +1954,9 @@ static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo, throw INTERP_KERNEL::Exception("Unexpected nb of slice element : 1 or 2 expected !\n1st is for tuple selection, 2nd for component selection !"); PyObject *ob0=PyTuple_GetItem(value,0); int sw1,sw2; - convertObjToPossibleCpp2(ob0,nbTuple,sw1,it,vt,pt,dt); + convertObjToPossibleCpp2WithNegIntInterp(ob0,nbTuple,sw1,it,vt,pt,dt); PyObject *ob1=PyTuple_GetItem(value,1); - convertObjToPossibleCpp2(ob1,nbCompo,sw2,ic,vc,pc,dc); + convertObjToPossibleCpp2WithNegIntInterp(ob1,nbCompo,sw2,ic,vc,pc,dc); sw=4*sw2+sw1; } } @@ -1674,7 +1969,7 @@ static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo, * if value list[int,double] -> cpp std::vector sw=4 * if value tuple[int,double] -> cpp std::vector sw=4 */ -static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector& f) +static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector& f) { sw=-1; if(PyFloat_Check(value)) @@ -1730,17 +2025,17 @@ static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, Para return; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0); if(SWIG_IsOK(status)) { - d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp); + d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp); sw=2; return ; } - status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0); + status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0); if(SWIG_IsOK(status)) { - e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp); + e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp); sw=3; return ; } @@ -1755,7 +2050,7 @@ static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, Para * if value list[int,double] -> cpp std::vector sw=4 * if value tuple[int,double] -> cpp std::vector sw=4 */ -static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector& f, +static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector& f, const char *msg, int nbTuplesExpected, int nbCompExpected, bool throwIfNullPt) throw(INTERP_KERNEL::Exception) { sw=-1; @@ -1794,10 +2089,10 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou catch(INTERP_KERNEL::Exception& exc) { throw exc; } } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0); if(SWIG_IsOK(status)) { - d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp); + d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp); sw=2; if(d) { @@ -1830,10 +2125,10 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou return 0; } } - status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0); + status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0); if(SWIG_IsOK(status)) { - e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp); + e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp); sw=3; if(e->getNumberOfCompo()==nbCompExpected) { @@ -1862,7 +2157,7 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou * if value list[int,double] -> cpp std::vector sw=4 * if value tuple[int,double] -> cpp std::vector sw=4 */ -static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector& f, +static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector& f, const char *msg, int nbCompExpected, bool throwIfNullPt, int& nbTuples) throw(INTERP_KERNEL::Exception) { sw=-1; @@ -1943,10 +2238,10 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do return &f[0]; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0); if(SWIG_IsOK(status)) { - d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp); + d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp); sw=2; if(d) { @@ -1972,10 +2267,10 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do { nbTuples=0; return 0; } } } - status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0); + status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0); if(SWIG_IsOK(status)) { - e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp); + e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp); sw=3; if(e) { @@ -2015,8 +2310,8 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int& sw, double& val, std::vector& f, const char *msg, bool throwIfNullPt, int& nbTuples) throw(INTERP_KERNEL::Exception) { - ParaMEDMEM::DataArrayDouble *d=0; - ParaMEDMEM::DataArrayDoubleTuple *e=0; + MEDCoupling::DataArrayDouble *d=0; + MEDCoupling::DataArrayDoubleTuple *e=0; sw=-1; if(PyFloat_Check(value)) { @@ -2075,10 +2370,10 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int& return &f[0]; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0); if(SWIG_IsOK(status)) { - d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp); + d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp); sw=2; if(d) { @@ -2104,10 +2399,10 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int& { nbTuples=0; return 0; } } } - status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0); + status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0); if(SWIG_IsOK(status)) { - e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp); + e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp); sw=3; if(e) { @@ -2183,10 +2478,10 @@ static const int *convertObjToPossibleCpp1_Safe(PyObject *value, int& sw, int& s return &stdvecTyypp[0]; } void *argp; - int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0); + int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0); if(SWIG_IsOK(status)) { - ParaMEDMEM::DataArrayInt *daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp); + MEDCoupling::DataArrayInt *daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp); if(daIntTyypp) { sw=3; sz=daIntTyypp->getNbOfElems(); @@ -2198,37 +2493,37 @@ static const int *convertObjToPossibleCpp1_Safe(PyObject *value, int& sw, int& s return 0; } } - status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0); + status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0); if(SWIG_IsOK(status)) { - ParaMEDMEM::DataArrayIntTuple *daIntTuple=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp); + MEDCoupling::DataArrayIntTuple *daIntTuple=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp); sw=4; sz=daIntTuple->getNumberOfCompo(); return daIntTuple->getConstPointer(); } throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayInt, DataArrayIntTuple"); } -static ParaMEDMEM::DataArray *CheckAndRetrieveDataArrayInstance(PyObject *obj, const char *msg) +static MEDCoupling::DataArray *CheckAndRetrieveDataArrayInstance(PyObject *obj, const char *msg) { void *aBasePtrVS=0; - int status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArray,0|0); + int status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArray,0|0); if(!SWIG_IsOK(status)) { - status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0); + status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0); if(!SWIG_IsOK(status)) { - status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0); + status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0); if(!SWIG_IsOK(status)) { - status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar,0|0); + status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,0|0); if(!SWIG_IsOK(status)) { - status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArrayByte,0|0); + status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayByte,0|0); std::ostringstream oss; oss << msg << " ! Accepted instances are DataArrayDouble, DataArrayInt, DataArrayAsciiChar, DataArrayByte !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); } } } } - return reinterpret_cast< ParaMEDMEM::DataArray * >(aBasePtrVS); + return reinterpret_cast< MEDCoupling::DataArray * >(aBasePtrVS); }