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

Method GetNumberOfCells

Common/DataModel/vtkDataObjectTree.cxx:585–602  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

583
584//------------------------------------------------------------------------------
585vtkIdType vtkDataObjectTree::GetNumberOfCells()
586{
587 vtkIdType numCells = 0;
588 auto dObjTreeIter = vtk::TakeSmartPointer(this->NewIterator());
589 for (dObjTreeIter->InitTraversal(); !dObjTreeIter->IsDoneWithTraversal();
590 dObjTreeIter->GoToNextItem())
591 {
592 if (auto ds = vtkDataSet::SafeDownCast(dObjTreeIter->GetCurrentDataObject()))
593 {
594 numCells += ds->GetNumberOfCells();
595 }
596 else if (auto cg = vtkCellGrid::SafeDownCast(dObjTreeIter->GetCurrentDataObject()))
597 {
598 numCells += cg->GetNumberOfCells();
599 }
600 }
601 return numCells;
602}
603
604//------------------------------------------------------------------------------
605unsigned long vtkDataObjectTree::GetActualMemorySize()

Callers

nothing calls this directly

Calls 5

NewIteratorMethod · 0.95
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45
GoToNextItemMethod · 0.45
GetCurrentDataObjectMethod · 0.45

Tested by

no test coverage detected