1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : VISU_Convertor_impl.hxx
6 // Author : Alexey PETROV
9 #ifndef VISU_Convertor_impl_HeaderFile
10 #define VISU_Convertor_impl_HeaderFile
12 #include "VISU_Convertor.hxx"
19 #include <qfileinfo.h>
21 class VISU_Convertor_impl: public VISU_Convertor{
23 void GetPoints(VISU::TVTKSource& theStorage,
24 const VISU::TMesh& theMesh)
25 const throw (std::runtime_error&);
26 void GetCellsOnEntity(VISU::TVTKSource& theStorage,
27 const VISU::TMeshOnEntity& theMeshOnEntity,
28 const std::string& theFamilyName)
29 const throw (std::runtime_error&);
30 void GetCellsOnGroup(VISU::TVTKSource& theStorage,
31 const VISU::TMesh& theMesh,
32 const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
33 const throw (std::runtime_error&);
34 void GetField(VISU::TVTKSource& theStorage,
35 const VISU::TMesh& theMesh,
36 const VISU::TMeshOnEntity& theMeshOnEntity,
37 const VISU::TField& theField,
38 const VISU::TField::TValForTime& theValForTime)
39 const throw (std::runtime_error&);
43 void FindMesh(const std::string& theMeshName, VISU::TMesh*& theMesh)
44 throw(std::runtime_error&);
45 void FindMeshOnEntity(const std::string& theMeshName, VISU::TMesh*& theMesh,
46 const VISU::TEntity& theEntity, VISU::TMeshOnEntity*& theMeshOnEntity,
47 const std::string& theFamilyName, VISU::TFamily*& theFamily)
48 throw (std::runtime_error&);
50 void FindMeshOnGroup(const std::string& theMeshName, VISU::TMesh*& theMesh,
51 const std::string& theGroupName, VISU::TGroup*& theGroup)
52 throw (std::runtime_error&);
54 void FindField(const std::string& theMeshName, VISU::TMesh*& theMesh,
55 const VISU::TEntity& theEntity,
56 VISU::TMeshOnEntity*& theMeshOnEntity,
57 VISU::TMeshOnEntity*& theVTKMeshOnEntity,
58 const std::string& theFieldName, VISU::TField*& theField)
59 throw (std::runtime_error&);
60 void FindTimeStamp(const std::string& theMeshName, VISU::TMesh*& theMesh,
61 const VISU::TEntity& theEntity,
62 VISU::TMeshOnEntity*& theMeshOnEntity,
63 VISU::TMeshOnEntity*& theVTKMeshOnEntity,
64 const std::string& theFieldName, VISU::TField*& theField,
65 int theStampsNum, VISU::TField::TValForTime*& theValForTime)
66 throw (std::runtime_error&);
70 virtual vtkIdType GetMeshOnEntitySize(const std::string& theMeshName,
71 const VISU::TEntity& theEntity,
72 const std::string& theFamilyName = "")
73 throw (std::runtime_error&);
74 virtual vtkIdType GetMeshOnGroupSize(const std::string& theMeshName,
75 const std::string& theGroupName)
76 throw(std::runtime_error&);
77 virtual vtkIdType GetTimeStampSize(const std::string& theMeshName,
78 const VISU::TEntity& theEntity,
79 const std::string& theFieldName,
81 throw(std::runtime_error&);
82 virtual vtkIdType GetFieldOnMeshSize(const std::string& theMeshName,
83 const VISU::TEntity& theEntity,
84 const std::string& theFieldName)
85 throw(std::runtime_error&);
86 virtual const VISU::TField& GetField(const std::string& theMeshName,
87 VISU::TEntity theEntity,
88 const std::string& theFieldName)
89 throw(std::runtime_error&);
90 virtual const VISU::TField::TValForTime& GetTimeStamp(const std::string& theMeshName,
91 const VISU::TEntity& theEntity,
92 const std::string& theFieldName,
94 throw(std::runtime_error&);
97 VISU_Convertor_impl();
98 virtual ~VISU_Convertor_impl();
99 virtual VISU_Convertor* Build() throw (std::runtime_error&) { return this;};
100 virtual TOutput* GetMeshOnEntity(const std::string& theMeshName,
101 const VISU::TEntity& theEntity,
102 const std::string& theFamilyName = "")
103 throw(std::runtime_error&);
104 virtual TOutput* GetMeshOnGroup(const std::string& theMeshName,
105 const std::string& theGroupName)
106 throw(std::runtime_error&);
107 virtual TOutput* GetTimeStampOnMesh(const std::string& theMeshName,
108 const VISU::TEntity& theEntity,
109 const std::string& theFieldName,
111 throw(std::runtime_error&);
114 virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
115 const std::string& theFamilyName = "")
116 throw (std::runtime_error&) = 0;
117 virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
118 const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
119 throw (std::runtime_error&) = 0;
120 virtual int LoadFieldOnMesh(VISU::TMesh& theMesh,
121 VISU::TMeshOnEntity& theMeshOnEntity,
122 VISU::TField& theField,
123 VISU::TField::TValForTime& theValForTime)
124 throw (std::runtime_error&) = 0;
127 template<class T> std::string dtos(const std::string& fmt, T val){
128 static QString aString;
129 aString.sprintf(fmt.c_str(),val);
130 return aString.latin1();
134 int getNbMedConnect(int theMedType, int theMedEntity, int theMeshDim);
135 int getNbMedNodes(int theMedType);
136 int med2vtkCellType(int theMedType);
137 int vtk2medCellType(int theVtkType);
138 int getIdMedType(int medType);
142 med_geometrie_element medType;
149 extern Med2vtk med2vtk[MED_NBR_GEOMETRIE_MAILLE];