VTK  9.0.1
vtkEnSight6BinaryReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEnSight6BinaryReader.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 =========================================================================*/
38 #ifndef vtkEnSight6BinaryReader_h
39 #define vtkEnSight6BinaryReader_h
40 
41 #include "vtkEnSightReader.h"
42 #include "vtkIOEnSightModule.h" // For export macro
43 
45 class vtkIdTypeArray;
46 class vtkPoints;
47 
48 class VTKIOENSIGHT_EXPORT vtkEnSight6BinaryReader : public vtkEnSightReader
49 {
50 public:
51  static vtkEnSight6BinaryReader* New();
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
55 protected:
57  ~vtkEnSight6BinaryReader() override;
58 
59  // Returns 1 if successful. Sets file size as a side action.
60  int OpenFile(const char* filename);
61 
65  int ReadGeometryFile(const char* fileName, int timeStep, vtkMultiBlockDataSet* output) override;
66 
72  const char* fileName, int timeStep, vtkMultiBlockDataSet* output) override;
73 
79  int ReadScalarsPerNode(const char* fileName, const char* description, int timeStep,
80  vtkMultiBlockDataSet* output, int measured = 0, int numberOfComponents = 1,
81  int component = 0) override;
82 
87  int ReadVectorsPerNode(const char* fileName, const char* description, int timeStep,
88  vtkMultiBlockDataSet* output, int measured = 0) override;
89 
94  int ReadTensorsPerNode(const char* fileName, const char* description, int timeStep,
95  vtkMultiBlockDataSet* output) override;
96 
102  int ReadScalarsPerElement(const char* fileName, const char* description, int timeStep,
103  vtkMultiBlockDataSet* output, int numberOfComponents = 1, int component = 0) override;
104 
109  int ReadVectorsPerElement(const char* fileName, const char* description, int timeStep,
110  vtkMultiBlockDataSet* output) override;
111 
116  int ReadTensorsPerElement(const char* fileName, const char* description, int timeStep,
117  vtkMultiBlockDataSet* output) override;
118 
124  int partId, char line[256], const char* name, vtkMultiBlockDataSet* output) override;
125 
131  int partId, char line[256], const char* name, vtkMultiBlockDataSet* output) override;
132 
137  int ReadLine(char result[80]);
138 
144  int ReadIntNumber(int* result);
145 
150  int ReadIntArray(int* result, int numInts);
151 
156  int ReadFloatArray(float* result, int numFloats);
157 
159 
162  int SkipTimeStep();
163  int SkipStructuredGrid(char line[256]);
164  int SkipUnstructuredGrid(char line[256]);
166 
167  // global list of points for the unstructured parts of the model
170  vtkIdTypeArray* UnstructuredNodeIds; // matching of node ids to point ids
171 
173 
174  // The size of the file is used to choose byte order.
175  vtkTypeUInt64 FileSize;
176 
177  istream* BinaryIFile;
178 
179 private:
181  void operator=(const vtkEnSight6BinaryReader&) = delete;
182 };
183 
184 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkGenericEnSightReader::ReadLine
int ReadLine(char result[256])
Internal function to read in a line up to 256 characters.
vtkX3D::component
@ component
Definition: vtkX3D.h:181
vtkEnSight6BinaryReader::FileSize
vtkTypeUInt64 FileSize
Definition: vtkEnSight6BinaryReader.h:175
vtkEnSightReader
superclass for EnSight file readers
Definition: vtkEnSightReader.h:32
vtkEnSightReader.h
vtkEnSight6BinaryReader::ElementIdsListed
int ElementIdsListed
Definition: vtkEnSight6BinaryReader.h:172
vtkEnSightReader::ReadScalarsPerNode
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.
vtkEnSightReader::ReadScalarsPerElement
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.
vtkEnSight6BinaryReader
class to read binary EnSight6 files
Definition: vtkEnSight6BinaryReader.h:48
vtkEnSight6BinaryReader::UnstructuredPoints
vtkPoints * UnstructuredPoints
Definition: vtkEnSight6BinaryReader.h:169
vtkEnSight6BinaryReader::NumberOfUnstructuredPoints
int NumberOfUnstructuredPoints
Definition: vtkEnSight6BinaryReader.h:168
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:45
vtkEnSightReader::CreateUnstructuredGridOutput
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.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkEnSight6BinaryReader::UnstructuredNodeIds
vtkIdTypeArray * UnstructuredNodeIds
Definition: vtkEnSight6BinaryReader.h:170
vtkEnSightReader::ReadVectorsPerNode
virtual int ReadVectorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0)=0
Read vectors per node for this dataset.
vtkEnSightReader::ReadVectorsPerElement
virtual int ReadVectorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read vectors per element for this dataset.
vtkEnSightReader::ReadTensorsPerElement
virtual int ReadTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read tensors per element for this dataset.
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkEnSightReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkEnSightReader::CreateStructuredGridOutput
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.
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkEnSightReader::ReadMeasuredGeometryFile
virtual int ReadMeasuredGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
Read the measured geometry file.
vtkEnSightReader::ReadGeometryFile
virtual int ReadGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
Read the geometry file.
vtkX3D::description
@ description
Definition: vtkX3D.h:328
vtkGenericEnSightReader::New
static vtkGenericEnSightReader * New()
vtkEnSight6BinaryReader::BinaryIFile
istream * BinaryIFile
Definition: vtkEnSight6BinaryReader.h:177
vtkEnSightReader::ReadTensorsPerNode
virtual int ReadTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read tensors per node for this dataset.