Salome HOME
f659a8fc2738222ce2c1195ae083e59e1716d46b
[modules/med.git] / src / MEDWrapper / Base / MED_Common.hxx
1 //  
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : 
25 //  Author : 
26 //  Module : 
27 //  $Header$
28
29 #ifndef MED_Common_HeaderFile
30 #define MED_Common_HeaderFile
31
32 #include <string>
33 #include <set>
34 #include <map>
35
36 extern "C"
37 {
38 #include <hdf5.h>
39 }  
40
41 #include <boost/tuple/tuple.hpp>
42
43 #include "SALOMEconfig.h"
44
45 #include "MED_Vector.hxx"
46 #include "MED_SharedPtr.hxx"
47 #include "MED_SliceArray.hxx"
48
49 namespace MED{
50
51   enum EVersion {eVUnknown = -1, eV2_1, eV2_2};
52   
53   typedef enum {eFAUX, eVRAI} EBooleen ; 
54   typedef double TFloat;
55 #if defined(SUN4SOL2) || defined(PCLINUX) || defined(OSF1_32) || defined(IRIX64_32) || defined(RS6000) || defined(HP9000)
56   typedef int TInt;
57 #endif
58 #if defined(IRIX64) || defined(OSF1)
59   typedef long TInt;
60 #endif
61   typedef hid_t TIdt;
62   typedef herr_t TErr;
63
64   typedef enum {eFULL_INTERLACE, eNO_INTERLACE} EModeSwitch;
65
66   typedef enum {eFLOAT64=6, eINT=26} ETypeChamp;
67
68   typedef enum {eNON_STRUCTURE, eSTRUCTURE} EMaillage;
69
70   typedef enum {eCART, eCYL, eSPHER} ERepere; 
71
72   typedef enum {eNOD, eDESC} EConnectivite ; 
73
74   typedef enum {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203,
75                 eQUAD4=204, eTRIA6=206,eQUAD8=208, eTETRA4=304,
76                 ePYRA5=305, ePENTA6=306, eHEXA8=308, eTETRA10=310, 
77                 ePYRA13=313, ePENTA15=315, eHEXA20=320, 
78                 ePOLYGONE=400, ePOLYEDRE=500, eNONE=0} EGeometrieElement;
79
80   typedef enum {eMAILLE, eFACE, eARETE, eNOEUD} EEntiteMaillage; 
81
82   typedef enum {eNO_PFLMOD, eGLOBAL, eCOMPACT}  EModeProfil; 
83
84   typedef TVector<TFloat> TFloatVector;
85   typedef TVector<std::string> TStringVector;
86   typedef TVector<TInt> TIntVector;
87   typedef std::set<std::string> TStringSet;
88   
89   typedef std::map<EGeometrieElement,TInt> TGeom2Size;
90   typedef std::map<EEntiteMaillage,TGeom2Size> TEntityInfo;
91
92   typedef std::set<EGeometrieElement> TGeomSet;
93   typedef std::map<EEntiteMaillage,TGeomSet> TEntity2GeomSet;
94
95   const TEntity2GeomSet& 
96   GetEntity2GeomSet();
97
98   template<EVersion>
99   TInt
100   GetDESCLength();
101   
102   template<EVersion>
103   TInt
104   GetIDENTLength();
105   
106   template<EVersion>
107   TInt
108   GetNOMLength();
109   
110   template<EVersion>
111   TInt
112   GetLNOMLength();
113   
114   template<EVersion>
115   TInt
116   GetPNOMLength();
117   
118   template<EVersion>
119   TInt
120   GetNbConn(EGeometrieElement typmai,
121             EEntiteMaillage typent,
122             TInt mdim);
123   
124   TInt 
125   GetNbNodes(EGeometrieElement typmai);
126
127   struct TNameInfo;
128   typedef SharedPtr<TNameInfo> PNameInfo;
129   
130   struct TMeshInfo;
131   typedef SharedPtr<TMeshInfo> PMeshInfo;
132   
133   struct TFamilyInfo;
134   typedef SharedPtr<TFamilyInfo> PFamilyInfo;
135
136   struct TElemInfo;
137   typedef SharedPtr<TElemInfo> PElemInfo;
138
139   struct TNodeInfo;
140   typedef SharedPtr<TNodeInfo> PNodeInfo;
141
142   struct TPolygoneInfo;
143   typedef SharedPtr<TPolygoneInfo> PPolygoneInfo;
144
145   struct TPolyedreInfo;
146   typedef SharedPtr<TPolyedreInfo> PPolyedreInfo;
147
148   struct TCellInfo;
149   typedef SharedPtr<TCellInfo> PCellInfo;
150
151   struct TFieldInfo;
152   typedef SharedPtr<TFieldInfo> PFieldInfo;
153
154   struct TTimeStampInfo;
155   typedef SharedPtr<TTimeStampInfo> PTimeStampInfo;
156
157   struct TProfileInfo;
158   typedef SharedPtr<TProfileInfo> PProfileInfo;
159   
160   struct TGaussInfo;
161   typedef SharedPtr<TGaussInfo> PGaussInfo;
162   
163   struct TTimeStampVal;
164   typedef SharedPtr<TTimeStampVal> PTimeStampVal;
165
166   class TWrapper;
167   typedef SharedPtr<TWrapper> PWrapper;
168 };
169
170
171 #endif