Salome HOME
Merge from V6_main 11/02/2013
[tools/medcoupling.git] / src / MEDLoader / MEDFileData.hxx
1 // Copyright (C) 2007-2012  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 "MEDFileField.hxx"
26 #include "MEDFileMesh.hxx"
27
28 namespace ParaMEDMEM
29 {
30   /*!
31    * User class.
32    */
33   class MEDLOADER_EXPORT MEDFileData : public RefCountObject, public MEDFileWritable
34   {
35   public:
36     static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
37     static MEDFileData *New();
38     MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
39     std::size_t getHeapMemorySize() const;
40     MEDFileFields *getFields() const;
41     MEDFileMeshes *getMeshes() const;
42     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
43     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
44     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
45     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
46     std::string simpleRepr() const;
47     //
48     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
49     bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
50     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
51     //
52     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
53   private:
54     MEDFileData();
55     MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception);
56   private:
57     MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fields;
58     MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _meshes;
59   };
60 }
61
62 #endif