1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : VISU_CorbaMedConvertor.hxx
6 // Author : Alexey PETROV
9 #ifndef VISU_CorbaMedConvertor_HeaderFile
10 #define VISU_CorbaMedConvertor_HeaderFile
12 #include "VISUConfig.hh"
13 #include "VISU_Convertor_impl.hxx"
20 class VISU_MEDConvertor: public VISU_Convertor_impl{
24 SALOME_MED::FAMILY_var myFamily;
27 VISU::TEntity myEntity;
31 typedef std::map<std::string,TFamily> TFamilyMap;
34 SALOME_MED::FIELD_var myField;
37 VISU::TEntity myEntity;
40 typedef std::pair<double,std::string> TTime;
45 typedef std::map<int,TValForTime> TValField;
47 void ShallowCopy(const TField& aField);
49 typedef map<string,TField> TFieldMap;
52 SALOME_MED::SUPPORT_var mySupport;
54 VISU::TEntity myEntity;
55 TFamilyMap myFamilyMap;
58 typedef std::map<TEntity,TMeshOnEntity> TMeshOnEntityMap;
59 const TFamily* GetFamily(const VISU::TMeshOnEntity& theMeshOnEntity,
60 const string& theFamilyName)
61 throw(std::runtime_error&);
62 TFamily* GetFamily(VISU::TMeshOnEntity& theMeshOnEntity,
63 const string& theFamilyName)
64 throw(std::runtime_error&);
66 typedef std::pair<std::string,TEntity> TFamilyAndEntity;
67 typedef std::set<TFamilyAndEntity> TFamilyAndEntitySet;
72 TFamilyAndEntitySet myFamilyAndEntitySet;
74 typedef std::map<std::string,TGroup> TGroupMap;
79 typedef vector<float> TPointsCoord;
80 TPointsCoord myPointsCoord;
81 TMeshOnEntityMap myMeshOnEntityMap;
83 void CreateMeshOnNodes();
84 const TField* GetField(const string& theFieldName) const;
86 typedef std::map<std::string,TMesh> TMeshMap;
88 SALOMEDS::SObject_var mySObject;
90 void SetMedField(SALOME_MED::FIELD_ptr theMedField);
91 virtual VISU_Convertor* Build() throw (std::runtime_error&);
93 virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
94 const string& theFamilyName = "")
95 throw (std::runtime_error&) {return 1;}
96 virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
97 const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
98 throw (std::runtime_error&) {return 1;}
99 virtual int LoadFieldOnMesh(VISU::TMesh& theMesh,
100 VISU::TMeshOnEntity& theMeshOnEntity,
101 VISU::TField& theField,
102 VISU::TField::TValForTime& theValForTime)
103 throw (std::runtime_error&) {return 1;}
106 class VISU_MedMeshConvertor: public VISU_Convertor_impl{
108 SALOME_MED::MESH_var myMedMesh;
110 void SetMedMesh(SALOME_MED::MESH_ptr theMedMesh);
111 virtual VISU_Convertor* Build() throw (std::runtime_error&);
113 virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
114 const string& theFamilyName = "")
115 throw (std::runtime_error&) {return 1;}
116 virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
117 const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
118 throw (std::runtime_error&) {return 1;}
119 virtual int LoadFieldOnMesh(VISU::TMesh& theMesh,
120 VISU::TMeshOnEntity& theMeshOnEntity,
121 VISU::TField& theField,
122 VISU::TField::TValForTime& theValForTime)
123 throw (std::runtime_error&) {return 1;}
126 class VISU_MEDConvertor: public VISU_Convertor_impl{
128 VISUMED::TMeshMap myMeshMap2;
129 SALOMEDS::SObject_var mySObject;
130 VISU_MEDConvertor() {};
132 VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject) : mySObject(SALOMEDS::SObject::_duplicate(theMedSObject)) {}
133 virtual VISU_Convertor* Build() throw (std::runtime_error&);
135 virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
136 const string& theFamilyName = "")
137 throw (std::runtime_error&) {return 1;}
138 virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
139 const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
140 throw (std::runtime_error&) {return 1;}
141 virtual int LoadFieldOnMesh(VISU::TMesh& theMesh,
142 VISU::TMeshOnEntity& theMeshOnEntity,
143 VISU::TField& theField,
144 VISU::TField::TValForTime& theValForTime)
145 throw (std::runtime_error&) {return 1;}
148 class VISU_MEDFieldConvertor: public VISU_MEDConvertor{
150 SALOME_MED::FIELD_var myField;
152 VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) : myField(SALOME_MED::FIELD::_duplicate(theField)) {}
153 virtual VISU_Convertor* Build() throw (std::runtime_error&);
157 VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) throw(std::runtime_error&);
158 VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) throw(std::runtime_error&);