3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
29 #ifndef MED_Structures_HeaderFile
30 #define MED_Structures_HeaderFile
32 #include "MED_Common.hxx"
36 //---------------------------------------------------------------
37 typedef std::vector<char> TString;
39 std::string GetString(TInt theId, TInt theStep,
40 const TString& theString);
42 void SetString(TInt theId, TInt theStep,
44 const std::string& theValue);
46 //---------------------------------------------------------------
53 //---------------------------------------------------------------
54 struct TNameInfo: virtual TBase
57 virtual std::string GetName() const = 0;
58 virtual void SetName(const std::string& theValue) = 0;
62 //---------------------------------------------------------------
63 struct TMeshInfo: virtual TNameInfo
66 TInt GetDim() const { return myDim;}
69 EMaillage GetType() const { return myType;}
72 virtual std::string GetDesc() const = 0;
73 virtual void SetDesc(const std::string& theValue) = 0;
77 //---------------------------------------------------------------
78 typedef std::vector<TInt> TFamAttr;
80 struct TFamilyInfo: virtual TNameInfo
83 const PMeshInfo& GetMeshInfo() const { return myMeshInfo;}
86 TInt GetId() const { return myId;}
87 void SetId(TInt theId) { myId = theId;}
90 TInt GetNbGroup() const { return myNbGroup;}
93 virtual std::string GetGroupName(TInt theId) const = 0;
94 virtual void SetGroupName(TInt theId, const std::string& theValue) = 0;
97 TInt GetNbAttr() const { return myNbAttr;}
100 TInt GetAttrId(TInt theId) const;
101 void SetAttrId(TInt theId, TInt theVal);
104 TInt GetAttrVal(TInt theId) const;
105 void SetAttrVal(TInt theId, TInt theVal);
108 virtual std::string GetAttrDesc(TInt theId) const = 0;
109 virtual void SetAttrDesc(TInt theId, const std::string& theValue) = 0;
113 //---------------------------------------------------------------
114 typedef std::vector<TInt> TElemNum;
116 struct TElemInfo: virtual TBase
118 PMeshInfo myMeshInfo;
119 const PMeshInfo& GetMeshInfo() const { return myMeshInfo;}
122 TInt GetNbElem() const { return myNbElem;}
125 TInt GetFamNum(TInt theId) const;
126 void SetFamNum(TInt theId, TInt theVal);
128 EBooleen myIsElemNum;
129 EBooleen IsElemNum() const { return myIsElemNum;}
132 TInt GetElemNum(TInt theId) const;
133 void SetElemNum(TInt theId, TInt theVal);
135 EBooleen myIsElemNames;
136 EBooleen IsElemNames() const { return myIsElemNames;}
139 virtual std::string GetElemName(TInt theId) const = 0;
140 virtual void SetElemName(TInt theId, const std::string& theValue) = 0;
144 //---------------------------------------------------------------
145 typedef std::vector<TFloat> TNodeCoord;
147 struct TNodeInfo: virtual TElemInfo
150 TFloat GetNodeCoord(TInt theId, TInt theComp) const;
151 void SetNodeCoord(TInt theId, TInt theComp, TFloat theVal);
154 ERepere GetSystem() const { return mySystem;}
155 void SetSystem(ERepere theSystem) { mySystem = theSystem;}
157 TString myCoordNames;
158 virtual std::string GetCoordName(TInt theId) const = 0;
159 virtual void SetCoordName(TInt theId, const std::string& theValue) = 0;
161 TString myCoordUnits;
162 virtual std::string GetCoordUnit(TInt theId) const = 0;
163 virtual void SetCoordUnit(TInt theId, const std::string& theValue) = 0;
167 //---------------------------------------------------------------
168 typedef SliceArray<TElemNum> TConnSlice;
169 typedef ConstSliceArray<TElemNum> TConstConnSlice;
171 struct TCellInfo: virtual TElemInfo
173 EEntiteMaillage myTEntity;
174 EEntiteMaillage GetEntity() const { return myTEntity;}
176 EGeometrieElement myTGeom;
177 EGeometrieElement GetGeom() const { return myTGeom;}
179 EConnectivite myTConn;
180 EConnectivite GetConn() const { return myTConn;}
182 virtual TInt GetConnDim() const = 0;
185 TConstConnSlice GetConnSlice(TInt theElemId) const;
186 TConnSlice GetConnSlice(TInt theElemId);
188 TInt GetConn(TInt theElemId, TInt theConnId) const;
189 void SetConn(TInt theElemId, TInt theConnId, TInt theVal);
192 //---------------------------------------------------------------
193 struct TPolygoneInfo: virtual TElemInfo
195 EEntiteMaillage myTEntity; // MED_FACE|MED_MAILLE
196 EEntiteMaillage GetEntity() const { return myTEntity;}
198 EGeometrieElement myTGeom; // ePOLYGONE
199 EGeometrieElement GetGeom() const { return ePOLYGONE;}
201 EConnectivite myTConn; // eNOD|eDESC(eDESC not used)
202 EConnectivite GetConn() const { return myTConn;}
205 TInt GetConnDim() const { return myConnDim;}
207 TElemNum myConn; // Table de connectivities
208 TElemNum GetConnectivite() const { return myConn;}
210 TElemNum myIndex; // Table de indexes
211 TElemNum GetIndex() {return myIndex;}
212 TInt GetNbConn(TInt theElemId) const;
215 //---------------------------------------------------------------
216 struct TPolyedreInfo: virtual TElemInfo
218 EEntiteMaillage myTEntity; // MED_FACE|MED_MAILLE
219 EEntiteMaillage GetEntity() const { return myTEntity;}
221 EGeometrieElement myTGeom; // ePOLYEDRE
222 EGeometrieElement GetGeom() const { return ePOLYEDRE;}
224 EConnectivite myTConn; // eNOD|eDESC(eDESC not used)
225 EConnectivite GetConn() const { return myTConn;}
228 TInt GetNbConn() const { return myNbConn;}
230 TElemNum myConn; // Table de connectivities
231 TElemNum GetConnectivite() const { return myConn;}
234 TInt GetNbFacesIndex() const { return myNbFacesIndex;}
236 TElemNum myFacesIndex; // Table de faces indexes
237 TElemNum GetFacesIndex() {return myFacesIndex;}
239 TElemNum myIndex; // Table de indexes
240 TElemNum GetIndex() {return myIndex;}
241 TInt GetNbConn(TInt theElemId) const;
244 //---------------------------------------------------------------
245 struct TFieldInfo: virtual TNameInfo
247 PMeshInfo myMeshInfo;
248 const PMeshInfo& GetMeshInfo() const { return myMeshInfo;}
251 ETypeChamp GetType() const { return myType;}
254 TInt GetNbComp() const { return myNbComp;}
257 EBooleen GetIsLocal() const { return myIsLocal;}
260 TInt GetNbRef() const { return myNbRef;}
263 virtual std::string GetCompName(TInt theId) const = 0;
264 virtual void SetCompName(TInt theId, const std::string& theValue) = 0;
267 virtual std::string GetUnitName(TInt theId) const = 0;
268 virtual void SetUnitName(TInt theId, const std::string& theValue) = 0;
272 //---------------------------------------------------------------
273 struct TTimeStampInfo: virtual TBase
275 PFieldInfo myFieldInfo;
276 const PFieldInfo& GetFieldInfo() const { return myFieldInfo;}
278 EEntiteMaillage myEntity;
279 EEntiteMaillage GetEntity() const { return myEntity;}
282 const TGeom& GetGeom() const { return myGeom;}
284 TInt myNbGauss, myNumDt, myNumOrd;
285 TInt GetNbGauss() const { return myNbGauss;}
286 TInt GetNumDt() const { return myNumDt;}
287 TInt GetNumOrd() const { return myNumOrd;}
290 TFloat GetDt() const { return myDt;}
293 virtual std::string GetGaussName() const = 0;
294 virtual void SetGaussName(const std::string& theValue) = 0;
297 virtual std::string GetUnitDt() const = 0;
298 virtual void SetUnitDt(const std::string& theValue) = 0;
302 //---------------------------------------------------------------
303 typedef std::vector<TFloat> TValue;
304 typedef std::map<EGeometrieElement,TValue> TMeshValue;
306 struct TTimeStampVal: virtual TBase
308 PTimeStampInfo myTimeStampInfo;
309 const PTimeStampInfo& GetTimeStampInfo() const { return myTimeStampInfo;}
311 TMeshValue myMeshValue;
312 TFloat GetVal(EGeometrieElement theGeom, TInt theId,
313 TInt theComp, TInt theGauss = 0) const;
315 void SetVal(EGeometrieElement theGeom, TInt theId,
316 TInt theComp, TFloat theVal, TInt theGauss = 0);
317 EModeProfil myPflMode;
318 EModeProfil GetPflMode() const { return myPflMode;}
319 void GetPflMode(EModeProfil theVal) { myPflMode = theVal;}
322 virtual std::string GetPflName() const = 0;
323 virtual void SetPflName(const std::string& theValue) = 0;