Salome HOME
Merge from V6_main 01/04/2013
[modules/med.git] / src / MEDLoader / MEDFileData.hxx
1 // Copyright (C) 2007-2013  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.
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 MEDLOADER_EXPORT MEDFileData : public RefCountObject, public MEDFileWritable
35   {
36   public:
37     static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
38     static MEDFileData *New();
39     MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
40     std::size_t getHeapMemorySize() const;
41     MEDFileFields *getFields() const;
42     MEDFileMeshes *getMeshes() const;
43     MEDFileParameters *getParams() const;
44     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
45     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
46     void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
47     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
48     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
49     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
50     std::string simpleRepr() const;
51     //
52     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
53     bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
54     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
55     //
56     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
57   private:
58     MEDFileData();
59     MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception);
60   private:
61     MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fields;
62     MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _meshes;
63     MEDCouplingAutoRefCountObjectPtr<MEDFileParameters> _params;
64   };
65 }
66
67 #endif