From: Anthony Geay Date: Wed, 19 Oct 2016 10:51:29 +0000 (+0200) Subject: Ready for pickelization X-Git-Tag: V8_2_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=392b6949b0e81a257445b9d00d15345ab7e8248c;p=tools%2Fmedcoupling.git Ready for pickelization --- diff --git a/src/MEDLoader/MEDFileData.hxx b/src/MEDLoader/MEDFileData.hxx index 6b31f2096..c7f923336 100644 --- a/src/MEDLoader/MEDFileData.hxx +++ b/src/MEDLoader/MEDFileData.hxx @@ -37,6 +37,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileData *New(const std::string& fileName); MEDLOADER_EXPORT static MEDFileData *New(med_idt fid); MEDLOADER_EXPORT static MEDFileData *New(); + MEDLOADER_EXPORT static MEDFileData *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT MEDFileData *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; diff --git a/src/MEDLoader/MEDFileEquivalence.hxx b/src/MEDLoader/MEDFileEquivalence.hxx index 050159890..67d04ce20 100644 --- a/src/MEDLoader/MEDFileEquivalence.hxx +++ b/src/MEDLoader/MEDFileEquivalence.hxx @@ -24,7 +24,7 @@ #include "MEDLoaderDefines.hxx" #include "MEDCouplingRefCountObject.hxx" #include "MEDCouplingMemArray.hxx" -#include "MEDFileUtilities.hxx" +#include "MEDFileUtilities.txx" #include "MCAuto.hxx" #include diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 810e06da6..0235798df 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -22,7 +22,6 @@ #include "MEDFileMesh.hxx" #include "MEDLoaderBase.hxx" #include "MEDLoaderTraits.hxx" -#include "MEDFileUtilities.hxx" #include "MEDFileSafeCaller.txx" #include "MEDFileFieldOverView.hxx" diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index f201eed5a..de637f10f 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -24,7 +24,7 @@ #include "MEDLoaderDefines.hxx" #include "MEDFileFieldOverView.hxx" -#include "MEDFileUtilities.hxx" +#include "MEDFileUtilities.txx" #include "MCAuto.hxx" #include "MEDLoaderTraits.hxx" @@ -737,6 +737,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, bool loadAll=true); + MEDLOADER_EXPORT static MEDFileField1TS *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true); @@ -787,6 +788,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileIntField1TS *New(); MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, bool loadAll=true); + MEDLOADER_EXPORT static MEDFileIntField1TS *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true); @@ -1048,6 +1050,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(); MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, bool loadAll=true); + MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent); @@ -1095,6 +1098,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(); MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, bool loadAll=true); + MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent); @@ -1152,6 +1156,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileFields *New(); MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileFields *New(med_idt fid, bool loadAll=true); + MEDLOADER_EXPORT static MEDFileFields *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0); MEDLOADER_EXPORT static MEDFileFields *LoadSpecificEntities(const std::string& fileName, const std::vector< std::pair >& entities, bool loadAll=true); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDLoader/MEDFileJoint.cxx b/src/MEDLoader/MEDFileJoint.cxx index 0895ba94b..8e7d6f3c1 100644 --- a/src/MEDLoader/MEDFileJoint.cxx +++ b/src/MEDLoader/MEDFileJoint.cxx @@ -18,7 +18,6 @@ // #include "MEDFileJoint.hxx" -#include "MEDFileUtilities.hxx" #include "MEDLoader.hxx" #include "MEDLoaderBase.hxx" #include "MEDFileSafeCaller.txx" diff --git a/src/MEDLoader/MEDFileJoint.hxx b/src/MEDLoader/MEDFileJoint.hxx index bba126ccc..c05c6a686 100644 --- a/src/MEDLoader/MEDFileJoint.hxx +++ b/src/MEDLoader/MEDFileJoint.hxx @@ -21,7 +21,7 @@ #define __MEDFILEJOINT_HXX__ #include "MEDLoaderDefines.hxx" -#include "MEDFileUtilities.hxx" +#include "MEDFileUtilities.txx" #include "MEDCouplingMemArray.hxx" #include "MCAuto.hxx" diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index d001e5ce9..40dee2a20 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -19,7 +19,6 @@ // Author : Anthony Geay (CEA/DEN) #include "MEDFileMesh.hxx" -#include "MEDFileUtilities.hxx" #include "MEDFileFieldOverView.hxx" #include "MEDFileField.hxx" #include "MEDLoader.hxx" diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index 4bd228285..de52190bf 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -23,7 +23,7 @@ #include "MEDLoaderDefines.hxx" #include "MEDFileMeshLL.hxx" -#include "MEDFileUtilities.hxx" +#include "MEDFileUtilities.txx" #include "MEDCouplingPartDefinition.hxx" #include "MEDFileMeshReadSelector.hxx" #include "MEDFileJoint.hxx" @@ -42,6 +42,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileMesh *New(med_idt fid, MEDFileMeshReadSelector *mrs=0); + MEDLOADER_EXPORT static MEDFileMesh *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0, MEDFileJoints* joints=0); MEDLOADER_EXPORT static MEDFileMesh *New(med_idt fid, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0, MEDFileJoints* joints=0); MEDLOADER_EXPORT void writeLL(med_idt fid) const; @@ -252,6 +253,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileUMesh *New(med_idt fid, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileUMesh *New(med_idt fid, MEDFileMeshReadSelector *mrs=0); + MEDLOADER_EXPORT static MEDFileUMesh *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem); MEDLOADER_EXPORT static MEDFileUMesh *New(); MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); @@ -459,6 +461,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileCMesh *New(); MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileCMesh *New(med_idt fid, MEDFileMeshReadSelector *mrs=0); + MEDLOADER_EXPORT static MEDFileCMesh *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileCMesh *New(med_idt fid, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; @@ -494,6 +497,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(); MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(med_idt fid, MEDFileMeshReadSelector *mrs=0); + MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(med_idt fid, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; @@ -558,6 +562,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT static MEDFileMeshes *New(); MEDLOADER_EXPORT static MEDFileMeshes *New(med_idt fid); + MEDLOADER_EXPORT static MEDFileMeshes *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileMeshes *New(const std::string& fileName); MEDLOADER_EXPORT MEDFileMeshes *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDLoader/MEDFileParameter.cxx b/src/MEDLoader/MEDFileParameter.cxx index 335c158d0..39cd3abdf 100644 --- a/src/MEDLoader/MEDFileParameter.cxx +++ b/src/MEDLoader/MEDFileParameter.cxx @@ -19,7 +19,6 @@ // Author : Anthony Geay (CEA/DEN) #include "MEDFileParameter.hxx" -#include "MEDFileUtilities.hxx" #include "MEDFileSafeCaller.txx" #include "MEDLoaderBase.hxx" diff --git a/src/MEDLoader/MEDFileParameter.hxx b/src/MEDLoader/MEDFileParameter.hxx index f827b23b2..08aa7ab90 100644 --- a/src/MEDLoader/MEDFileParameter.hxx +++ b/src/MEDLoader/MEDFileParameter.hxx @@ -22,7 +22,7 @@ #define __MEDFILEPARAMETER_HXX__ #include "MEDLoaderDefines.hxx" -#include "MEDFileUtilities.hxx" +#include "MEDFileUtilities.txx" #include "MEDCouplingMemArray.hxx" #include "MCAuto.hxx" @@ -159,6 +159,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT static MEDFileParameters *New(); MEDLOADER_EXPORT static MEDFileParameters *New(med_idt fid); + MEDLOADER_EXPORT static MEDFileParameters *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileParameters *New(const std::string& fileName); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; diff --git a/src/MEDLoader/MEDFileUtilities.cxx b/src/MEDLoader/MEDFileUtilities.cxx index e697d8135..201388f6a 100644 --- a/src/MEDLoader/MEDFileUtilities.cxx +++ b/src/MEDLoader/MEDFileUtilities.cxx @@ -25,6 +25,8 @@ #include +const char MEDCoupling::MEDFileWritableStandAlone::DFT_FILENAME_IN_MEM[]="DftFileNameInMemory"; + med_access_mode MEDFileUtilities::TraduceWriteMode(int medloaderwritemode) { switch(medloaderwritemode) @@ -183,3 +185,25 @@ void MEDCoupling::MEDFileWritableStandAlone::write(const std::string& fileName, MEDFileUtilities::CheckMEDCode(fid,fid,oss.str()); writeLL(fid); } + +void MEDCoupling::MEDFileWritableStandAlone::write30(const std::string& fileName, int mode) const +{ + med_access_mode medmod(MEDFileUtilities::TraduceWriteMode(mode)); + throw INTERP_KERNEL::Exception("MEDFileWritableStandAlone::write30 : will be implemented with MEDFile >= 3.2.1 !"); + //MEDFileUtilities::AutoFid fid(MEDfileVersionOpen(fileName.c_str(),medmod,3,0,0)); + //writeLL(fid); +} + +MEDCoupling::MCAuto MEDCoupling::MEDFileWritableStandAlone::serialize() const +{ + med_memfile memfile=MED_MEMFILE_INIT; + memfile.app_image_ptr=0; + memfile.app_image_size=0; + // + MEDFileUtilities::AutoFid fid(MEDmemFileOpen(DFT_FILENAME_IN_MEM,&memfile,MED_FALSE,MED_ACC_CREAT)); + writeLL(fid); + // + MEDCoupling::MCAuto ret(MEDCoupling::DataArrayByte::New()); + ret->useArray(reinterpret_cast(memfile.app_image_ptr),true,C_DEALLOC,memfile.app_image_size,1); + return ret; +} diff --git a/src/MEDLoader/MEDFileUtilities.hxx b/src/MEDLoader/MEDFileUtilities.hxx index 8116d7e5c..a89260fbc 100644 --- a/src/MEDLoader/MEDFileUtilities.hxx +++ b/src/MEDLoader/MEDFileUtilities.hxx @@ -24,6 +24,9 @@ #include "InterpKernelException.hxx" #include "MEDLoaderDefines.hxx" +#include "MCAuto.hxx" +#include "MEDCouplingMemArray.hxx" + #include "med.h" namespace MEDFileUtilities @@ -66,6 +69,12 @@ namespace MEDCoupling public: MEDLOADER_EXPORT virtual void writeLL(med_idt fid) const = 0; MEDLOADER_EXPORT virtual void write(const std::string& fileName, int mode) const; + MEDLOADER_EXPORT virtual void write30(const std::string& fileName, int mode) const; + MEDLOADER_EXPORT MCAuto serialize() const; + public: + MEDLOADER_EXPORT static const char DFT_FILENAME_IN_MEM[]; + template + static T *BuildFromMemoryChunk(DataArrayByte *db); }; MEDFileUtilities::AutoFid OpenMEDFileForRead(const std::string& fileName); diff --git a/src/MEDLoader/MEDFileUtilities.txx b/src/MEDLoader/MEDFileUtilities.txx new file mode 100644 index 000000000..9e3f8bada --- /dev/null +++ b/src/MEDLoader/MEDFileUtilities.txx @@ -0,0 +1,39 @@ +// Copyright (C) 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author : Anthony Geay (EDF R&D) + +#ifndef __MEDFILEUTILITIES_TXX__ +#define __MEDFILEUTILITIES_TXX__ + +#include "MEDFileUtilities.hxx" + +template +T *MEDCoupling::MEDFileWritableStandAlone::BuildFromMemoryChunk(MEDCoupling::DataArrayByte *db) +{ + if(!db) + throw INTERP_KERNEL::Exception("Null input DataArrayByte !"); + db->checkAllocated(); + med_memfile memfile=MED_MEMFILE_INIT; + memfile.app_image_ptr=db->getPointer(); + memfile.app_image_size=db->getNbOfElems(); + MEDFileUtilities::AutoFid fid(MEDmemFileOpen(MEDCoupling::MEDFileWritableStandAlone::DFT_FILENAME_IN_MEM,&memfile,MED_FALSE,MED_ACC_RDONLY)); + return T::New(fid); +} + +#endif diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 89ac8920e..45b90ddbd 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -153,6 +153,7 @@ using namespace MEDCoupling; %newobject MEDCoupling::MEDFileFields::__iter__; %newobject MEDCoupling::MEDFileFields::extractPart; +%newobject MEDCoupling::MEDFileWritableStandAlone::serialize; %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New; %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy; %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy; @@ -536,6 +537,15 @@ namespace MEDCoupling { public: void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception); + void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception); + %extend + { + DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception) + { + MCAuto ret(self->serialize()); + return ret.retn(); + } + } }; class MEDFileMeshReadSelector @@ -916,6 +926,7 @@ namespace MEDCoupling public: static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); + static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception); virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception); virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception); @@ -1228,6 +1239,7 @@ namespace MEDCoupling static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception); + static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); static MEDFileUMesh *New(); static const char *GetSpeStr4ExtMesh(); ~MEDFileUMesh(); @@ -1280,6 +1292,11 @@ namespace MEDCoupling return MEDFileUMesh::New(mem); } + MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileUMesh::New(db); + } + MEDFileUMesh() { return MEDFileUMesh::New(); @@ -1543,6 +1560,7 @@ namespace MEDCoupling { public: static MEDFileCMesh *New(); + static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception); @@ -1563,6 +1581,11 @@ namespace MEDCoupling { return MEDFileCMesh::New(fileName,mName,dt,it,mrs); } + + MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileCMesh::New(db); + } PyObject *getMesh() const throw(INTERP_KERNEL::Exception) { @@ -1578,6 +1601,7 @@ namespace MEDCoupling { public: static MEDFileCurveLinearMesh *New(); + static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception); @@ -1597,6 +1621,11 @@ namespace MEDCoupling { return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs); } + + MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileCurveLinearMesh::New(db); + } PyObject *getMesh() const throw(INTERP_KERNEL::Exception) { @@ -1671,7 +1700,7 @@ namespace MEDCoupling { public: static MEDFileMeshes *New(); - static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception); + static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception); int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception); std::vector getMeshesNames() const throw(INTERP_KERNEL::Exception); @@ -1693,6 +1722,11 @@ namespace MEDCoupling return MEDFileMeshes::New(fileName); } + MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileMeshes::New(db); + } + std::string __str__() const throw(INTERP_KERNEL::Exception) { return self->simpleRepr(); @@ -2058,6 +2092,7 @@ namespace MEDCoupling static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); static MEDFileField1TS *New(); MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception); @@ -2088,6 +2123,11 @@ namespace MEDCoupling return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll); } + MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileField1TS::New(db); + } + MEDFileField1TS() { return MEDFileField1TS::New(); @@ -2192,6 +2232,7 @@ namespace MEDCoupling public: static MEDFileIntField1TS *New(); static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception); MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception); @@ -2226,6 +2267,11 @@ namespace MEDCoupling return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll); } + MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileIntField1TS::New(db); + } + std::string __str__() const throw(INTERP_KERNEL::Exception) { return self->simpleRepr(); @@ -2798,6 +2844,7 @@ namespace MEDCoupling static MEDFileIntFieldMultiTS *New(); static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); // void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception); void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception); @@ -2825,6 +2872,11 @@ namespace MEDCoupling return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll); } + MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileIntFieldMultiTS::New(db); + } + static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true) { std::vector > tmp(convertTimePairIdsFromPy(entities)); @@ -2868,6 +2920,7 @@ namespace MEDCoupling public: static MEDFileFields *New() throw(INTERP_KERNEL::Exception); static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception); MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception); MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception); @@ -2899,6 +2952,11 @@ namespace MEDCoupling { return MEDFileFields::New(fileName,loadAll); } + + MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileFields::New(db); + } std::string __str__() const throw(INTERP_KERNEL::Exception) { @@ -3345,6 +3403,7 @@ namespace MEDCoupling public: static MEDFileParameters *New(); static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception); + static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception); std::vector getParamsNames() const throw(INTERP_KERNEL::Exception); std::string simpleRepr() const throw(INTERP_KERNEL::Exception); @@ -3366,6 +3425,11 @@ namespace MEDCoupling return MEDFileParameters::New(fileName); } + MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileParameters::New(db); + } + std::string __str__() const throw(INTERP_KERNEL::Exception) { return self->simpleRepr(); @@ -3429,6 +3493,7 @@ namespace MEDCoupling class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone { public: + static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception); static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception); static MEDFileData *New(); MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception); @@ -3449,6 +3514,11 @@ namespace MEDCoupling return MEDFileData::New(fileName); } + MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception) + { + return MEDFileData::New(db); + } + MEDFileData() { return MEDFileData::New();