VTK
vtkEnSightGoldBinaryReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEnSightGoldBinaryReader.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 =========================================================================*/
42 #ifndef vtkEnSightGoldBinaryReader_h
43 #define vtkEnSightGoldBinaryReader_h
44 
45 #include "vtkIOEnSightModule.h" // For export macro
46 #include "vtkEnSightReader.h"
47 
48 
50 
52 {
53 public:
56  virtual void PrintSelf(ostream& os, vtkIndent indent);
57 
58 protected:
61 
62  // Returns 1 if successful. Sets file size as a side action.
63  int OpenFile(const char* filename);
64 
65 
66  // Returns 1 if successful. Handles constructing the filename, opening the file and checking
67  // if it's binary
68  int InitializeFile(const char* filename);
69 
71 
73  virtual int ReadGeometryFile(const char* fileName, int timeStep,
74  vtkMultiBlockDataSet *output);
76 
78 
80  virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep,
81  vtkMultiBlockDataSet *output);
83 
85 
88  virtual int ReadScalarsPerNode(const char* fileName, const char* description,
89  int timeStep, vtkMultiBlockDataSet *output,
90  int measured = 0,
91  int numberOfComponents = 1,
92  int component = 0);
94 
96 
98  virtual int ReadVectorsPerNode(const char* fileName, const char* description,
99  int timeStep, vtkMultiBlockDataSet *output,
100  int measured = 0);
102 
104 
106  virtual int ReadTensorsPerNode(const char* fileName, const char* description,
107  int timeStep, vtkMultiBlockDataSet *output);
109 
111 
114  virtual int ReadScalarsPerElement(const char* fileName, const char* description,
115  int timeStep, vtkMultiBlockDataSet *output,
116  int numberOfComponents = 1,
117  int component = 0);
119 
121 
123  virtual int ReadVectorsPerElement(const char* fileName, const char* description,
124  int timeStep, vtkMultiBlockDataSet *output);
126 
128 
130  virtual int ReadTensorsPerElement(const char* fileName, const char* description,
131  int timeStep, vtkMultiBlockDataSet *output);
133 
135 
138  virtual int CreateUnstructuredGridOutput(int partId,
139  char line[80],
140  const char* name,
141  vtkMultiBlockDataSet *output);
143 
145 
147  virtual int CreateStructuredGridOutput(int partId,
148  char line[256],
149  const char* name,
150  vtkMultiBlockDataSet *output);
152 
154 
156  int CreateRectilinearGridOutput(int partId, char line[256], const char* name,
157  vtkMultiBlockDataSet *output);
159 
161 
163  int CreateImageDataOutput(int partId, char line[80], const char* name,
164  vtkMultiBlockDataSet *output);
166 
169  int ReadLine(char result[80]);
170 
172 
174  int ReadInt(int *result);
175  int ReadPartId(int *result);
177 
180  int ReadIntArray(int *result, int numInts);
181 
184  int ReadLong(vtkTypeInt64 *result);
185 
188  int ReadFloatArray(float *result, int numFloats);
189 
194  int CountTimeSteps();
195 
197 
198  int SkipTimeStep();
199  int SkipStructuredGrid(char line[256]);
200  int SkipUnstructuredGrid(char line[256]);
201  int SkipRectilinearGrid(char line[256]);
202  int SkipImageData(char line[256]);
204 
207  int SeekToCachedTimeStep(const char* fileName, int realTimeStep);
208 
210  void AddTimeStepToCache(const char* fileName, int realTimeStep, vtkTypeInt64 address);
211 
213  void AddFileIndexToCache(const char* fileName);
214 
217  int Fortran;
218 
219  ifstream *IFile;
220  // The size of the file could be used to choose byte order.
222 
223  //BTX
224  class FileOffsetMapInternal;
225  FileOffsetMapInternal *FileOffsets;
226  //ETX
227 
228 private:
229  int SizeOfInt;
230  vtkEnSightGoldBinaryReader(const vtkEnSightGoldBinaryReader&); // Not implemented.
231  void operator=(const vtkEnSightGoldBinaryReader&); // Not implemented.
232 };
233 
234 #endif
virtual int CreateStructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
class to read binary EnSight Gold files
virtual int ReadVectorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0)=0
virtual int ReadMeasuredGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
virtual int ReadTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
int vtkIdType
Definition: vtkType.h:275
virtual int ReadGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
virtual int ReadTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual int ReadScalarsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int numberOfComponents=1, int component=0)=0
void PrintSelf(ostream &os, vtkIndent indent)
superclass for EnSight file readers
static vtkGenericEnSightReader * New()
Composite dataset that organizes datasets into blocks.
virtual int CreateUnstructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
virtual int ReadScalarsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0, int numberOfComponents=1, int component=0)=0
#define VTKIOENSIGHT_EXPORT
int ReadLine(char result[256])
virtual int ReadVectorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0