1 // Copyright (C) 2007-2013 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
23 // VISU OBJECT : interactive object for VISU entities implementation
24 // File : VISU_CorbaMedConvertor.hxx
25 // Author : Alexey PETROV
29 #ifndef VISU_CorbaMedConvertor_HeaderFile
30 #define VISU_CorbaMedConvertor_HeaderFile
32 #include "VISUConfig.hh"
33 #include "VISU_Convertor_impl.hxx"
34 #include "VISU_Structures_impl.hxx"
35 #include "VISU_PointCoords.hxx"
36 #include "VISU_MeshValue.hxx"
42 //---------------------------------------------------------------
43 typedef std::pair<int, int> TIndexAndSize; //
44 typedef std::map<SALOME_MED::medGeometryElement, TIndexAndSize> TCellsFirstIndex; // key: SALOME_MED::medGeometryElement
46 //---------------------------------------------------------------
47 struct TCMEDCoordHolder: TCoordHolder<SALOME_TYPES::ListOfDouble_var>
65 //---------------------------------------------------------------
66 template<class TValueType, class TContainerType>
67 struct TTCMEDMeshValue: TTMeshValueHolder<TValueType, TContainerType>
69 typedef TTMeshValueHolder<TValueType, TContainerType> TSuperClass;
70 vtkIdType myStartIndex;
72 //! To initilize the class instance
74 Init(vtkIdType theNbElem,
77 const TContainerType& theContainer,
78 vtkIdType theStartIndex)
80 TSuperClass::Init(theNbElem, theNbGauss, theNbComp, theContainer);
81 myStartIndex = theStartIndex;
88 return &(this->myContainer[myStartIndex]);
95 return &(this->myContainer[myStartIndex]);
100 //---------------------------------------------------------------
101 struct TCMesh: virtual TMeshImpl
103 SALOME_MED::MESH_var myMesh;
105 typedef MED::SharedPtr<TCMesh> PCMesh;
107 //---------------------------------------------------------------
108 struct TCSubProfile: virtual TSubProfileImpl
110 SALOME_MED::medGeometryElement myMGeom;
112 typedef SharedPtr<TCSubProfile> PCSubProfile;
114 //---------------------------------------------------------------
115 struct TCProfile: virtual TProfileImpl
117 typedef MED::SharedPtr<TCProfile> PCProfile;
119 //---------------------------------------------------------------
120 struct TCGauss: virtual TGaussImpl
123 typedef SharedPtr<TCGauss> PCGauss;
125 struct TCGaussSubMesh: virtual TGaussSubMeshImpl
128 typedef SharedPtr<TCGaussSubMesh> PCGaussSubMesh;
131 //---------------------------------------------------------------
132 struct TCGaussMesh: virtual TGaussMeshImpl
134 typedef SharedPtr<TCGaussMesh> PCGaussMesh;
137 //---------------------------------------------------------------
138 struct TCSubMesh: virtual TSubMeshImpl
140 typedef MED::SharedPtr<TCSubMesh> PCSubMesh;
143 //---------------------------------------------------------------
144 struct TCMeshOnEntity: virtual TMeshOnEntityImpl
146 SALOME_MED::SUPPORT_var mySupport;
147 TCellsFirstIndex myCellsFirstIndex;
149 typedef MED::SharedPtr<TCMeshOnEntity> PCMeshOnEntity;
152 //---------------------------------------------------------------
153 struct TCFamily: virtual TFamilyImpl
155 SALOME_MED::FAMILY_var myFamily;
157 typedef MED::SharedPtr<TCFamily> PCFamily;
160 //---------------------------------------------------------------
161 struct TCGroup: virtual TGroupImpl
163 SALOME_MED::GROUP_var myGroup;
165 typedef MED::SharedPtr<TCGroup> PCGroup;
168 //---------------------------------------------------------------
169 struct TCField: virtual TFieldImpl
171 typedef MED::SharedPtr<TCField> PCField;
174 //---------------------------------------------------------------
175 struct TCValForTime: virtual TValForTimeImpl
177 SALOME_MED::FIELD_var myField;
179 typedef MED::SharedPtr<TCValForTime> PCValForTime;
184 //---------------------------------------------------------------
185 class VISU_MEDConvertor: public VISU_Convertor_impl
188 SALOMEDS::SObject_var mySObject;
189 VISU_MEDConvertor() {};
192 VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject):
193 mySObject(SALOMEDS::SObject::_duplicate(theMedSObject))
203 Build(SALOME_MED::MED_ptr theMED);
206 Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator);
210 LoadMeshOnEntity(VISU::PMeshImpl theMesh,
211 VISU::PMeshOnEntityImpl theMeshOnEntity);
215 LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
216 VISU::PMeshOnEntityImpl theMeshOnEntity,
217 VISU::PFamilyImpl theFamily);
221 LoadMeshOnGroup(VISU::PMeshImpl theMesh,
222 const VISU::TFamilySet& theFamilySet);
226 LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
227 VISU::PMeshOnEntityImpl theMeshOnEntity,
228 VISU::PFieldImpl theField,
229 VISU::PValForTimeImpl theValForTime);
233 LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
234 VISU::PMeshOnEntityImpl theMeshOnEntity,
235 VISU::PFieldImpl theField,
236 VISU::PValForTimeImpl theValForTime)
242 LoadPoints(VISU::PCMesh theMesh) ;
245 LoadPointsOnFamily(VISU::PCMesh theMesh,
246 VISU::PCFamily theFamily) ;
249 LoadCellsOnEntity(VISU::PCMesh theMesh,
250 VISU::PCMeshOnEntity theMeshOnEntity);
253 LoadCellsOnFamily(VISU::PCMesh theMesh,
254 VISU::PCMeshOnEntity theMeshOnEntity,
255 VISU::PCFamily theFamily);
258 LoadField(VISU::PCMesh theMesh,
259 VISU::PCMeshOnEntity theMeshOnEntity,
260 VISU::PField theField,
261 VISU::PCValForTime theValForTime);
266 //---------------------------------------------------------------
267 class VISU_MEDFieldConvertor: public VISU_MEDConvertor
270 SALOME_MED::FIELD_var myField;
274 VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) :
275 myField(SALOME_MED::FIELD::_duplicate(theField))
284 VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) ;
285 VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) ;