1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : VISU_MedConvertor.hxx
6 // Author : Alexey PETROV
9 #ifndef VISU_MedConvertor_HeaderFile
10 #define VISU_MedConvertor_HeaderFile
12 #include "VISU_Convertor_impl.hxx"
14 #include "MED_Common.hxx"
15 #include "MED_Structures.hxx"
17 #include <boost/thread/mutex.hpp>
18 #include <qfileinfo.h>
22 typedef TVector<TName> TNames;
24 //---------------------------------------------------------------
25 class TMEDNamedPointCoords: public virtual TNamedPointCoords
27 MED::PNodeInfo myNodeInfo;
31 Init(vtkIdType theNbPoints,
33 const MED::PNodeInfo& theNodeInfo);
37 GetNodeName(vtkIdType theObjID) const;
39 typedef SharedPtr<TMEDNamedPointCoords> PMEDNamedPointCoords;
42 //---------------------------------------------------------------
43 struct TMEDMesh: virtual TMeshImpl
45 MED::PMeshInfo myMeshInfo;
46 MED::TEntityInfo myEntityInfo;
48 typedef SharedPtr<TMEDMesh> PMEDMesh;
51 //---------------------------------------------------------------
52 struct TMEDSubProfile: virtual TSubProfileImpl
54 MED::EGeometrieElement myMGeom;
57 myIsElemNum(MED::eFAUX)
60 MED::EBooleen myIsElemNum;
61 MED::TElemNum myElemNum;
65 GetElemObjID(vtkIdType theID) const;
67 typedef SharedPtr<TMEDSubProfile> PMEDSubProfile;
70 //---------------------------------------------------------------
71 struct TMEDProfile: virtual TProfileImpl
73 typedef SharedPtr<TMEDProfile> PMEDProfile;
76 //---------------------------------------------------------------
77 struct TMEDGauss: virtual TGaussImpl
79 MED::PGaussInfo myGaussInfo;
81 //! To define a way to implement more detail comparision of the TGaussSubMesh instances
84 LessThan(const PGaussImpl& theGauss,
85 bool& theResult) const;
87 typedef SharedPtr<TMEDGauss> PMEDGauss;
90 //---------------------------------------------------------------
91 struct TMEDGaussSubMesh: virtual TGaussSubMeshImpl
94 myIsElemNum(MED::eFAUX)
97 MED::EBooleen myIsElemNum;
98 MED::TElemNum myElemNum;
102 GetObjID(vtkIdType theID) const;
104 typedef SharedPtr<TMEDGaussSubMesh> PMEDGaussSubMesh;
107 //---------------------------------------------------------------
108 struct TMEDGaussMesh: virtual TGaussMeshImpl
110 typedef SharedPtr<TMEDGaussMesh> PMEDGaussMesh;
113 //---------------------------------------------------------------
114 struct TMEDSubMesh: virtual TSubMeshImpl
117 myIsElemNum(MED::eFAUX)
120 MED::EBooleen myIsElemNum;
121 MED::TElemNum myElemNum;
122 MED::PElemInfo myElemInfo;
125 Init(const MED::PElemInfo& theElemInfo);
129 GetElemObjID(vtkIdType theID) const;
133 GetElemName(vtkIdType theObjID) const;
135 typedef SharedPtr<TMEDSubMesh> PMEDSubMesh;
138 //---------------------------------------------------------------
139 typedef std::map<vtkIdType,vtkIdType> TFamilyID2CellsSize;
141 struct TMEDMeshOnEntity: virtual TMeshOnEntityImpl
143 TFamilyID2CellsSize myFamilyID2CellsSize;
144 MED::TGeom2Size myGeom2Size;
146 typedef SharedPtr<TMEDMeshOnEntity> PMEDMeshOnEntity;
149 //---------------------------------------------------------------
150 struct TMEDFamily: virtual TFamilyImpl
152 typedef SharedPtr<TMEDFamily> PMEDFamily;
155 //---------------------------------------------------------------
156 struct TMEDGroup: virtual TGroupImpl
158 typedef SharedPtr<TMEDGroup> PMEDGroup;
161 //---------------------------------------------------------------
162 struct TMEDField: virtual TFieldImpl
164 typedef SharedPtr<TMEDField> PMEDField;
167 //---------------------------------------------------------------
168 struct TMEDValForTime: virtual TValForTimeImpl
170 typedef SharedPtr<TMEDValForTime> PMEDValForTime;
174 class VISU_MedConvertor: public VISU_Convertor_impl
177 VISU_MedConvertor(const VISU_MedConvertor&);
179 bool myIsEntitiesDone;
185 VISU_MedConvertor(const std::string& theFileName);
204 QFileInfo myFileInfo;
208 LoadMeshOnEntity(VISU::PMeshImpl theMesh,
209 VISU::PMeshOnEntityImpl theMeshOnEntity);
213 LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
214 VISU::PMeshOnEntityImpl theMeshOnEntity,
215 VISU::PFamilyImpl theFamily);
219 LoadMeshOnGroup(VISU::PMeshImpl theMesh,
220 const VISU::TFamilySet& theFamilySet);
224 LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
225 VISU::PMeshOnEntityImpl theMeshOnEntity,
226 VISU::PFieldImpl theField,
227 VISU::PValForTimeImpl theValForTime);
231 LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
232 VISU::PMeshOnEntityImpl theMeshOnEntity,
233 VISU::PFieldImpl theField,
234 VISU::PValForTimeImpl theValForTime);
237 LoadPoints(const MED::PWrapper& theMed,
238 const VISU::PMEDMesh theMesh);
241 LoadPointsOnFamily(const MED::PWrapper& theMed,
242 const VISU::PMEDMesh theMesh,
243 const VISU::PMEDFamily theFamily);
246 LoadCellsOnEntity(const MED::PWrapper& theMed,
247 const VISU::PMEDMesh theMesh,
248 const VISU::PMEDMeshOnEntity theMeshOnEntity);
251 LoadCellsOnFamily(const MED::PWrapper& theMed,
252 const VISU::PMEDMesh theMesh,
253 const VISU::PMEDMeshOnEntity theMeshOnEntity,
254 const VISU::PMEDFamily theFamily);
257 LoadValForTimeOnMesh(const MED::PWrapper& theMed,
258 VISU::PMEDMesh theMesh,
259 VISU::PMEDMeshOnEntity theMeshOnEntity,
260 VISU::PMEDField theField,
261 VISU::PMEDValForTime theValForTime);
264 LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
265 VISU::PMEDMesh theMesh,
266 VISU::PMEDMeshOnEntity theMeshOnEntity,
267 VISU::PMEDField theField,
268 VISU::PMEDValForTime theValForTime);