Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/visu.git] / src / VISU_I / VISU_CorbaMedConvertor.hxx
1 // File:        VISU_CorbaMedConvertor.hxx
2 // Created:     Fri Jan 10 12:02:49 2003
3 // Author:      Alexey PETROV
4 //              <apo@ivanox.nnov.matra-dtv.fr>
5
6
7 #ifndef VISU_CorbaMedConvertor_HeaderFile
8 #define VISU_CorbaMedConvertor_HeaderFile
9
10 #include "VISUConfig.hh"
11 #include "VISU_Convertor_impl.hxx"
12
13 extern "C"{
14 #include <med.h>
15 }  
16
17
18 class VISU_MEDConvertor: public VISU_Convertor_impl{
19  protected:
20   /*
21   struct TFamily{
22     SALOME_MED::FAMILY_var myFamily;
23     int myId;
24     string myName;
25     VISU::TEntity myEntity;
26     TBindGroups myGroups;
27     TSubMesh mySubMesh;
28   };
29   typedef std::map<std::string,TFamily> TFamilyMap;
30
31   struct TField{
32     SALOME_MED::FIELD_var myField;
33     int myId;
34     string myName;
35     VISU::TEntity myEntity;
36     string myMeshName;
37     int myNbComp;
38     typedef std::pair<double,std::string> TTime;
39     struct TValForTime{
40       int myId;
41       TTime myTime;
42     };
43     typedef std::map<int,TValForTime> TValField;
44     TValField myValField;
45     void ShallowCopy(const TField& aField);
46   };
47   typedef map<string,TField> TFieldMap;
48
49   struct TMeshOnEntity{
50     SALOME_MED::SUPPORT_var mySupport;
51     string myMeshName;
52     VISU::TEntity myEntity;
53     TFamilyMap myFamilyMap;
54     TFieldMap myFieldMap;
55   };
56   typedef std::map<TEntity,TMeshOnEntity> TMeshOnEntityMap;
57   const TFamily* GetFamily(const VISU::TMeshOnEntity& theMeshOnEntity, 
58                      const string& theFamilyName)
59     throw(std::runtime_error&); 
60   TFamily* GetFamily(VISU::TMeshOnEntity& theMeshOnEntity, 
61                      const string& theFamilyName)
62     throw(std::runtime_error&); 
63
64   typedef std::pair<std::string,TEntity> TFamilyAndEntity;
65   typedef std::set<TFamilyAndEntity> TFamilyAndEntitySet;
66   struct TGroup{
67     TVTKReader myStorage;
68     string myName;
69     string myMeshName;
70     TFamilyAndEntitySet myFamilyAndEntitySet;
71   };
72   typedef std::map<std::string,TGroup> TGroupMap;
73
74   struct TMesh{
75     int myDim;
76     string myName;
77     typedef vector<float> TPointsCoord;
78     TPointsCoord myPointsCoord;
79     TMeshOnEntityMap myMeshOnEntityMap;
80     TGroupMap myGroupMap;
81     void CreateMeshOnNodes();
82     const TField* GetField(const string& theFieldName) const;
83   };
84   typedef std::map<std::string,TMesh> TMeshMap;
85   */
86   SALOMEDS::SObject_var mySObject;
87  public:
88   void SetMedField(SALOME_MED::FIELD_ptr theMedField);
89   virtual VISU_Convertor* Build() throw (std::runtime_error&);
90  protected:
91   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
92                                const string& theFamilyName = "")
93     throw (std::runtime_error&) {return 1;}
94   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
95                               const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
96     throw (std::runtime_error&) {return 1;}
97   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
98                               VISU::TMeshOnEntity& theMeshOnEntity, 
99                               VISU::TField& theField, 
100                               VISU::TField::TValForTime& theValForTime)
101     throw (std::runtime_error&) {return 1;}
102 };
103
104 class VISU_MedMeshConvertor: public VISU_Convertor_impl{
105 protected:
106   SALOME_MED::MESH_var myMedMesh;
107 public:
108   void SetMedMesh(SALOME_MED::MESH_ptr theMedMesh);
109   virtual VISU_Convertor* Build() throw (std::runtime_error&);
110  protected:
111   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
112                                const string& theFamilyName = "")
113     throw (std::runtime_error&) {return 1;}
114   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
115                               const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
116     throw (std::runtime_error&) {return 1;}
117   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
118                               VISU::TMeshOnEntity& theMeshOnEntity, 
119                               VISU::TField& theField, 
120                               VISU::TField::TValForTime& theValForTime)
121     throw (std::runtime_error&) {return 1;}
122 };
123
124 class VISU_CorbaMedConvertor: public VISU_MedMeshConvertor{
125 protected:
126   SALOME_MED::FIELD_var myMedField;
127 public:
128   void SetMedField(SALOME_MED::FIELD_ptr theMedField);
129   virtual VISU_Convertor* Build() throw (std::runtime_error&);
130 };
131
132 class VISU_CorbaMedSupportConvertor: public VISU_Convertor_impl{
133 protected:
134   SALOME_MED::SUPPORT_var mySupport;
135   SALOME_MED::MESH_var myMedMesh;
136 public:
137   void SetSupport(SALOME_MED::SUPPORT_ptr theSupport);
138   virtual VISU_Convertor* Build() throw (std::runtime_error&);
139  protected:
140   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
141                                const string& theFamilyName = "")
142     throw (std::runtime_error&) {return 1;}
143   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
144                               const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
145     throw (std::runtime_error&) {return 1;}
146   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
147                               VISU::TMeshOnEntity& theMeshOnEntity, 
148                               VISU::TField& theField, 
149                               VISU::TField::TValForTime& theValForTime)
150     throw (std::runtime_error&) {return 1;}
151 };
152
153 #endif