Salome HOME
9703ec75620f61e2661eae3e8ac498b81ddc0afb
[modules/smesh.git] / src / MEDWrapper / MED_Common.hxx
1 // Copyright (C) 2007-2016  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, or (at your option) any later version.
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 MED_Common_HeaderFile
24 #define MED_Common_HeaderFile
25
26 #include "MED_WrapperDef.hxx"
27 #include "MED_Vector.hxx"
28 #include "MED_SharedPtr.hxx"
29 #include "MED_SliceArray.hxx"
30
31 #include <string>
32 #include <set>
33 #include <map>
34
35 #include <hdf5.h>
36
37 #include <boost/tuple/tuple.hpp>
38
39 #ifdef WIN32
40 #pragma warning(disable:4099)
41 #endif
42
43 namespace MED
44 {
45   typedef enum {eFAUX, eVRAI} EBooleen ; 
46   typedef double TFloat;
47 #if defined(HAVE_F77INT64)
48   typedef long TInt;
49 #else
50   typedef int TInt;
51 #endif 
52   typedef hid_t TIdt;
53   typedef herr_t TErr;
54
55   typedef enum {eFULL_INTERLACE, eNO_INTERLACE} EModeSwitch;
56
57   typedef enum {eFLOAT64=6, eINT=24, eLONG=26 } ETypeChamp;
58
59   typedef enum {eNON_STRUCTURE, eSTRUCTURE} EMaillage;
60
61   typedef enum {eCART, eCYL, eSPHER} ERepere; 
62
63   typedef enum {eNOD, eDESC} EConnectivite ; 
64
65   typedef enum {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203,
66                 eQUAD4=204, eTRIA6=206, eTRIA7=207, eQUAD8=208, eQUAD9=209,eTETRA4=304,
67                 ePYRA5=305, ePENTA6=306, eHEXA8=308, eOCTA12=312, eTETRA10=310, 
68                 ePYRA13=313, ePENTA15=315, eHEXA20=320, eHEXA27=327,
69                 ePOLYGONE=400, ePOLYGON2=420, ePOLYEDRE=500, eNONE=0, 
70                 eBALL=1101 /*no such a type in med.h, it's just a trick*/,
71                 eAllGeoType=-1 } EGeometrieElement;
72
73   typedef enum {eMAILLE, eFACE, eARETE, eNOEUD, eNOEUD_ELEMENT, eSTRUCT_ELEMENT} EEntiteMaillage; 
74
75   typedef enum {eNO_PFLMOD, eGLOBAL, eCOMPACT}  EModeProfil; 
76
77   typedef enum {eGRILLE_CARTESIENNE, eGRILLE_POLAIRE, eGRILLE_STANDARD} EGrilleType;
78
79   typedef enum {eCOOR, eCONN, eNOM, eNUM, eFAM, eCOOR_IND1, eCOOR_IND2, eCOOR_IND3} ETable;
80
81   typedef TVector<TFloat> TFloatVector;
82   typedef TVector<std::string> TStringVector;
83   typedef TVector<TInt> TIntVector;
84   typedef std::set<std::string> TStringSet;
85   
86   typedef std::map<EGeometrieElement,TInt> TGeom2Size;
87   typedef std::map<EEntiteMaillage,TGeom2Size> TEntityInfo;
88
89   typedef std::set<EGeometrieElement> TGeomSet;
90   typedef std::map<EEntiteMaillage,TGeomSet> TEntity2GeomSet;
91
92   MEDWRAPPER_EXPORT 
93   const TEntity2GeomSet& 
94   GetEntity2GeomSet();
95
96   TInt MEDWRAPPER_EXPORT
97   GetDESCLength();
98   
99   TInt MEDWRAPPER_EXPORT
100   GetIDENTLength();
101   
102   TInt MEDWRAPPER_EXPORT
103   GetNOMLength();
104   
105   TInt MEDWRAPPER_EXPORT
106   GetLNOMLength();
107   
108   TInt MEDWRAPPER_EXPORT
109   GetPNOMLength();
110   
111   void MEDWRAPPER_EXPORT
112   GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release);
113   
114   MEDWRAPPER_EXPORT
115   TInt
116   GetNbConn(EGeometrieElement typmai,
117             EEntiteMaillage typent,
118             TInt mdim);
119   
120   MEDWRAPPER_EXPORT
121   TInt 
122   GetNbNodes(EGeometrieElement typmai);
123
124   struct TNameInfo;
125   typedef SharedPtr<TNameInfo> PNameInfo;
126   
127   struct TMeshInfo;
128   typedef SharedPtr<TMeshInfo> PMeshInfo;
129   
130   struct TFamilyInfo;
131   typedef SharedPtr<TFamilyInfo> PFamilyInfo;
132
133   struct TElemInfo;
134   typedef SharedPtr<TElemInfo> PElemInfo;
135
136   struct TNodeInfo;
137   typedef SharedPtr<TNodeInfo> PNodeInfo;
138
139   struct TPolygoneInfo;
140   typedef SharedPtr<TPolygoneInfo> PPolygoneInfo;
141
142   struct TPolyedreInfo;
143   typedef SharedPtr<TPolyedreInfo> PPolyedreInfo;
144
145   struct TCellInfo;
146   typedef SharedPtr<TCellInfo> PCellInfo;
147
148   struct TBallInfo;
149   typedef SharedPtr<TBallInfo> PBallInfo;
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   class TGrilleInfo;
164   typedef SharedPtr<TGrilleInfo> PGrilleInfo;
165
166   struct TTimeStampValueBase;
167   typedef SharedPtr<TTimeStampValueBase> PTimeStampValueBase;
168
169   struct TWrapper;
170   typedef SharedPtr<TWrapper> PWrapper;
171 }
172
173 #endif // MED_Common_HeaderFile