MCPcopy Create free account
hub / github.com/Kitware/VTK / AddOrCreateFieldDataSizeValueDataset

Method AddOrCreateFieldDataSizeValueDataset

IO/HDF/vtkHDFWriterImplementation.cxx:699–725  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

697
698//------------------------------------------------------------------------------
699bool vtkHDFWriter::Implementation::AddOrCreateFieldDataSizeValueDataset(
700 hid_t group, const char* name, vtkIdType* value, vtkIdType size, bool offset)
701{
702 // Assume that when subfiles are set, we don't need to write data unless
703 // SubFilesReady is set, which means all subfiles have been written.
704 if (!this->Subfiles.empty() && group != this->StepsGroup)
705 {
706 if (this->SubFilesReady)
707 {
708 return this->CreateVirtualDataset(group, name, H5T_STD_I64LE, 1);
709 }
710 return true;
711 }
712 if (!H5Lexists(group, name, H5P_DEFAULT))
713 {
714 // Dataset needs to be created
715 std::vector<hsize_t> dimensions{ 2 };
716 return this->CreateAndWriteHdfDataset(group, H5T_STD_I64LE, H5T_STD_I64LE, name, 1, dimensions,
717 &value) != H5I_INVALID_HID; // NOLINT(bugprone-multi-level-implicit-pointer-conversion)
718 }
719 else
720 {
721 // Append the value to an existing dataset
722 vtkHDF::ScopedH5DHandle dataset = H5Dopen(group, name, H5P_DEFAULT);
723 return this->AddFieldDataSizeValueToDataset(dataset, value, size, offset);
724 }
725}
726
727//------------------------------------------------------------------------------
728bool vtkHDFWriter::Implementation::AddArrayToDataset(

Callers 1

Calls 4

CreateVirtualDatasetMethod · 0.95
emptyMethod · 0.45

Tested by

no test coverage detected