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 // SALOME VTKViewer : build VTK viewer into Salome desktop
28 #ifndef VISU_Convertor_impl_HeaderFile
29 #define VISU_Convertor_impl_HeaderFile
31 #include "VISU_Convertor.hxx"
32 #include "VISU_ConvertorDef_impl.hxx"
34 #include <boost/tuple/tuple.hpp>
37 //---------------------------------------------------------------
38 //! This class perfroms mapping of intermediate data strucutres into corresponding VTK representation
40 It implements VISU_Convertor public interface and declare new pure virtual functions
41 to fill its intermediate data structure from a MED source
43 class VISU_CONVERTOR_EXPORT VISU_Convertor_impl: public VISU_Convertor
46 VISU_Convertor_impl();
49 ~VISU_Convertor_impl();
51 //! Just to define default behaviour
56 //! Just to define default behaviour
61 //! Just to define default behaviour
66 //! Just to define default behaviour
71 //! Just to define default behaviour
76 //! Implemention of the VISU_Convertor::GetSize
81 //! Implemention of the VISU_Convertor::GetMeshOnEntity
84 GetMeshOnEntity(const std::string& theMeshName,
85 const VISU::TEntity& theEntity);
87 //! Implemention of the VISU_Convertor::GetMeshOnEntitySize
90 GetMeshOnEntitySize(const std::string& theMeshName,
91 const VISU::TEntity& theEntity);
93 //! Implemention of the VISU_Convertor::GetFamilyOnEntity
95 VISU::PUnstructuredGridIDMapper
96 GetFamilyOnEntity(const std::string& theMeshName,
97 const VISU::TEntity& theEntity,
98 const std::string& theFamilyName);
100 //! Implemention of the VISU_Convertor::GetFamilyOnEntitySize
103 GetFamilyOnEntitySize(const std::string& theMeshName,
104 const VISU::TEntity& theEntity,
105 const std::string& theFamilyName);
107 //! Implemention of the VISU_Convertor::GetMeshOnGroup
109 VISU::PUnstructuredGridIDMapper
110 GetMeshOnGroup(const std::string& theMeshName,
111 const std::string& theGroupName);
113 //! Implemention of the VISU_Convertor::GetMeshOnGroupSize
116 GetMeshOnGroupSize(const std::string& theMeshName,
117 const std::string& theGroupName);
119 //! Implemention of the VISU_Convertor::GetTimeStampOnMesh
121 VISU::PUnstructuredGridIDMapper
122 GetTimeStampOnMesh( const std::string& theMeshName,
123 const VISU::TEntity& theEntity,
124 const std::string& theFieldName,
125 int theTimeStampNumber );
127 //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
130 GetTimeStampOnMeshSize(const std::string& theMeshName,
131 const VISU::TEntity& theEntity,
132 const std::string& theFieldName,
133 int theTimeStampNumber,
134 bool& theIsEstimated);
136 //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
139 GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
140 const VISU::TEntity& theEntity,
141 const std::string& theFieldName,
142 int theTimeStampNumber,
143 bool& theIsEstimated);
145 //! Implemention of the VISU_Convertor::GetTimeStampOnGaussPts
147 VISU::PGaussPtsIDMapper
148 GetTimeStampOnGaussPts(const std::string& theMeshName,
149 const VISU::TEntity& theEntity,
150 const std::string& theFieldName,
151 int theTimeStampNumber);
153 //! Implemention of the VISU_Convertor::GetFieldOnMeshSize
156 GetFieldOnMeshSize(const std::string& theMeshName,
157 const VISU::TEntity& theEntity,
158 const std::string& theFieldName);
160 //! Implemention of the VISU_Convertor::GetField
163 GetField(const std::string& theMeshName,
164 VISU::TEntity theEntity,
165 const std::string& theFieldName);
167 //! Implemention of the VISU_Convertor::GetTimeStamp
169 const VISU::PValForTime
170 GetTimeStamp(const std::string& theMeshName,
171 const VISU::TEntity& theEntity,
172 const std::string& theFieldName,
176 //! An utility method to find TMesh by its name
178 FindMesh(const std::string& theMeshName);
180 //! An utility method to find TMeshOnEntity by name of its parent mesh and entity
181 typedef boost::tuple<VISU::PMeshImpl,
182 VISU::PMeshOnEntityImpl> TFindMeshOnEntity;
184 FindMeshOnEntity(const std::string& theMeshName,
185 const VISU::TEntity& theEntity);
187 //! An utility method to find TFamily by name of its parent mesh, corresponding entity and its name
188 typedef boost::tuple<VISU::PMeshImpl,
189 VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity;
191 FindFamilyOnEntity(const std::string& theMeshName,
192 const VISU::TEntity& theEntity,
193 const std::string& theFamilyName);
195 //! An utility method to find Group by name of its parent mesh and its name
196 typedef boost::tuple<VISU::PMeshImpl,
197 VISU::PGroupImpl> TFindMeshOnGroup;
199 FindMeshOnGroup(const std::string& theMeshName,
200 const std::string& theGroupName);
202 //! An utility method to find TField by name of its parent mesh, corresponding entity and its name
203 typedef boost::tuple<VISU::PMeshImpl,
204 VISU::PMeshOnEntityImpl,
205 VISU::PMeshOnEntityImpl,
206 VISU::PFieldImpl> TFindField;
208 FindField( const std::string& theMeshName,
209 const VISU::TEntity& theEntity,
210 const std::string& theFieldName );
212 //! An utility method to find TTimeStamp by name of its parent mesh, corresponding entity, field name and its number
213 typedef boost::tuple<VISU::PMeshImpl,
214 VISU::PMeshOnEntityImpl,
215 VISU::PMeshOnEntityImpl,
217 VISU::PValForTimeImpl> TFindTimeStamp;
219 FindTimeStamp(const std::string& theMeshName,
220 const VISU::TEntity& theEntity,
221 const std::string& theFieldName,
225 GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh,
226 const VISU::PMeshOnEntityImpl& theMeshOnEntity,
227 const VISU::PFieldImpl& theField,
228 const VISU::PValForTimeImpl& theValForTime,
229 const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
230 const VISU::PProfileImpl& theProfile,
231 const VISU::TEntity& theEntity );
234 //! Implemention of the VISU_Convertor::GetTimeStampSize
237 GetTimeStampSize(const std::string& theMeshName,
238 const VISU::TEntity& theEntity,
239 const std::string& theFieldName,
242 //! To fill intermeiate representation of TMeshOnEntity from a MED source
245 LoadMeshOnEntity(VISU::PMeshImpl theMesh,
246 VISU::PMeshOnEntityImpl theMeshOnEntity) = 0;
248 //! To fill intermeiate representation of TFamily from a MED source
251 LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
252 VISU::PMeshOnEntityImpl theMeshOnEntity,
253 VISU::PFamilyImpl theFamily) = 0;
255 //! To fill intermeiate representation of TGroup from a MED source
258 LoadMeshOnGroup(VISU::PMeshImpl theMesh,
259 const VISU::TFamilySet& theFamilySet) = 0;
261 //! To fill intermeiate representation of TValForTime for ordinary mesh from a MED source
264 LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
265 VISU::PMeshOnEntityImpl theMeshOnEntity,
266 VISU::PFieldImpl theField,
267 VISU::PValForTimeImpl theValForTime) = 0;
269 //! To fill intermeiate representation of TValForTime for mesh on Gauss Points from a MED source
272 LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
273 VISU::PMeshOnEntityImpl theMeshOnEntity,
274 VISU::PFieldImpl theField,
275 VISU::PValForTimeImpl theValForTime) = 0;