Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/med.git] / src / MEDWrapper / V2_1 / Wrapper / MED_V2_1_Wrapper.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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : 
25 //  Author : 
26 //  Module : 
27 //  $Header$
28
29 #ifndef MED_V2_1_Wrapper_HeaderFile
30 #define MED_V2_1_Wrapper_HeaderFile
31
32 #ifdef WNT
33  #if defined MEDWRAPPER_V2_1_EXPORTS
34   #if defined WIN32
35    #define MED_V21_WRAPPER_EXPORT __declspec( dllexport )
36   #else
37    #define MED_V21_WRAPPER_EXPORT
38   #endif
39  #else
40   #if defined WIN32
41    #define MED_V21_WRAPPER_EXPORT __declspec( dllimport )
42   #else
43    #define MED_V21_WRAPPER_EXPORT
44   #endif
45  #endif
46 #else
47  #define MED_V21_WRAPPER_EXPORT
48 #endif
49
50 #include "MED_TWrapper.hxx"
51
52 namespace MED
53 {
54   template<>
55   TInt MED_V21_WRAPPER_EXPORT
56   GetDESCLength<eV2_1>();
57   
58   template<>
59   TInt MED_V21_WRAPPER_EXPORT
60   GetIDENTLength<eV2_1>();
61   
62   template<>
63   TInt MED_V21_WRAPPER_EXPORT
64   GetNOMLength<eV2_1>();
65   
66   template<>
67   TInt MED_V21_WRAPPER_EXPORT
68   GetLNOMLength<eV2_1>();
69   
70   template<>
71   TInt MED_V21_WRAPPER_EXPORT
72   GetPNOMLength<eV2_1>();
73
74   template<>
75   void MED_V21_WRAPPER_EXPORT
76   GetVersionRelease<eV2_1>(TInt& majeur, TInt& mineur, TInt& release);
77
78   template<>
79   TInt MED_V21_WRAPPER_EXPORT
80   GetNbConn<eV2_1>(EGeometrieElement typmai,
81                    EEntiteMaillage typent,
82                    TInt mdim);
83   
84   namespace V2_1
85   {
86     //----------------------------------------------------------------------------
87     class TFile;
88     typedef boost::shared_ptr<TFile> PFile;
89     
90     typedef enum {eLECT, eECRI, eREMP} EModeAcces; 
91
92     //----------------------------------------------------------------------------
93     class MED_V21_WRAPPER_EXPORT TVWrapper: public MED::TTWrapper<eV2_1>
94     {
95       TVWrapper();
96       TVWrapper(const TVWrapper&);
97       TVWrapper& operator=(const TVWrapper&);
98       
99     public:
100       TVWrapper(const std::string& theFileName);
101
102
103       //----------------------------------------------------------------------------
104       virtual
105       TInt
106       GetNbMeshes(TErr* theErr = NULL);
107       
108       virtual
109       void
110       GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
111                   TErr* theErr = NULL);
112
113       virtual 
114       void
115       SetMeshInfo(const MED::TMeshInfo& theInfo,
116                   TErr* theErr = NULL);
117       
118       void
119       SetMeshInfo(const MED::TMeshInfo& theInfo,
120                   EModeAcces theMode,
121                   TErr* theErr = NULL);
122       
123       
124       //----------------------------------------------------------------------------
125       virtual
126       TInt
127       GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
128                     TErr* theErr = NULL);
129       virtual 
130       TInt
131       GetNbFamAttr(TInt theFamId, 
132                    const MED::TMeshInfo& theInfo,
133                    TErr* theErr = NULL);
134       virtual 
135       TInt
136       GetNbFamGroup(TInt theFamId, 
137                     const MED::TMeshInfo& theInfo,
138                     TErr* theErr = NULL);
139       
140       virtual 
141       void
142       GetFamilyInfo(TInt theFamId, 
143                     MED::TFamilyInfo& theInfo,
144                     TErr* theErr = NULL);
145
146       virtual 
147       void
148       SetFamilyInfo(const MED::TFamilyInfo& theInfo,
149                     TErr* theErr = NULL);
150       
151       void
152       SetFamilyInfo(const MED::TFamilyInfo& theInfo,
153                     EModeAcces theMode,
154                     TErr* theErr = NULL);
155       
156       
157       //----------------------------------------------------------------------------
158       virtual
159       TInt
160       GetNbNodes(const MED::TMeshInfo& theMeshInfo,
161                  TErr* theErr = NULL);
162       
163       virtual 
164       void
165       GetNodeInfo(MED::TNodeInfo& theInfo,
166                   TErr* theErr = NULL);
167       
168       virtual
169       void
170       SetNodeInfo(const MED::TNodeInfo& theInfo,
171                   TErr* theErr = NULL);
172       
173       void 
174       SetNodeInfo(const MED::TNodeInfo& theInfo,
175                   EModeAcces theMode,
176                   TErr* theErr = NULL);
177       
178       
179       //----------------------------------------------------------------------------
180       virtual
181       TEntityInfo
182       GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
183                     EConnectivite theConn = eNOD,
184                     TErr* theErr = NULL);
185       
186       virtual
187       TInt
188       GetNbCells(const MED::TMeshInfo& theMeshInfo, 
189                  EEntiteMaillage, 
190                  EGeometrieElement, 
191                  EConnectivite theConn = eNOD,
192                  TErr* theErr = NULL);
193       
194       virtual 
195       void
196       GetCellInfo(MED::TCellInfo& theInfo,
197                   TErr* theErr = NULL);
198       
199       virtual
200       void
201       SetCellInfo(const MED::TCellInfo& theInfo,
202                   TErr* theErr = NULL);
203       
204       void 
205       SetCellInfo(const MED::TCellInfo& theInfo,
206                   EModeAcces theMode,
207                   TErr* theErr = NULL);
208
209       
210       //----------------------------------------------------------------------------
211       virtual 
212       TInt
213       GetNbFields(TErr* theErr = NULL);
214       
215       virtual
216       TInt
217       GetNbComp(TInt theFieldId,
218                 TErr* theErr = NULL);
219       
220       virtual 
221       void
222       GetFieldInfo(TInt theFieldId, 
223                    MED::TFieldInfo& theInfo,
224                    TErr* theErr = NULL);
225
226       virtual 
227       void
228       SetFieldInfo(const MED::TFieldInfo& theInfo,
229                    TErr* theErr = NULL);
230       
231       void 
232       SetFieldInfo(const MED::TFieldInfo& theInfo,
233                    EModeAcces theMode,
234                    TErr* theErr = NULL);
235
236       
237       //----------------------------------------------------------------------------
238       virtual 
239       TInt
240       GetNbProfiles(TErr* theErr = NULL);
241
242       virtual 
243       TProfileInfo::TInfo
244       GetProfilePreInfo(TInt theId, 
245                         TErr* theErr = NULL);
246       
247       virtual 
248       void
249       GetProfileInfo(TInt theId, 
250                      TProfileInfo& theInfo,
251                      TErr* theErr = NULL);
252
253       virtual
254       void
255       SetProfileInfo(const TProfileInfo& theInfo,
256                      TErr*               theErr = NULL);
257
258       void
259       SetProfileInfo(const TProfileInfo& theInfo,
260                      EModeAcces          theMode,
261                      TErr*               theErr = NULL);
262       
263       //----------------------------------------------------------------------------
264       virtual 
265       TInt
266       GetNbTimeStamps(const MED::TFieldInfo& theInfo, 
267                       const MED::TEntityInfo& theEntityInfo,
268                       EEntiteMaillage& theEntity,
269                       TGeom2Size& theGeom2Size,
270                       TErr* theErr = NULL);
271       
272       virtual 
273       void
274       GetTimeStampInfo(TInt theTimeStampId, 
275                        MED::TTimeStampInfo& theInfo,
276                        TErr* theErr = NULL);
277
278       virtual 
279       void
280       GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
281                         const TMKey2Profile& theMKey2Profile,
282                         const TKey2Gauss& theKey2Gauss,
283                         TErr* theErr = NULL);
284       
285       virtual 
286       void
287       SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
288                         TErr* theErr = NULL);
289       
290       void
291       SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
292                         EModeAcces theMode,
293                         TErr* theErr = NULL);
294
295     protected:
296       PFile myFile;
297     };
298   }
299 }
300
301 #endif