VTK  9.7.20261112
vtkHDFWriter::Implementation Class Reference

#include <vtkHDFWriterImplementation.h>

Detailed Description

Definition at line 25 of file vtkHDFWriterImplementation.h.

Public Member Functions

hid_t GetRoot ()
 Access root 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 Returns whether the operation was successful If the operation fails, some attributes may have been written.
bool CollectPartitionOffsets (vtkDataObject *input)
 Collect offsets from all distributed partitions in the object using collective operartions.
vtkHDF::ScopedH5AHandle CreateScalarAttribute (hid_t group, const char *name, int value)
 Create a scalar integer attribute in the given group.
vtkHDF::ScopedH5AHandle CreateVectorAttribute (hid_t group, const char *name, hid_t type, hsize_t size, const void *data)
 Create a vector attribute (1D array) with arbitrary type and size in the given group.
vtkHDF::ScopedH5AHandle CreateStringAttribute (hid_t group, const char *name, const std::string &value)
 Create a string attribute in the given group.
vtkHDF::ScopedH5GHandle CreateHdfGroup (hid_t group, const char *name)
 Retrieve group if it exists, create it if needed.
vtkHDF::ScopedH5GHandle CreateHdfGroupWithLinkOrder (hid_t group, const char *name)
 Retrieve or create a group that keeps track of link creation order Returned scoped handle may be invalid when group could not be created.
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.
std::string GetGroupName (hid_t group)
 Return the name of a group given its id.
bool CreateSoftLink (hid_t group, const char *groupName, const char *targetLink)
 Create a soft link to the real group containing the block dataset.
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.
vtkHDF::ScopedH5DHandle OpenDataset (hid_t group, const char *name)
 Open and return an existing dataset using its group id and dataset name.
hsize_t GetDataSetSize (hid_t group, const char *name)
 Get size of 1D dataset.
vtkHDF::ScopedH5DHandle CreateHdfDatasetFromDataArray (hid_t group, const char *name, hid_t type, vtkAbstractArray *dataArray, const std::vector< hsize_t > &dims={})
 Creates a dataset in the given group from a dataArray and write data to it dims provides the dimensions of the structured dataset.
bool AddOrCreateDataset (hid_t group, unsigned int partId, const char *name, hid_t type, vtkAbstractArray *dataArray, const std::vector< hsize_t > &dims={})
 Append the given array to the dataset with the given name, creating it if it does not exist yet.
bool AddOrCreateSingleRowDataset (hid_t group, unsigned int partId, const char *name, const std::vector< vtkIdType > &value, bool offset=false, bool trim=false)
 Append a single row of integer values to the dataset with name name in group group.
vtkHDF::ScopedH5GHandle GetSubfileNonNullPart (const std::string &blockPath, int &type)
 Find the first non null part for the given path in all subfiles.
void CreateArraysFromNonNullPart (hid_t group, vtkDataObject *data)
 Initialize empty data object array structures from a base group.
 Implementation (vtkHDFWriter *writer)
virtual ~Implementation ()
bool CreateFile (bool overwrite, const std::string &filename)
 Create/Open/Close file.
bool OpenFile (const std::string &filename)
 Create/Open/Close file.
void CloseFile ()
 Create/Open/Close file.
bool CreateStepsGroup (hid_t group)
 Create/Get the steps group in the given group.
hid_t GetStepsGroup (hid_t currentGroup)
 Create/Get the steps group in the given group.
void SetChunkSize (int chunkSize)
 Global properties.
void SetCompressionLevel (int level)
 Global properties.
void SetUseDistributedWriting (bool distributedFile)
 Use distributed HDF5 MPI I/O for writing.
bool GetUseDistributedWriting () const
 Use distributed HDF5 MPI I/O for writing.
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.
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 ()
 Open subfile where data has already been written, and needs to be referenced by the main file using virtual datasets.
bool InitDynamicDataset (hid_t group, const char *name, hid_t type, hsize_t cols, const std::vector< hsize_t > &chunkSize)
 Create a chunked dataset with an empty extendable dataspace using chunking Return true if the operation was successful.
bool InitDynamicDataset (hid_t group, const char *name, hid_t type, const std::vector< hsize_t > &dims, const std::vector< hsize_t > &chunkSize)
 Create a chunked dataset with an empty extendable dataspace using chunking Return true if the operation was successful.
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.

Constructor & Destructor Documentation

◆ Implementation()

vtkHDFWriter::Implementation::Implementation ( vtkHDFWriter * writer)

◆ ~Implementation()

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

Member Function Documentation

◆ CreateFile()

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

Create/Open/Close file.

Set File and Root groups, close them when the file is closed.

◆ OpenFile()

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

Create/Open/Close file.

Set File and Root groups, close them when the file is closed.

◆ CloseFile()

void vtkHDFWriter::Implementation::CloseFile ( )

Create/Open/Close file.

Set File and Root groups, close them when the file is closed.

◆ GetRoot()

hid_t vtkHDFWriter::Implementation::GetRoot ( )
inline

Access root group.

Definition at line 41 of file vtkHDFWriterImplementation.h.

◆ CreateStepsGroup()

bool vtkHDFWriter::Implementation::CreateStepsGroup ( hid_t group)

Create/Get the steps group in the given group.

◆ GetStepsGroup()

hid_t vtkHDFWriter::Implementation::GetStepsGroup ( hid_t currentGroup)

Create/Get the steps group in the given group.

◆ SetChunkSize()

void vtkHDFWriter::Implementation::SetChunkSize ( int chunkSize)
inline

Global properties.

Definition at line 55 of file vtkHDFWriterImplementation.h.

◆ SetCompressionLevel()

void vtkHDFWriter::Implementation::SetCompressionLevel ( int level)
inline

Global properties.

Definition at line 56 of file vtkHDFWriterImplementation.h.

◆ SetUseDistributedWriting()

void vtkHDFWriter::Implementation::SetUseDistributedWriting ( bool distributedFile)

Use distributed HDF5 MPI I/O for writing.

When enabled, all operations will be done collectively. GetUseDistributedWriting will always return false if HDF5_ENABLE_PARALLEL is not enabled at compile time

◆ GetUseDistributedWriting()

bool vtkHDFWriter::Implementation::GetUseDistributedWriting ( ) const
inline

Use distributed HDF5 MPI I/O for writing.

When enabled, all operations will be done collectively. GetUseDistributedWriting will always return false if HDF5_ENABLE_PARALLEL is not enabled at compile time

Definition at line 67 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 whether the operation was successful If the operation fails, some attributes may have been written.

◆ CollectPartitionOffsets()

bool vtkHDFWriter::Implementation::CollectPartitionOffsets ( vtkDataObject * input)

Collect offsets from all distributed partitions in the object using collective operartions.

◆ 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 98 of file vtkHDFWriterImplementation.h.

◆ GetSubFilesReady()

bool vtkHDFWriter::Implementation::GetSubFilesReady ( )
inline

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.

Definition at line 99 of file vtkHDFWriterImplementation.h.

◆ 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.

◆ CreateVectorAttribute()

vtkHDF::ScopedH5AHandle vtkHDFWriter::Implementation::CreateVectorAttribute ( hid_t group,
const char * name,
hid_t type,
hsize_t size,
const void * data )

Create a vector attribute (1D array) with arbitrary type and size in the given group.

Noop if the attribute already exists. Returned scoped handle may be invalid.

◆ CreateStringAttribute()

vtkHDF::ScopedH5AHandle vtkHDFWriter::Implementation::CreateStringAttribute ( hid_t group,
const char * name,
const std::string & value )

Create a string attribute in the given group.

Noop if the attribute already exists.

◆ CreateHdfGroup()

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

Retrieve group if it exists, create it if needed.

Returned scoped handle may be invalid when group could not be created

◆ CreateHdfGroupWithLinkOrder()

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

Retrieve or create a group that keeps track of link creation order Returned scoped handle may be invalid when group could not be created.

◆ 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.

◆ GetGroupName()

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

Return the name of a group given its id.

◆ CreateSoftLink()

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

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

Return true if the operation succeeded or if it already exists.

◆ CreateExternalLink()

bool 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 dataset.

Return true if the operation succeeded.

◆ InitDynamicDataset() [1/2]

bool vtkHDFWriter::Implementation::InitDynamicDataset ( hid_t group,
const char * name,
hid_t type,
hsize_t cols,
const std::vector< hsize_t > & chunkSize )

Create a chunked dataset with an empty extendable dataspace using chunking Return true if the operation was successful.

◆ InitDynamicDataset() [2/2]

bool vtkHDFWriter::Implementation::InitDynamicDataset ( hid_t group,
const char * name,
hid_t type,
const std::vector< hsize_t > & dims,
const std::vector< hsize_t > & chunkSize )

Create a chunked dataset with an empty extendable dataspace using chunking Return true if the operation was successful.

◆ 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.

◆ GetDataSetSize()

hsize_t vtkHDFWriter::Implementation::GetDataSetSize ( hid_t group,
const char * name )

Get size of 1D dataset.

Return 0 if it does not exist.

Warning
: expects a 1D dataset.

◆ CreateHdfDatasetFromDataArray()

vtkHDF::ScopedH5DHandle vtkHDFWriter::Implementation::CreateHdfDatasetFromDataArray ( hid_t group,
const char * name,
hid_t type,
vtkAbstractArray * dataArray,
const std::vector< hsize_t > & dims = {} )

Creates a dataset in the given group from a dataArray and write data to it dims provides the dimensions of the structured dataset.

If dims is empty, the dataspace shape is [nTuples] (or [nTuples, nComp] when nComp > 1). Returned scoped handle may be invalid

◆ AddOrCreateDataset()

bool vtkHDFWriter::Implementation::AddOrCreateDataset ( hid_t group,
unsigned int partId,
const char * name,
hid_t type,
vtkAbstractArray * dataArray,
const std::vector< hsize_t > & dims = {} )

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 must match. dims provides the dimensions of the structured dataset. Used only for ImageData for now. Return true if the operation was successful.

◆ AddOrCreateSingleRowDataset()

bool vtkHDFWriter::Implementation::AddOrCreateSingleRowDataset ( hid_t group,
unsigned int partId,
const char * name,
const std::vector< vtkIdType > & value,
bool offset = false,
bool trim = false )

Append a single row of integer values 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.

◆ 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.

◆ GetSubfileNonNullPart()

vtkHDF::ScopedH5GHandle vtkHDFWriter::Implementation::GetSubfileNonNullPart ( const std::string & blockPath,
int & type )

Find the first non null part for the given path in all subfiles.

◆ CreateArraysFromNonNullPart()

void vtkHDFWriter::Implementation::CreateArraysFromNonNullPart ( hid_t group,
vtkDataObject * data )

Initialize empty data object array structures from a base group.

Used to get meta information for composite subfiles when all subfiles do not have non-null data.


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