Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/med.git] / src / MEDMEM / MEDMEM_DriverFactory.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef DRIVERFACTORY_HXX
24 #define DRIVERFACTORY_HXX
25
26 #include <MEDMEM.hxx>
27
28 #include "MEDMEM_MedVersion.hxx"
29 #include "MEDMEM_GenDriver.hxx"
30 #include "MEDMEM_define.hxx"
31
32 #include "MEDMEM_FieldForward.hxx"
33
34 #include <string>
35
36 namespace MEDMEM {
37
38   class GMESH;
39   //class MED;
40   class GENDRIVER;
41
42   namespace DRIVERFACTORY {
43
44     MEDMEM_EXPORT extern bool globalVtkBinaryFormatForWriting;
45
46     MEDMEM_EXPORT bool getVtkBinaryFormatForWriting();
47
48     MEDMEM_EXPORT void setVtkBinaryFormatForWriting(bool isBinary);
49
50     MEDMEM_EXPORT driverTypes deduceDriverTypeFromFileName(const std::string & fileName);
51
52     driverTypes deduceDriverTypeFromFileName(const std::string & fileName);
53
54     MEDMEM_EXPORT GENDRIVER * buildDriverForMesh(driverTypes driverType,
55                                                  const std::string & fileName,
56                                                  GMESH *mesh,const string &  driverName,
57                                                  MED_EN::med_mode_acces access);
58
59     template<class T, class INTERLACING_TAG>
60     GENDRIVER * buildDriverForField(driverTypes driverType,
61                                     const std::string & fileName,
62                                     FIELD<T,INTERLACING_TAG> *fielde,
63                                     MED_EN::med_mode_acces access);
64     MEDMEM_EXPORT GENDRIVER * buildMeshDriverFromFile(const string & fileName,
65                                                       GMESH * ptrMesh,
66                                                       MED_EN::med_mode_acces access);
67     template<class T, class INTERLACING_TAG>
68     GENDRIVER * buildFieldDriverFromFile(const string & fileName,
69                                          FIELD<T,INTERLACING_TAG> * ptrField,
70                                          MED_EN::med_mode_acces access);
71     MEDMEM_EXPORT GENDRIVER * buildConcreteMedDriverForMesh(const std::string & fileName,
72                                                             GMESH *mesh,
73                                                             const string & driverName,
74                                                             MED_EN::med_mode_acces access,
75                                                             MED_EN::medFileVersion version);
76     template<class T, class INTERLACING_TAG>
77     GENDRIVER * buildConcreteMedDriverForField(const std::string & fileName,
78                                                FIELD<T,INTERLACING_TAG> *fielde,
79                                                MED_EN::med_mode_acces access,
80                                                MED_EN::medFileVersion version);
81   }
82 }
83
84 #include"MEDMEM_DriverFactory.ixx"
85
86 #endif