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

Method GetNewDataSet

IO/HDF/vtkHDFReaderImplementation.cxx:1443–1493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1441template bool vtkHDFReader::Implementation::GetAttribute<double>(
1442 const char* attributeName, size_t dim, double* value);
1443VTK_ABI_NAMESPACE_END
1444
1445//------------------------------------------------------------------------------
1446vtkSmartPointer<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}

Callers 3

RequestDataObjectMethod · 0.80
ReadMethod · 0.80
ReadRecursivelyMethod · 0.80

Calls 4

findFunction · 0.50
NewFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected