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:
114 
121 
122  virtual void ClearForNewCaseFileName();
123 
125 
126  vtkSetStringMacro(MeasuredFileName);
128 
130 
131  vtkSetStringMacro(MatchFileName);
133 
135 
138  int ReadCaseFileGeometry(char* line);
139  int ReadCaseFileVariable(char* line);
140  int ReadCaseFileTime(char* line);
141  int ReadCaseFileFile(char* line);
143 
144  // set in UpdateInformation to value returned from ReadCaseFile
146 
148 
150  virtual int ReadGeometryFile(const char* fileName, int timeStep,
151  vtkMultiBlockDataSet *output) = 0;
153 
155 
157  virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep,
158  vtkMultiBlockDataSet *output) = 0;
160 
164 
166 
168  virtual int ReadScalarsPerNode(const char* fileName, const char* description,
169  int timeStep, vtkMultiBlockDataSet *output,
170  int measured = 0, int numberOfComponents = 1,
171  int component = 0) = 0;
173 
175 
177  virtual int ReadVectorsPerNode(const char* fileName, const char* description,
178  int timeStep, vtkMultiBlockDataSet *output,
179  int measured = 0) = 0;
181 
183 
185  virtual int ReadTensorsPerNode(const char* fileName, const char* description,
186  int timeStep, vtkMultiBlockDataSet *output) = 0;
188 
190 
192  virtual int ReadScalarsPerElement(const char* fileName, const char* description,
193  int timeStep, vtkMultiBlockDataSet *output,
194  int numberOfComponents = 1,
195  int component = 0) = 0;
197 
199 
201  virtual int ReadVectorsPerElement(const char* fileName, const char* description,
202  int timeStep, vtkMultiBlockDataSet *output) = 0;
204 
206 
208  virtual int ReadTensorsPerElement(const char* fileName, const char* description,
209  int timeStep, vtkMultiBlockDataSet *output) = 0;
211 
213 
215  virtual int CreateUnstructuredGridOutput(int partId,
216  char line[80],
217  const char* name,
218  vtkMultiBlockDataSet *output) = 0;
220 
222 
224  virtual int CreateStructuredGridOutput(int partId,
225  char line[80],
226  const char* name,
227  vtkMultiBlockDataSet *output) = 0;
229 
231  void AddVariableFileName(const char* fileName1, const char* fileName2 = NULL);
232 
235 
238 
241  int GetElementType(const char* line);
242 
245  int GetSectionType(const char *line);
246 
248  void ReplaceWildcards(char* filename, int num);
249 
251  void RemoveLeadingBlanks(char *line);
252 
253  // Get the vtkIdList for the given output index and cell type.
255 
257 
260  unsigned int blockNo,
261  vtkDataSet* dataset);
263 
265 
268  unsigned int blockNo);
270 
272 
273  void SetBlockName(vtkMultiBlockDataSet* output, unsigned int blockNo,
274  const char* name);
276 
278  char* MatchFileName; // may not actually be necessary to read this file
279 
280  // pointer to lists of vtkIdLists (cell ids per element type per part)
281  vtkEnSightReaderCellIdsType* CellIds;
282 
283  // part ids of unstructured outputs
285 
287 
288  // pointers to lists of filenames
289  char** VariableFileNames; // non-complex
291 
292  // array of time sets
295 
296  // array of file sets
299 
300  // collection of filename numbers per time set
303 
304  // collection of filename numbers per file set
307 
308  // collection of number of steps per file per file set
310 
311  // ids of the time and file sets
314 
319 
322 
324  vtkSetMacro(UseTimeSets, int);
325  vtkGetMacro(UseTimeSets, int);
326  vtkBooleanMacro(UseTimeSets, int);
327 
329  vtkSetMacro(UseFileSets, int);
330  vtkGetMacro(UseFileSets, int);
331  vtkBooleanMacro(UseFileSets, int);
332 
334 
335  // global list of points for measured geometry
337 
340 
342 
344 
346 
347 private:
348  vtkEnSightReader(const vtkEnSightReader&); // Not implemented.
349  void operator=(const vtkEnSightReader&); // Not implemented.
350 };
351 
352 #endif
vtkEnSightReader::NumberOfNewOutputs
int NumberOfNewOutputs
Definition: vtkEnSightReader.h:338
vtkEnSightReader::GeometryTimeValue
float GeometryTimeValue
Definition: vtkEnSightReader.h:320
vtkEnSightReader::UseFileSets
int UseFileSets
Definition: vtkEnSightReader.h:326
vtkEnSightReader::MatchFileName
char * MatchFileName
Definition: vtkEnSightReader.h:278
vtkEnSightReader::AddVariableFileName
void AddVariableFileName(const char *fileName1, const char *fileName2=NULL)
vtkEnSightReader::FileSetFileNameNumbers
vtkIdListCollection * FileSetFileNameNumbers
Definition: vtkEnSightReader.h:305
vtkGenericEnSightReader.h
vtkX3D::component
@ component
Definition: vtkX3D.h:175
VTKIOENSIGHT_EXPORT
#define VTKIOENSIGHT_EXPORT
Definition: vtkIOEnSightModule.h:15
vtkEnSightReader::SectionTypeList
SectionTypeList
Definition: vtkEnSightReader.h:78
vtkEnSightReader::VariableFileSetIds
vtkIdList * VariableFileSetIds
Definition: vtkEnSightReader.h:297
vtkEnSightReader
superclass for EnSight file readers
Definition: vtkEnSightReader.h:33
vtkEnSightReader::ComplexVariableFileNames
char ** ComplexVariableFileNames
Definition: vtkEnSightReader.h:290
vtkEnSightReader::ReadCaseFile
int ReadCaseFile()
vtkEnSightReader::NumberOfMeasuredPoints
int NumberOfMeasuredPoints
Definition: vtkEnSightReader.h:336
vtkEnSightReader::TimeSetsWithFilenameNumbers
vtkIdList * TimeSetsWithFilenameNumbers
Definition: vtkEnSightReader.h:302
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkEnSightReader::VariableTimeSetIds
vtkIdList * VariableTimeSetIds
Definition: vtkEnSightReader.h:293
vtkEnSightReader::ReadScalarsPerNode
virtual int ReadScalarsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0, int numberOfComponents=1, int component=0)=0
vtkEnSightReader::ReadScalarsPerElement
virtual int ReadScalarsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int numberOfComponents=1, int component=0)=0
vtkEnSightReader::ParticleCoordinatesByIndex
int ParticleCoordinatesByIndex
Definition: vtkEnSightReader.h:343
vtkEnSightReader::CaseFileRead
int CaseFileRead
Definition: vtkEnSightReader.h:145
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkEnSightReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkEnSightReader::ReadCaseFileTime
int ReadCaseFileTime(char *line)
vtkEnSightReader::ReadCaseFileGeometry
int ReadCaseFileGeometry(char *line)
vtkEnSightReader::VariableFileNames
char ** VariableFileNames
Definition: vtkEnSightReader.h:289
vtkEnSightReader::GetElementType
int GetElementType(const char *line)
vtkEnSightReader::InitialRead
int InitialRead
Definition: vtkEnSightReader.h:339
vtkEnSightReader::GeometryFileSet
int GeometryFileSet
Definition: vtkEnSightReader.h:316
vtkEnSightReader::vtkEnSightReader
vtkEnSightReader()
vtkEnSightReader::SetBlockName
void SetBlockName(vtkMultiBlockDataSet *output, unsigned int blockNo, const char *name)
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:51
vtkEnSightReader::RemoveLeadingBlanks
void RemoveLeadingBlanks(char *line)
vtkEnSightReader::MeasuredTimeValue
float MeasuredTimeValue
Definition: vtkEnSightReader.h:321
vtkEnSightReader::TimeSetIds
vtkIdList * TimeSetIds
Definition: vtkEnSightReader.h:312
vtkEnSightReader::ReadVariableFiles
int ReadVariableFiles(vtkMultiBlockDataSet *output)
vtkEnSightReader::GetSectionType
int GetSectionType(const char *line)
vtkEnSightReader::ReplaceWildcards
void ReplaceWildcards(char *filename, int num)
vtkEnSightReader::MeasuredFileName
char * MeasuredFileName
Definition: vtkEnSightReader.h:277
vtkEnSightReader::CreateUnstructuredGridOutput
virtual int CreateUnstructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
vtkEnSightReader::ComplexVariableFileSetIds
vtkIdList * ComplexVariableFileSetIds
Definition: vtkEnSightReader.h:298
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkIOEnSightModule.h
vtkEnSightReader::GetCellIds
vtkIdList * GetCellIds(int index, int cellType)
vtkEnSightReader::ReadCaseFileVariable
int ReadCaseFileVariable(char *line)
vtkEnSightReader::FileSetsWithFilenameNumbers
vtkIdList * FileSetsWithFilenameNumbers
Definition: vtkEnSightReader.h:306
vtkgl::num
GLuint GLuint num
Definition: vtkgl.h:16907
vtkEnSightReader::AddVariableType
void AddVariableType()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkGenericEnSightReader
class to read any type of EnSight files
Definition: vtkGenericEnSightReader.h:55
vtkEnSightReader::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkEnSightReader::UnstructuredPartIds
vtkIdList * UnstructuredPartIds
Definition: vtkEnSightReader.h:284
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkEnSightReader::ReadVectorsPerNode
virtual int ReadVectorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0)=0
vtkEnSightReader::ReadVectorsPerElement
virtual int ReadVectorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
vtkEnSightReader::ReadTensorsPerElement
virtual int ReadTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
vtkIdListCollection
maintain an unordered list of dataarray objects
Definition: vtkIdListCollection.h:31
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkDax::detail::cellType
CellTypeInDataSet cellType(vtkDataSet *input)
Definition: vtkDaxDetailCommon.h:36
vtkEnSightReader::FileSetNumberOfSteps
vtkIdListCollection * FileSetNumberOfSteps
Definition: vtkEnSightReader.h:309
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkEnSightReader::CreateStructuredGridOutput
virtual int CreateStructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkEnSightReader::VariableTypesList
VariableTypesList
Definition: vtkEnSightReader.h:62
vtkEnSightReader::AddToBlock
void AddToBlock(vtkMultiBlockDataSet *output, unsigned int blockNo, vtkDataSet *dataset)
vtkEnSightReader::ReadMeasuredGeometryFile
virtual int ReadMeasuredGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
vtkEnSightReader::ElementTypesList
ElementTypesList
Definition: vtkEnSightReader.h:40
vtkEnSightReader::ReadGeometryFile
virtual int ReadGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
vtkEnSightReader::AddVariableDescription
void AddVariableDescription(const char *description)
vtkX3D::description
@ description
Definition: vtkX3D.h:322
vtkEnSightReader::ActualTimeValue
double ActualTimeValue
Definition: vtkEnSightReader.h:345
vtkEnSightReader::MeasuredTimeSet
int MeasuredTimeSet
Definition: vtkEnSightReader.h:317
vtkEnSightReader::TimeSetFileNameNumbers
vtkIdListCollection * TimeSetFileNameNumbers
Definition: vtkEnSightReader.h:301
vtkEnSightReader::ReadCaseFileFile
int ReadCaseFileFile(char *line)
vtkEnSightReader::MeasuredFileSet
int MeasuredFileSet
Definition: vtkEnSightReader.h:318
vtkDataSetCollection
maintain an unordered list of dataset objects
Definition: vtkDataSetCollection.h:31
vtkEnSightReader::GeometryTimeSet
int GeometryTimeSet
Definition: vtkEnSightReader.h:315
vtkEnSightReader::CellIds
vtkEnSightReaderCellIdsType * CellIds
Definition: vtkEnSightReader.h:281
vtkEnSightReader::NumberOfGeometryParts
int NumberOfGeometryParts
Definition: vtkEnSightReader.h:331
vtkEnSightReader::FileSets
vtkIdList * FileSets
Definition: vtkEnSightReader.h:313
vtkEnSightReader::UseTimeSets
int UseTimeSets
Definition: vtkEnSightReader.h:323
vtkEnSightReader::ReadTensorsPerNode
virtual int ReadTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
vtkEnSightReader::ComplexVariableTimeSetIds
vtkIdList * ComplexVariableTimeSetIds
Definition: vtkEnSightReader.h:294
vtkEnSightReader::CheckOutputConsistency
int CheckOutputConsistency()
vtkEnSightReader::ClearForNewCaseFileName
virtual void ClearForNewCaseFileName()
vtkEnSightReader::VariableMode
int VariableMode
Definition: vtkEnSightReader.h:286
vtkEnSightReader::~vtkEnSightReader
~vtkEnSightReader()
vtkEnSightReader::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkEnSightReader::GetDataSetFromBlock
vtkDataSet * GetDataSetFromBlock(vtkMultiBlockDataSet *output, unsigned int blockNo)