------------------------------------------------------------------------------ Return number of cells using face #faceId
| 2581 | //------------------------------------------------------------------------------ |
| 2582 | // Return number of cells using face #faceId |
| 2583 | int 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: |
no test coverage detected