Salome HOME
Initiating medtool
[modules/med.git] / src / medtool / src / MEDLoader / MEDFileData.hxx
1 // Copyright (C) 2007-2015  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 "MEDCouplingAutoRefCountObjectPtr.hxx"
25 #include "MEDFileParameter.hxx"
26 #include "MEDFileField.hxx"
27 #include "MEDFileMesh.hxx"
28
29 namespace ParaMEDMEM
30 {
31   /*!
32    * User class.
33    */
34   class MEDFileData : public RefCountObject, public MEDFileWritable
35   {
36   public:
37     MEDLOADER_EXPORT static MEDFileData *New(const std::string& fileName);
38     MEDLOADER_EXPORT static MEDFileData *New();
39     MEDLOADER_EXPORT MEDFileData *deepCpy() const;
40     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
41     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
42     MEDLOADER_EXPORT MEDFileFields *getFields() const;
43     MEDLOADER_EXPORT MEDFileMeshes *getMeshes() const;
44     MEDLOADER_EXPORT MEDFileParameters *getParams() const;
45     MEDLOADER_EXPORT void setFields(MEDFileFields *fields);
46     MEDLOADER_EXPORT void setMeshes(MEDFileMeshes *meshes);
47     MEDLOADER_EXPORT void setParams(MEDFileParameters *params);
48     MEDLOADER_EXPORT int getNumberOfFields() const;
49     MEDLOADER_EXPORT int getNumberOfMeshes() const;
50     MEDLOADER_EXPORT int getNumberOfParams() const;
51     MEDLOADER_EXPORT std::string simpleRepr() const;
52     //
53     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
54     MEDLOADER_EXPORT bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
55     MEDLOADER_EXPORT bool unPolyzeMeshes();
56     //
57     MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
58   private:
59     MEDFileData();
60     MEDFileData(const std::string& fileName);
61   private:
62     MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fields;
63     MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _meshes;
64     MEDCouplingAutoRefCountObjectPtr<MEDFileParameters> _params;
65   };
66 }
67
68 #endif