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 
27 class vtkDataSet;
29 class vtkEnSightReaderCellIdsType;
30 class vtkIdList;
32 
33 class VTKIOENSIGHT_EXPORT vtkEnSightReader : public vtkGenericEnSightReader
34 {
35 public:
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 
118 protected:
120  ~vtkEnSightReader();
121 
122  virtual int RequestInformation(vtkInformation*,
125  virtual int RequestData(vtkInformation*,
128 
129  virtual void ClearForNewCaseFileName();
130 
132 
135  vtkSetStringMacro(MeasuredFileName);
137 
139 
142  vtkSetStringMacro(MatchFileName);
144 
146 
149  int ReadCaseFile();
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 
175  int ReadVariableFiles(vtkMultiBlockDataSet *output);
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 
250  void AddVariableDescription(const char* description);
251 
255  void AddVariableType();
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.
280  vtkIdList* GetCellIds(int index, int cellType);
281 
286  void AddToBlock(vtkMultiBlockDataSet* output,
287  unsigned int blockNo,
288  vtkDataSet* dataset);
289 
294  vtkDataSet* GetDataSetFromBlock(vtkMultiBlockDataSet* output,
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 
354  int UseFileSets;
355  vtkSetMacro(UseFileSets, int);
356  vtkGetMacro(UseFileSets, int);
357  vtkBooleanMacro(UseFileSets, int);
358 
360 
361  // global list of points for measured geometry
363 
366 
367  int CheckOutputConsistency();
368 
370 
372 
373 private:
374  vtkEnSightReader(const vtkEnSightReader&) VTK_DELETE_FUNCTION;
375  void operator=(const vtkEnSightReader&) VTK_DELETE_FUNCTION;
376 };
377 
378 #endif
vtkEnSightReader::NumberOfNewOutputs
int NumberOfNewOutputs
Definition: vtkEnSightReader.h:364
vtkEnSightReader::GeometryTimeValue
float GeometryTimeValue
Definition: vtkEnSightReader.h:346
vtkEnSightReader::UseFileSets
int UseFileSets
Definition: vtkEnSightReader.h:352
vtkGenericEnSightReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkEnSightReader::MatchFileName
char * MatchFileName
Definition: vtkEnSightReader.h:304
vtkEnSightReader::FileSetFileNameNumbers
vtkIdListCollection * FileSetFileNameNumbers
Definition: vtkEnSightReader.h:331
vtkGenericEnSightReader.h
vtkGenericEnSightReader::AddVariableType
void AddVariableType(int variableType)
Add a variable type to the appropriate array.
vtkX3D::component
Definition: vtkX3D.h:175
vtkEnSightReader::SectionTypeList
SectionTypeList
Definition: vtkEnSightReader.h:77
vtkEnSightReader::VariableFileSetIds
vtkIdList * VariableFileSetIds
Definition: vtkEnSightReader.h:323
vtkEnSightReader
superclass for EnSight file readers
Definition: vtkEnSightReader.h:33
vtkEnSightReader::ComplexVariableFileNames
char ** ComplexVariableFileNames
Definition: vtkEnSightReader.h:316
vtkEnSightReader::NumberOfMeasuredPoints
int NumberOfMeasuredPoints
Definition: vtkEnSightReader.h:362
vtkGenericEnSightReader::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkEnSightReader::TimeSetsWithFilenameNumbers
vtkIdList * TimeSetsWithFilenameNumbers
Definition: vtkEnSightReader.h:328
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkEnSightReader::VariableTimeSetIds
vtkIdList * VariableTimeSetIds
Definition: vtkEnSightReader.h:319
vtkEnSightReader::ParticleCoordinatesByIndex
int ParticleCoordinatesByIndex
Definition: vtkEnSightReader.h:369
vtkEnSightReader::CaseFileRead
int CaseFileRead
Definition: vtkEnSightReader.h:157
vtkEnSightReader::VariableFileNames
char ** VariableFileNames
Definition: vtkEnSightReader.h:315
vtkEnSightReader::InitialRead
int InitialRead
Definition: vtkEnSightReader.h:365
vtkEnSightReader::GeometryFileSet
int GeometryFileSet
Definition: vtkEnSightReader.h:342
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:51
vtkEnSightReader::MeasuredTimeValue
float MeasuredTimeValue
Definition: vtkEnSightReader.h:347
vtkEnSightReader::TimeSetIds
vtkIdList * TimeSetIds
Definition: vtkEnSightReader.h:338
vtkEnSightReader::MeasuredFileName
char * MeasuredFileName
Definition: vtkEnSightReader.h:303
vtkEnSightReader::ComplexVariableFileSetIds
vtkIdList * ComplexVariableFileSetIds
Definition: vtkEnSightReader.h:324
vtkEnSightReader::FileSetsWithFilenameNumbers
vtkIdList * FileSetsWithFilenameNumbers
Definition: vtkEnSightReader.h:332
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGenericEnSightReader
class to read any type of EnSight files
Definition: vtkGenericEnSightReader.h:51
vtkEnSightReader::UnstructuredPartIds
vtkIdList * UnstructuredPartIds
Definition: vtkEnSightReader.h:310
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkIdListCollection
maintain an unordered list of dataarray objects
Definition: vtkIdListCollection.h:34
vtkDax::detail::cellType
CellTypeInDataSet cellType(vtkDataSet *input)
Definition: vtkDaxDetailCommon.h:36
vtkEnSightReader::FileSetNumberOfSteps
vtkIdListCollection * FileSetNumberOfSteps
Definition: vtkEnSightReader.h:335
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkGenericEnSightReader::ClearForNewCaseFileName
virtual void ClearForNewCaseFileName()
Clear data structures such that setting a new case file name works.
vtkX3D::name
Definition: vtkX3D.h:219
vtkGenericEnSightReader::ReplaceWildcards
int ReplaceWildcards(char *fileName, int timeSet, int fileSet)
Replace the wildcards in the geometry file name with appropriate filename numbers as specified in the...
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkEnSightReader::VariableTypesList
VariableTypesList
Definition: vtkEnSightReader.h:61
vtkEnSightReader::ElementTypesList
ElementTypesList
Definition: vtkEnSightReader.h:39
vtkX3D::description
Definition: vtkX3D.h:322
vtkEnSightReader::ActualTimeValue
double ActualTimeValue
Definition: vtkEnSightReader.h:371
vtkEnSightReader::MeasuredTimeSet
int MeasuredTimeSet
Definition: vtkEnSightReader.h:343
vtkEnSightReader::TimeSetFileNameNumbers
vtkIdListCollection * TimeSetFileNameNumbers
Definition: vtkEnSightReader.h:327
vtkGenericEnSightReader::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkEnSightReader::MeasuredFileSet
int MeasuredFileSet
Definition: vtkEnSightReader.h:344
vtkDataSetCollection
maintain an unordered list of dataset objects
Definition: vtkDataSetCollection.h:31
vtkEnSightReader::GeometryTimeSet
int GeometryTimeSet
Definition: vtkEnSightReader.h:341
vtkEnSightReader::CellIds
vtkEnSightReaderCellIdsType * CellIds
Definition: vtkEnSightReader.h:307
vtkEnSightReader::NumberOfGeometryParts
int NumberOfGeometryParts
Definition: vtkEnSightReader.h:357
vtkEnSightReader::FileSets
vtkIdList * FileSets
Definition: vtkEnSightReader.h:339
vtkEnSightReader::UseTimeSets
int UseTimeSets
Definition: vtkEnSightReader.h:349
vtkEnSightReader::ComplexVariableTimeSetIds
vtkIdList * ComplexVariableTimeSetIds
Definition: vtkEnSightReader.h:320
vtkX3D::index
Definition: vtkX3D.h:246
vtkEnSightReader::VariableMode
int VariableMode
Definition: vtkEnSightReader.h:312
vtkGenericEnSightReader::AddVariableDescription
void AddVariableDescription(const char *description)
Add a variable description to the appropriate array.