Salome HOME
committing the version in the main trunk of the CVS tree the branch
[modules/med.git] / src / MEDWrapper / V2_1 / 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.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_1_Wrapper_HeaderFile
30 #define MED_V2_1_Wrapper_HeaderFile
31
32 #include "MED_TWrapper.hxx"
33
34 namespace MED{
35   namespace V2_1{
36
37     const TInt PNOM = 8;
38
39     typedef MED::TTMeshInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVMeshInfo;
40
41     typedef MED::TTFamilyInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVFamilyInfo;
42
43     typedef MED::TTNodeInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVNodeInfo;
44
45     typedef MED::TTCellInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVCellInfo;
46
47     typedef MED::TTFieldInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVFieldInfo;
48
49     typedef MED::TTTimeStampInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVTimeStampInfo;
50
51     typedef MED::TTTimeStampVal<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVTimeStampVal;
52
53     //---------------------------------------------------------------
54     class TFile;
55     typedef boost::shared_ptr<TFile> PFile;
56     
57     typedef enum {eLECT, eECRI, eREMP} EModeAcces; 
58
59     //---------------------------------------------------------------
60     class TVWrapper: public MED::TTWrapper<PNOM,DESC,IDENT,NOM,LNOM,eV2_1>
61     {
62       TVWrapper();
63       TVWrapper(const TVWrapper&);
64       TVWrapper& operator=(const TVWrapper&);
65       
66     public:
67       TVWrapper(const std::string& theFileName);
68
69
70       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71       virtual TInt GetNbMeshes(TErr* theErr = NULL);
72       
73       virtual void GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
74                                TErr* theErr = NULL);
75
76       virtual void SetMeshInfo(const MED::TMeshInfo& theInfo,
77                                TErr* theErr = NULL);
78       
79       void SetMeshInfo(const MED::TMeshInfo& theInfo,
80                        EModeAcces theMode,
81                        TErr* theErr = NULL);
82
83       
84       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85       virtual TInt GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
86                                  TErr* theErr = NULL);
87       virtual TInt GetNbFamAttr(TInt theFamId, 
88                                 const MED::TMeshInfo& theInfo,
89                                 TErr* theErr = NULL);
90       virtual TInt GetNbFamGroup(TInt theFamId, 
91                                  const MED::TMeshInfo& theInfo,
92                                  TErr* theErr = NULL);
93       
94       virtual void GetFamilyInfo(TInt theFamId, 
95                                  MED::TFamilyInfo& theInfo,
96                                  TErr* theErr = NULL);
97
98       virtual void SetFamilyInfo(const MED::TFamilyInfo& theInfo,
99                                  TErr* theErr = NULL);
100       
101       void SetFamilyInfo(const MED::TFamilyInfo& theInfo,
102                          EModeAcces theMode,
103                          TErr* theErr = NULL);
104
105       
106       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107       virtual TInt GetNbNodes(const MED::TMeshInfo& theMeshInfo,
108                               TErr* theErr = NULL);
109       
110       virtual void GetNodeInfo(MED::TNodeInfo& theInfo,
111                                TErr* theErr = NULL);
112
113       virtual void SetNodeInfo(const MED::TNodeInfo& theInfo,
114                                TErr* theErr = NULL);
115       
116       void SetNodeInfo(const MED::TNodeInfo& theInfo,
117                        EModeAcces theMode,
118                        TErr* theErr = NULL);
119
120       
121       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122       virtual TEntityInfo GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
123                                         EConnectivite theTConn = eNOD,
124                                         TErr* theErr = NULL);
125       
126       virtual TInt GetNbCells(const MED::TMeshInfo& theMeshInfo, 
127                               EEntiteMaillage, 
128                               EGeometrieElement, 
129                               EConnectivite theTConn = eNOD,
130                               TErr* theErr = NULL);
131       
132       virtual void GetCellInfo(MED::TCellInfo& theInfo,
133                                TErr* theErr = NULL);
134
135       virtual void SetCellInfo(const MED::TCellInfo& theInfo,
136                                TErr* theErr = NULL);
137       
138       void SetCellInfo(const MED::TCellInfo& theInfo,
139                        EModeAcces theMode,
140                        TErr* theErr = NULL);
141
142       
143       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144       virtual TInt GetNbFields(TErr* theErr = NULL);
145       
146       virtual TInt GetNbComp(TInt theFieldId,
147                              TErr* theErr = NULL);
148       
149       virtual void GetFieldInfo(TInt theFieldId, 
150                                 MED::TFieldInfo& theInfo,
151                                 TErr* theErr = NULL);
152
153       virtual void SetFieldInfo(const MED::TFieldInfo& theInfo,
154                                 TErr* theErr = NULL);
155       
156       void SetFieldInfo(const MED::TFieldInfo& theInfo,
157                         EModeAcces theMode,
158                         TErr* theErr = NULL);
159
160       
161       //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162       virtual TInt GetNbTimeStamps(const MED::TFieldInfo& theInfo, 
163                                    const MED::TEntityInfo& theEntityInfo,
164                                    EEntiteMaillage& theEntity,
165                                    TGeom& theGeom,
166                                    TErr* theErr = NULL);
167       
168       virtual void GetTimeStampInfo(TInt theTimeStampId, 
169                                     MED::TTimeStampInfo& theInfo,
170                                     TErr* theErr = NULL);
171
172       virtual void GetTimeStampVal(MED::TTimeStampVal& theVal,
173                                    TErr* theErr = NULL);
174       
175       virtual void SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
176                                 TErr* theErr = NULL);
177       
178       void SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
179                         EModeAcces theMode,
180                         TErr* theErr = NULL);
181
182     protected:
183       PFile myFile;
184     };
185   }
186 }
187
188 #endif