Salome HOME
fa2f829102dc0b9c9c348c65b8229ad67f4d4d5e
[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() ;
24
25   virtual float GetMeshOnEntitySize(const std::string& theMeshName, 
26                                     const VISU::TEntity& theEntity,
27                                     const std::string& theFamilyName = "");
28
29   virtual float GetMeshOnGroupSize(const std::string& theMeshName, 
30                                    const std::string& theGroupName);
31
32   virtual float GetTimeStampSize(const std::string& theMeshName, 
33                                  const VISU::TEntity& theEntity,
34                                  const std::string& theFieldName,
35                                  int theStampsNum);
36
37   virtual float GetFieldOnMeshSize(const std::string& theMeshName, 
38                                    const VISU::TEntity& theEntity,
39                                    const std::string& theFieldName);
40
41   virtual const VISU::TField& GetField(const std::string& theMeshName, 
42                                        VISU::TEntity theEntity, 
43                                        const std::string& theFieldName);
44
45   virtual const VISU::TField::TValForTime& GetTimeStamp(const std::string& theMeshName, 
46                                                         const VISU::TEntity& theEntity,
47                                                         const std::string& theFieldName,
48                                                         int theStampsNum);
49
50 public:
51   VISU_Convertor_impl();
52
53   virtual ~VISU_Convertor_impl();
54
55   virtual VISU_Convertor* Build()  { return this;};
56
57   virtual TOutput* GetMeshOnEntity(const std::string& theMeshName, 
58                                    const VISU::TEntity& theEntity,
59                                    const std::string& theFamilyName = "");
60
61   virtual TOutput* GetMeshOnGroup(const std::string& theMeshName, 
62                                   const std::string& theGroupName);
63
64   virtual TOutput* GetTimeStampOnMesh(const std::string& theMeshName, 
65                                       const VISU::TEntity& theEntity,
66                                       const std::string& theFieldName,
67                                       int theStampsNum);
68
69 protected:
70   void FindMesh(const std::string& theMeshName, VISU::TMesh*& theMesh);
71
72   void FindMeshOnEntity(const std::string& theMeshName, VISU::TMesh*& theMesh,
73                         const VISU::TEntity& theEntity, VISU::TMeshOnEntity*& theMeshOnEntity,
74                         const std::string& theFamilyName, VISU::TFamily*& theFamily);
75
76   void FindMeshOnGroup(const std::string& theMeshName, VISU::TMesh*& theMesh,
77                        const std::string& theGroupName, VISU::TGroup*& theGroup);
78
79   void FindField(const std::string& theMeshName, VISU::TMesh*& theMesh,
80                  const VISU::TEntity& theEntity, 
81                  VISU::TMeshOnEntity*& theMeshOnEntity,
82                  VISU::TMeshOnEntity*& theVTKMeshOnEntity,
83                  const std::string& theFieldName, VISU::TField*& theField);
84
85   void FindTimeStamp(const std::string& theMeshName, VISU::TMesh*& theMesh,
86                      const VISU::TEntity& theEntity, 
87                      VISU::TMeshOnEntity*& theMeshOnEntity,
88                      VISU::TMeshOnEntity*& theVTKMeshOnEntity,
89                      const std::string& theFieldName, VISU::TField*& theField,
90                      int theStampsNum, VISU::TField::TValForTime*& theValForTime);
91
92 protected:
93   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
94                                const std::string& theFamilyName = "") = 0;
95
96   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
97                               const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet) = 0;
98
99   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
100                               VISU::TMeshOnEntity& theMeshOnEntity, 
101                               VISU::TField& theField, 
102                               VISU::TField::TValForTime& theValForTime) = 0;
103 };
104
105 #endif