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

Method GetNumberOfCellsUsingFace

Common/DataModel/vtkSimpleCellTessellator.cxx:2583–2612  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Return number of cells using face #faceId

Source from the content-addressed store, hash-verified

2581//------------------------------------------------------------------------------
2582// Return number of cells using face #faceId
2583int vtkSimpleCellTessellator::GetNumberOfCellsUsingFace(int faceId)
2584{
2585#if SLOW_API
2586 int result = 0;
2587 this->GenericCell->GetBoundaryIterator(this->CellIterator, 2);
2588 this->CellIterator->Begin();
2589
2590 int i = 0;
2591 while (!this->CellIterator->IsAtEnd() && (i < faceId))
2592 {
2593 this->CellIterator->Next();
2594 ++i;
2595 }
2596
2597 assert("check: cell_found" && i == faceId);
2598 // +1 because CountNeighbors does not include the cell itself.
2599 result = this->GenericCell->CountNeighbors(this->CellIterator->GetCell()) + 1;
2600
2601 return result;
2602#else
2603 if (this->GenericCell->IsFaceOnBoundary(faceId))
2604 {
2605 // So no other cell is using it:
2606 return 1;
2607 }
2608
2609 // else this face is used by another cell
2610 return 2;
2611#endif
2612}
2613
2614//------------------------------------------------------------------------------
2615// Description:

Callers 1

Calls 8

GetBoundaryIteratorMethod · 0.80
CountNeighborsMethod · 0.80
IsFaceOnBoundaryMethod · 0.80
assertFunction · 0.50
BeginMethod · 0.45
IsAtEndMethod · 0.45
NextMethod · 0.45
GetCellMethod · 0.45

Tested by

no test coverage detected