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

Method ReadHyperTreeGridMetaInfo

IO/HDF/vtkHDFReaderImplementation.cxx:1214–1258  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1212
1213//------------------------------------------------------------------------------
1214bool vtkHDFReader::Implementation::ReadHyperTreeGridMetaInfo(vtkHyperTreeGrid* htg)
1215{
1216 // Read general info about this HTG
1217 int branchFactor = 0;
1218 if (!this->GetAttribute("BranchFactor", 1, &branchFactor))
1219 {
1220 vtkErrorWithObjectMacro(this->Reader, << "Cannot find BranchFactor attribute");
1221 return false;
1222 }
1223 htg->SetBranchFactor(branchFactor);
1224
1225 // Read TransposedRootIndexing attribute
1226 int transposedRootIndexing = 0;
1227 if (H5Aexists(this->VTKGroup, "TransposedRootIndexing") > 0)
1228 {
1229 this->GetAttribute("TransposedRootIndexing", 1, &transposedRootIndexing);
1230 }
1231 htg->SetTransposedRootIndexing(transposedRootIndexing != 0);
1232
1233 // Read Interface attributes if they exist
1234 bool hasInterfaceIntercepts = H5Aexists(this->VTKGroup, "InterfaceInterceptsName") > 0;
1235 bool hasInterfaceNormals = H5Aexists(this->VTKGroup, "InterfaceNormalsName") > 0;
1236 if (hasInterfaceIntercepts)
1237 {
1238 std::string interfaceInterceptsName;
1239 vtkHDFUtilities::GetStringAttribute(
1240 this->VTKGroup, "InterfaceInterceptsName", interfaceInterceptsName);
1241 htg->SetInterfaceInterceptsName(interfaceInterceptsName.c_str());
1242 }
1243
1244 if (hasInterfaceNormals)
1245 {
1246 std::string interfaceNormalsName;
1247 vtkHDFUtilities::GetStringAttribute(
1248 this->VTKGroup, "InterfaceNormalsName", interfaceNormalsName);
1249 htg->SetInterfaceNormalsName(interfaceNormalsName.c_str());
1250 }
1251
1252 if (hasInterfaceIntercepts && hasInterfaceNormals)
1253 {
1254 htg->SetHasInterface(true);
1255 }
1256
1257 return true;
1258}
1259
1260//------------------------------------------------------------------------------
1261bool vtkHDFReader::Implementation::ReadHyperTreeGridDimensions(vtkHyperTreeGrid* htg)

Callers 1

ReadHyperTreeGridDataMethod · 0.95

Calls 4

GetAttributeMethod · 0.95
H5AexistsFunction · 0.85
SetBranchFactorMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected