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