3 // Copyright (C) 2003 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 // File : VISU_Convertor.hxx
24 // Author : Alexey PETROV
27 #ifndef VISU_Convertor_HeaderFile
28 #define VISU_Convertor_HeaderFile
31 \file VISU_Convertor.hxx
32 \brief The file represents definition of basic interface of the VISU CONVERTER package
35 #include "VISU_Structures.hxx"
38 //---------------------------------------------------------------
39 //! This class defines interface to read VTK interpretation of MED entities
41 It is the main class of the VISU CONVERTER package.
42 Following MED entities can be retrived from any MED file:
43 - mesh from corresponding MED ENTITIES;
47 The class produce its work in two main steps:
48 1. Perfrom parsing of MED file to get known what MED entities are pressent in it
49 2. Get VTK representation for any existing MED entity
50 Also, it can perform some additional work to calculate expected amount of memory to build defined VTK representation
52 class VISU_CONVERTOR_EXPORT VISU_Convertor
55 //! Get brief name of the corresponding source MED file
60 //! Let known whether the source MED file parsed or not
65 //! This method perform first parsing of MED file to get known what MED entities are pressent in it
70 //! This method perform first parsing of MED file to get known what MED mesh entities are pressent in it
75 //! This method perform first parsing of MED file to get known what MED fields are pressent in it
80 //! This min /max calculation over existing MED fields
85 //! This method perform first parsing of MED file to get known what MED groups are pressent in it
90 //! This method allow to get known what MED entities are present is the MED file
95 //! Get amount of memory to build VTK representations for all existing MED entities
100 //! Get mesh for corresponding MED ENTITY
103 GetMeshOnEntity(const std::string& theMeshName,
104 const VISU::TEntity& theEntity) = 0;
106 //! Get amount of memory to build mesh for corresponding MED ENTITY
109 GetMeshOnEntitySize(const std::string& theMeshName,
110 const VISU::TEntity& theEntity) = 0;
112 //! Get mesh for corresponding MED FAMILY
114 VISU::PUnstructuredGridIDMapper
115 GetFamilyOnEntity(const std::string& theMeshName,
116 const VISU::TEntity& theEntity,
117 const std::string& theFamilyName) = 0;
119 //! Get amount of memory to build mesh for corresponding MED FAMILY
122 GetFamilyOnEntitySize(const std::string& theMeshName,
123 const VISU::TEntity& theEntity,
124 const std::string& theFamilyName) = 0;
126 //! Get mesh for corresponding MED GROUP
128 VISU::PUnstructuredGridIDMapper
129 GetMeshOnGroup(const std::string& theMeshName,
130 const std::string& theGroupName) = 0;
132 //! Get amount of memory to build mesh for corresponding MED GROUP
135 GetMeshOnGroupSize(const std::string& theMeshName,
136 const std::string& theGroupName) = 0;
138 //! Get mesh with attached values for corresponding MED TIMESTAMP
140 VISU::PUnstructuredGridIDMapper
141 GetTimeStampOnMesh(const std::string& theMeshName,
142 const VISU::TEntity& theEntity,
143 const std::string& theFieldName,
144 int theTimeStampNumber) = 0;
146 //! Get Gauss Points mesh with attached values for corresponding MED TIMESTAMP
148 VISU::PGaussPtsIDMapper
149 GetTimeStampOnGaussPts(const std::string& theMeshName,
150 const VISU::TEntity& theEntity,
151 const std::string& theFieldName,
152 int theTimeStampNumber) = 0;
154 //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
157 GetTimeStampOnMeshSize(const std::string& theMeshName,
158 const VISU::TEntity& theEntity,
159 const std::string& theFieldName,
160 int theTimeStampNumber,
161 bool& theIsEstimated) = 0;
163 //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
166 GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
167 const VISU::TEntity& theEntity,
168 const std::string& theFieldName,
169 int theTimeStampNumber,
170 bool& theIsEstimated) = 0;
172 //! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD
175 GetFieldOnMeshSize(const std::string& theMeshName,
176 const VISU::TEntity& theEntity,
177 const std::string& theFieldName) = 0;
179 //! Find MED FIELD container
182 GetField(const std::string& theMeshName,
183 VISU::TEntity theEntity,
184 const std::string& theFieldName) = 0;
186 //! Find MED TIMESTAMP container
188 const VISU::PValForTime
189 GetTimeStamp(const std::string& theMeshName,
190 const VISU::TEntity& theEntity,
191 const std::string& theFieldName,
192 int theTimeStampNumber) = 0;
194 //! Allow to generate pretty name for MED TIMESTAMP
197 GenerateName(const VISU::TTime& aTime);
201 GenerateName(const std::string& theName, unsigned int theTimeId);
207 VISU::TMeshMap myMeshMap;
213 //! Instatiate proper VISU_Convertor subclass
214 VISU_CONVERTOR_EXPORT
216 CreateConvertor(const std::string& theFileName);