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

Method GetSubFilesDatasetSize

IO/HDF/vtkHDFWriterImplementation.cxx:1427–1452  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1425
1426//------------------------------------------------------------------------------
1427bool vtkHDFWriter::Implementation::GetSubFilesDatasetSize(
1428 const std::string& datasetPath, const std::string& groupName, hsize_t& totalSize)
1429{
1430 totalSize = 0;
1431 for (auto& fileRoot : this->Subfiles)
1432 {
1433 if (H5Lexists(fileRoot, groupName.c_str(), H5P_DEFAULT) <= 0 ||
1434 H5Lexists(fileRoot, datasetPath.c_str(), H5P_DEFAULT) <= 0)
1435 {
1436 if (PATH::ContainsAny(datasetPath, { PATH::OFFSETS }))
1437 {
1438 totalSize++; // For 0 cells, Offset is still [0]
1439 }
1440 continue;
1441 }
1442 vtkHDF::ScopedH5DHandle sourceDataset = H5Dopen(fileRoot, datasetPath.c_str(), H5P_DEFAULT);
1443 vtkHDF::ScopedH5SHandle sourceDataSpace = H5Dget_space(sourceDataset);
1444 std::vector<hsize_t> sourceDims(3);
1445 if (H5Sget_simple_extent_dims(sourceDataSpace, sourceDims.data(), nullptr) < 0)
1446 {
1447 return false;
1448 }
1449 totalSize += sourceDims[0];
1450 }
1451 return true;
1452}
1453
1454//------------------------------------------------------------------------------
1455vtkHDF::ScopedH5GHandle vtkHDFWriter::Implementation::GetSubfileNonNullPart(

Callers 1

CreateVirtualDatasetMethod · 0.95

Calls 4

ContainsAnyFunction · 0.85
c_strMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected