X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileData.hxx;h=558c1e69a83847a015a0e86067f0797b389524ad;hb=19a65812ae7b522811413fff6e642d1273b13d48;hp=cbe25dd825f121b5cbcec635da6d59eb545501e8;hpb=e197fcb8cc603df9c360df1798e4fce8ca12366e;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileData.hxx b/src/MEDLoader/MEDFileData.hxx index cbe25dd82..558c1e69a 100644 --- a/src/MEDLoader/MEDFileData.hxx +++ b/src/MEDLoader/MEDFileData.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-2021 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. +// 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 @@ -21,24 +21,29 @@ #ifndef __MEDFILEDATA_HXX__ #define __MEDFILEDATA_HXX__ -#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MCAuto.hxx" #include "MEDFileParameter.hxx" #include "MEDFileField.hxx" #include "MEDFileMesh.hxx" +#include "MEDFileMeshSupport.hxx" +#include "MEDFileStructureElement.hxx" -namespace ParaMEDMEM +namespace MEDCoupling { /*! * User class. */ - class MEDFileData : public RefCountObject, public MEDFileWritable + class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone { public: MEDLOADER_EXPORT static MEDFileData *New(const std::string& fileName); + MEDLOADER_EXPORT static MEDFileData *New(med_idt fid); MEDLOADER_EXPORT static MEDFileData *New(); - MEDLOADER_EXPORT MEDFileData *deepCpy() const; + MEDLOADER_EXPORT static MEDFileData *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileData"); } + MEDLOADER_EXPORT MEDFileData *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileFields *getFields() const; MEDLOADER_EXPORT MEDFileMeshes *getMeshes() const; MEDLOADER_EXPORT MEDFileParameters *getParams() const; @@ -50,18 +55,29 @@ namespace ParaMEDMEM MEDLOADER_EXPORT int getNumberOfParams() const; MEDLOADER_EXPORT std::string simpleRepr() const; // + MEDLOADER_EXPORT std::string getHeader() const; + MEDLOADER_EXPORT void setHeader(const std::string& header); + // MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair >& modifTab); MEDLOADER_EXPORT bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName); MEDLOADER_EXPORT bool unPolyzeMeshes(); + MEDLOADER_EXPORT void dealWithStructureElements(); + MEDLOADER_EXPORT static MCAuto Aggregate(const std::vector& mfds); // - MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const; + MEDLOADER_EXPORT void writeLL(med_idt fid) const; private: MEDFileData(); - MEDFileData(const std::string& fileName); + MEDFileData(med_idt fid); + void readHeader(med_idt fid); + void writeHeader(med_idt fid) const; + void readMeshSupports(med_idt fid); private: - MEDCouplingAutoRefCountObjectPtr _fields; - MEDCouplingAutoRefCountObjectPtr _meshes; - MEDCouplingAutoRefCountObjectPtr _params; + MCAuto _fields; + MCAuto _meshes; + MCAuto _params; + MCAuto _mesh_supports; + MCAuto _struct_elems; + std::string _header; }; }