Salome HOME
6a9e404124fa81d68fe7326f3a20709b8472cc92
[modules/med.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
20 #ifndef __MEDFILEDATA_HXX__
21 #define __MEDFILEDATA_HXX__
22
23 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
24 #include "MEDFileField.hxx"
25 #include "MEDFileMesh.hxx"
26
27 namespace ParaMEDMEM
28 {
29   /*!
30    * User class.
31    */
32   class MEDLOADER_EXPORT MEDFileData : public RefCountObject, public MEDFileWritable
33   {
34   public:
35     static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
36     static MEDFileData *New();
37     MEDFileFields *getFields() const;
38     MEDFileMeshes *getMeshes() const;
39     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
40     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
41     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
42     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
43     std::string simpleRepr() const;
44     //
45     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
46     bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
47     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
48     //
49     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
50   private:
51     MEDFileData();
52     MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception);
53   private:
54     MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fields;
55     MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _meshes;
56   };
57 }
58
59 #endif