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
vtkIdList * UnstructuredPartIds
vtkIdList * FileSetsWithFilenameNumbers
void AddVariableDescription(const char *description)
Add a variable description to the appropriate array.
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:62
void AddVariableType(int variableType)
Add a variable type to the appropriate array.
vtkIdList * FileSets
vtkEnSightReaderCellIdsType * CellIds
vtkIdListCollection * TimeSetFileNameNumbers
vtkIdList * ComplexVariableTimeSetIds
vtkIdList * VariableFileSetIds
char ** ComplexVariableFileNames
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkIdListCollection * FileSetFileNameNumbers
list of point or cell ids
Definition: vtkIdList.h:36
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkIdList * TimeSetsWithFilenameNumbers
int ReplaceWildcards(char *fileName, int timeSet, int fileSet)
Replace the wildcards in the geometry file name with appropriate filename numbers as specified in the...
superclass for EnSight file readers
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
CellTypeInDataSet cellType(vtkDataSet *input)
virtual void ClearForNewCaseFileName()
Clear data structures such that setting a new case file name works.
maintain an unordered list of dataarray objects
Composite dataset that organizes datasets into blocks.
vtkIdList * VariableTimeSetIds
Store zero or more vtkInformation instances.
vtkIdList * TimeSetIds
class to read any type of EnSight files
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.