9 #ifndef vtkHDFReaderImplementation_h
10 #define vtkHDFReaderImplementation_h
19 VTK_ABI_NAMESPACE_BEGIN
49 const std::array<int, 2>&
GetVersion() {
return this->Version; }
84 int attributeType,
const char*
name,
const std::vector<hsize_t>& fileExtent);
145 : Class(H5T_NO_CLASS)
147 , Sign(H5T_SGN_ERROR)
152 return Class < other.
Class || (Class == other.
Class && Size < other.
Size) ||
153 (Class == other.
Class && Size == other.
Size && Sign < other.
Sign);
162 hid_t
OpenDataSet(hid_t group,
const char*
name, hid_t* nativeType, std::vector<hsize_t>& dims);
167 template <
typename T>
174 template <
typename T>
191 hid_t group,
const char*
name,
const std::vector<hsize_t>& fileExtent);
193 const std::vector<hsize_t>& fileExtent);
194 template <
typename T>
196 hid_t dataset,
const std::vector<hsize_t>& fileExtent, hsize_t numberOfComponents);
197 template <
typename T>
199 hid_t dataset,
const std::vector<hsize_t>& fileExtent, hsize_t numberOfComponents, T*
data);
217 std::array<hid_t, 3> AttributeDataGroup;
220 std::array<int, 2> Version;
223 const std::vector<hsize_t>& fileExtent, hsize_t numberOfComponents);
224 std::map<TypeDescription, ArrayReader> TypeReaderMap;
226 bool ReadDataSetType();
232 bool ComputeAMRBlocksPerLevels(std::vector<int>& levels);
233 bool ReadLevelSpacing(hid_t levelGroupID,
double*
spacing);
234 bool ReadAMRBoxRawValues(hid_t levelGroupID, std::vector<int>& amrBoxRawData);
235 bool ReadLevelTopology(
unsigned int level,
const std::string& levelGroupName,
242 VTK_ABI_NAMESPACE_END
virtual ~Implementation()
std::vector< std::string > GetArrayNames(int attributeType)
Returns the names of arrays for 'attributeType' (point or cell).
bool FillAMR(vtkOverlappingAMR *data, unsigned int maximumLevelsToReadByDefault, double origin[3], vtkDataArraySelection *dataArraySelection[3])
Fills the given AMR data with the content of the opened HDF file.
void Close()
Closes the VTK HDF file and releases any allocated resources.
vtkStringArray * NewStringArray(hid_t dataset, hsize_t size)
Reads a vtkDataArray of type T from the attributeType, dataset The array has type 'T' and 'numberOfCo...
Abstract superclass for all arrays.
hid_t TemplateTypeToHdfNativeType()
Convert C++ template type T to HDF5 native type this can be constexpr in C++17 standard.
const std::array< int, 2 > & GetVersion()
Returns the version of the VTK HDF implementation.
Implementation for the vtkHDFReader.
vtkDataArray * NewArray(int attributeType, const char *name, const std::vector< hsize_t > &fileExtent)
Reads and returns a new vtkDataArray.
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'.
a vtkAbstractArray subclass for strings
std::vector< vtkIdType > GetMetadata(const char *name, hsize_t size, hsize_t offset=0)
Reads a 1D metadata array in a DataArray or a vector of vtkIdType.
Implementation(vtkHDFReader *reader)
vtkIdType GetArrayOffset(vtkIdType step, int attributeType, std::string name)
Methods to query for array offsets when steps are present.
int GetDataSetType()
Type of vtkDataSet stored by the HDF file, such as VTK_IMAGE_DATA or VTK_UNSTRUCTURED_GRID, from vtkTypes.h.
std::size_t GetNumberOfSteps()
Read the number of steps from the opened file.
int GetNumberOfPieces(vtkIdType step=-1)
Returns the number of partitions for this dataset at the time step step if applicable.
static const unsigned int numberOfElements
vtkDataArray * NewArrayForGroup(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...
bool GetPartitionExtent(hsize_t partitionIndex, int *extent)
For an ImageData, sets the extent for 'partitionIndex'.
Store on/off settings for data arrays, etc.
vtkDataArray * NewMetadataArray(const char *name, hsize_t offset, hsize_t size)
Reads a 1D metadata array in a DataArray or a vector of vtkIdType.
abstract superclass for arrays of numeric data
vtkAbstractArray * NewFieldArray(const char *name, vtkIdType offset=-1, vtkIdType size=-1)
Reads and returns a new vtkDataArray.
void BuildTypeReaderMap()
Builds a map between native types and GetArray routines for that type.
bool operator<(const TypeDescription &other) const
vtkDataArray * NewVtkDataArray()
Create a vtkDataArray based on the C++ template type T.
bool GetAttribute(const char *attributeName, size_t numberOfElements, T *value)
Reads an attribute from the /VTKHDF group.
bool Open(VTK_FILEPATH const char *fileName)
Opens this VTK HDF file and checks if it is valid.
hierarchical dataset of vtkUniformGrids
Used to store HDF native types in a map.
vtkDataArray * GetStepValues()
Read the values of the steps from the open file.
std::vector< hsize_t > GetDimensions(const char *dataset)
Returns the dimensions of a HDF dataset.
TypeDescription GetTypeDescription(hid_t type)
Associates a struc of three integers with HDF type.