------------------------------------------------------------------------------
| 1294 | |
| 1295 | //------------------------------------------------------------------------------ |
| 1296 | bool vtkHDFReader::Implementation::CreateHyperTreeGridCellArrays(vtkHyperTreeGrid* htg, |
| 1297 | std::vector<vtkSmartPointer<vtkAbstractArray>>& cellArrays, |
| 1298 | const vtkDataArraySelection* arraySelection, vtkIdType cellCount) |
| 1299 | { |
| 1300 | constexpr int cellType = vtkDataObject::AttributeTypes::CELL; |
| 1301 | const std::vector<std::string> arrayNames = this->GetArrayNames(cellType); |
| 1302 | for (const std::string& arrayName : arrayNames) |
| 1303 | { |
| 1304 | if (arraySelection->ArrayIsEnabled(arrayName.c_str())) |
| 1305 | { |
| 1306 | // Read a null extent so we get the correct array type |
| 1307 | vtkSmartPointer<vtkDataArray> array; |
| 1308 | std::vector<hsize_t> nullExtent{ 0, 0 }; |
| 1309 | if ((array = vtk::TakeSmartPointer( |
| 1310 | this->NewArray(cellType, arrayName.c_str(), nullExtent))) == nullptr) |
| 1311 | { |
| 1312 | vtkErrorWithObjectMacro(nullptr, "Error reading array " << arrayName); |
| 1313 | return false; |
| 1314 | } |
| 1315 | |
| 1316 | array->SetName(arrayName.c_str()); |
| 1317 | array->Allocate(cellCount * array->GetNumberOfComponents()); |
| 1318 | htg->GetCellData()->AddArray(array); |
| 1319 | cellArrays.emplace_back(array); |
| 1320 | } |
| 1321 | } |
| 1322 | |
| 1323 | return true; |
| 1324 | } |
| 1325 | |
| 1326 | //------------------------------------------------------------------------------ |
| 1327 | bool vtkHDFReader::Implementation::AppendCellDataForHyperTree( |
no test coverage detected