1 // License as published by the Free Software Foundation; either
2 // version 2.1 of the License.
4 // This library is distributed in the hope that it will be useful,
5 // but WITHOUT ANY WARRANTY; without even the implied warranty of
6 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7 // Lesser General Public License for more details.
9 // You should have received a copy of the GNU Lesser General Public
10 // License along with this library; if not, write to the Free Software
11 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
13 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
15 // File : VISU_MedConvertor.hxx
16 // Author : Alexey PETROV
19 #ifndef VISU_MedConvertor_HeaderFile
20 #define VISU_MedConvertor_HeaderFile
22 #include "VISU_Convertor_impl.hxx"
24 #include "MED_Common.hxx"
25 #include "MED_Structures.hxx"
27 #include <boost/thread/mutex.hpp>
28 #include <qfileinfo.h>
32 typedef TVector<TName> TNames;
34 //---------------------------------------------------------------
35 class TMEDNamedPointCoords: public virtual TNamedPointCoords
37 MED::PNodeInfo myNodeInfo;
41 Init(vtkIdType theNbPoints,
43 const MED::PNodeInfo& theNodeInfo);
46 Init(vtkIdType theNbPoints,
48 const MED::PGrilleInfo& theGrilleInfo);
52 GetNodeName(vtkIdType theObjID) const;
54 typedef SharedPtr<TMEDNamedPointCoords> PMEDNamedPointCoords;
57 //---------------------------------------------------------------
58 struct TMEDMesh: virtual TMeshImpl
60 MED::PMeshInfo myMeshInfo;
61 MED::TEntityInfo myEntityInfo;
63 typedef SharedPtr<TMEDMesh> PMEDMesh;
66 //---------------------------------------------------------------
67 struct TMEDSubProfile: virtual TSubProfileImpl
69 MED::EGeometrieElement myMGeom;
72 myIsElemNum(MED::eFAUX)
75 MED::EBooleen myIsElemNum;
76 MED::TElemNum myElemNum;
80 GetElemObjID(vtkIdType theID) const;
82 typedef SharedPtr<TMEDSubProfile> PMEDSubProfile;
85 //---------------------------------------------------------------
86 struct TMEDProfile: virtual TProfileImpl
88 typedef SharedPtr<TMEDProfile> PMEDProfile;
91 //---------------------------------------------------------------
92 struct TMEDGauss: virtual TGaussImpl
94 MED::PGaussInfo myGaussInfo;
96 //! To define a way to implement more detail comparision of the TGaussSubMesh instances
99 LessThan(const PGaussImpl& theGauss,
100 bool& theResult) const;
102 typedef SharedPtr<TMEDGauss> PMEDGauss;
105 //---------------------------------------------------------------
106 struct TMEDGaussSubMesh: virtual TGaussSubMeshImpl
109 myIsElemNum(MED::eFAUX)
112 MED::EBooleen myIsElemNum;
113 MED::TElemNum myElemNum;
117 GetObjID(vtkIdType theID,
118 vtkIdType theStartID) const;
120 typedef SharedPtr<TMEDGaussSubMesh> PMEDGaussSubMesh;
123 //---------------------------------------------------------------
124 struct TMEDGaussMesh: virtual TGaussMeshImpl
126 typedef SharedPtr<TMEDGaussMesh> PMEDGaussMesh;
129 //---------------------------------------------------------------
130 struct TMEDSubMesh: virtual TSubMeshImpl
133 myIsElemNum(MED::eFAUX)
136 MED::EBooleen myIsElemNum;
137 MED::TElemNum myElemNum;
138 MED::PElemInfo myElemInfo;
141 Init(const MED::PElemInfo& theElemInfo);
144 Init(const MED::PGrilleInfo& theGrilleInfo);
148 GetElemObjID(vtkIdType theID) const;
152 GetElemName(vtkIdType theObjID) const;
154 typedef SharedPtr<TMEDSubMesh> PMEDSubMesh;
157 //---------------------------------------------------------------
158 typedef std::map<vtkIdType,vtkIdType> TFamilyID2CellsSize;
160 struct TMEDMeshOnEntity: virtual TMeshOnEntityImpl
162 TFamilyID2CellsSize myFamilyID2CellsSize;
163 MED::TGeom2Size myGeom2Size;
165 typedef SharedPtr<TMEDMeshOnEntity> PMEDMeshOnEntity;
168 //---------------------------------------------------------------
169 struct TMEDFamily: virtual TFamilyImpl
171 typedef SharedPtr<TMEDFamily> PMEDFamily;
174 //---------------------------------------------------------------
175 struct TMEDGroup: virtual TGroupImpl
177 typedef SharedPtr<TMEDGroup> PMEDGroup;
180 //---------------------------------------------------------------
181 struct TMEDField: virtual TFieldImpl
183 typedef SharedPtr<TMEDField> PMEDField;
186 //---------------------------------------------------------------
187 struct TMEDValForTime: virtual TValForTimeImpl
189 typedef SharedPtr<TMEDValForTime> PMEDValForTime;
193 class VISU_MedConvertor: public VISU_Convertor_impl
196 VISU_MedConvertor(const VISU_MedConvertor&);
198 bool myIsEntitiesDone;
204 VISU_MedConvertor(const std::string& theFileName);
223 QFileInfo myFileInfo;
227 LoadMeshOnEntity(VISU::PMeshImpl theMesh,
228 VISU::PMeshOnEntityImpl theMeshOnEntity);
232 LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
233 VISU::PMeshOnEntityImpl theMeshOnEntity,
234 VISU::PFamilyImpl theFamily);
238 LoadMeshOnGroup(VISU::PMeshImpl theMesh,
239 const VISU::TFamilySet& theFamilySet);
243 LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
244 VISU::PMeshOnEntityImpl theMeshOnEntity,
245 VISU::PFieldImpl theField,
246 VISU::PValForTimeImpl theValForTime);
250 LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
251 VISU::PMeshOnEntityImpl theMeshOnEntity,
252 VISU::PFieldImpl theField,
253 VISU::PValForTimeImpl theValForTime);
256 LoadPoints(const MED::PWrapper& theMed,
257 const VISU::PMEDMesh theMesh);
260 LoadPointsOnFamily(const MED::PWrapper& theMed,
261 const VISU::PMEDMesh theMesh,
262 const VISU::PMEDFamily theFamily);
265 LoadCellsOnEntity(const MED::PWrapper& theMed,
266 const VISU::PMEDMesh theMesh,
267 const VISU::PMEDMeshOnEntity theMeshOnEntity);
270 LoadCellsOnFamily(const MED::PWrapper& theMed,
271 const VISU::PMEDMesh theMesh,
272 const VISU::PMEDMeshOnEntity theMeshOnEntity,
273 const VISU::PMEDFamily theFamily);
276 LoadValForTimeOnMesh(const MED::PWrapper& theMed,
277 VISU::PMEDMesh theMesh,
278 VISU::PMEDMeshOnEntity theMeshOnEntity,
279 VISU::PMEDField theField,
280 VISU::PMEDValForTime theValForTime);
283 LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
284 VISU::PMEDMesh theMesh,
285 VISU::PMEDMeshOnEntity theMeshOnEntity,
286 VISU::PMEDField theField,
287 VISU::PMEDValForTime theValForTime);