10#ifndef vtkHDFWriterImplementation_h
11#define vtkHDFWriterImplementation_h
23VTK_ABI_NAMESPACE_BEGIN
47 bool CreateFile(
bool overwrite,
const std::string& filename);
108 const char* name,
int rank, std::vector<hsize_t> dimensions,
const void* data);
153 hid_t group,
const char* filename,
const char*
source,
const char* targetLink);
183 hid_t group,
const char* name,
hid_t type,
int rank,
const hsize_t dimensions[]);
212 hid_t dataspace, hsize_t numCols, hsize_t chunkSize[],
int compressionLevel = 0);
241 hsize_t chunkSize[],
int compressionLevel = 0);
282 hid_t group,
const char* name,
vtkIdType value,
bool offset =
false,
bool trim =
false);
311 vtkHDF::ScopedH5FHandle File;
312 vtkHDF::ScopedH5GHandle Root;
313 vtkHDF::ScopedH5GHandle StepsGroup;
314 std::vector<vtkHDF::ScopedH5FHandle> Subfiles;
315 std::vector<std::string> SubfileNames;
316 bool SubFilesReady =
false;
318 const std::array<std::string, 4> PrimitiveNames = { {
"Vertices",
"Lines",
"Polygons",
325 hsize_t GetNumberOfCellsSubfile(
const std::string& basePath, std::size_t subfileId, hsize_t part,
326 bool isPolyData,
const std::string& groupName);
333 char GetPrimitive(
hid_t group);
342 hsize_t GetSubfileNumberOf(
const std::string& base,
const std::string& qualifier,
343 std::size_t subfileId, hsize_t part,
char primitive = 0xff);
345 std::string GetBasePath(
const std::string& fullPath);
350 bool DatasetAndGroupExist(
const std::string& dataset,
hid_t group);
357 bool GetSubFilesDatasetSize(
358 const std::string& datasetPath,
const std::string& groupName, hsize_t& totalSize);
361 enum class IndexingMode
377 IndexingMode GetDatasetIndexationMode(
const std::string& path);
Abstract superclass for all arrays.
object to represent cell connectivity
general representation of visualization data
bool AddOrCreateDataset(hid_t group, const char *name, hid_t type, vtkAbstractArray *dataArray)
Append the given array to the dataset with the given name, creating it if it does not exist yet.
bool GetSubFilesReady()
Inform the implementation that all the data has been written in subfiles, and that the virtual datase...
vtkHDF::ScopedH5AHandle CreateScalarAttribute(hid_t group, const char *name, int value)
Create a scalar integer attribute in the given group.
vtkHDF::ScopedH5GHandle CreateHdfGroup(hid_t group, const char *name)
Create a group in the given group from a dataspace.
vtkHDF::ScopedH5DHandle CreateAndWriteHdfDataset(hid_t group, hid_t type, hid_t source_type, const char *name, int rank, std::vector< hsize_t > dimensions, const void *data)
Create a dataset in the given group with the given parameters and write data to it Returned scoped ha...
hid_t GetStepsGroup(hid_t currentGroup)
vtkHDF::ScopedH5DHandle CreateDatasetFromDataArray(hid_t group, const char *name, hid_t type, vtkAbstractArray *dataArray)
Creates a dataset in the given group from a dataArray and write data to it Returned scoped handle may...
bool AddOrCreateFieldDataSizeValueDataset(hid_t group, const char *name, vtkIdType *value, vtkIdType size, bool offset=false)
Append a 2D integer value to the dataset with name FieldDataSize.
bool WriteSumSteps(hid_t group, const char *name)
For temporal multi-piece meta-files, write the dataset name in group group, which must be the "steps"...
bool CreateFile(bool overwrite, const std::string &filename)
Create the file from the filename and create the root VTKHDF group.
vtkHDF::ScopedH5GHandle CreateHdfGroupWithLinkOrder(hid_t group, const char *name)
Create a group that keeps track of link creation order Returned scoped handle may be invalid.
vtkHDF::ScopedH5DHandle OpenDataset(hid_t group, const char *name)
Open and return an existing dataset using its group id and dataset name.
vtkHDF::ScopedH5GHandle OpenExistingGroup(hid_t group, const char *name)
Open and return an existing group thanks to id and a relative or absolute path to this group.
bool OpenFile()
Open existing VTKHDF file and set Root and File members.
vtkHDF::ScopedH5DHandle CreateHdfDataset(hid_t group, const char *name, hid_t type, int rank, const hsize_t dimensions[])
Create a dataset in the given group It internally creates a dataspace from a rank and dimensions Retu...
vtkHDF::ScopedH5SHandle CreateDataspaceFromArray(vtkAbstractArray *dataArray)
Creates a dataspace to the exact array dimensions Returned scoped handle may be invalid.
bool AddFieldDataSizeValueToDataset(hid_t dataset, vtkIdType *value, vtkIdType size, bool offset)
Add a 2D value of integer type to an existing dataspace which represents the FieldDataSize.
Implementation(vtkHDFWriter *writer)
bool InitDynamicDataset(hid_t group, const char *name, hid_t type, hsize_t cols, hsize_t chunkSize[], int compressionLevel=0)
Create a chunked dataset with an empty extendable dataspace using chunking and set the desired level ...
bool CreateExternalLink(hid_t group, const char *filename, const char *source, const char *targetLink)
Create an external link to the real group containing the block dataset.
bool AddOrCreateSingleValueDataset(hid_t group, const char *name, vtkIdType value, bool offset=false, bool trim=false)
Append a single integer value to the dataset with name name in group group.
bool AddArrayToDataset(hid_t dataset, vtkAbstractArray *dataArray, int trim=0)
Append a full data array at the end of an existing infinite dataspace.
bool CreateSoftLink(hid_t group, const char *groupName, const char *targetLink)
Create a soft link to the real group containing the block dataset.
vtkHDF::ScopedH5DHandle CreateChunkedHdfDataset(hid_t group, const char *name, hid_t type, hid_t dataspace, hsize_t numCols, hsize_t chunkSize[], int compressionLevel=0)
Create a chunked dataset in the given group from a dataspace.
void CreateArraysFromNonNullPart(hid_t group, vtkDataObject *data)
Initialize empty data object array structures from a base group.
vtkHDF::ScopedH5DHandle CreateSingleValueDataset(hid_t group, const char *name, vtkIdType value)
Creates a dataset and write a value to it.
void CloseFile()
Close currently handled file, open using CreateFile or OpenFile.
vtkHDF::ScopedH5GHandle GetSubfileNonNullPart(const std::string &blockPath, int &type)
Find the first non null part for the given path in all subfiles.
vtkHDF::ScopedH5SHandle CreateUnlimitedSimpleDataspace(hsize_t numCols)
Create an unlimited HDF dataspace with a dimension of 0 * numCols.
std::vector< PolyDataTopos > GetCellArraysForTopos(vtkPolyData *polydata)
Get the cell array for the POLY_DATA_TOPOS.
bool CreateStepsGroup(hid_t group)
Create the steps group in the given group.
bool WriteHeader(hid_t group, const char *hdfType)
Write version and type attributes to the root group A root must be open for the operation to succeed ...
std::string GetGroupName(hid_t group)
Return the name of a group given its id.
void SetSubFilesReady(bool status)
Inform the implementation that all the data has been written in subfiles, and that the virtual datase...
vtkHDF::ScopedH5SHandle CreateSimpleDataspace(int rank, const hsize_t dimensions[])
Create a HDF dataspace It is simple (not scalar or null) which means that it is an array of elements ...
bool AddSingleValueToDataset(hid_t dataset, vtkIdType value, bool offset, bool trim=false)
Add a single value of integer type to an existing dataspace.
vtkHDF::ScopedH5DHandle CreateHdfDataset(hid_t group, const char *name, hid_t type, hid_t dataspace)
Create a dataset in the given group from a dataspace Returned scoped handle may be invalid.
bool CreateVirtualDataset(hid_t group, const char *name, hid_t type, int numComp)
Create a virtual dataset from all the subfiles that have been added.
bool OpenSubfile(const std::string &filename)
Open subfile where data has already been written, and needs to be referenced by the main file using v...
virtual ~Implementation()
bool WriteSumStepsPolyData(hid_t group, const char *name)
For temporal multi-piece meta-files, write the dataset name in group group, which must be the "steps"...
Write a data object to a VTKHDF file.
concrete dataset represents vertices, lines, polygons, and triangle strips
Stores a group name and the corresponding cell array.
const char * hdfGroupName
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
@ Cells
A cell specified by degrees of freedom held in arrays.