Salome HOME
Roll-back previous integration
[modules/visu.git] / src / CONVERTOR / VISU_Convertor_impl.hxx
1 //  Copyright (C) 2003  CEA/DEN, EDF R&D
2 //
3 //
4 //
5 //  File   : VISU_Convertor_impl.hxx
6 //  Author : Alexey PETROV
7 //  Module : VISU
8
9 #ifndef VISU_Convertor_impl_HeaderFile
10 #define VISU_Convertor_impl_HeaderFile
11
12 #include "VISU_Convertor.hxx"
13
14 extern "C"{
15 #include <med.h>
16 }  
17
18 #include <qstring.h>
19 #include <qfileinfo.h>
20
21 class VISU_Convertor_impl: public VISU_Convertor{
22 public:
23   virtual float GetSize() throw (std::runtime_error&);
24
25   virtual float GetMeshOnEntitySize(const std::string& theMeshName, 
26                                     const VISU::TEntity& theEntity,
27                                     const std::string& theFamilyName = "")
28     throw (std::runtime_error&);
29
30   virtual float GetMeshOnGroupSize(const std::string& theMeshName, 
31                                    const std::string& theGroupName)
32     throw(std::runtime_error&);
33
34   virtual float GetTimeStampSize(const std::string& theMeshName, 
35                                  const VISU::TEntity& theEntity,
36                                  const std::string& theFieldName,
37                                  int theStampsNum)
38     throw(std::runtime_error&);
39
40   virtual float GetFieldOnMeshSize(const std::string& theMeshName, 
41                                    const VISU::TEntity& theEntity,
42                                    const std::string& theFieldName)
43     throw(std::runtime_error&);
44
45   virtual const VISU::TField& GetField(const std::string& theMeshName, 
46                                        VISU::TEntity theEntity, 
47                                        const std::string& theFieldName)
48     throw(std::runtime_error&);
49
50   virtual const VISU::TField::TValForTime& GetTimeStamp(const std::string& theMeshName, 
51                                                         const VISU::TEntity& theEntity,
52                                                         const std::string& theFieldName,
53                                                         int theStampsNum)
54     throw(std::runtime_error&);
55
56 public:
57   VISU_Convertor_impl();
58
59   virtual ~VISU_Convertor_impl();
60
61   virtual VISU_Convertor* Build() throw (std::runtime_error&) { return this;};
62
63   virtual TOutput* GetMeshOnEntity(const std::string& theMeshName, 
64                                    const VISU::TEntity& theEntity,
65                                    const std::string& theFamilyName = "")
66     throw(std::runtime_error&);
67
68   virtual TOutput* GetMeshOnGroup(const std::string& theMeshName, 
69                                   const std::string& theGroupName)
70     throw(std::runtime_error&);
71
72   virtual TOutput* GetTimeStampOnMesh(const std::string& theMeshName, 
73                                       const VISU::TEntity& theEntity,
74                                       const std::string& theFieldName,
75                                       int theStampsNum)
76     throw(std::runtime_error&);
77
78 protected:
79   void FindMesh(const std::string& theMeshName, VISU::TMesh*& theMesh)
80     throw(std::runtime_error&);
81
82   void FindMeshOnEntity(const std::string& theMeshName, VISU::TMesh*& theMesh,
83                         const VISU::TEntity& theEntity, VISU::TMeshOnEntity*& theMeshOnEntity,
84                         const std::string& theFamilyName, VISU::TFamily*& theFamily)
85     throw (std::runtime_error&);
86
87   void FindMeshOnGroup(const std::string& theMeshName, VISU::TMesh*& theMesh,
88                        const std::string& theGroupName, VISU::TGroup*& theGroup)
89     throw (std::runtime_error&);
90
91   void FindField(const std::string& theMeshName, VISU::TMesh*& theMesh,
92                  const VISU::TEntity& theEntity, 
93                  VISU::TMeshOnEntity*& theMeshOnEntity,
94                  VISU::TMeshOnEntity*& theVTKMeshOnEntity,
95                  const std::string& theFieldName, VISU::TField*& theField)
96     throw (std::runtime_error&);
97
98   void FindTimeStamp(const std::string& theMeshName, VISU::TMesh*& theMesh,
99                      const VISU::TEntity& theEntity, 
100                      VISU::TMeshOnEntity*& theMeshOnEntity,
101                      VISU::TMeshOnEntity*& theVTKMeshOnEntity,
102                      const std::string& theFieldName, VISU::TField*& theField,
103                      int theStampsNum, VISU::TField::TValForTime*& theValForTime)
104     throw (std::runtime_error&);
105
106 protected:
107   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
108                                const std::string& theFamilyName = "")
109     throw (std::runtime_error&) = 0;
110
111   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
112                               const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
113     throw (std::runtime_error&) = 0;
114
115   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
116                               VISU::TMeshOnEntity& theMeshOnEntity, 
117                               VISU::TField& theField, 
118                               VISU::TField::TValForTime& theValForTime)
119     throw (std::runtime_error&) = 0;
120 };
121
122 #endif