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 
23 
24 
25 class vtkDataSet;
27 class vtkEnSightReaderCellIdsType;
28 class vtkIdList;
30 
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent);
36 
37  //BTX
39  {
40  POINT = 0,
41  BAR2 = 1,
42  BAR3 = 2,
43  NSIDED = 3,
44  TRIA3 = 4,
45  TRIA6 = 5,
46  QUAD4 = 6,
47  QUAD8 = 7,
48  NFACED = 8,
49  TETRA4 = 9,
50  TETRA10 = 10,
51  PYRAMID5 = 11,
52  PYRAMID13 = 12,
53  HEXA8 = 13,
54  HEXA20 = 14,
55  PENTA6 = 15,
56  PENTA15 = 16,
57  NUMBER_OF_ELEMENT_TYPES = 17
58  };
59 
61  {
62  SCALAR_PER_NODE = 0,
63  VECTOR_PER_NODE = 1,
64  TENSOR_SYMM_PER_NODE = 2,
65  SCALAR_PER_ELEMENT = 3,
66  VECTOR_PER_ELEMENT = 4,
67  TENSOR_SYMM_PER_ELEMENT = 5,
68  SCALAR_PER_MEASURED_NODE = 6,
69  VECTOR_PER_MEASURED_NODE = 7,
70  COMPLEX_SCALAR_PER_NODE = 8,
71  COMPLEX_VECTOR_PER_NODE = 9,
72  COMPLEX_SCALAR_PER_ELEMENT = 10,
73  COMPLEX_VECTOR_PER_ELEMENT = 11
74  };
75 
77  {
78  COORDINATES = 0,
79  BLOCK = 1,
80  ELEMENT = 2
81  };
82  //ETX
83 
85 
87  vtkGetStringMacro(MeasuredFileName);
89 
91 
93  vtkGetStringMacro(MatchFileName);
95 
97 
105  vtkSetMacro(ParticleCoordinatesByIndex, int);
106  vtkGetMacro(ParticleCoordinatesByIndex, int);
107  vtkBooleanMacro(ParticleCoordinatesByIndex, int);
109 
110 protected:
112  ~vtkEnSightReader();
113 
114  virtual int RequestInformation(vtkInformation*,
117  virtual int RequestData(vtkInformation*,
120 
122 
123  vtkSetStringMacro(MeasuredFileName);
125 
127 
128  vtkSetStringMacro(MatchFileName);
130 
132 
134  int ReadCaseFile();
135  int ReadCaseFileGeometry(char* line);
136  int ReadCaseFileVariable(char* line);
137  int ReadCaseFileTime(char* line);
138  int ReadCaseFileFile(char* line);
140 
141  // set in UpdateInformation to value returned from ReadCaseFile
143 
145 
147  virtual int ReadGeometryFile(const char* fileName, int timeStep,
148  vtkMultiBlockDataSet *output) = 0;
150 
152 
154  virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep,
155  vtkMultiBlockDataSet *output) = 0;
157 
160  int ReadVariableFiles(vtkMultiBlockDataSet *output);
161 
163 
165  virtual int ReadScalarsPerNode(const char* fileName, const char* description,
166  int timeStep, vtkMultiBlockDataSet *output,
167  int measured = 0, int numberOfComponents = 1,
168  int component = 0) = 0;
170 
172 
174  virtual int ReadVectorsPerNode(const char* fileName, const char* description,
175  int timeStep, vtkMultiBlockDataSet *output,
176  int measured = 0) = 0;
178 
180 
182  virtual int ReadTensorsPerNode(const char* fileName, const char* description,
183  int timeStep, vtkMultiBlockDataSet *output) = 0;
185 
187 
189  virtual int ReadScalarsPerElement(const char* fileName, const char* description,
190  int timeStep, vtkMultiBlockDataSet *output,
191  int numberOfComponents = 1,
192  int component = 0) = 0;
194 
196 
198  virtual int ReadVectorsPerElement(const char* fileName, const char* description,
199  int timeStep, vtkMultiBlockDataSet *output) = 0;
201 
203 
205  virtual int ReadTensorsPerElement(const char* fileName, const char* description,
206  int timeStep, vtkMultiBlockDataSet *output) = 0;
208 
210 
212  virtual int CreateUnstructuredGridOutput(int partId,
213  char line[80],
214  const char* name,
215  vtkMultiBlockDataSet *output) = 0;
217 
219 
221  virtual int CreateStructuredGridOutput(int partId,
222  char line[80],
223  const char* name,
224  vtkMultiBlockDataSet *output) = 0;
226 
228  void AddVariableFileName(const char* fileName1, const char* fileName2 = NULL);
229 
231  void AddVariableDescription(const char* description);
232 
234  void AddVariableType();
235 
238  int GetElementType(const char* line);
239 
242  int GetSectionType(const char *line);
243 
245  void ReplaceWildcards(char* filename, int num);
246 
248  void RemoveLeadingBlanks(char *line);
249 
250  // Get the vtkIdList for the given output index and cell type.
251  vtkIdList* GetCellIds(int index, int cellType);
252 
254 
256  void AddToBlock(vtkMultiBlockDataSet* output,
257  unsigned int blockNo,
258  vtkDataSet* dataset);
260 
262 
264  vtkDataSet* GetDataSetFromBlock(vtkMultiBlockDataSet* output,
265  unsigned int blockNo);
267 
269 
270  void SetBlockName(vtkMultiBlockDataSet* output, unsigned int blockNo,
271  const char* name);
273 
275  char* MatchFileName; // may not actually be necessary to read this file
276 
277  // pointer to lists of vtkIdLists (cell ids per element type per part)
278  vtkEnSightReaderCellIdsType* CellIds;
279 
280  // part ids of unstructured outputs
282 
284 
285  // pointers to lists of filenames
286  char** VariableFileNames; // non-complex
288 
289  // array of time sets
292 
293  // array of file sets
296 
297  // collection of filename numbers per time set
300 
301  // collection of filename numbers per file set
304 
305  // collection of number of steps per file per file set
307 
308  // ids of the time and file sets
311 
316 
319 
321  vtkSetMacro(UseTimeSets, int);
322  vtkGetMacro(UseTimeSets, int);
323  vtkBooleanMacro(UseTimeSets, int);
324 
325  int UseFileSets;
326  vtkSetMacro(UseFileSets, int);
327  vtkGetMacro(UseFileSets, int);
328  vtkBooleanMacro(UseFileSets, int);
329 
331 
332  // global list of points for measured geometry
334 
337 
338  int CheckOutputConsistency();
339 
341 
343 
344 private:
345  vtkEnSightReader(const vtkEnSightReader&); // Not implemented.
346  void operator=(const vtkEnSightReader&); // Not implemented.
347 };
348 
349 #endif
vtkIdList * UnstructuredPartIds
vtkIdList * FileSetsWithFilenameNumbers
void AddVariableDescription(const char *description)
vtkIdList * ComplexVariableFileSetIds
maintain an unordered list of dataset objects
vtkIdListCollection * FileSetNumberOfSteps
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:58
void AddVariableType(int variableType)
vtkIdList * FileSets
vtkEnSightReaderCellIdsType * CellIds
vtkIdListCollection * TimeSetFileNameNumbers
vtkIdList * ComplexVariableTimeSetIds
vtkIdList * VariableFileSetIds
char ** ComplexVariableFileNames
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkIdListCollection * FileSetFileNameNumbers
list of point or cell ids
Definition: vtkIdList.h:34
vtkIdList * TimeSetsWithFilenameNumbers
int ReplaceWildcards(char *fileName, int timeSet, int fileSet)
superclass for EnSight file readers
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
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 VTK_IO_EXPORT
class to read any type of EnSight files
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)