Salome HOME
Merge from V6_main 13/12/2012
[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     MEDFileFields *getFields() const;
39     MEDFileMeshes *getMeshes() const;
40     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
41     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
42     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
43     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
44     std::string simpleRepr() const;
45     //
46     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
47     bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
48     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
49     //
50     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
51   private:
52     MEDFileData();
53     MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception);
54   private:
55     MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fields;
56     MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _meshes;
57   };
58 }
59
60 #endif