| 1441 | template bool vtkHDFReader::Implementation::GetAttribute<double>( |
| 1442 | const char* attributeName, size_t dim, double* value); |
| 1443 | VTK_ABI_NAMESPACE_END |
| 1444 | |
| 1445 | //------------------------------------------------------------------------------ |
| 1446 | vtkSmartPointer<vtkDataObject> vtkHDFReader::Implementation::GetNewDataSet( |
| 1447 | int dataSetType, int numPieces) |
| 1448 | { |
| 1449 | constexpr std::array partitionedTypes = { VTK_UNSTRUCTURED_GRID, VTK_POLY_DATA, |
| 1450 | VTK_HYPER_TREE_GRID }; |
| 1451 | vtkSmartPointer<vtkDataObject> newOutput = nullptr; |
| 1452 | if (numPieces > 1 && |
| 1453 | std::find(partitionedTypes.begin(), partitionedTypes.end(), dataSetType) != |
| 1454 | partitionedTypes.end()) |
| 1455 | { |
| 1456 | newOutput = vtkSmartPointer<vtkPartitionedDataSet>::New(); |
| 1457 | } |
| 1458 | else if (dataSetType == VTK_IMAGE_DATA) |
| 1459 | { |
| 1460 | newOutput = vtkSmartPointer<vtkImageData>::New(); |
| 1461 | } |
| 1462 | else if (dataSetType == VTK_UNSTRUCTURED_GRID) |
| 1463 | { |
| 1464 | newOutput = vtkSmartPointer<vtkUnstructuredGrid>::New(); |
| 1465 | } |
| 1466 | else if (dataSetType == VTK_POLY_DATA) |
| 1467 | { |
| 1468 | newOutput = vtkSmartPointer<vtkPolyData>::New(); |
| 1469 | } |
| 1470 | else if (dataSetType == VTK_HYPER_TREE_GRID) |
| 1471 | { |
| 1472 | newOutput = vtkSmartPointer<vtkHyperTreeGrid>::New(); |
| 1473 | } |
| 1474 | else if (dataSetType == VTK_OVERLAPPING_AMR) |
| 1475 | { |
| 1476 | newOutput = vtkSmartPointer<vtkOverlappingAMR>::New(); |
| 1477 | } |
| 1478 | else if (dataSetType == VTK_PARTITIONED_DATA_SET_COLLECTION) |
| 1479 | { |
| 1480 | newOutput = vtkSmartPointer<vtkPartitionedDataSetCollection>::New(); |
| 1481 | } |
| 1482 | else if (dataSetType == VTK_MULTIBLOCK_DATA_SET) |
| 1483 | { |
| 1484 | newOutput = vtkSmartPointer<vtkMultiBlockDataSet>::New(); |
| 1485 | } |
| 1486 | else |
| 1487 | { |
| 1488 | vtkErrorWithObjectMacro(this->Reader, "HDF dataset type unknown: " << dataSetType); |
| 1489 | return nullptr; |
| 1490 | } |
| 1491 | |
| 1492 | return newOutput; |
| 1493 | } |
no test coverage detected