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 =========================================================================*/
24 #ifndef vtkHDFReader_h
25 #define vtkHDFReader_h
26 
27 #include "vtkDataObjectAlgorithm.h"
28 #include "vtkIOHDFModule.h" // For export macro
29 #include <vector> // For storing list of values
30 
31 class vtkAbstractArray;
32 class vtkCallbackCommand;
33 class vtkCommand;
35 class vtkDataSet;
37 class vtkImageData;
39 class vtkInformation;
40 class vtkOverlappingAMR;
42 
52 class VTKIOHDF_EXPORT vtkHDFReader : public vtkDataObjectAlgorithm
53 {
54 public:
55  static vtkHDFReader* New();
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
63  vtkSetFilePathMacro(FileName);
64  vtkGetFilePathMacro(FileName);
66 
74  virtual int CanReadFile(VTK_FILEPATH const char* name);
75 
77 
80  vtkDataSet* GetOutputAsDataSet();
81  vtkDataSet* GetOutputAsDataSet(int index);
83 
85 
89  virtual vtkDataArraySelection* GetPointDataArraySelection();
90  virtual vtkDataArraySelection* GetCellDataArraySelection();
91  virtual vtkDataArraySelection* GetFieldDataArraySelection();
93 
95 
98  int GetNumberOfPointArrays();
99  int GetNumberOfCellArrays();
101 
103 
107  const char* GetPointArrayName(int index);
108  const char* GetCellArrayName(int index);
110 
111  vtkSetMacro(MaximumLevelsToReadByDefaultForAMR, unsigned int);
112  vtkGetMacro(MaximumLevelsToReadByDefaultForAMR, unsigned int);
113 
114 protected:
115  vtkHDFReader();
116  ~vtkHDFReader() override;
117 
122  constexpr static int GetNumberOfAttributeTypes() { return 3; }
123 
127  int CanReadFileVersion(int major, int minor);
128 
130 
134  int Read(vtkInformation* outInfo, vtkImageData* data);
135  int Read(vtkInformation* outInfo, vtkUnstructuredGrid* data);
136  int Read(vtkInformation* outInfo, vtkOverlappingAMR* data);
138 
143  int Read(const std::vector<vtkIdType>& numberOfPoints,
144  const std::vector<vtkIdType>& numberOfCells,
145  const std::vector<vtkIdType>& numberOfConnectivityIds, int filePiece,
146  vtkUnstructuredGrid* pieceData);
150  int AddFieldArrays(vtkDataObject* data);
151 
155  static void SelectionModifiedCallback(
156  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
157 
159 
163  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
164  vtkInformationVector* outputVector) override;
165  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
166  vtkInformationVector* outputVector) override;
167  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
168  vtkInformationVector* outputVector) override;
170 
174  void PrintPieceInformation(vtkInformation* outInfo);
175 
176 private:
177  vtkHDFReader(const vtkHDFReader&) = delete;
178  void operator=(const vtkHDFReader&) = delete;
179 
180 protected:
184  char* FileName;
185 
190  vtkDataArraySelection* DataArraySelection[3];
191 
198 
201  int WholeExtent[6];
202  double Origin[3];
203  double Spacing[3];
205 
206  unsigned int MaximumLevelsToReadByDefaultForAMR = 0;
207 
210 };
211 
212 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkCallbackCommand * SelectionObserver
The observer to modify this object when the array selections are modified.
Definition: vtkHDFReader.h:196
abstract base class for most VTK objects
Definition: vtkObject.h:62
Store vtkAlgorithm input/output information.
VTKHDF format reader.
Definition: vtkHDFReader.h:52
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
Abstract superclass for all arrays.
static vtkDataObjectAlgorithm * New()
Implementation for the vtkHDFReader.
Implementation * Impl
Definition: vtkHDFReader.h:208
superclass for callback/observer methods
Definition: vtkCommand.h:394
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
Store on/off settings for data arrays, etc.
dataset represents arbitrary combinations of all possible cell types
represent and manipulate attribute data in a dataset
char * FileName
The input file's name.
Definition: vtkHDFReader.h:184
#define VTK_FILEPATH
Superclass for algorithms that produce only data object as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static constexpr int GetNumberOfAttributeTypes()
How many attribute types we have.
Definition: vtkHDFReader.h:122
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
hierarchical dataset of vtkUniformGrids
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:65
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.