VTK  9.3.20240907
Classes | Public Member Functions | List of all members
vtkHDFWriter::Implementation Class Reference

#include <vtkHDFWriterImplementation.h>

Classes

struct  PolyDataTopos
 Stores a group name and the corresponding cell array. More...
 

Public Member Functions

hid_t GetRoot ()
 
hid_t GetFile ()
 
hid_t GetStepsGroup ()
 
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 Returns wether the operation was successful If the operation fails, some attributes may have been written.
 
bool CreateFile (bool overwrite, const std::string &filename)
 Create the file from the filename and create the root VTKHDF group.
 
bool OpenFile ()
 Open existing VTKHDF file and set Root and File members.
 
void CloseFile ()
 Close currently handled file, open using CreateFile or OpenFile.
 
bool OpenSubfile (const std::string &filename)
 Open subfile where data has already been written, and needs to be referenced by the main file using virtual datasets.
 
bool CreateStepsGroup ()
 Create the steps group in the root group.
 
std::vector< PolyDataToposGetCellArraysForTopos (vtkPolyData *polydata)
 Get the cell array for the POLY_DATA_TOPOS.
 
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 handle may be invalid.
 
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 Returned scoped handle may be invalid.
 
vtkHDF::ScopedH5AHandle CreateScalarAttribute (hid_t group, const char *name, int value)
 Create a scalar integer attribute in the given group.
 
vtkHDF::ScopedH5SHandle CreateUnlimitedSimpleDataspace (hsize_t numCols)
 Create an unlimited HDF dataspace with a dimension of 0 * numCols.
 
vtkHDF::ScopedH5GHandle CreateHdfGroup (hid_t group, const char *name)
 Create a group in the given group from a dataspace.
 
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.
 
herr_t CreateSoftLink (hid_t group, const char *groupName, const char *targetLink)
 Create a soft link to the real group containing the block datatset.
 
herr_t CreateExternalLink (hid_t group, const char *filename, const char *source, const char *targetLink)
 Create an external link to the real group containing the block datatset.
 
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.
 
vtkHDF::ScopedH5DHandle OpenDataset (hid_t group, const char *name)
 Open and return an existing dataset using its group id and dataset name.
 
std::string GetGroupName (hid_t group)
 Return the name of a group given its id.
 
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.
 
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 Returned scoped handle may be invalid.
 
vtkHDF::ScopedH5DHandle CreateVirtualDataset (hid_t group, const char *name, hid_t type, int numComp)
 Create a virtual dataset from all the subfiles that have been added.
 
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.
 
vtkHDF::ScopedH5SHandle CreateDataspaceFromArray (vtkAbstractArray *dataArray)
 Creates a dataspace to the exact array dimensions Returned scoped handle may be invalid.
 
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 be invalid.
 
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 of compression.
 
bool AddSingleValueToDataset (hid_t dataset, int value, bool offset, bool trim=false)
 Add a single value of integer type to an existing dataspace.
 
bool AddFieldDataSizeValueToDataset (hid_t dataset, int *value, int size, bool offset)
 Add a 2D value of integer type to an existing dataspace which represents the FieldDataSize.
 
bool AddArrayToDataset (hid_t dataset, vtkAbstractArray *dataArray, int trim=0)
 Append a full data array at the end of an existing infinite dataspace.
 
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 AddOrCreateSingleValueDataset (hid_t group, const char *name, int value, bool offset=false, bool trim=false)
 Append a single integer value to the dataset with name name in group group.
 
bool AddOrCreateFieldDataSizeValueDataset (hid_t group, const char *name, int *value, int size, bool offset=false)
 Append a 2D integer value to the dataset with name FieldDataSize.
 
 Implementation (vtkHDFWriter *writer)
 
virtual ~Implementation ()
 
void SetSubFilesReady (bool status)
 Inform the implementation that all the data has been written in subfiles, and that the virtual datasets can now be created from them.
 
bool GetSubFilesReady ()
 Inform the implementation that all the data has been written in subfiles, and that the virtual datasets can now be created from them.
 
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" group or a child of it as the running sum of all registered sub-files datasets in the same location.
 
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" group or a child of it as the running sum of all registered sub-files datasets in the same location.
 
vtkHDF::ScopedH5DHandle CreateSingleValueDataset (hid_t group, const char *name, int value)
 Creates a dataset and write a value to it.
 
vtkHDF::ScopedH5DHandle Create2DValueDataset (hid_t group, const char *name, int *value, int size)
 Creates a dataset and write a value to it.
 

Detailed Description

Definition at line 24 of file vtkHDFWriterImplementation.h.

Constructor & Destructor Documentation

◆ Implementation()

vtkHDFWriter::Implementation::Implementation ( vtkHDFWriter writer)

◆ ~Implementation()

virtual vtkHDFWriter::Implementation::~Implementation ( )
virtual

Member Function Documentation

◆ GetRoot()

hid_t vtkHDFWriter::Implementation::GetRoot ( )
inline

Definition at line 27 of file vtkHDFWriterImplementation.h.

◆ GetFile()

hid_t vtkHDFWriter::Implementation::GetFile ( )
inline

Definition at line 28 of file vtkHDFWriterImplementation.h.

◆ GetStepsGroup()

hid_t vtkHDFWriter::Implementation::GetStepsGroup ( )
inline

Definition at line 29 of file vtkHDFWriterImplementation.h.

◆ WriteHeader()

bool vtkHDFWriter::Implementation::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 Returns wether the operation was successful If the operation fails, some attributes may have been written.

◆ CreateFile()

bool vtkHDFWriter::Implementation::CreateFile ( bool  overwrite,
const std::string &  filename 
)

Create the file from the filename and create the root VTKHDF group.

This file is closed on object destruction. Overwrite the file if it exists by default Returns true if the operation was successful If the operation fails, the file may have been created

◆ OpenFile()

bool vtkHDFWriter::Implementation::OpenFile ( )

Open existing VTKHDF file and set Root and File members.

This file is closed on object destruction.

◆ CloseFile()

void vtkHDFWriter::Implementation::CloseFile ( )

Close currently handled file, open using CreateFile or OpenFile.

This does only need to be called when we want to close the file early; the file and open groups are closed automatically on object destruction.

◆ OpenSubfile()

bool vtkHDFWriter::Implementation::OpenSubfile ( const std::string &  filename)

Open subfile where data has already been written, and needs to be referenced by the main file using virtual datasets.

Return false if the subfile cannot be opened.

◆ SetSubFilesReady()

void vtkHDFWriter::Implementation::SetSubFilesReady ( bool  status)
inline

Inform the implementation that all the data has been written in subfiles, and that the virtual datasets can now be created from them.

This mechanism is used when writing a meta-file for temporal and/or multi-piece data.

Definition at line 74 of file vtkHDFWriterImplementation.h.

◆ GetSubFilesReady()

bool vtkHDFWriter::Implementation::GetSubFilesReady ( )
inline

Inform the implementation that all the data has been written in subfiles, and that the virtual datasets can now be created from them.

This mechanism is used when writing a meta-file for temporal and/or multi-piece data.

Definition at line 75 of file vtkHDFWriterImplementation.h.

◆ CreateStepsGroup()

bool vtkHDFWriter::Implementation::CreateStepsGroup ( )

Create the steps group in the root group.

Set a member variable to store the group, so it can be retrieved later using GetStepsGroup function.

◆ GetCellArraysForTopos()

std::vector< PolyDataTopos > vtkHDFWriter::Implementation::GetCellArraysForTopos ( vtkPolyData polydata)

Get the cell array for the POLY_DATA_TOPOS.

◆ CreateAndWriteHdfDataset()

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::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 handle may be invalid.

◆ CreateSimpleDataspace()

vtkHDF::ScopedH5SHandle vtkHDFWriter::Implementation::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 Returned scoped handle may be invalid.

◆ CreateScalarAttribute()

vtkHDF::ScopedH5AHandle vtkHDFWriter::Implementation::CreateScalarAttribute ( hid_t  group,
const char *  name,
int  value 
)

Create a scalar integer attribute in the given group.

Noop if the attribute already exists.

◆ CreateUnlimitedSimpleDataspace()

vtkHDF::ScopedH5SHandle vtkHDFWriter::Implementation::CreateUnlimitedSimpleDataspace ( hsize_t  numCols)

Create an unlimited HDF dataspace with a dimension of 0 * numCols.

This dataspace can be attached to a chunked dataset and extended afterwards. Returned scoped handle may be invalid

◆ CreateHdfGroup()

vtkHDF::ScopedH5GHandle vtkHDFWriter::Implementation::CreateHdfGroup ( hid_t  group,
const char *  name 
)

Create a group in the given group from a dataspace.

Returned scoped handle may be invalid.

◆ CreateHdfGroupWithLinkOrder()

vtkHDF::ScopedH5GHandle vtkHDFWriter::Implementation::CreateHdfGroupWithLinkOrder ( hid_t  group,
const char *  name 
)

Create a group that keeps track of link creation order Returned scoped handle may be invalid.

◆ CreateSoftLink()

herr_t vtkHDFWriter::Implementation::CreateSoftLink ( hid_t  group,
const char *  groupName,
const char *  targetLink 
)

Create a soft link to the real group containing the block datatset.

◆ CreateExternalLink()

herr_t vtkHDFWriter::Implementation::CreateExternalLink ( hid_t  group,
const char *  filename,
const char *  source,
const char *  targetLink 
)

Create an external link to the real group containing the block datatset.

◆ OpenExistingGroup()

vtkHDF::ScopedH5GHandle vtkHDFWriter::Implementation::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.

◆ OpenDataset()

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::OpenDataset ( hid_t  group,
const char *  name 
)

Open and return an existing dataset using its group id and dataset name.

◆ GetGroupName()

std::string vtkHDFWriter::Implementation::GetGroupName ( hid_t  group)

Return the name of a group given its id.

◆ CreateHdfDataset() [1/2]

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::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.

◆ CreateHdfDataset() [2/2]

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::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 Returned scoped handle may be invalid.

◆ CreateVirtualDataset()

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::CreateVirtualDataset ( hid_t  group,
const char *  name,
hid_t  type,
int  numComp 
)

Create a virtual dataset from all the subfiles that have been added.

This virtual dataset references the datasets with the same name in subfiles, and its first dimension is the sum of all subfiles datasets'. the number of components must be the same in every subfile.

◆ WriteSumSteps()

bool vtkHDFWriter::Implementation::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" group or a child of it as the running sum of all registered sub-files datasets in the same location.

The PolyData version does the same operation in 2 dimensions, for offsets array of size nbTimeSteps*nbPrimitives.

◆ WriteSumStepsPolyData()

bool vtkHDFWriter::Implementation::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" group or a child of it as the running sum of all registered sub-files datasets in the same location.

The PolyData version does the same operation in 2 dimensions, for offsets array of size nbTimeSteps*nbPrimitives.

◆ CreateChunkedHdfDataset()

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::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.

Chunked datasets are used to append data iteratively Returned scoped handle may be invalid

◆ CreateDataspaceFromArray()

vtkHDF::ScopedH5SHandle vtkHDFWriter::Implementation::CreateDataspaceFromArray ( vtkAbstractArray dataArray)

Creates a dataspace to the exact array dimensions Returned scoped handle may be invalid.

◆ CreateDatasetFromDataArray()

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::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 be invalid.

◆ CreateSingleValueDataset()

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::CreateSingleValueDataset ( hid_t  group,
const char *  name,
int  value 
)

Creates a dataset and write a value to it.

Returned scoped handle may be invalid

◆ Create2DValueDataset()

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::Create2DValueDataset ( hid_t  group,
const char *  name,
int *  value,
int  size 
)

Creates a dataset and write a value to it.

Returned scoped handle may be invalid

◆ InitDynamicDataset()

bool vtkHDFWriter::Implementation::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 of compression.

Return true if the operation was successful.

◆ AddSingleValueToDataset()

bool vtkHDFWriter::Implementation::AddSingleValueToDataset ( hid_t  dataset,
int  value,
bool  offset,
bool  trim = false 
)

Add a single value of integer type to an existing dataspace.

The trim parameter allows to overwrite the last data instead of appending it to the dataset. Return true if the write operation was successful.

◆ AddFieldDataSizeValueToDataset()

bool vtkHDFWriter::Implementation::AddFieldDataSizeValueToDataset ( hid_t  dataset,
int *  value,
int  size,
bool  offset 
)

Add a 2D value of integer type to an existing dataspace which represents the FieldDataSize.

Return true if the write operation was successful.

◆ AddArrayToDataset()

bool vtkHDFWriter::Implementation::AddArrayToDataset ( hid_t  dataset,
vtkAbstractArray dataArray,
int  trim = 0 
)

Append a full data array at the end of an existing infinite dataspace.

It can also overwrite the last elements using the trim parameter. When trim is positive, it will overwrite the number of array defined by the parameter starting from the end of the dataset. When trim is non positive it appends data array at the end of the dataset. Return true if the write operation was successful.

◆ AddOrCreateDataset()

bool vtkHDFWriter::Implementation::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.

If the dataset/dataspace already exists, array types much match. Return true if the operation was successful.

◆ AddOrCreateSingleValueDataset()

bool vtkHDFWriter::Implementation::AddOrCreateSingleValueDataset ( hid_t  group,
const char *  name,
int  value,
bool  offset = false,
bool  trim = false 
)

Append a single integer value to the dataset with name name in group group.

Create the dataset and dataspace if it does not exist yet. When offset is true, the value written to the dataset is offset by the previous value of the dataspace. Return true if the operation is successful.

◆ AddOrCreateFieldDataSizeValueDataset()

bool vtkHDFWriter::Implementation::AddOrCreateFieldDataSizeValueDataset ( hid_t  group,
const char *  name,
int *  value,
int  size,
bool  offset = false 
)

Append a 2D integer value to the dataset with name FieldDataSize.

Create the dataset and dataspace if it does not exist yet. When offset is true, the value written to the dataset is offset by the previous value of the dataspace. Return true if the operation is successful.


The documentation for this class was generated from the following file: