------------------------------------------------------------------------------
| 1521 | |
| 1522 | //------------------------------------------------------------------------------ |
| 1523 | void vtkHDFWriter::Implementation::CreateArraysFromNonNullPart(hid_t group, vtkDataObject* data) |
| 1524 | { |
| 1525 | std::array<hid_t, 3> attributeDataGroup{ H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID }; |
| 1526 | std::array attributeGroupNames = { PATH::POINT_DATA, PATH::CELL_DATA, PATH::FIELD_DATA }; |
| 1527 | |
| 1528 | for (int i = 0; i < 3; i++) |
| 1529 | { |
| 1530 | if (H5Lexists(group, attributeGroupNames[i].c_str(), H5P_DEFAULT) > 0) |
| 1531 | { |
| 1532 | vtkHDF::ScopedH5GHandle pointDataGroup = |
| 1533 | this->OpenExistingGroup(group, attributeGroupNames[i].c_str()); |
| 1534 | attributeDataGroup[i] = pointDataGroup; |
| 1535 | for (const std::string& name : vtkHDFUtilities::GetArrayNames(attributeDataGroup, i)) |
| 1536 | { |
| 1537 | std::vector<hsize_t> extent = { 0, 0 }; |
| 1538 | vtkSmartPointer<vtkDataArray> array = vtk::TakeSmartPointer( |
| 1539 | vtkHDFUtilities::NewArrayForGroup(attributeDataGroup[i], name.c_str(), extent)); |
| 1540 | array->SetName(name.c_str()); |
| 1541 | if (i == vtkDataObject::AttributeTypes::FIELD) |
| 1542 | { |
| 1543 | data->GetAttributesAsFieldData(i)->AddArray(array); |
| 1544 | } |
| 1545 | else |
| 1546 | { |
| 1547 | data->GetAttributes(i)->AddArray(array); |
| 1548 | } |
| 1549 | } |
| 1550 | } |
| 1551 | } |
| 1552 | } |
| 1553 | //------------------------------------------------------------------------------ |
| 1554 | vtkHDFWriter::Implementation::Implementation(vtkHDFWriter* writer) |
| 1555 | : Writer(writer) |
no test coverage detected