| 1589 | // vtkCellArray::Visit entry point: |
| 1590 | template <class OffsetsT, class ConnectivityT> |
| 1591 | void operator()(OffsetsT* offsets, ConnectivityT* conn, TLinks* links, vtkIdType cellId, |
| 1592 | vtkIdType nPts, const vtkIdType* pts, vtkIdList* cellIds) const |
| 1593 | { |
| 1594 | using ValueType = GetAPIType<OffsetsT>; |
| 1595 | |
| 1596 | // Find the shortest linked list |
| 1597 | auto minPtId = pts[0]; |
| 1598 | auto minNumCells = links->GetNcells(minPtId); |
| 1599 | vtkIdType numCells; |
| 1600 | for (vtkIdType i = 1; i < nPts; ++i) |
| 1601 | { |
| 1602 | const auto& ptId = pts[i]; |
| 1603 | numCells = links->GetNcells(ptId); |
| 1604 | if (numCells < minNumCells) |
| 1605 | { |
| 1606 | minNumCells = numCells; |
| 1607 | minPtId = ptId; |
| 1608 | } |
| 1609 | } |
| 1610 | const auto minCells = links->GetCells(minPtId); |
| 1611 | |
| 1612 | // Now for each cell, see if it contains all the face points |
| 1613 | // in the facePts list. If so, then this is not a boundary face. |
| 1614 | const auto connRange = GetRange(conn); |
| 1615 | const auto offsetsRange = GetRange(offsets); |
| 1616 | bool match; |
| 1617 | vtkIdType j; |
| 1618 | ValueType k; |
| 1619 | for (vtkIdType i = 0; i < minNumCells; ++i) |
| 1620 | { |
| 1621 | const auto& minCellId = minCells[i]; |
| 1622 | if (minCellId != cellId) // don't include current cell |
| 1623 | { |
| 1624 | // get cell points |
| 1625 | const ValueType nCellPts = offsetsRange[minCellId + 1] - offsetsRange[minCellId]; |
| 1626 | const auto cellPts = connRange.begin() + offsetsRange[minCellId]; |
| 1627 | match = true; |
| 1628 | for (j = 0; j < nPts && match; ++j) // for all pts in input boundary entity |
| 1629 | { |
| 1630 | const auto& ptId = pts[j]; |
| 1631 | if (ptId != minPtId) // of course minPtId is contained by cell |
| 1632 | { |
| 1633 | match = false; |
| 1634 | for (k = 0; k < nCellPts; ++k) // for all points in candidate cell |
| 1635 | { |
| 1636 | if (ptId == cellPts[k]) |
| 1637 | { |
| 1638 | match = true; // a match was found |
| 1639 | break; |
| 1640 | } |
| 1641 | } // for all points in current cell |
| 1642 | } // if not guaranteed match |
| 1643 | } // for all input points |
| 1644 | if (match) |
| 1645 | { |
| 1646 | cellIds->InsertNextId(minCellId); |
| 1647 | } |
| 1648 | } // if not the reference cell |
nothing calls this directly
no test coverage detected