------------------------------------------------------------------------------ Return number of cells using edge #edgeId
| 2551 | //------------------------------------------------------------------------------ |
| 2552 | // Return number of cells using edge #edgeId |
| 2553 | int vtkSimpleCellTessellator::GetNumberOfCellsUsingEdge(int edgeId) |
| 2554 | { |
| 2555 | assert("pre: valid_range" && edgeId >= 0); // && edgeId<=5); |
| 2556 | #if SLOW_API |
| 2557 | int result = 0; |
| 2558 | this->GenericCell->GetBoundaryIterator(this->CellIterator, 1); |
| 2559 | this->CellIterator->Begin(); |
| 2560 | |
| 2561 | int i = 0; |
| 2562 | while (!this->CellIterator->IsAtEnd() && (i < edgeId)) |
| 2563 | { |
| 2564 | this->CellIterator->Next(); |
| 2565 | ++i; |
| 2566 | } |
| 2567 | |
| 2568 | assert("check: cell_found" && i == edgeId); |
| 2569 | // +1 because CountNeighbors does not include the cell itself. |
| 2570 | result = this->GenericCell->CountNeighbors(this->CellIterator->GetCell()) + 1; |
| 2571 | return result; |
| 2572 | #else |
| 2573 | // The cell with the greatest number of edges is the hexagonal prism |
| 2574 | // 6*2+6 |
| 2575 | int edgeSharing[18]; |
| 2576 | this->GenericCell->CountEdgeNeighbors(edgeSharing); |
| 2577 | return edgeSharing[edgeId] + 1; |
| 2578 | #endif |
| 2579 | } |
| 2580 | |
| 2581 | //------------------------------------------------------------------------------ |
| 2582 | // Return number of cells using face #faceId |
no test coverage detected