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

Method CreateHyperTreeGridCellArrays

IO/HDF/vtkHDFReaderImplementation.cxx:1296–1324  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1294
1295//------------------------------------------------------------------------------
1296bool 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//------------------------------------------------------------------------------
1327bool vtkHDFReader::Implementation::AppendCellDataForHyperTree(

Callers 1

ReadHyperTreeGridDataMethod · 0.95

Calls 10

GetArrayNamesMethod · 0.95
NewArrayMethod · 0.95
ArrayIsEnabledMethod · 0.45
c_strMethod · 0.45
SetNameMethod · 0.45
AllocateMethod · 0.45
GetNumberOfComponentsMethod · 0.45
AddArrayMethod · 0.45
GetCellDataMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected