VTK  9.2.6
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 =========================================================================*/
33 #ifndef vtkHDFReader_h
34 #define vtkHDFReader_h
35 
36 #include "vtkDataObjectAlgorithm.h"
37 #include "vtkIOHDFModule.h" // For export macro
38 #include <vector> // For storing list of values
39 
40 class vtkAbstractArray;
41 class vtkCallbackCommand;
42 class vtkCommand;
44 class vtkDataSet;
46 class vtkImageData;
48 class vtkInformation;
49 class vtkOverlappingAMR;
51 
61 class VTKIOHDF_EXPORT vtkHDFReader : public vtkDataObjectAlgorithm
62 {
63 public:
64  static vtkHDFReader* New();
66  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
69 
75 
83  virtual int CanReadFile(VTK_FILEPATH const char* name);
84 
86 
92 
94 
102 
104 
110 
112 
116  const char* GetPointArrayName(int index);
117  const char* GetCellArrayName(int index);
119 
120  vtkSetMacro(MaximumLevelsToReadByDefaultForAMR, unsigned int);
121  vtkGetMacro(MaximumLevelsToReadByDefaultForAMR, unsigned int);
122 
123 protected:
125  ~vtkHDFReader() override;
126 
131  constexpr static int GetNumberOfAttributeTypes() { return 3; }
132 
136  int CanReadFileVersion(int major, int minor);
137 
139 
147 
152  int Read(const std::vector<vtkIdType>& numberOfPoints,
153  const std::vector<vtkIdType>& numberOfCells,
154  const std::vector<vtkIdType>& numberOfConnectivityIds, int filePiece,
155  vtkUnstructuredGrid* pieceData);
160 
165  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
166 
168 
173  vtkInformationVector* outputVector) override;
175  vtkInformationVector* outputVector) override;
176  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
177  vtkInformationVector* outputVector) override;
179 
184 
185 private:
186  vtkHDFReader(const vtkHDFReader&) = delete;
187  void operator=(const vtkHDFReader&) = delete;
188 
189 protected:
193  char* FileName;
194 
199  vtkDataArraySelection* DataArraySelection[3];
200 
207 
210  int WholeExtent[6];
211  double Origin[3];
212  double Spacing[3];
214 
215  unsigned int MaximumLevelsToReadByDefaultForAMR = 0;
216 
217  class Implementation;
219 };
220 
221 #endif
Abstract superclass for all arrays.
supports function callbacks
superclass for callback/observer methods
Definition: vtkCommand.h:395
Store on/off settings for data arrays, etc.
Superclass for algorithms that produce only data object as output.
general representation of visualization data
Definition: vtkDataObject.h:75
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
Definition: vtkDataSet.h:72
Implementation for the vtkHDFReader.
VTKHDF format reader.
Definition: vtkHDFReader.h:62
int GetNumberOfPointArrays()
Get the number of point or cell arrays available in the input.
int GetNumberOfCellArrays()
virtual vtkDataArraySelection * GetFieldDataArraySelection()
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
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
vtkDataSet * GetOutputAsDataSet(int index)
vtkGetFilePathMacro(FileName)
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
Modify this object when an array selection is changed.
int AddFieldArrays(vtkDataObject *data)
Read the field arrays from the file and add them to the dataset.
const char * GetCellArrayName(int index)
virtual vtkDataArraySelection * GetPointDataArraySelection()
Get the data array selection tables used to configure which data arrays are loaded by the reader.
char * FileName
The input file's name.
Definition: vtkHDFReader.h:193
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 * GetCellDataArraySelection()
vtkCallbackCommand * SelectionObserver
The observer to modify this object when the array selections are modified.
Definition: vtkHDFReader.h:205
vtkDataSet * GetOutputAsDataSet()
Get the output as a vtkDataSet pointer.
virtual int CanReadFile(VTK_FILEPATH const char *name)
Test whether the file (type) with the given name can be read by this reader.
int Read(vtkInformation *outInfo, vtkOverlappingAMR *data)
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:217
constexpr static int GetNumberOfAttributeTypes()
How many attribute types we have.
Definition: vtkHDFReader.h:131
static vtkHDFReader * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetPointArrayName(int index)
Get the name of the point or cell array with the given index in the input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:63
a simple class to control print indentation
Definition: vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObject.h:72
hierarchical dataset of vtkUniformGrids
dataset represents arbitrary combinations of all possible cell types
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
@ data
Definition: vtkX3D.h:321
#define VTK_FILEPATH