21#ifndef vtkHDFReaderImplementation_h
22#define vtkHDFReaderImplementation_h
60 const std::array<int, 2>&
GetVersion() {
return this->Version; }
65 bool GetAttribute(
const char* attributeName,
size_t numberOfElements, T* value);
89 int attributeType,
const char* name,
const std::vector<hsize_t>& fileExtent);
102 std::vector<vtkIdType>
GetMetadata(
const char* name, hsize_t size);
119 :
Class(H5T_NO_CLASS)
121 ,
Sign(H5T_SGN_ERROR)
137 hid_t
OpenDataSet(hid_t group,
const char* name, hid_t* nativeType, std::vector<hsize_t>& dims);
142 template <
typename T>
149 template <
typename T>
166 template <
typename T>
168 hid_t dataset,
const std::vector<hsize_t>& fileExtent, hsize_t numberOfComponents);
169 template <
typename T>
171 hid_t dataset,
const std::vector<hsize_t>& fileExtent, hsize_t numberOfComponents, T* data);
185 std::string FileName;
189 std::array<hid_t, 3> AttributeDataGroup;
192 std::array<int, 2> Version;
195 const std::vector<hsize_t>& fileExtent, hsize_t numberOfComponents);
196 std::map<TypeDescription, ArrayReader> TypeReaderMap;
201extern template bool vtkHDFReader::Implementation::GetAttribute<int>(
202 const char* attributeName,
size_t dim,
int* value);
203extern template bool vtkHDFReader::Implementation::GetAttribute<double>(
204 const char* attributeName,
size_t dim,
double* value);
Abstract superclass for all arrays.
abstract superclass for arrays of numeric data
Implementation for the vtkHDFReader.
vtkDataArray * NewMetadataArray(const char *name, hsize_t offset, hsize_t size)
Reads a 1D metadata array in a DataArray or a vector of vtkIdType.
bool GetPartitionExtent(hsize_t partitionIndex, int *extent)
For an ImageData, sets the extent for 'partitionIndex'.
virtual ~Implementation()
TypeDescription GetTypeDescription(hid_t type)
Associates a struc of three integers with HDF type.
const std::array< int, 2 > & GetVersion()
Returns the version of the VTK HDF implementation.
bool Open(VTK_FILEPATH const char *fileName)
Opens this VTK HDF file and checks if it is valid.
std::vector< vtkIdType > GetMetadata(const char *name, hsize_t size)
Implementation(vtkHDFReader *reader)
vtkDataArray * NewArray(int attributeType, const char *name, const std::vector< hsize_t > &fileExtent)
Reads and returns a new vtkDataArray.
std::vector< hsize_t > GetDimensions(const char *dataset)
Returns the dimensions of a HDF dataset.
bool GetAttribute(const char *attributeName, size_t numberOfElements, T *value)
Reads an attribute from the /VTKHDF group.
hid_t OpenDataSet(hid_t group, const char *name, hid_t *nativeType, std::vector< hsize_t > &dims)
Opens the hdf5 dataset given the 'group' and 'name'.
std::vector< std::string > GetArrayNames(int attributeType)
Returns the names of arrays for 'attributeType' (point or cell).
void BuildTypeReaderMap()
Builds a map between native types and GetArray routines for that type.
int GetDataSetType()
Type of vtkDataSet stored by the HDF file, such as VTK_IMAGE_DATA or VTK_UNSTRUCTURED_GRID,...
void Close()
Closes the VTK HDF file and releases any allocated resources.
int GetNumberOfPieces()
Returns the number of partitions for this dataset.
vtkAbstractArray * NewFieldArray(const char *name)
bool NewArray(hid_t dataset, const std::vector< hsize_t > &fileExtent, hsize_t numberOfComponents, T *data)
vtkDataArray * NewVtkDataArray()
Create a vtkDataArray based on the C++ template type T.
vtkDataArray * NewArray(hid_t group, const char *name, const std::vector< hsize_t > &fileExtent)
Reads a vtkDataArray of type T from the attributeType, dataset The array has type 'T' and 'numberOfCo...
vtkDataArray * NewArray(hid_t dataset, const std::vector< hsize_t > &fileExtent, hsize_t numberOfComponents)
vtkStringArray * NewStringArray(hid_t dataset, hsize_t size)
hid_t TemplateTypeToHdfNativeType()
Convert C++ template type T to HDF5 native type this can be constexpr in C++17 standard.
vtkDataArray * NewArray(int attributeType, const char *name, hsize_t offset, hsize_t size)
a vtkAbstractArray subclass for strings
Used to store HDF native types in a map.
bool operator<(const TypeDescription &other) const