Salome HOME
Join modifications from branch CEAFor_V3_2_0
[modules/med.git] / src / MEDWrapper / V2_2 / MED_V2_2_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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : 
25 //  Author : 
26 //  Module : 
27 //  $Header$
28
29 #ifndef MED_V2_2_Wrapper_HeaderFile
30 #define MED_V2_2_Wrapper_HeaderFile
31
32 #include "MED_Structures.hxx"
33 #include "MED_TWrapper.hxx"
34
35 namespace MED
36 {
37   template<>
38   TInt
39   GetDESCLength<eV2_2>();
40   
41   template<>
42   TInt
43   GetIDENTLength<eV2_2>();
44   
45   template<>
46   TInt
47   GetNOMLength<eV2_2>();
48   
49   template<>
50   TInt
51   GetLNOMLength<eV2_2>();
52   
53   template<>
54   TInt
55   GetPNOMLength<eV2_2>();
56
57   template<>
58   TInt
59   GetNbConn<eV2_2>(EGeometrieElement typmai,
60                    EEntiteMaillage typent,
61                    TInt mdim);
62
63   namespace V2_2
64   {
65
66     typedef MED::TTMeshInfo<eV2_2> TVMeshInfo;
67
68     typedef MED::TTFamilyInfo<eV2_2> TVFamilyInfo;
69
70     typedef MED::TTNodeInfo<eV2_2> TVNodeInfo;
71
72     typedef MED::TTCellInfo<eV2_2> TVCellInfo;
73
74     typedef MED::TTFieldInfo<eV2_2> TVFieldInfo;
75
76     typedef MED::TTTimeStampInfo<eV2_2> TVTimeStampInfo;
77
78     typedef MED::TTTimeStampVal<eV2_2> TVTimeStampVal;
79
80     typedef MED::TTGrilleInfo<eV2_2> TVGrilleInfo;
81
82     //---------------------------------------------------------------
83     class TFile;
84     typedef boost::shared_ptr<TFile> PFile;
85     
86     typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces; 
87
88     //---------------------------------------------------------------
89     class TVWrapper: public MED::TTWrapper<eV2_2>
90     {
91       TVWrapper();
92       TVWrapper(const TVWrapper&);
93       TVWrapper& operator=(const TVWrapper&);
94       
95     public:
96       TVWrapper(const std::string& theFileName);
97
98       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99       virtual 
100       TInt
101       GetNbMeshes(TErr* theErr = NULL);
102       
103       virtual
104       void
105       GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
106                                TErr* theErr = NULL);
107
108       virtual
109       void
110       SetMeshInfo(const MED::TMeshInfo& theInfo,
111                   TErr* theErr = NULL);
112       
113       void SetMeshInfo(const MED::TMeshInfo& theInfo,
114                        EModeAcces theMode,
115                        TErr* theErr = NULL);
116       
117       
118       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119       virtual
120       TInt
121       GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
122                     TErr* theErr = NULL);
123
124       virtual 
125       TInt
126       GetNbFamAttr(TInt theFamId, 
127                    const MED::TMeshInfo& theInfo,
128                    TErr* theErr = NULL);
129       
130       virtual
131       TInt
132       GetNbFamGroup(TInt theFamId, 
133                     const MED::TMeshInfo& theInfo,
134                     TErr* theErr = NULL);
135       
136       virtual
137       void
138       GetFamilyInfo(TInt theFamId, 
139                     MED::TFamilyInfo& theInfo,
140                     TErr* theErr = NULL);
141       
142       virtual
143       void
144       SetFamilyInfo(const MED::TFamilyInfo& theInfo,
145                     TErr* theErr = NULL);
146       
147       void 
148       SetFamilyInfo(const MED::TFamilyInfo& theInfo,
149                     EModeAcces theMode,
150                     TErr* theErr = NULL);
151       
152       
153       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154       virtual
155       void
156       GetNames(TElemInfo& theInfo,
157                TInt nb,
158                EEntiteMaillage theEntity, 
159                EGeometrieElement theGeom,
160                TErr* theErr = NULL);
161
162       virtual
163       void
164       GetNumeration(TElemInfo& theInfo,
165                     TInt nb,
166                     EEntiteMaillage theEntity, 
167                     EGeometrieElement theGeom,
168                     TErr* theErr = NULL);
169
170       virtual
171       void
172       GetFamilies(TElemInfo& theInfo,
173                   TInt nb,
174                   EEntiteMaillage theEntity, 
175                   EGeometrieElement theGeom,
176                   TErr* theErr = NULL);
177
178       virtual
179       void
180       SetNames(const TElemInfo& theInfo,
181                EEntiteMaillage theEntity, 
182                EGeometrieElement theGeom,
183                TErr* theErr = NULL);
184
185       void
186       SetNames(const TElemInfo& theInfo,
187                EModeAcces theMode,
188                EEntiteMaillage theEntity, 
189                EGeometrieElement theGeom,
190                TErr* theErr = NULL);
191       
192       virtual
193       void
194       SetNumeration(const TElemInfo& theInfo,
195                     EEntiteMaillage theEntity, 
196                     EGeometrieElement theGeom,
197                     TErr* theErr = NULL);
198       void
199       SetNumeration(const TElemInfo& theInfo,
200                     EModeAcces theMode,
201                     EEntiteMaillage theEntity, 
202                     EGeometrieElement theGeom,
203                     TErr* theErr = NULL);
204       
205       virtual
206       void
207       SetFamilies(const TElemInfo& theInfo,
208                   EEntiteMaillage theEntity, 
209                   EGeometrieElement theGeom,
210                   TErr* theErr = NULL);
211       void
212       SetFamilies(const TElemInfo& theInfo,
213                   EModeAcces theMode,
214                   EEntiteMaillage theEntity, 
215                   EGeometrieElement theGeom,
216                   TErr* theErr = NULL);
217
218       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219       virtual
220       TInt
221       GetNbNodes(const MED::TMeshInfo& theMeshInfo,
222                  TErr* theErr = NULL)
223       {
224         return GetNbNodes(theMeshInfo,eCOOR,theErr);
225       }
226
227       TInt
228       GetNbNodes(const MED::TMeshInfo& theMeshInfo,
229                  ETable theTable,
230                  TErr* theErr = NULL);
231       
232       virtual 
233       void
234       GetNodeInfo(MED::TNodeInfo& theInfo,
235                   TErr* theErr = NULL);
236       
237       virtual
238       void
239       SetNodeInfo(const MED::TNodeInfo& theInfo,
240                   TErr* theErr = NULL);
241       
242       void
243       SetNodeInfo(const MED::TNodeInfo& theInfo,
244                   EModeAcces theMode,
245                   TErr* theErr = NULL);
246       
247       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248       virtual
249       void
250       GetPolygoneInfo(TPolygoneInfo& theInfo,
251                       TErr* theErr = NULL);
252
253       virtual 
254       void
255       SetPolygoneInfo(const TPolygoneInfo& theInfo,
256                                    TErr* theErr = NULL);
257       
258       void
259       SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
260                       EModeAcces theMode,
261                       TErr* theErr = NULL);
262
263       virtual 
264       TInt
265       GetNbPolygones(const TMeshInfo& theMeshInfo,
266                    EEntiteMaillage theEntity,
267                    EGeometrieElement theGeom,
268                    EConnectivite theConnMode = eNOD,
269                    TErr* theErr = NULL);
270       
271       virtual 
272       TInt
273       GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
274                         EEntiteMaillage theEntity,
275                         EGeometrieElement theGeom,
276                         EConnectivite theConnMode = eNOD,
277                         TErr* theErr = NULL);
278
279       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
280       virtual 
281       void
282       GetPolyedreInfo(TPolyedreInfo& theInfo,
283                       TErr* theErr = NULL);
284       
285       virtual
286       void
287       SetPolyedreInfo(const TPolyedreInfo& theInfo,
288                       TErr* theErr = NULL);
289       
290       void
291       SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
292                       EModeAcces theMode,
293                       TErr* theErr = NULL);
294       
295       virtual
296       TInt
297       GetNbPolyedres(const TMeshInfo& theMeshInfo,
298                      EEntiteMaillage,
299                      EGeometrieElement,
300                      EConnectivite,
301                      TErr* theErr = NULL);
302       
303       virtual 
304       void
305       GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
306                           TInt& theNbFaces,
307                           TInt& theConnSize,
308                           EConnectivite theConnMode = eNOD,
309                           TErr* theErr = NULL);
310       
311       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
312       virtual
313       TEntityInfo
314       GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
315                     EConnectivite theConnMode = eNOD,
316                     TErr* theErr = NULL);
317       
318       virtual 
319       TInt
320       GetNbCells(const MED::TMeshInfo& theMeshInfo, 
321                  EEntiteMaillage, 
322                  EGeometrieElement, 
323                  EConnectivite theConnMode = eNOD,
324                  TErr* theErr = NULL);
325       
326       virtual
327       void
328       GetCellInfo(MED::TCellInfo& theInfo,
329                   TErr* theErr = NULL);
330
331       virtual 
332       void
333       SetCellInfo(const MED::TCellInfo& theInfo,
334                   TErr* theErr = NULL);
335       
336       void 
337       SetCellInfo(const MED::TCellInfo& theInfo,
338                   EModeAcces theMode,
339                   TErr* theErr = NULL);
340       
341       
342       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343       virtual
344       TInt
345       GetNbFields(TErr* theErr = NULL);
346       
347       virtual
348       TInt
349       GetNbComp(TInt theFieldId,
350                 TErr* theErr = NULL);
351       
352       virtual 
353       void
354       GetFieldInfo(TInt theFieldId, 
355                    MED::TFieldInfo& theInfo,
356                    TErr* theErr = NULL);
357       
358       virtual
359       void
360       SetFieldInfo(const MED::TFieldInfo& theInfo,
361                    TErr* theErr = NULL);
362       
363       void
364       SetFieldInfo(const MED::TFieldInfo& theInfo,
365                    EModeAcces theMode,
366                    TErr* theErr = NULL);
367       
368       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369       virtual 
370       TInt
371       GetNbGauss(TErr* theErr = NULL);
372
373       virtual 
374       TGaussInfo::TInfo
375       GetGaussPreInfo(TInt theId, 
376                       TErr* theErr = NULL);
377
378       virtual 
379       void
380       GetGaussInfo(TInt theId, 
381                    TGaussInfo& theInfo,
382                    TErr* theErr = NULL);
383
384       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
385       virtual 
386       TInt
387       GetNbProfiles(TErr* theErr = NULL);
388
389       virtual 
390       TProfileInfo::TInfo
391       GetProfilePreInfo(TInt theId, 
392                         TErr* theErr = NULL);
393       
394       virtual 
395       void
396       GetProfileInfo(TInt theId, 
397                      TProfileInfo& theInfo,
398                      TErr* theErr = NULL);
399
400
401       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
402       virtual 
403       TInt
404       GetNbTimeStamps(const MED::TFieldInfo& theInfo, 
405                       const MED::TEntityInfo& theEntityInfo,
406                       EEntiteMaillage& theEntity,
407                       TGeom2Size& theGeom2Size,
408                       TErr* theErr = NULL);
409       
410       virtual 
411       void
412       GetTimeStampInfo(TInt theTimeStampId, 
413                        MED::TTimeStampInfo& theInfo,
414                        TErr* theErr = NULL);
415       
416       virtual
417       void
418       GetTimeStampVal(MED::TTimeStampVal& theVal,
419                       const TMKey2Profile& theMKey2Profile,
420                       const TKey2Gauss& theKey2Gauss,
421                       TErr* theErr = NULL);
422       
423       virtual
424       void
425       SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
426                    TErr* theErr = NULL);
427       
428       void 
429       SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
430                    EModeAcces theMode,
431                    TErr* theErr = NULL);
432       
433       virtual
434       void
435       GetGrilleInfo(TGrilleInfo& theGrilleInfo,
436                     TErr* theErr = NULL);
437       
438       virtual
439       void
440       SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
441                     TErr* theErr = NULL);
442
443       void
444       SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
445                     EModeAcces theMode,
446                     TErr* theErr = NULL);
447
448       virtual
449       void
450       GetGrilleType(const MED::TMeshInfo& theMeshInfo,
451                     EGrilleType& type,
452                     TErr* theErr = NULL);
453
454       void
455       GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
456                       TIntVector& theStruct,
457                       TErr* theErr = NULL);
458
459     protected:
460       PFile myFile;
461     };
462   }
463 }
464
465 #endif