]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_Convertor_impl.hxx
Salome HOME
NRI : First integration.
[modules/visu.git] / src / VISU_I / VISU_Convertor_impl.hxx
1 // File:        VISU_Convertor_impl.hxx
2 // Created:     Fri Jan 10 11:36:46 2003
3 // Author:      Alexey PETROV
4 //              <apo@ivanox.nnov.matra-dtv.fr>
5
6
7 #ifndef VISU_Convertor_impl_HeaderFile
8 #define VISU_Convertor_impl_HeaderFile
9
10 #include "VISU_Convertor.hxx"
11
12 extern "C"{
13 #include <med.h>
14 }  
15
16 #include <qstring.h>
17 #include <qfileinfo.h>
18
19 #include <fstream>      
20 #include <strstream>    
21 using namespace std;
22
23 class VISU_Convertor_impl: public VISU_Convertor{
24  private:
25   string GetHead(const string& theMeshName) const throw (std::runtime_error&);
26   string GetPoints(const VISU::TMesh& theMesh) const throw (std::runtime_error&);
27   int GetCells(ostrstream& strCellsOut, ostrstream& strTypesOut,
28                const VISU::TMeshOnEntity& theMeshOnEntity, 
29                const string& theFamilyName = "") const throw (std::runtime_error&);
30   string GetField(const VISU::TField& theField, 
31                   const VISU::TField::TValForTime& theValForTime,
32                   int theDim, int theNbPoints, int theNbCells) const 
33                     throw (std::runtime_error&);
34  public:
35   VISU_Convertor_impl();
36   virtual ~VISU_Convertor_impl();
37   virtual VISU_Convertor* Build() throw (std::runtime_error&) { return this;};
38   virtual OutputType* GetMeshOnEntity(const string& theMeshName, 
39                                       const VISU::TEntity& theEntity,
40                                       const string& theFamilyName = "")
41     throw(std::runtime_error&);
42   virtual OutputType* GetMeshOnGroup(const string& theMeshName, 
43                                      const string& theGroupName)
44     throw(std::runtime_error&);
45   virtual OutputType* GetFieldOnMesh(const string& theMeshName, 
46                                      const VISU::TEntity& theEntity,
47                                      const string& theFieldName,
48                                      int theStampsNum)
49     throw(std::runtime_error&);
50
51  protected:
52   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
53                                const string& theFamilyName = "")
54     throw (std::runtime_error&) = 0;
55   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
56                               const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
57     throw (std::runtime_error&) = 0;
58   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
59                               VISU::TMeshOnEntity& theMeshOnEntity, 
60                               VISU::TField& theField, 
61                               VISU::TField::TValForTime& theValForTime)
62     throw (std::runtime_error&) = 0;
63 };
64
65 extern "C"{
66   int getNbMedConnect(int theMedType, int theMedEntity, int theMeshDim);
67   int getNbMedNodes(int theMedType);
68   int med2vtkCellType(int theMedType);
69   int vtk2medCellType(int theVtkType);
70   int getIdMedType(int medType);
71 }
72
73 struct Med2vtk {
74   med_geometrie_element medType;
75   const char *medName;
76   int medNbNodes;
77   int vtkType;
78   const char *vtkName;
79   int vtkNbNodes;
80 };
81 extern Med2vtk med2vtk[MED_NBR_GEOMETRIE_MAILLE];
82 #endif