1 // Copyright (C) 2007-2012 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 // SALOME VTKViewer : build VTK viewer into Salome desktop
29 #ifndef VISU_Convertor_impl_HeaderFile
30 #define VISU_Convertor_impl_HeaderFile
32 #include "VISU_Convertor.hxx"
33 #include "VISU_ConvertorDef_impl.hxx"
35 #include <boost/tuple/tuple.hpp>
38 //---------------------------------------------------------------
39 //! This class perfroms mapping of intermediate data strucutres into corresponding VTK representation
41 It implements VISU_Convertor public interface and declare new pure virtual functions
42 to fill its intermediate data structure from a MED source
44 class VISU_CONVERTOR_EXPORT VISU_Convertor_impl: public VISU_Convertor
47 VISU_Convertor_impl();
50 ~VISU_Convertor_impl();
52 //! Just to define default behaviour
57 //! Just to define default behaviour
62 //! Just to define default behaviour
67 //! Just to define default behaviour
72 //! Just to define default behaviour
77 //! Implemention of the VISU_Convertor::GetSize
82 //! Implemention of the VISU_Convertor::GetMeshOnEntity
85 GetMeshOnEntity(const std::string& theMeshName,
86 const VISU::TEntity& theEntity);
88 //! Implemention of the VISU_Convertor::GetMeshOnEntitySize
91 GetMeshOnEntitySize(const std::string& theMeshName,
92 const VISU::TEntity& theEntity);
94 //! Implemention of the VISU_Convertor::GetFamilyOnEntity
96 VISU::PUnstructuredGridIDMapper
97 GetFamilyOnEntity(const std::string& theMeshName,
98 const VISU::TEntity& theEntity,
99 const std::string& theFamilyName);
101 //! Implemention of the VISU_Convertor::GetFamilyOnEntitySize
104 GetFamilyOnEntitySize(const std::string& theMeshName,
105 const VISU::TEntity& theEntity,
106 const std::string& theFamilyName);
108 //! Implemention of the VISU_Convertor::GetMeshOnGroup
110 VISU::PUnstructuredGridIDMapper
111 GetMeshOnGroup(const std::string& theMeshName,
112 const std::string& theGroupName);
114 //! Implemention of the VISU_Convertor::GetMeshOnGroupSize
117 GetMeshOnGroupSize(const std::string& theMeshName,
118 const std::string& theGroupName);
120 //! Implemention of the VISU_Convertor::GetTimeStampOnMesh
122 VISU::PUnstructuredGridIDMapper
123 GetTimeStampOnMesh( const std::string& theMeshName,
124 const VISU::TEntity& theEntity,
125 const std::string& theFieldName,
126 int theTimeStampNumber );
128 //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
131 GetTimeStampOnMeshSize(const std::string& theMeshName,
132 const VISU::TEntity& theEntity,
133 const std::string& theFieldName,
134 int theTimeStampNumber,
135 bool& theIsEstimated);
137 //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
140 GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
141 const VISU::TEntity& theEntity,
142 const std::string& theFieldName,
143 int theTimeStampNumber,
144 bool& theIsEstimated);
146 //! Implemention of the VISU_Convertor::GetTimeStampOnGaussPts
148 VISU::PGaussPtsIDMapper
149 GetTimeStampOnGaussPts(const std::string& theMeshName,
150 const VISU::TEntity& theEntity,
151 const std::string& theFieldName,
152 int theTimeStampNumber);
154 //! Implemention of the VISU_Convertor::GetFieldOnMeshSize
157 GetFieldOnMeshSize(const std::string& theMeshName,
158 const VISU::TEntity& theEntity,
159 const std::string& theFieldName);
161 //! Implemention of the VISU_Convertor::GetField
164 GetField(const std::string& theMeshName,
165 VISU::TEntity theEntity,
166 const std::string& theFieldName);
168 //! Implemention of the VISU_Convertor::GetTimeStamp
170 const VISU::PValForTime
171 GetTimeStamp(const std::string& theMeshName,
172 const VISU::TEntity& theEntity,
173 const std::string& theFieldName,
177 //! An utility method to find TMesh by its name
179 FindMesh(const std::string& theMeshName);
181 //! An utility method to find TMeshOnEntity by name of its parent mesh and entity
182 typedef boost::tuple<VISU::PMeshImpl,
183 VISU::PMeshOnEntityImpl> TFindMeshOnEntity;
185 FindMeshOnEntity(const std::string& theMeshName,
186 const VISU::TEntity& theEntity);
188 //! An utility method to find TFamily by name of its parent mesh, corresponding entity and its name
189 typedef boost::tuple<VISU::PMeshImpl,
190 VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity;
192 FindFamilyOnEntity(const std::string& theMeshName,
193 const VISU::TEntity& theEntity,
194 const std::string& theFamilyName);
196 //! An utility method to find Group by name of its parent mesh and its name
197 typedef boost::tuple<VISU::PMeshImpl,
198 VISU::PGroupImpl> TFindMeshOnGroup;
200 FindMeshOnGroup(const std::string& theMeshName,
201 const std::string& theGroupName);
203 //! An utility method to find TField by name of its parent mesh, corresponding entity and its name
204 typedef boost::tuple<VISU::PMeshImpl,
205 VISU::PMeshOnEntityImpl,
206 VISU::PMeshOnEntityImpl,
207 VISU::PFieldImpl> TFindField;
209 FindField( const std::string& theMeshName,
210 const VISU::TEntity& theEntity,
211 const std::string& theFieldName );
213 //! An utility method to find TTimeStamp by name of its parent mesh, corresponding entity, field name and its number
214 typedef boost::tuple<VISU::PMeshImpl,
215 VISU::PMeshOnEntityImpl,
216 VISU::PMeshOnEntityImpl,
218 VISU::PValForTimeImpl> TFindTimeStamp;
220 FindTimeStamp(const std::string& theMeshName,
221 const VISU::TEntity& theEntity,
222 const std::string& theFieldName,
226 GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh,
227 const VISU::PMeshOnEntityImpl& theMeshOnEntity,
228 const VISU::PFieldImpl& theField,
229 const VISU::PValForTimeImpl& theValForTime,
230 const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
231 const VISU::PProfileImpl& theProfile,
232 const VISU::TEntity& theEntity );
235 //! Implemention of the VISU_Convertor::GetTimeStampSize
238 GetTimeStampSize(const std::string& theMeshName,
239 const VISU::TEntity& theEntity,
240 const std::string& theFieldName,
243 //! To fill intermeiate representation of TMeshOnEntity from a MED source
246 LoadMeshOnEntity(VISU::PMeshImpl theMesh,
247 VISU::PMeshOnEntityImpl theMeshOnEntity) = 0;
249 //! To fill intermeiate representation of TFamily from a MED source
252 LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
253 VISU::PMeshOnEntityImpl theMeshOnEntity,
254 VISU::PFamilyImpl theFamily) = 0;
256 //! To fill intermeiate representation of TGroup from a MED source
259 LoadMeshOnGroup(VISU::PMeshImpl theMesh,
260 const VISU::TFamilySet& theFamilySet) = 0;
262 //! To fill intermeiate representation of TValForTime for ordinary mesh from a MED source
265 LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
266 VISU::PMeshOnEntityImpl theMeshOnEntity,
267 VISU::PFieldImpl theField,
268 VISU::PValForTimeImpl theValForTime) = 0;
270 //! To fill intermeiate representation of TValForTime for mesh on Gauss Points from a MED source
273 LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
274 VISU::PMeshOnEntityImpl theMeshOnEntity,
275 VISU::PFieldImpl theField,
276 VISU::PValForTimeImpl theValForTime) = 0;