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

Method GetMetaData

Common/DataModel/vtkDataObjectTree.cxx:373–410  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

371
372//------------------------------------------------------------------------------
373vtkInformation* vtkDataObjectTree::GetMetaData(vtkCompositeDataIterator* compositeIter)
374{
375 auto dObjTreeIter = vtkDataObjectTreeIterator::SafeDownCast(compositeIter);
376 if (!dObjTreeIter || dObjTreeIter->IsDoneWithTraversal())
377 {
378 vtkErrorMacro("Invalid iterator location.");
379 return nullptr;
380 }
381
382 vtkDataObjectTreeIndex index = dObjTreeIter->GetCurrentIndex();
383
384 if (index.empty())
385 {
386 // Sanity check.
387 vtkErrorMacro("Invalid index returned by iterator.");
388 return nullptr;
389 }
390
391 vtkDataObjectTree* parent = this;
392 int numIndices = static_cast<int>(index.size());
393 for (int cc = 0; cc < numIndices - 1; cc++)
394 {
395 if (!parent || parent->GetNumberOfChildren() <= index[cc])
396 {
397 vtkErrorMacro("Structure is not expected. Did you forget to use copy structure?");
398 return nullptr;
399 }
400 parent = vtkDataObjectTree::SafeDownCast(parent->GetChild(index[cc]));
401 }
402
403 if (!parent || parent->GetNumberOfChildren() <= index.back())
404 {
405 vtkErrorMacro("Structure is not expected. Did you forget to use copy structure?");
406 return nullptr;
407 }
408
409 return parent->GetChildMetaData(index.back());
410}
411
412//------------------------------------------------------------------------------
413vtkTypeBool vtkDataObjectTree::HasMetaData(vtkCompositeDataIterator* compositeIter)

Calls 8

backMethod · 0.80
GetChildMetaDataMethod · 0.80
IsDoneWithTraversalMethod · 0.45
GetCurrentIndexMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
GetNumberOfChildrenMethod · 0.45
GetChildMethod · 0.45

Tested by 1

CreateMultiBlockFunction · 0.36