From: Anthony Geay Date: Wed, 29 Apr 2020 12:15:00 +0000 (+0200) Subject: WIP X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fce3258b85580da312ebc53ec90fb4cf508d379d;p=tools%2Fmedcoupling.git WIP --- diff --git a/src/ParaMEDMEM/ParaDataArray.cxx b/src/ParaMEDMEM/ParaDataArray.cxx index 8f1c73c07..f0f16ef11 100644 --- a/src/ParaMEDMEM/ParaDataArray.cxx +++ b/src/ParaMEDMEM/ParaDataArray.cxx @@ -24,3 +24,13 @@ using namespace MEDCoupling; template class ParaDataArrayTemplate; template class ParaDataArrayTemplate; + +ParaDataArrayInt32 *ParaDataArrayInt32::New(DataArrayInt32 *seqDa) +{ + return new ParaDataArrayInt32(seqDa); +} + +ParaDataArrayInt64 *ParaDataArrayInt64::New(DataArrayInt64 *seqDa) +{ + return new ParaDataArrayInt64(seqDa); +} diff --git a/src/ParaMEDMEM/ParaDataArray.hxx b/src/ParaMEDMEM/ParaDataArray.hxx index af7700738..e06f714ef 100644 --- a/src/ParaMEDMEM/ParaDataArray.hxx +++ b/src/ParaMEDMEM/ParaDataArray.hxx @@ -57,6 +57,8 @@ namespace MEDCoupling class ParaDataArrayInt32 : public ParaDataArrayDiscrete { + public: + static ParaDataArrayInt32 *New(DataArrayInt32 *seqDa); private: ParaDataArrayInt32(DataArrayInt32 *seqDa):ParaDataArrayDiscrete(seqDa) { } std::string getClassName() const override { return "ParaDataArrayInt32"; } @@ -64,6 +66,8 @@ namespace MEDCoupling class ParaDataArrayInt64 : public ParaDataArrayDiscrete { + public: + static ParaDataArrayInt64 *New(DataArrayInt64 *seqDa); private: ParaDataArrayInt64(DataArrayInt64 *seqDa):ParaDataArrayDiscrete(seqDa) { } std::string getClassName() const override { return "ParaDataArrayInt64"; } diff --git a/src/ParaMEDMEM_Swig/ParaMEDMEM.i b/src/ParaMEDMEM_Swig/ParaMEDMEM.i index 5ba926d7f..dbe2a6000 100644 --- a/src/ParaMEDMEM_Swig/ParaMEDMEM.i +++ b/src/ParaMEDMEM_Swig/ParaMEDMEM.i @@ -173,6 +173,13 @@ def MEDCouplingDenseMatrixIadd(self,*args): def MEDCouplingDenseMatrixIsub(self,*args): import _ParaMEDMEM return _ParaMEDMEM.DenseMatrix____isub___(self, self, *args) + +if MEDCouplingUse64BitIDs(): + ParaDataArrayInt = ParaDataArrayInt64 +else: + ParaDataArrayInt = ParaDataArrayInt32 +pass + %} %include "MEDCouplingFinalize.i" diff --git a/src/ParaMEDMEM_Swig/ParaMEDMEMCommon.i b/src/ParaMEDMEM_Swig/ParaMEDMEMCommon.i index d2eb770f4..2c685f7c1 100644 --- a/src/ParaMEDMEM_Swig/ParaMEDMEMCommon.i +++ b/src/ParaMEDMEM_Swig/ParaMEDMEMCommon.i @@ -36,6 +36,7 @@ #include "ComponentTopology.hxx" #include "ParaUMesh.hxx" #include "ParaSkyLineArray.hxx" +#include "ParaDataArray.hxx" using namespace INTERP_KERNEL; using namespace MEDCoupling; @@ -66,6 +67,10 @@ using namespace ICoCo; %newobject MEDCoupling::ParaUMesh::redistributeCells; %newobject MEDCoupling::ParaUMesh::redistributeCellField; %newobject MEDCoupling::ParaUMesh::redistributeNodeField; +%newobject MEDCoupling::ParaDataArrayInt32::New; +%newobject MEDCoupling::ParaDataArrayInt32::buildComplement; +%newobject MEDCoupling::ParaDataArrayInt64::New; +%newobject MEDCoupling::ParaDataArrayInt64::buildComplement; %newobject MEDCoupling::ParaSkyLineArray::New; %newobject MEDCoupling::ParaSkyLineArray::equiRedistribute; %newobject MEDCoupling::ParaSkyLineArray::getSkyLineArray; @@ -73,6 +78,8 @@ using namespace ICoCo; %feature("unref") ParaSkyLineArray "$this->decrRef();" %feature("unref") ParaUMesh "$this->decrRef();" +%feature("unref") ParaDataArrayInt32 "$this->decrRef();" +%feature("unref") ParaDataArrayInt64 "$this->decrRef();" %nodefaultctor; @@ -202,6 +209,38 @@ namespace MEDCoupling } }; + class ParaDataArray : public RefCountObject + { + }; + + class ParaDataArrayInt32 : public ParaDataArray + { + public: + static ParaDataArrayInt32 *New(DataArrayInt32 *seqDa); + DataArrayInt32 *buildComplement(int nbOfElems) const; + %extend + { + ParaDataArrayInt32(DataArrayInt32 *seqDa) + { + return ParaDataArrayInt32::New(seqDa); + } + } + }; + + class ParaDataArrayInt64 : public ParaDataArray + { + public: + static ParaDataArrayInt64 *New(DataArrayInt64 *seqDa); + DataArrayInt64 *buildComplement(long nbOfElems) const; + %extend + { + ParaDataArrayInt64(DataArrayInt64 *seqDa) + { + return ParaDataArrayInt64::New(seqDa); + } + } + }; + class ParaSkyLineArray : public RefCountObject { public: