------------------------------------------------------------------------------
| 1259 | |
| 1260 | //------------------------------------------------------------------------------ |
| 1261 | bool vtkHDFReader::Implementation::ReadHyperTreeGridDimensions(vtkHyperTreeGrid* htg) |
| 1262 | { |
| 1263 | std::array<int, 3> dimensions; |
| 1264 | if (!this->GetAttribute("Dimensions", 1, dimensions.data())) |
| 1265 | { |
| 1266 | vtkErrorWithObjectMacro(this->Reader, << "Missing dimensions attribute"); |
| 1267 | return false; |
| 1268 | } |
| 1269 | |
| 1270 | // Read coordinate arrays |
| 1271 | std::vector<hsize_t> coordinates_extent{ 0, static_cast<hsize_t>(dimensions[0]) }; |
| 1272 | auto XCoordinates = vtk::TakeSmartPointer( |
| 1273 | vtkHDFUtilities::NewArrayForGroup(this->VTKGroup, "XCoordinates", coordinates_extent)); |
| 1274 | coordinates_extent[1] = static_cast<hsize_t>(dimensions[1]); |
| 1275 | auto YCoordinates = vtk::TakeSmartPointer( |
| 1276 | vtkHDFUtilities::NewArrayForGroup(this->VTKGroup, "YCoordinates", coordinates_extent)); |
| 1277 | coordinates_extent[1] = static_cast<hsize_t>(dimensions[2]); |
| 1278 | auto ZCoordinates = vtk::TakeSmartPointer( |
| 1279 | vtkHDFUtilities::NewArrayForGroup(this->VTKGroup, "ZCoordinates", coordinates_extent)); |
| 1280 | |
| 1281 | if (!XCoordinates || !YCoordinates || !ZCoordinates) |
| 1282 | { |
| 1283 | vtkErrorWithObjectMacro(this->Reader, << "Missing coordinates array"); |
| 1284 | return false; |
| 1285 | } |
| 1286 | |
| 1287 | htg->SetDimensions(dimensions.data()); |
| 1288 | htg->SetXCoordinates(XCoordinates); |
| 1289 | htg->SetYCoordinates(YCoordinates); |
| 1290 | htg->SetZCoordinates(ZCoordinates); |
| 1291 | |
| 1292 | return true; |
| 1293 | } |
| 1294 | |
| 1295 | //------------------------------------------------------------------------------ |
| 1296 | bool vtkHDFReader::Implementation::CreateHyperTreeGridCellArrays(vtkHyperTreeGrid* htg, |
no test coverage detected