VTK  9.3.20240327
vtkEnSight6BinaryReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
26 #ifndef vtkEnSight6BinaryReader_h
27 #define vtkEnSight6BinaryReader_h
28 
29 #include "vtkEnSightReader.h"
30 #include "vtkIOEnSightModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
34 class vtkIdTypeArray;
35 class vtkPoints;
36 
37 class VTKIOENSIGHT_EXPORT vtkEnSight6BinaryReader : public vtkEnSightReader
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44 protected:
47 
48  // Returns 1 if successful. Sets file size as a side action.
49  int OpenFile(const char* filename);
50 
54  int ReadGeometryFile(const char* fileName, int timeStep, vtkMultiBlockDataSet* output) override;
55 
61  const char* fileName, int timeStep, vtkMultiBlockDataSet* output) override;
62 
68  int ReadScalarsPerNode(const char* fileName, const char* description, int timeStep,
69  vtkMultiBlockDataSet* output, int measured = 0, int numberOfComponents = 1,
70  int component = 0) override;
71 
76  int ReadVectorsPerNode(const char* fileName, const char* description, int timeStep,
77  vtkMultiBlockDataSet* output, int measured = 0) override;
78 
82  int ReadAsymmetricTensorsPerNode(const char* fileName, const char* description, int timeStep,
83  vtkMultiBlockDataSet* output) override;
84 
89  int ReadTensorsPerNode(const char* fileName, const char* description, int timeStep,
90  vtkMultiBlockDataSet* output) override;
91 
97  int ReadScalarsPerElement(const char* fileName, const char* description, int timeStep,
98  vtkMultiBlockDataSet* output, int numberOfComponents = 1, int component = 0) override;
99 
104  int ReadVectorsPerElement(const char* fileName, const char* description, int timeStep,
105  vtkMultiBlockDataSet* output) override;
106 
110  int ReadAsymmetricTensorsPerElement(const char* fileName, const char* description, int timeStep,
111  vtkMultiBlockDataSet* output) override;
112 
117  int ReadTensorsPerElement(const char* fileName, const char* description, int timeStep,
118  vtkMultiBlockDataSet* output) override;
119 
125  int partId, char line[81], const char* name, vtkMultiBlockDataSet* output) override;
126 
132  int partId, char line[81], const char* name, vtkMultiBlockDataSet* output) override;
133 
138  int ReadLine(char result[81]);
139 
145  int ReadIntNumber(int* result);
146 
151  int ReadIntArray(int* result, int numInts);
152 
157  int ReadFloatArray(float* result, int numFloats);
158 
160 
164  int SkipStructuredGrid(char line[256]);
165  int SkipUnstructuredGrid(char line[256]);
167 
171  virtual void CleanUpCache();
172 
173  // global list of points for the unstructured parts of the model
176  vtkIdTypeArray* UnstructuredNodeIds; // matching of node ids to point ids
177 
179 
180  // The size of the file is used to choose byte order.
181  vtkTypeUInt64 FileSize;
182 
183  istream* BinaryIFile;
184 
185 private:
187  void operator=(const vtkEnSight6BinaryReader&) = delete;
188 };
189 
190 VTK_ABI_NAMESPACE_END
191 #endif
class to read binary EnSight6 files
int SkipStructuredGrid(char line[256])
Read to the next time step in the geometry file.
int ReadLine(char result[81])
Internal function to read in a line up to 80 characters.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ReadAsymmetricTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Not implemented, always return 0;.
int ReadTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Read tensors per element for this dataset.
int ReadFloatArray(float *result, int numFloats)
Internal function to read in a float array.
int ReadScalarsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0, int numberOfComponents=1, int component=0) override
Read scalars per node for this dataset.
~vtkEnSight6BinaryReader() override
virtual void CleanUpCache()
Clean up the internal cached data.
int ReadScalarsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int numberOfComponents=1, int component=0) override
Read scalars per element for this dataset.
int ReadGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output) override
Read the geometry file.
int ReadTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Read tensors per node for this dataset.
int ReadAsymmetricTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Not implemented, always return 0;.
int CreateUnstructuredGridOutput(int partId, char line[81], const char *name, vtkMultiBlockDataSet *output) override
Read an unstructured part (partId) from the geometry file and create a vtkUnstructuredGrid output.
int ReadVectorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0) override
Read vectors per node for this dataset.
int SkipUnstructuredGrid(char line[256])
Read to the next time step in the geometry file.
static vtkEnSight6BinaryReader * New()
int ReadIntArray(int *result, int numInts)
Internal function to read in an integer array.
int ReadMeasuredGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output) override
Read the measured geometry file.
int CreateStructuredGridOutput(int partId, char line[81], const char *name, vtkMultiBlockDataSet *output) override
Read a structured part from the geometry file and create a vtkStructuredGridOutput.
int ReadIntNumber(int *result)
Internal function to read in a single integer.
int SkipTimeStep()
Read to the next time step in the geometry file.
int OpenFile(const char *filename)
int ReadVectorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Read vectors per element for this dataset.
superclass for EnSight file readers
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:108
Composite dataset that organizes datasets into blocks.
represent and manipulate 3D points
Definition: vtkPoints.h:138
@ component
Definition: vtkX3D.h:175
@ description
Definition: vtkX3D.h:322
@ name
Definition: vtkX3D.h:219