9#ifndef vtkHDFUtilities_h
10#define vtkHDFUtilities_h
14#include "vtkIOHDFModule.h"
25VTK_ABI_NAMESPACE_BEGIN
27#if VTK_ID_TYPE_IMPL == VTK_LONG_LONG
28#define VTK_ID_H5T H5T_NATIVE_LLONG
29#elif VTK_ID_TYPE_IMPL == VTK_LONG
30#define VTK_ID_H5T H5T_NATIVE_LONG
31#elif VTK_ID_TYPE_IMPL == VTK_INT
32#define VTK_ID_H5T H5T_NATIVE_INT
34#error "No HDF5 type available for vtkIdType"
50const std::vector<std::string>
POLY_DATA_TOPOS{
"Vertices",
"Lines",
"Polygons",
"Strips" };
125VTKIOHDF_EXPORT
bool Open(
const char* fileName,
hid_t& fileID);
139 hid_t group,
const char* attributeName,
size_t numberOfElements, T* value);
155 const std::string& rootName, std::array<int, 2>& version,
int& dataSetType,
int& numberOfPieces,
156 std::array<hid_t, 3>& attributeDataGroup);
162 hid_t loc_id,
const char* name,
const H5L_info_t* info,
void* opdata);
168 const std::array<hid_t, 3>& attributeDataGroup,
int attributeType);
174 hid_t groupID,
const std::string& path);
183 hid_t group,
const char* name,
hid_t* nativeType, std::vector<hsize_t>& dims);
199 const std::vector<hsize_t>& dims,
const std::vector<hsize_t>& parameterExtent);
201 hid_t group,
const char* name,
const std::vector<hsize_t>& parameterExtent);
211 hid_t group,
const char* name, hsize_t size, hsize_t offset);
225 hid_t group,
vtkIdType step,
int attributeType, std::string name);
236 hid_t dataset, std::vector<hsize_t> dims, std::vector<hsize_t> fileExtent);
240#include "vtkHDFUtilities.txx"
Abstract superclass for all arrays.
abstract superclass for arrays of numeric data
a vtkAbstractArray subclass for strings
Common utility variables and functions for reader and writer of vtkHDF.
VTKIOHDF_EXPORT bool RetrieveHDFInformation(hid_t &fileID, hid_t &groupID, const std::string &rootName, std::array< int, 2 > &version, int &dataSetType, int &numberOfPieces, std::array< hid_t, 3 > &attributeDataGroup)
Initialize meta information of the file.
VTKIOHDF_EXPORT std::vector< std::string > GetArrayNames(const std::array< hid_t, 3 > &attributeDataGroup, int attributeType)
Returns the names of arrays for 'attributeType' (point or cell).
VTKIOHDF_EXPORT 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'.
VTKIOHDF_EXPORT vtkDataArray * NewArrayForGroup(hid_t dataset, hid_t nativeType, const std::vector< hsize_t > &dims, const std::vector< hsize_t > ¶meterExtent)
Reads a vtkDataArray of type T from the attributeType, dataset The array has type 'T' and 'numberOfCo...
VTKIOHDF_EXPORT hid_t TemplateTypeToHdfNativeType()
Convert C++ template type T to HDF5 native type this can be constexpr in C++17 standard.
VTKIOHDF_EXPORT std::vector< vtkIdType > GetMetadata(hid_t group, const char *name, hsize_t size, hsize_t offset)
Reads a 1D metadata array in a DataArray or a vector of vtkIdType.
const std::vector< std::string > POLY_DATA_TOPOS
constexpr std::size_t NUM_POLY_DATA_TOPOS
constexpr int GEOMETRY_ATTRIBUTE_TAG
VTKIOHDF_EXPORT vtkStringArray * NewStringArray(hid_t dataset, std::vector< hsize_t > dims, std::vector< hsize_t > fileExtent)
const std::string VTKHDF_ROOT_PATH
static constexpr int GetNumberOfAttributeTypes()
VTKIOHDF_EXPORT std::vector< hsize_t > GetDimensions(hid_t fileID, const char *datasetName)
Returns the dimensions of a HDF dataset of a file.
VTKIOHDF_EXPORT std::size_t GetNumberOfSteps(hid_t groupID)
Read the number of steps of an HDF group.
VTKIOHDF_EXPORT void MakeObjectNameValid(std::string &objectName)
VTKIOHDF_EXPORT vtkIdType GetArrayOffset(hid_t group, vtkIdType step, int attributeType, std::string name)
Methods to query for array offsets for the HDF group when steps are present.
VTKIOHDF_EXPORT bool GetAttribute(hid_t group, const char *attributeName, size_t numberOfElements, T *value)
Reads an attribute from the group passed to it.
VTKIOHDF_EXPORT bool Open(const char *fileName, hid_t &fileID)
Open a VTK HDF file and checks if it is valid.
static constexpr int GetNumberOfDataArrayTypes()
VTKIOHDF_EXPORT hid_t getH5TypeFromVtkType(int dataType)
VTKIOHDF_EXPORT vtkAbstractArray * NewFieldArray(const std::array< hid_t, 3 > &attributeDataGroup, const char *name, vtkIdType offset, vtkIdType size, vtkIdType dimMaxSize)
Reads and returns a new vtkAbstractArray.
VTKIOHDF_EXPORT std::vector< std::string > GetOrderedChildrenOfGroup(hid_t groupID, const std::string &path)
Return the name of all children of an HDF group given its path.
VTKIOHDF_EXPORT herr_t FileInfoCallBack(hid_t loc_id, const char *name, const H5L_info_t *info, void *opdata)
Convenient callback method to retrieve a name when calling a H5Giterate()
VTKIOHDF_EXPORT std::array< vtkIdType, 2 > GetFieldArraySize(hid_t group, vtkIdType step, std::string name)
Return the field array size (components, tuples) for the HDF group.
TemporalGeometryOffsets(T *impl, vtkIdType step)
std::vector< vtkIdType > CellOffsets
std::vector< vtkIdType > ConnectivityOffsets
std::vector< vtkIdType > CellOffsets
std::vector< vtkIdType > ConnectivityOffsets
TransientGeometryOffsets(T *impl, vtkIdType step)
#define VTK_DEPRECATED_IN_9_4_0(reason)