Salome HOME
Ready for pickelization
[tools/medcoupling.git] / src / MEDLoader / MEDFileData.hxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 #ifndef __MEDFILEDATA_HXX__
22 #define __MEDFILEDATA_HXX__
23
24 #include "MCAuto.hxx"
25 #include "MEDFileParameter.hxx"
26 #include "MEDFileField.hxx"
27 #include "MEDFileMesh.hxx"
28
29 namespace MEDCoupling
30 {
31   /*!
32    * User class.
33    */
34   class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
35   {
36   public:
37     MEDLOADER_EXPORT static MEDFileData *New(const std::string& fileName);
38     MEDLOADER_EXPORT static MEDFileData *New(med_idt fid);
39     MEDLOADER_EXPORT static MEDFileData *New();
40     MEDLOADER_EXPORT static MEDFileData *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileData>(db); }
41     MEDLOADER_EXPORT MEDFileData *deepCopy() const;
42     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
43     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
44     MEDLOADER_EXPORT MEDFileFields *getFields() const;
45     MEDLOADER_EXPORT MEDFileMeshes *getMeshes() const;
46     MEDLOADER_EXPORT MEDFileParameters *getParams() const;
47     MEDLOADER_EXPORT void setFields(MEDFileFields *fields);
48     MEDLOADER_EXPORT void setMeshes(MEDFileMeshes *meshes);
49     MEDLOADER_EXPORT void setParams(MEDFileParameters *params);
50     MEDLOADER_EXPORT int getNumberOfFields() const;
51     MEDLOADER_EXPORT int getNumberOfMeshes() const;
52     MEDLOADER_EXPORT int getNumberOfParams() const;
53     MEDLOADER_EXPORT std::string simpleRepr() const;
54     //
55     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
56     MEDLOADER_EXPORT bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
57     MEDLOADER_EXPORT bool unPolyzeMeshes();
58     MEDLOADER_EXPORT static MCAuto<MEDFileData> Aggregate(const std::vector<const MEDFileData *>& mfds);
59     //
60     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
61   private:
62     MEDFileData();
63     MEDFileData(med_idt fid);
64   private:
65     MCAuto<MEDFileFields> _fields;
66     MCAuto<MEDFileMeshes> _meshes;
67     MCAuto<MEDFileParameters> _params;
68   };
69 }
70
71 #endif