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

Method RetrieveDataArraysFromAssembly

IO/HDF/vtkHDFReader.cxx:1616–1649  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1614
1615//------------------------------------------------------------------------------
1616bool vtkHDFReader::RetrieveDataArraysFromAssembly()
1617{
1618 const std::vector<std::string> datasets =
1619 this->Impl->GetOrderedChildrenOfGroup(vtkHDFUtilities::VTKHDF_ROOT_PATH);
1620 for (const auto& datasetName : datasets)
1621 {
1622 if (datasetName == "Assembly")
1623 {
1624 continue;
1625 }
1626 std::string hdfPathName = vtkHDFUtilities::VTKHDF_ROOT_PATH + "/" + datasetName;
1627
1628 if (!this->Impl->HasAttribute(hdfPathName.c_str(), "Type"))
1629 {
1630 continue; // Allow empty datasets in assembly
1631 }
1632 if (!this->Impl->RetrieveHDFInformation(hdfPathName))
1633 {
1634 return false;
1635 }
1636
1637 for (int attrIdx = vtkDataObject::AttributeTypes::POINT;
1638 attrIdx <= vtkDataObject::AttributeTypes::CELL; ++attrIdx)
1639 {
1640 const std::vector<std::string> arrayNames = this->Impl->GetArrayNames(attrIdx);
1641 for (const std::string& arrayName : arrayNames)
1642 {
1643 this->DataArraySelection[attrIdx]->AddArray(arrayName.c_str());
1644 }
1645 }
1646 }
1647
1648 return true;
1649}
1650
1651//------------------------------------------------------------------------------
1652int vtkHDFReader::ReadRecursively(

Callers 1

SetupInformationMethod · 0.95

Calls 6

GetArrayNamesMethod · 0.80
HasAttributeMethod · 0.45
c_strMethod · 0.45
AddArrayMethod · 0.45

Tested by

no test coverage detected