------------------------------------------------------------------------------
| 1366 | |
| 1367 | //------------------------------------------------------------------------------ |
| 1368 | bool vtkHDFWriter::AppendBlocks(hid_t group, vtkPartitionedDataSetCollection* pdc) |
| 1369 | { |
| 1370 | for (unsigned int datasetId = 0; datasetId < pdc->GetNumberOfPartitionedDataSets(); datasetId++) |
| 1371 | { |
| 1372 | vtkHDF::ScopedH5GHandle datasetGroup; |
| 1373 | vtkPartitionedDataSet* currentBlock = pdc->GetPartitionedDataSet(datasetId); |
| 1374 | const std::string currentName = ::getBlockName(pdc, datasetId); |
| 1375 | |
| 1376 | if (this->UseExternalComposite) |
| 1377 | { |
| 1378 | if (!this->AppendExternalBlock(currentBlock, currentName)) |
| 1379 | { |
| 1380 | return false; |
| 1381 | } |
| 1382 | datasetGroup = this->Impl->OpenExistingGroup(group, currentName.c_str()); |
| 1383 | } |
| 1384 | else |
| 1385 | { |
| 1386 | if (this->CurrentTimeIndex == 0) |
| 1387 | { |
| 1388 | datasetGroup = this->Impl->CreateHdfGroup(group, currentName.c_str()); |
| 1389 | } |
| 1390 | else |
| 1391 | { |
| 1392 | datasetGroup = this->Impl->OpenExistingGroup(group, currentName.c_str()); |
| 1393 | } |
| 1394 | this->PreviousStepMeshMTime = this->CompositeMeshMTime[datasetId]; |
| 1395 | this->DispatchDataObject(datasetGroup, currentBlock); |
| 1396 | if (auto ds = vtkDataSet::SafeDownCast(currentBlock->GetPartition(0))) |
| 1397 | { |
| 1398 | this->CompositeMeshMTime[datasetId] = ds->GetMeshMTime(); |
| 1399 | } |
| 1400 | else |
| 1401 | { |
| 1402 | this->CompositeMeshMTime[datasetId] = this->CurrentTimeIndex + 1; |
| 1403 | } |
| 1404 | } |
| 1405 | |
| 1406 | if (this->CurrentTimeIndex == 0) |
| 1407 | { |
| 1408 | this->Impl->CreateScalarAttribute(datasetGroup, "Index", datasetId); |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | return true; |
| 1413 | } |
| 1414 | |
| 1415 | //------------------------------------------------------------------------------ |
| 1416 | bool vtkHDFWriter::AppendExternalBlock(vtkDataObject* block, const std::string& blockName) |
no test coverage detected