]> SALOME platform Git repositories - modules/med.git/blob - src/MEDWrapper/V2_2/MED_V2_2_Wrapper.hxx
Salome HOME
f8398b758b568f6334764ce88a0ba66a1aa61cec
[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     //---------------------------------------------------------------
81     class TFile;
82     typedef boost::shared_ptr<TFile> PFile;
83     
84     typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces; 
85
86     //---------------------------------------------------------------
87     class TVWrapper: public MED::TTWrapper<eV2_2>
88     {
89       TVWrapper();
90       TVWrapper(const TVWrapper&);
91       TVWrapper& operator=(const TVWrapper&);
92       
93     public:
94       TVWrapper(const std::string& theFileName);
95
96       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97       virtual 
98       TInt
99       GetNbMeshes(TErr* theErr = NULL);
100       
101       virtual
102       void
103       GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
104                                TErr* theErr = NULL);
105
106       virtual
107       void
108       SetMeshInfo(const MED::TMeshInfo& theInfo,
109                   TErr* theErr = NULL);
110       
111       void SetMeshInfo(const MED::TMeshInfo& theInfo,
112                        EModeAcces theMode,
113                        TErr* theErr = NULL);
114       
115       
116       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117       virtual
118       TInt
119       GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
120                     TErr* theErr = NULL);
121
122       virtual 
123       TInt
124       GetNbFamAttr(TInt theFamId, 
125                    const MED::TMeshInfo& theInfo,
126                    TErr* theErr = NULL);
127       
128       virtual
129       TInt
130       GetNbFamGroup(TInt theFamId, 
131                     const MED::TMeshInfo& theInfo,
132                     TErr* theErr = NULL);
133       
134       virtual
135       void
136       GetFamilyInfo(TInt theFamId, 
137                     MED::TFamilyInfo& theInfo,
138                     TErr* theErr = NULL);
139       
140       virtual
141       void
142       SetFamilyInfo(const MED::TFamilyInfo& theInfo,
143                     TErr* theErr = NULL);
144       
145       void 
146       SetFamilyInfo(const MED::TFamilyInfo& theInfo,
147                     EModeAcces theMode,
148                     TErr* theErr = NULL);
149       
150       
151       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152       virtual
153       void
154       GetNames(TElemInfo& theInfo,
155                TInt nb,
156                EEntiteMaillage theEntity, 
157                EGeometrieElement theGeom,
158                TErr* theErr = NULL);
159
160       virtual
161       void
162       GetNumeration(TElemInfo& theInfo,
163                     TInt nb,
164                     EEntiteMaillage theEntity, 
165                     EGeometrieElement theGeom,
166                     TErr* theErr = NULL);
167
168       virtual
169       void
170       GetFamilies(TElemInfo& theInfo,
171                   TInt nb,
172                   EEntiteMaillage theEntity, 
173                   EGeometrieElement theGeom,
174                   TErr* theErr = NULL);
175
176       virtual
177       void
178       SetNames(const TElemInfo& theInfo,
179                EEntiteMaillage theEntity, 
180                EGeometrieElement theGeom,
181                TErr* theErr = NULL);
182
183       void
184       SetNames(const TElemInfo& theInfo,
185                EModeAcces theMode,
186                EEntiteMaillage theEntity, 
187                EGeometrieElement theGeom,
188                TErr* theErr = NULL);
189       
190       virtual
191       void
192       SetNumeration(const TElemInfo& theInfo,
193                     EEntiteMaillage theEntity, 
194                     EGeometrieElement theGeom,
195                     TErr* theErr = NULL);
196       void
197       SetNumeration(const TElemInfo& theInfo,
198                     EModeAcces theMode,
199                     EEntiteMaillage theEntity, 
200                     EGeometrieElement theGeom,
201                     TErr* theErr = NULL);
202       
203       virtual
204       void
205       SetFamilies(const TElemInfo& theInfo,
206                   EEntiteMaillage theEntity, 
207                   EGeometrieElement theGeom,
208                   TErr* theErr = NULL);
209       void
210       SetFamilies(const TElemInfo& theInfo,
211                   EModeAcces theMode,
212                   EEntiteMaillage theEntity, 
213                   EGeometrieElement theGeom,
214                   TErr* theErr = NULL);
215
216       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217       virtual
218       TInt
219       GetNbNodes(const MED::TMeshInfo& theMeshInfo,
220                  TErr* theErr = NULL);
221       
222       virtual 
223       void
224       GetNodeInfo(MED::TNodeInfo& theInfo,
225                   TErr* theErr = NULL);
226       
227       virtual
228       void
229       SetNodeInfo(const MED::TNodeInfo& theInfo,
230                   TErr* theErr = NULL);
231       
232       void
233       SetNodeInfo(const MED::TNodeInfo& theInfo,
234                   EModeAcces theMode,
235                   TErr* theErr = NULL);
236       
237       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238       virtual
239       void
240       GetPolygoneInfo(TPolygoneInfo& theInfo,
241                       TErr* theErr = NULL);
242
243       virtual 
244       void
245       SetPolygoneInfo(const TPolygoneInfo& theInfo,
246                                    TErr* theErr = NULL);
247       
248       void
249       SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
250                       EModeAcces theMode,
251                       TErr* theErr = NULL);
252
253       virtual 
254       TInt
255       GetNbPolygones(const TMeshInfo& theMeshInfo,
256                    EEntiteMaillage theEntity,
257                    EGeometrieElement theGeom,
258                    EConnectivite theConnMode = eNOD,
259                    TErr* theErr = NULL);
260       
261       virtual 
262       TInt
263       GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
264                         EEntiteMaillage theEntity,
265                         EGeometrieElement theGeom,
266                         EConnectivite theConnMode = eNOD,
267                         TErr* theErr = NULL);
268
269       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270       virtual 
271       void
272       GetPolyedreInfo(TPolyedreInfo& theInfo,
273                       TErr* theErr = NULL);
274       
275       virtual
276       void
277       SetPolyedreInfo(const TPolyedreInfo& theInfo,
278                       TErr* theErr = NULL);
279       
280       void
281       SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
282                       EModeAcces theMode,
283                       TErr* theErr = NULL);
284       
285       virtual
286       TInt
287       GetNbPolyedres(const TMeshInfo& theMeshInfo,
288                      EEntiteMaillage,
289                      EGeometrieElement,
290                      EConnectivite,
291                      TErr* theErr = NULL);
292       
293       virtual 
294       void
295       GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
296                           TInt& theNbFaces,
297                           TInt& theConnSize,
298                           EConnectivite theConnMode = eNOD,
299                           TErr* theErr = NULL);
300       
301       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302       virtual
303       TEntityInfo
304       GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
305                     EConnectivite theConnMode = eNOD,
306                     TErr* theErr = NULL);
307       
308       virtual 
309       TInt
310       GetNbCells(const MED::TMeshInfo& theMeshInfo, 
311                  EEntiteMaillage, 
312                  EGeometrieElement, 
313                  EConnectivite theConnMode = eNOD,
314                  TErr* theErr = NULL);
315       
316       virtual
317       void
318       GetCellInfo(MED::TCellInfo& theInfo,
319                   TErr* theErr = NULL);
320
321       virtual 
322       void
323       SetCellInfo(const MED::TCellInfo& theInfo,
324                   TErr* theErr = NULL);
325       
326       void 
327       SetCellInfo(const MED::TCellInfo& theInfo,
328                   EModeAcces theMode,
329                   TErr* theErr = NULL);
330       
331       
332       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
333       virtual
334       TInt
335       GetNbFields(TErr* theErr = NULL);
336       
337       virtual
338       TInt
339       GetNbComp(TInt theFieldId,
340                 TErr* theErr = NULL);
341       
342       virtual 
343       void
344       GetFieldInfo(TInt theFieldId, 
345                    MED::TFieldInfo& theInfo,
346                    TErr* theErr = NULL);
347       
348       virtual
349       void
350       SetFieldInfo(const MED::TFieldInfo& theInfo,
351                    TErr* theErr = NULL);
352       
353       void
354       SetFieldInfo(const MED::TFieldInfo& theInfo,
355                    EModeAcces theMode,
356                    TErr* theErr = NULL);
357       
358       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359       virtual 
360       TInt
361       GetNbGauss(TErr* theErr = NULL);
362
363       virtual 
364       TGaussInfo::TInfo
365       GetGaussPreInfo(TInt theId, 
366                       TErr* theErr = NULL);
367
368       virtual 
369       void
370       GetGaussInfo(TInt theId, 
371                    TGaussInfo& theInfo,
372                    TErr* theErr = NULL);
373
374       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
375       virtual 
376       TInt
377       GetNbProfiles(TErr* theErr = NULL);
378
379       virtual 
380       TProfileInfo::TInfo
381       GetProfilePreInfo(TInt theId, 
382                         TErr* theErr = NULL);
383       
384       virtual 
385       void
386       GetProfileInfo(TInt theId, 
387                      TProfileInfo& theInfo,
388                      TErr* theErr = NULL);
389
390
391       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
392       virtual 
393       TInt
394       GetNbTimeStamps(const MED::TFieldInfo& theInfo, 
395                       const MED::TEntityInfo& theEntityInfo,
396                       EEntiteMaillage& theEntity,
397                       TGeom2Size& theGeom2Size,
398                       TErr* theErr = NULL);
399       
400       virtual 
401       void
402       GetTimeStampInfo(TInt theTimeStampId, 
403                        MED::TTimeStampInfo& theInfo,
404                        TErr* theErr = NULL);
405       
406       virtual
407       void
408       GetTimeStampVal(MED::TTimeStampVal& theVal,
409                       const TMKey2Profile& theMKey2Profile,
410                       const TKey2Gauss& theKey2Gauss,
411                       TErr* theErr = NULL);
412       
413       virtual
414       void
415       SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
416                    TErr* theErr = NULL);
417       
418       void 
419       SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
420                    EModeAcces theMode,
421                    TErr* theErr = NULL);
422       
423     protected:
424       PFile myFile;
425     };
426   }
427 }
428
429 #endif