VTK  9.1.0
vtkHDFReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkHDFReader.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=========================================================================*/
21#ifndef vtkHDFReader_h
22#define vtkHDFReader_h
23
24#include "vtkDataSetAlgorithm.h"
25#include "vtkIOHDFModule.h" // For export macro
26#include <vector> // For storing list of values
27
31class vtkDataSet;
34class vtkInformation;
35class vtkCommand;
36
47class VTKIOHDF_EXPORT vtkHDFReader : public vtkDataSetAlgorithm
48{
49public:
50 static vtkHDFReader* New();
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
55
61
69 virtual int CanReadFile(VTK_FILEPATH const char* name);
70
72
78
80
88
90
96
98
102 const char* GetPointArrayName(int index);
103 const char* GetCellArrayName(int index);
105
106protected:
108 ~vtkHDFReader() override;
109
114 constexpr static int GetNumberOfAttributeTypes() { return 3; }
115
119 int CanReadFileVersion(int major, int minor);
120
122
126 int Read(vtkInformation* outInfo, vtkImageData* data);
129
134 int Read(const std::vector<vtkIdType>& numberOfPoints,
135 const std::vector<vtkIdType>& numberOfCells,
136 const std::vector<vtkIdType>& numberOfConnectivityIds, int filePiece,
137 vtkUnstructuredGrid* pieceData);
142
147 vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
148
150
155 vtkInformationVector* outputVector) override;
157 vtkInformationVector* outputVector) override;
159 vtkInformationVector* outputVector) override;
161
166
167private:
168 vtkHDFReader(const vtkHDFReader&) = delete;
169 void operator=(const vtkHDFReader&) = delete;
170
171protected:
175 char* FileName;
176
181 vtkDataArraySelection* DataArraySelection[3];
182
189
192 int WholeExtent[6];
193 double Origin[3];
194 double Spacing[3];
196 class Implementation;
198};
199
200#endif
Abstract superclass for all arrays.
supports function callbacks
superclass for callback/observer methods
Definition: vtkCommand.h:394
Store on/off settings for data arrays for a vtkSource.
Superclass for algorithms that produce output of the same type as input.
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
Implementation for the vtkHDFReader.
VTKHDF format reader.
Definition: vtkHDFReader.h:48
int GetNumberOfPointArrays()
Get the number of point or cell arrays available in the input.
int GetNumberOfCellArrays()
const char * GetCellArrayName(int index)
virtual vtkDataArraySelection * GetFieldDataArraySelection()
vtkDataSet * GetOutputAsDataSet(int index)
virtual vtkDataArraySelection * GetCellDataArraySelection()
int CanReadFileVersion(int major, int minor)
Test if the reader can read a file with the given version number.
int Read(vtkInformation *outInfo, vtkImageData *data)
Reads the 'data' requested in 'outInfo' (through extents or pieces).
~vtkHDFReader() override
vtkSetFilePathMacro(FileName)
Get/Set the name of the input file.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called within ProcessRequest when a request asks for Information.
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Standard functions to specify the type, information and read the data from the file.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkHDFReader * New()
static constexpr int GetNumberOfAttributeTypes()
How many attribute types we have.
Definition: vtkHDFReader.h:114
vtkGetFilePathMacro(FileName)
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
Modify this object when an array selection is changed.
const char * GetPointArrayName(int index)
Get the name of the point or cell array with the given index in the input.
char * FileName
The input file's name.
Definition: vtkHDFReader.h:175
int Read(const std::vector< vtkIdType > &numberOfPoints, const std::vector< vtkIdType > &numberOfCells, const std::vector< vtkIdType > &numberOfConnectivityIds, int filePiece, vtkUnstructuredGrid *pieceData)
Read 'pieceData' specified by 'filePiece' where number of points, cells and connectivity ids store th...
virtual vtkDataArraySelection * GetPointDataArraySelection()
Get the data array selection tables used to configure which data arrays are loaded by the reader.
vtkCallbackCommand * SelectionObserver
The observer to modify this object when the array selections are modified.
Definition: vtkHDFReader.h:187
virtual int CanReadFile(VTK_FILEPATH const char *name)
Test whether the file (type) with the given name can be read by this reader.
void PrintPieceInformation(vtkInformation *outInfo)
Print update number of pieces, piece number and ghost levels.
int Read(vtkInformation *outInfo, vtkUnstructuredGrid *data)
Implementation * Impl
Definition: vtkHDFReader.h:197
vtkDataSet * GetOutputAsDataSet()
Get the output as a vtkDataSet pointer.
int AddFieldArrays(vtkDataSet *data)
Read the field arrays from the file and add them to the dataset.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObject.h:82
dataset represents arbitrary combinations of all possible cell types
#define VTK_FILEPATH