VTK: IO/EnSight/vtkEnSight6BinaryReader.h Source File

| VTK 9.3.1

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
33 class vtkMultiBlockDataSet;
34 class vtkIdTypeArray;
35 class vtkPoints;
36
37 class VTKIOENSIGHT_EXPORT vtkEnSight6BinaryReader : public vtkEnSightReader
38 {
39 public:
40 static vtkEnSight6BinaryReader* New();
41 vtkTypeMacro(vtkEnSight6BinaryReader, vtkEnSightReader);
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
44 protected:
45 vtkEnSight6BinaryReader();
46 ~vtkEnSight6BinaryReader() override;
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
60 int ReadMeasuredGeometryFile(
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
124 int CreateUnstructuredGridOutput(
125 int partId, char line[81], const char* name, vtkMultiBlockDataSet* output) override;
126
131 int CreateStructuredGridOutput(
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
163 int SkipTimeStep();
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
174 int NumberOfUnstructuredPoints;
175 vtkPoints* UnstructuredPoints;
176 vtkIdTypeArray* UnstructuredNodeIds; // matching of node ids to point ids
177
178 int ElementIdsListed;
179
180 // The size of the file is used to choose byte order.
181 vtkTypeUInt64 FileSize;
182
183 istream* BinaryIFile;
184
185 private:
186 vtkEnSight6BinaryReader(const vtkEnSight6BinaryReader&) = delete;
187 void operator=(const vtkEnSight6BinaryReader&) = delete;
188 };
189
190 VTK_ABI_NAMESPACE_END
191 #endif
vtkEnSight6BinaryReader
class to read binary EnSight6 files
Definition: vtkEnSight6BinaryReader.h:38
vtkEnSight6BinaryReader::UnstructuredNodeIds
vtkIdTypeArray * UnstructuredNodeIds
Definition: vtkEnSight6BinaryReader.h:176
vtkEnSight6BinaryReader::ElementIdsListed
int ElementIdsListed
Definition: vtkEnSight6BinaryReader.h:178
vtkEnSight6BinaryReader::SkipStructuredGrid
int SkipStructuredGrid(char line[256])
Read to the next time step in the geometry file.
vtkEnSight6BinaryReader::ReadLine
int ReadLine(char result[81])
Internal function to read in a line up to 80 characters.
vtkEnSight6BinaryReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkEnSight6BinaryReader::ReadAsymmetricTensorsPerNode
int ReadAsymmetricTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Not implemented, always return 0;.
vtkEnSight6BinaryReader::ReadTensorsPerElement
int ReadTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Read tensors per element for this dataset.
vtkEnSight6BinaryReader::ReadFloatArray
int ReadFloatArray(float *result, int numFloats)
Internal function to read in a float array.
vtkEnSight6BinaryReader::ReadScalarsPerNode
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::~vtkEnSight6BinaryReader
~vtkEnSight6BinaryReader() override
vtkEnSight6BinaryReader::CleanUpCache
virtual void CleanUpCache()
Clean up the internal cached data.
vtkEnSight6BinaryReader::vtkEnSight6BinaryReader
vtkEnSight6BinaryReader()
vtkEnSight6BinaryReader::ReadScalarsPerElement
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.
vtkEnSight6BinaryReader::UnstructuredPoints
vtkPoints * UnstructuredPoints
Definition: vtkEnSight6BinaryReader.h:175
vtkEnSight6BinaryReader::NumberOfUnstructuredPoints
int NumberOfUnstructuredPoints
Definition: vtkEnSight6BinaryReader.h:174
vtkEnSight6BinaryReader::ReadGeometryFile
int ReadGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output) override
Read the geometry file.
vtkEnSight6BinaryReader::ReadTensorsPerNode
int ReadTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Read tensors per node for this dataset.
vtkEnSight6BinaryReader::ReadAsymmetricTensorsPerElement
int ReadAsymmetricTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Not implemented, always return 0;.
vtkEnSight6BinaryReader::FileSize
vtkTypeUInt64 FileSize
Definition: vtkEnSight6BinaryReader.h:181
vtkEnSight6BinaryReader::CreateUnstructuredGridOutput
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.
vtkEnSight6BinaryReader::ReadVectorsPerNode
int ReadVectorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0) override
Read vectors per node for this dataset.
vtkEnSight6BinaryReader::BinaryIFile
istream * BinaryIFile
Definition: vtkEnSight6BinaryReader.h:183
vtkEnSight6BinaryReader::SkipUnstructuredGrid
int SkipUnstructuredGrid(char line[256])
Read to the next time step in the geometry file.
vtkEnSight6BinaryReader::New
static vtkEnSight6BinaryReader * New()
vtkEnSight6BinaryReader::ReadIntArray
int ReadIntArray(int *result, int numInts)
Internal function to read in an integer array.
vtkEnSight6BinaryReader::ReadMeasuredGeometryFile
int ReadMeasuredGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output) override
Read the measured geometry file.
vtkEnSight6BinaryReader::CreateStructuredGridOutput
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.
vtkEnSight6BinaryReader::ReadIntNumber
int ReadIntNumber(int *result)
Internal function to read in a single integer.
vtkEnSight6BinaryReader::SkipTimeStep
int SkipTimeStep()
Read to the next time step in the geometry file.
vtkEnSight6BinaryReader::OpenFile
int OpenFile(const char *filename)
vtkEnSight6BinaryReader::ReadVectorsPerElement
int ReadVectorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output) override
Read vectors per element for this dataset.
vtkEnSightReader
superclass for EnSight file readers
Definition: vtkEnSightReader.h:22
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:50
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkX3D::component
@ component
Definition: vtkX3D.h:175
vtkX3D::description
@ description
Definition: vtkX3D.h:322
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkEnSightReader.h