VTK  9.0.1
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 =========================================================================*/
40 #ifndef vtkEnSightGoldBinaryReader_h
41 #define vtkEnSightGoldBinaryReader_h
42 
43 #include "vtkEnSightReader.h"
44 #include "vtkIOEnSightModule.h" // For export macro
45 
47 
48 class VTKIOENSIGHT_EXPORT vtkEnSightGoldBinaryReader : public vtkEnSightReader
49 {
50 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
55 protected:
57  ~vtkEnSightGoldBinaryReader() override;
58 
59  // Returns 1 if successful. Sets file size as a side action.
60  int OpenFile(const char* filename);
61 
62  // Returns 1 if successful. Handles constructing the filename, opening the file and checking
63  // if it's binary
64  int InitializeFile(const char* filename);
65 
69  int ReadGeometryFile(const char* fileName, int timeStep, vtkMultiBlockDataSet* output) override;
70 
76  const char* fileName, int timeStep, vtkMultiBlockDataSet* output) override;
77 
83  int ReadScalarsPerNode(const char* fileName, const char* description, int timeStep,
84  vtkMultiBlockDataSet* output, int measured = 0, int numberOfComponents = 1,
85  int component = 0) override;
86 
91  int ReadVectorsPerNode(const char* fileName, const char* description, int timeStep,
92  vtkMultiBlockDataSet* output, int measured = 0) override;
93 
98  int ReadTensorsPerNode(const char* fileName, const char* description, int timeStep,
99  vtkMultiBlockDataSet* output) override;
100 
106  int ReadScalarsPerElement(const char* fileName, const char* description, int timeStep,
107  vtkMultiBlockDataSet* output, int numberOfComponents = 1, int component = 0) override;
108 
113  int ReadVectorsPerElement(const char* fileName, const char* description, int timeStep,
114  vtkMultiBlockDataSet* output) override;
115 
120  int ReadTensorsPerElement(const char* fileName, const char* description, int timeStep,
121  vtkMultiBlockDataSet* output) override;
122 
129  int partId, char line[80], const char* name, vtkMultiBlockDataSet* output) override;
130 
136  int partId, char line[256], const char* name, vtkMultiBlockDataSet* output) override;
137 
142  int CreateRectilinearGridOutput(
143  int partId, char line[256], const char* name, vtkMultiBlockDataSet* output);
144 
149  int CreateImageDataOutput(
150  int partId, char line[80], const char* name, vtkMultiBlockDataSet* output);
151 
156  int ReadLine(char result[80]);
157 
159 
163  int ReadInt(int* result);
164  int ReadPartId(int* result);
166 
171  int ReadIntArray(int* result, int numInts);
172 
177  int ReadLong(vtkTypeInt64* result);
178 
183  int ReadFloatArray(float* result, int numFloats);
184 
191  int CountTimeSteps();
192 
194 
197  int SkipTimeStep();
198  int SkipStructuredGrid(char line[256]);
199  int SkipUnstructuredGrid(char line[256]);
200  int SkipRectilinearGrid(char line[256]);
201  int SkipImageData(char line[256]);
203 
207  int SeekToCachedTimeStep(const char* fileName, int realTimeStep);
208 
212  void AddTimeStepToCache(const char* fileName, int realTimeStep, vtkTypeInt64 address);
213 
217  void AddFileIndexToCache(const char* fileName);
218 
221  int Fortran;
222 
223  istream* GoldIFile;
224  // The size of the file could be used to choose byte order.
225  vtkTypeUInt64 FileSize;
226 
227  class FileOffsetMapInternal;
228  FileOffsetMapInternal* FileOffsets;
229 
230 private:
231  int SizeOfInt;
233  void operator=(const vtkEnSightGoldBinaryReader&) = delete;
234 };
235 
236 #endif
virtual int CreateStructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
Read a structured part from the geometry file and create a vtkStructuredGridOutput.
class to read binary EnSight Gold files
virtual int ReadVectorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0)=0
Read vectors per node for this dataset.
virtual int ReadMeasuredGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
Read the measured geometry file.
virtual int ReadTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read tensors per element for this dataset.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int ReadGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
Read the geometry file.
virtual int ReadTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read tensors per node for this dataset.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual int ReadScalarsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int numberOfComponents=1, int component=0)=0
Read scalars per element for this dataset.
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
Read an unstructured part (partId) from the geometry file and create a vtkUnstructuredGrid output...
virtual int ReadScalarsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0, int numberOfComponents=1, int component=0)=0
Read scalars per node for this dataset.
int ReadLine(char result[256])
Internal function to read in a line up to 256 characters.
virtual int ReadVectorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read vectors per element for this dataset.