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:
113  ~vtkEnSightReader();
114 
115  virtual int RequestInformation(vtkInformation*,
118  virtual int RequestData(vtkInformation*,
121 
122  virtual void ClearForNewCaseFileName();
123 
125 
126  vtkSetStringMacro(MeasuredFileName);
128 
130 
131  vtkSetStringMacro(MatchFileName);
133 
135 
137  int ReadCaseFile();
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 
163  int ReadVariableFiles(vtkMultiBlockDataSet *output);
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 
234  void AddVariableDescription(const char* description);
235 
237  void AddVariableType();
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.
254  vtkIdList* GetCellIds(int index, int cellType);
255 
257 
259  void AddToBlock(vtkMultiBlockDataSet* output,
260  unsigned int blockNo,
261  vtkDataSet* dataset);
263 
265 
267  vtkDataSet* GetDataSetFromBlock(vtkMultiBlockDataSet* output,
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 
328  int UseFileSets;
329  vtkSetMacro(UseFileSets, int);
330  vtkGetMacro(UseFileSets, int);
331  vtkBooleanMacro(UseFileSets, int);
332 
334 
335  // global list of points for measured geometry
337 
340 
341  int CheckOutputConsistency();
342 
344 
346 
347 private:
348  vtkEnSightReader(const vtkEnSightReader&); // Not implemented.
349  void operator=(const vtkEnSightReader&); // Not implemented.
350 };
351 
352 #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:61
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:38
vtkIdListCollection * FileSetFileNameNumbers
list of point or cell ids
Definition: vtkIdList.h:35
vtkIdList * TimeSetsWithFilenameNumbers
int ReplaceWildcards(char *fileName, int timeSet, int fileSet)
superclass for EnSight file readers
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
CellTypeInDataSet cellType(vtkDataSet *input)
virtual void ClearForNewCaseFileName()
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 VTKIOENSIGHT_EXPORT
class to read any type of EnSight files
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)