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
24 // File : VISU_Convertor.hxx
25 // Author : Alexey PETROV
28 #ifndef VISU_Convertor_HeaderFile
29 #define VISU_Convertor_HeaderFile
32 \file VISU_Convertor.hxx
33 \brief The file represents definition of basic interface of the VISU CONVERTER package
36 #include "VISU_Structures.hxx"
39 //---------------------------------------------------------------
40 //! This class defines interface to read VTK interpretation of MED entities
42 It is the main class of the VISU CONVERTER package.
43 Following MED entities can be retrived from any MED file:
44 - mesh from corresponding MED ENTITIES;
48 The class produce its work in two main steps:
49 1. Perfrom parsing of MED file to get known what MED entities are pressent in it
50 2. Get VTK representation for any existing MED entity
51 Also, it can perform some additional work to calculate expected amount of memory to build defined VTK representation
53 class VISU_CONVERTOR_EXPORT VISU_Convertor
56 //! Get brief name of the corresponding source MED file
61 //! Let known whether the source MED file parsed or not
66 //! This method perform first parsing of MED file to get known what MED entities are pressent in it
71 //! This method perform first parsing of MED file to get known what MED mesh entities are pressent in it
76 //! This method perform first parsing of MED file to get known what MED fields are pressent in it
81 //! This min /max calculation over existing MED fields
86 //! This method perform first parsing of MED file to get known what MED groups are pressent in it
91 //! This method allow to get known what MED entities are present is the MED file
96 //! Get amount of memory to build VTK representations for all existing MED entities
101 //! Get mesh for corresponding MED ENTITY
104 GetMeshOnEntity(const std::string& theMeshName,
105 const VISU::TEntity& theEntity) = 0;
107 //! Get amount of memory to build mesh for corresponding MED ENTITY
110 GetMeshOnEntitySize(const std::string& theMeshName,
111 const VISU::TEntity& theEntity) = 0;
113 //! Get mesh for corresponding MED FAMILY
115 VISU::PUnstructuredGridIDMapper
116 GetFamilyOnEntity(const std::string& theMeshName,
117 const VISU::TEntity& theEntity,
118 const std::string& theFamilyName) = 0;
120 //! Get amount of memory to build mesh for corresponding MED FAMILY
123 GetFamilyOnEntitySize(const std::string& theMeshName,
124 const VISU::TEntity& theEntity,
125 const std::string& theFamilyName) = 0;
127 //! Get mesh for corresponding MED GROUP
129 VISU::PUnstructuredGridIDMapper
130 GetMeshOnGroup(const std::string& theMeshName,
131 const std::string& theGroupName) = 0;
133 //! Get amount of memory to build mesh for corresponding MED GROUP
136 GetMeshOnGroupSize(const std::string& theMeshName,
137 const std::string& theGroupName) = 0;
139 //! Get mesh with attached values for corresponding MED TIMESTAMP
141 VISU::PUnstructuredGridIDMapper
142 GetTimeStampOnMesh(const std::string& theMeshName,
143 const VISU::TEntity& theEntity,
144 const std::string& theFieldName,
145 int theTimeStampNumber) = 0;
147 //! Get Gauss Points mesh with attached values for corresponding MED TIMESTAMP
149 VISU::PGaussPtsIDMapper
150 GetTimeStampOnGaussPts(const std::string& theMeshName,
151 const VISU::TEntity& theEntity,
152 const std::string& theFieldName,
153 int theTimeStampNumber) = 0;
155 //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
158 GetTimeStampOnMeshSize(const std::string& theMeshName,
159 const VISU::TEntity& theEntity,
160 const std::string& theFieldName,
161 int theTimeStampNumber,
162 bool& theIsEstimated) = 0;
164 //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
167 GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
168 const VISU::TEntity& theEntity,
169 const std::string& theFieldName,
170 int theTimeStampNumber,
171 bool& theIsEstimated) = 0;
173 //! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD
176 GetFieldOnMeshSize(const std::string& theMeshName,
177 const VISU::TEntity& theEntity,
178 const std::string& theFieldName) = 0;
180 //! Find MED FIELD container
183 GetField(const std::string& theMeshName,
184 VISU::TEntity theEntity,
185 const std::string& theFieldName) = 0;
187 //! Find MED TIMESTAMP container
189 const VISU::PValForTime
190 GetTimeStamp(const std::string& theMeshName,
191 const VISU::TEntity& theEntity,
192 const std::string& theFieldName,
193 int theTimeStampNumber) = 0;
195 //! Allow to generate pretty name for MED TIMESTAMP
198 GenerateName(const VISU::TTime& aTime);
202 GenerateName(const std::string& theName, unsigned int theTimeId);
208 VISU::TMeshMap myMeshMap;
214 //! Instatiate proper VISU_Convertor subclass
215 VISU_CONVERTOR_EXPORT
217 CreateConvertor(const std::string& theFileName);