VTK
vtkEnSightReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEnSightReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
19 #ifndef __vtkEnSightReader_h
20 #define __vtkEnSightReader_h
21 
22 #include "vtkIOEnSightModule.h" // For export macro
24 
25 
26 class vtkDataSet;
28 class vtkEnSightReaderCellIdsType;
29 class vtkIdList;
31 
33 {
34 public:
36  void PrintSelf(ostream& os, vtkIndent indent);
37 
38  //BTX
40  {
41  POINT = 0,
42  BAR2 = 1,
43  BAR3 = 2,
44  NSIDED = 3,
45  TRIA3 = 4,
46  TRIA6 = 5,
47  QUAD4 = 6,
48  QUAD8 = 7,
49  NFACED = 8,
50  TETRA4 = 9,
51  TETRA10 = 10,
52  PYRAMID5 = 11,
53  PYRAMID13 = 12,
54  HEXA8 = 13,
55  HEXA20 = 14,
56  PENTA6 = 15,
57  PENTA15 = 16,
58  NUMBER_OF_ELEMENT_TYPES = 17
59  };
60 
62  {
63  SCALAR_PER_NODE = 0,
64  VECTOR_PER_NODE = 1,
65  TENSOR_SYMM_PER_NODE = 2,
66  SCALAR_PER_ELEMENT = 3,
67  VECTOR_PER_ELEMENT = 4,
68  TENSOR_SYMM_PER_ELEMENT = 5,
69  SCALAR_PER_MEASURED_NODE = 6,
70  VECTOR_PER_MEASURED_NODE = 7,
71  COMPLEX_SCALAR_PER_NODE = 8,
72  COMPLEX_VECTOR_PER_NODE = 9,
73  COMPLEX_SCALAR_PER_ELEMENT = 10,
74  COMPLEX_VECTOR_PER_ELEMENT = 11
75  };
76 
78  {
79  COORDINATES = 0,
80  BLOCK = 1,
81  ELEMENT = 2
82  };
83  //ETX
84 
86 
88  vtkGetStringMacro(MeasuredFileName);
90 
92 
94  vtkGetStringMacro(MatchFileName);
96 
98 
106  vtkSetMacro(ParticleCoordinatesByIndex, int);
107  vtkGetMacro(ParticleCoordinatesByIndex, int);
108  vtkBooleanMacro(ParticleCoordinatesByIndex, int);
110 
111 protected:
113  ~vtkEnSightReader();
114 
115  virtual int RequestInformation(vtkInformation*,
118  virtual int RequestData(vtkInformation*,
121 
123 
124  vtkSetStringMacro(MeasuredFileName);
126 
128 
129  vtkSetStringMacro(MatchFileName);
131 
133 
135  int ReadCaseFile();
136  int ReadCaseFileGeometry(char* line);
137  int ReadCaseFileVariable(char* line);
138  int ReadCaseFileTime(char* line);
139  int ReadCaseFileFile(char* line);
141 
142  // set in UpdateInformation to value returned from ReadCaseFile
144 
146 
148  virtual int ReadGeometryFile(const char* fileName, int timeStep,
149  vtkMultiBlockDataSet *output) = 0;
151 
153 
155  virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep,
156  vtkMultiBlockDataSet *output) = 0;
158 
161  int ReadVariableFiles(vtkMultiBlockDataSet *output);
162 
164 
166  virtual int ReadScalarsPerNode(const char* fileName, const char* description,
167  int timeStep, vtkMultiBlockDataSet *output,
168  int measured = 0, int numberOfComponents = 1,
169  int component = 0) = 0;
171 
173 
175  virtual int ReadVectorsPerNode(const char* fileName, const char* description,
176  int timeStep, vtkMultiBlockDataSet *output,
177  int measured = 0) = 0;
179 
181 
183  virtual int ReadTensorsPerNode(const char* fileName, const char* description,
184  int timeStep, vtkMultiBlockDataSet *output) = 0;
186 
188 
190  virtual int ReadScalarsPerElement(const char* fileName, const char* description,
191  int timeStep, vtkMultiBlockDataSet *output,
192  int numberOfComponents = 1,
193  int component = 0) = 0;
195 
197 
199  virtual int ReadVectorsPerElement(const char* fileName, const char* description,
200  int timeStep, vtkMultiBlockDataSet *output) = 0;
202 
204 
206  virtual int ReadTensorsPerElement(const char* fileName, const char* description,
207  int timeStep, vtkMultiBlockDataSet *output) = 0;
209 
211 
213  virtual int CreateUnstructuredGridOutput(int partId,
214  char line[80],
215  const char* name,
216  vtkMultiBlockDataSet *output) = 0;
218 
220 
222  virtual int CreateStructuredGridOutput(int partId,
223  char line[80],
224  const char* name,
225  vtkMultiBlockDataSet *output) = 0;
227 
229  void AddVariableFileName(const char* fileName1, const char* fileName2 = NULL);
230 
232  void AddVariableDescription(const char* description);
233 
235  void AddVariableType();
236 
239  int GetElementType(const char* line);
240 
243  int GetSectionType(const char *line);
244 
246  void ReplaceWildcards(char* filename, int num);
247 
249  void RemoveLeadingBlanks(char *line);
250 
251  // Get the vtkIdList for the given output index and cell type.
252  vtkIdList* GetCellIds(int index, int cellType);
253 
255 
257  void AddToBlock(vtkMultiBlockDataSet* output,
258  unsigned int blockNo,
259  vtkDataSet* dataset);
261 
263 
265  vtkDataSet* GetDataSetFromBlock(vtkMultiBlockDataSet* output,
266  unsigned int blockNo);
268 
270 
271  void SetBlockName(vtkMultiBlockDataSet* output, unsigned int blockNo,
272  const char* name);
274 
276  char* MatchFileName; // may not actually be necessary to read this file
277 
278  // pointer to lists of vtkIdLists (cell ids per element type per part)
279  vtkEnSightReaderCellIdsType* CellIds;
280 
281  // part ids of unstructured outputs
283 
285 
286  // pointers to lists of filenames
287  char** VariableFileNames; // non-complex
289 
290  // array of time sets
293 
294  // array of file sets
297 
298  // collection of filename numbers per time set
301 
302  // collection of filename numbers per file set
305 
306  // collection of number of steps per file per file set
308 
309  // ids of the time and file sets
312 
317 
320 
322  vtkSetMacro(UseTimeSets, int);
323  vtkGetMacro(UseTimeSets, int);
324  vtkBooleanMacro(UseTimeSets, int);
325 
326  int UseFileSets;
327  vtkSetMacro(UseFileSets, int);
328  vtkGetMacro(UseFileSets, int);
329  vtkBooleanMacro(UseFileSets, int);
330 
332 
333  // global list of points for measured geometry
335 
338 
339  int CheckOutputConsistency();
340 
342 
344 
345 private:
346  vtkEnSightReader(const vtkEnSightReader&); // Not implemented.
347  void operator=(const vtkEnSightReader&); // Not implemented.
348 };
349 
350 #endif
vtkIdList * UnstructuredPartIds
vtkIdList * FileSetsWithFilenameNumbers
void AddVariableDescription(const char *description)
vtkIdList * ComplexVariableFileSetIds
maintain an unordered list of dataset objects
vtkIdListCollection * FileSetNumberOfSteps
GLuint index
Definition: vtkgl.h:11983
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
void AddVariableType(int variableType)
vtkIdList * FileSets
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:94
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
GLuint GLuint num
Definition: vtkgl.h:16907
vtkEnSightReaderCellIdsType * CellIds
vtkIdListCollection * TimeSetFileNameNumbers
vtkIdList * ComplexVariableTimeSetIds
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkIdList * VariableFileSetIds
char ** ComplexVariableFileNames
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkIdListCollection * FileSetFileNameNumbers
list of point or cell ids
Definition: vtkIdList.h:35
vtkIdList * TimeSetsWithFilenameNumbers
int ReplaceWildcards(char *fileName, int timeSet, int fileSet)
superclass for EnSight file readers
#define vtkGetStringMacro(name)
Definition: vtkSetGet.h:120
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
CellTypeInDataSet cellType(vtkDataSet *input)
maintain an unordered list of dataarray objects
Composite dataset that organizes datasets into blocks.
vtkIdList * VariableTimeSetIds
Store zero or more vtkInformation instances.
vtkIdList * TimeSetIds
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
#define VTKIOENSIGHT_EXPORT
class to read any type of EnSight files
void PrintSelf(ostream &os, vtkIndent indent)
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)