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

Method ReadHyperTreeGridDimensions

IO/HDF/vtkHDFReaderImplementation.cxx:1261–1293  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1259
1260//------------------------------------------------------------------------------
1261bool 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//------------------------------------------------------------------------------
1296bool vtkHDFReader::Implementation::CreateHyperTreeGridCellArrays(vtkHyperTreeGrid* htg,

Callers 1

ReadHyperTreeGridDataMethod · 0.95

Calls 6

GetAttributeMethod · 0.95
dataMethod · 0.45
SetDimensionsMethod · 0.45
SetXCoordinatesMethod · 0.45
SetYCoordinatesMethod · 0.45
SetZCoordinatesMethod · 0.45

Tested by

no test coverage detected