1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // VISU OBJECT : interactive object for VISU entities implementation
23 // File : VISU_CorbaMedConvertor.hxx
24 // Author : Alexey PETROV
28 #ifndef VISU_CorbaMedConvertor_HeaderFile
29 #define VISU_CorbaMedConvertor_HeaderFile
31 #include "VISUConfig.hh"
32 #include "VISU_Convertor_impl.hxx"
33 #include "VISU_Structures_impl.hxx"
34 #include "VISU_PointCoords.hxx"
35 #include "VISU_MeshValue.hxx"
41 //---------------------------------------------------------------
42 typedef std::pair<int, int> TIndexAndSize; //
43 typedef std::map<SALOME_MED::medGeometryElement, TIndexAndSize> TCellsFirstIndex; // key: SALOME_MED::medGeometryElement
45 //---------------------------------------------------------------
46 struct TCMEDCoordHolder: TCoordHolder<SALOME_MED::double_array_var>
64 //---------------------------------------------------------------
65 template<class TValueType, class TContainerType>
66 struct TTCMEDMeshValue: TTMeshValueHolder<TValueType, TContainerType>
68 typedef TTMeshValueHolder<TValueType, TContainerType> TSuperClass;
69 vtkIdType myStartIndex;
71 //! To initilize the class instance
73 Init(vtkIdType theNbElem,
76 const TContainerType& theContainer,
77 vtkIdType theStartIndex)
79 TSuperClass::Init(theNbElem, theNbGauss, theNbComp, theContainer);
80 myStartIndex = theStartIndex;
87 return &(this->myContainer[myStartIndex]);
94 return &(this->myContainer[myStartIndex]);
99 //---------------------------------------------------------------
100 struct TCMesh: virtual TMeshImpl
102 SALOME_MED::MESH_var myMesh;
104 typedef MED::SharedPtr<TCMesh> PCMesh;
106 //---------------------------------------------------------------
107 struct TCSubProfile: virtual TSubProfileImpl
109 SALOME_MED::medGeometryElement myMGeom;
111 typedef SharedPtr<TCSubProfile> PCSubProfile;
113 //---------------------------------------------------------------
114 struct TCProfile: virtual TProfileImpl
116 typedef MED::SharedPtr<TCProfile> PCProfile;
118 //---------------------------------------------------------------
119 struct TCGauss: virtual TGaussImpl
122 typedef SharedPtr<TCGauss> PCGauss;
124 struct TCGaussSubMesh: virtual TGaussSubMeshImpl
127 typedef SharedPtr<TCGaussSubMesh> PCGaussSubMesh;
130 //---------------------------------------------------------------
131 struct TCGaussMesh: virtual TGaussMeshImpl
133 typedef SharedPtr<TCGaussMesh> PCGaussMesh;
136 //---------------------------------------------------------------
137 struct TCSubMesh: virtual TSubMeshImpl
139 typedef MED::SharedPtr<TCSubMesh> PCSubMesh;
142 //---------------------------------------------------------------
143 struct TCMeshOnEntity: virtual TMeshOnEntityImpl
145 SALOME_MED::SUPPORT_var mySupport;
146 TCellsFirstIndex myCellsFirstIndex;
148 typedef MED::SharedPtr<TCMeshOnEntity> PCMeshOnEntity;
151 //---------------------------------------------------------------
152 struct TCFamily: virtual TFamilyImpl
154 SALOME_MED::FAMILY_var myFamily;
156 typedef MED::SharedPtr<TCFamily> PCFamily;
159 //---------------------------------------------------------------
160 struct TCGroup: virtual TGroupImpl
162 SALOME_MED::GROUP_var myGroup;
164 typedef MED::SharedPtr<TCGroup> PCGroup;
167 //---------------------------------------------------------------
168 struct TCField: virtual TFieldImpl
170 typedef MED::SharedPtr<TCField> PCField;
173 //---------------------------------------------------------------
174 struct TCValForTime: virtual TValForTimeImpl
176 SALOME_MED::FIELD_var myField;
178 typedef MED::SharedPtr<TCValForTime> PCValForTime;
183 //---------------------------------------------------------------
184 class VISU_MEDConvertor: public VISU_Convertor_impl
187 SALOMEDS::SObject_var mySObject;
188 VISU_MEDConvertor() {};
191 VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject):
192 mySObject(SALOMEDS::SObject::_duplicate(theMedSObject))
202 Build(SALOME_MED::MED_ptr theMED);
205 Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator);
209 LoadMeshOnEntity(VISU::PMeshImpl theMesh,
210 VISU::PMeshOnEntityImpl theMeshOnEntity);
214 LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
215 VISU::PMeshOnEntityImpl theMeshOnEntity,
216 VISU::PFamilyImpl theFamily);
220 LoadMeshOnGroup(VISU::PMeshImpl theMesh,
221 const VISU::TFamilySet& theFamilySet);
225 LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
226 VISU::PMeshOnEntityImpl theMeshOnEntity,
227 VISU::PFieldImpl theField,
228 VISU::PValForTimeImpl theValForTime);
232 LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
233 VISU::PMeshOnEntityImpl theMeshOnEntity,
234 VISU::PFieldImpl theField,
235 VISU::PValForTimeImpl theValForTime)
241 LoadPoints(VISU::PCMesh theMesh) ;
244 LoadPointsOnFamily(VISU::PCMesh theMesh,
245 VISU::PCFamily theFamily) ;
248 LoadCellsOnEntity(VISU::PCMesh theMesh,
249 VISU::PCMeshOnEntity theMeshOnEntity);
252 LoadCellsOnFamily(VISU::PCMesh theMesh,
253 VISU::PCMeshOnEntity theMeshOnEntity,
254 VISU::PCFamily theFamily);
257 LoadField(VISU::PCMesh theMesh,
258 VISU::PCMeshOnEntity theMeshOnEntity,
259 VISU::PField theField,
260 VISU::PCValForTime theValForTime);
265 //---------------------------------------------------------------
266 class VISU_MEDFieldConvertor: public VISU_MEDConvertor
269 SALOME_MED::FIELD_var myField;
273 VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) :
274 myField(SALOME_MED::FIELD::_duplicate(theField))
283 VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) ;
284 VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) ;