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=========================================================================*/
20#ifndef vtkEnSightReader_h
21#define vtkEnSightReader_h
22
23#include "vtkIOEnSightModule.h" // For export macro
25
26
27class vtkDataSet;
29class vtkEnSightReaderCellIdsType;
30class vtkIdList;
32
33class VTKIOENSIGHT_EXPORT vtkEnSightReader : public vtkGenericEnSightReader
34{
35public:
37 void PrintSelf(ostream& os, vtkIndent indent);
38
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
85
89 vtkGetStringMacro(MeasuredFileName);
91
93
97 vtkGetStringMacro(MatchFileName);
99
101
113 vtkSetMacro(ParticleCoordinatesByIndex, int);
114 vtkGetMacro(ParticleCoordinatesByIndex, int);
115 vtkBooleanMacro(ParticleCoordinatesByIndex, int);
117
118protected:
121
128
130
132
135 vtkSetStringMacro(MeasuredFileName);
137
139
142 vtkSetStringMacro(MatchFileName);
144
146
150 int ReadCaseFileGeometry(char* line);
151 int ReadCaseFileVariable(char* line);
152 int ReadCaseFileTime(char* line);
153 int ReadCaseFileFile(char* line);
155
156 // set in UpdateInformation to value returned from ReadCaseFile
158
162 virtual int ReadGeometryFile(const char* fileName, int timeStep,
163 vtkMultiBlockDataSet *output) = 0;
164
169 virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep,
170 vtkMultiBlockDataSet *output) = 0;
171
176
181 virtual int ReadScalarsPerNode(const char* fileName, const char* description,
182 int timeStep, vtkMultiBlockDataSet *output,
183 int measured = 0, int numberOfComponents = 1,
184 int component = 0) = 0;
185
190 virtual int ReadVectorsPerNode(const char* fileName, const char* description,
191 int timeStep, vtkMultiBlockDataSet *output,
192 int measured = 0) = 0;
193
198 virtual int ReadTensorsPerNode(const char* fileName, const char* description,
199 int timeStep, vtkMultiBlockDataSet *output) = 0;
200
205 virtual int ReadScalarsPerElement(const char* fileName, const char* description,
206 int timeStep, vtkMultiBlockDataSet *output,
207 int numberOfComponents = 1,
208 int component = 0) = 0;
209
214 virtual int ReadVectorsPerElement(const char* fileName, const char* description,
215 int timeStep, vtkMultiBlockDataSet *output) = 0;
216
221 virtual int ReadTensorsPerElement(const char* fileName, const char* description,
222 int timeStep, vtkMultiBlockDataSet *output) = 0;
223
228 virtual int CreateUnstructuredGridOutput(int partId,
229 char line[80],
230 const char* name,
231 vtkMultiBlockDataSet *output) = 0;
232
237 virtual int CreateStructuredGridOutput(int partId,
238 char line[80],
239 const char* name,
240 vtkMultiBlockDataSet *output) = 0;
241
245 void AddVariableFileName(const char* fileName1, const char* fileName2 = NULL);
246
251
256
261 int GetElementType(const char* line);
262
267 int GetSectionType(const char *line);
268
272 void ReplaceWildcards(char* filename, int num);
273
277 void RemoveLeadingBlanks(char *line);
278
279 // Get the vtkIdList for the given output index and cell type.
281
287 unsigned int blockNo,
288 vtkDataSet* dataset);
289
295 unsigned int blockNo);
296
300 void SetBlockName(vtkMultiBlockDataSet* output, unsigned int blockNo,
301 const char* name);
302
304 char* MatchFileName; // may not actually be necessary to read this file
305
306 // pointer to lists of vtkIdLists (cell ids per element type per part)
307 vtkEnSightReaderCellIdsType* CellIds;
308
309 // part ids of unstructured outputs
311
313
314 // pointers to lists of filenames
315 char** VariableFileNames; // non-complex
317
318 // array of time sets
321
322 // array of file sets
325
326 // collection of filename numbers per time set
329
330 // collection of filename numbers per file set
333
334 // collection of number of steps per file per file set
336
337 // ids of the time and file sets
340
345
348
350 vtkSetMacro(UseTimeSets, int);
351 vtkGetMacro(UseTimeSets, int);
352 vtkBooleanMacro(UseTimeSets, int);
353
355 vtkSetMacro(UseFileSets, int);
356 vtkGetMacro(UseFileSets, int);
357 vtkBooleanMacro(UseFileSets, int);
358
360
361 // global list of points for measured geometry
363
366
368
370
372
373private:
374 vtkEnSightReader(const vtkEnSightReader&) VTK_DELETE_FUNCTION;
375 void operator=(const vtkEnSightReader&) VTK_DELETE_FUNCTION;
376};
377
378#endif
maintain an unordered list of dataset objects
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
superclass for EnSight file readers
int GetSectionType(const char *line)
Determine the section type from a line read a file.
vtkIdList * ComplexVariableFileSetIds
virtual int ReadTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read tensors per element for this dataset.
vtkIdList * UnstructuredPartIds
virtual int ReadVectorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read vectors per element for this dataset.
vtkIdList * FileSets
vtkIdListCollection * FileSetFileNameNumbers
void ReplaceWildcards(char *filename, int num)
Replace the *'s in the filename with the given filename number.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void AddVariableFileName(const char *fileName1, const char *fileName2=NULL)
Add another file name to the list for a particular variable type.
void AddToBlock(vtkMultiBlockDataSet *output, unsigned int blockNo, vtkDataSet *dataset)
Convenience method use to convert the readers from VTK 5 multiblock API to the current composite data...
int GetElementType(const char *line)
Determine the element type from a line read a file.
virtual int CreateUnstructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
Read an unstructured part (partId) from the geometry file and create a vtkUnstructuredGrid output.
virtual int ReadVectorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0)=0
Read vectors per node for this dataset.
void SetBlockName(vtkMultiBlockDataSet *output, unsigned int blockNo, const char *name)
Set the name of a block.
void AddVariableType()
Record the variable type for the variable line just read.
vtkIdList * VariableTimeSetIds
vtkIdListCollection * FileSetNumberOfSteps
void AddVariableDescription(const char *description)
Add another description to the list for a particular variable type.
int ReadCaseFileTime(char *line)
vtkIdList * FileSetsWithFilenameNumbers
vtkDataSet * GetDataSetFromBlock(vtkMultiBlockDataSet *output, unsigned int blockNo)
Convenience method use to convert the readers from VTK 5 multiblock API to the current composite data...
vtkEnSightReaderCellIdsType * CellIds
virtual int ReadScalarsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int numberOfComponents=1, int component=0)=0
Read scalars per element for this dataset.
int ReadCaseFileVariable(char *line)
int CheckOutputConsistency()
virtual int CreateStructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
Read a structured part from the geometry file and create a vtkStructuredGridOutput.
vtkIdList * VariableFileSetIds
virtual void ClearForNewCaseFileName()
Clear data structures such that setting a new case file name works.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual int ReadMeasuredGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
Read the measured geometry file.
int ReadCaseFile()
Read the case file.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
char ** ComplexVariableFileNames
vtkIdList * ComplexVariableTimeSetIds
vtkIdList * TimeSetsWithFilenameNumbers
virtual int ReadScalarsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0, int numberOfComponents=1, int component=0)=0
Read scalars per node for this dataset.
vtkIdListCollection * TimeSetFileNameNumbers
int ReadCaseFileFile(char *line)
int ReadVariableFiles(vtkMultiBlockDataSet *output)
Read the variable files.
int ReadCaseFileGeometry(char *line)
vtkIdList * TimeSetIds
void RemoveLeadingBlanks(char *line)
Remove leading blank spaces from a string.
virtual int ReadGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
Read the geometry file.
vtkIdList * GetCellIds(int index, int cellType)
virtual int ReadTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read tensors per node for this dataset.
class to read any type of EnSight files
maintain an unordered list of dataarray objects
list of point or cell ids
Definition: vtkIdList.h:37
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
CellTypeInDataSet cellType(vtkDataSet *input)
@ component
Definition: vtkX3D.h:175
@ description
Definition: vtkX3D.h:322
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.