| 1629 | } |
| 1630 | |
| 1631 | void FaceOperator(vtkIdType faceBeginCellId, vtkIdType faceEndCellId) |
| 1632 | { |
| 1633 | auto& polys = this->LocalData.Local().Polys; |
| 1634 | const auto& extent = this->Extent; |
| 1635 | const auto& dims = this->Dims; |
| 1636 | const int& axis = this->CurrentAxis; |
| 1637 | const int& iAxis = this->IAxis; |
| 1638 | const int& jAxis = this->JAxis; |
| 1639 | |
| 1640 | const int axis2 = this->CurrentAxis * 2; |
| 1641 | const int iAxis2 = this->IAxis * 2; |
| 1642 | const int jAxis2 = this->JAxis * 2; |
| 1643 | |
| 1644 | TInputIdType cellId; |
| 1645 | int ijk[3]; |
| 1646 | ijk[axis] = this->MinFace ? extent[axis2] : extent[axis2 + 1] - 1; |
| 1647 | const int faceWidth_1 = dims[iAxis] - 1; |
| 1648 | const bool isFirst = vtkSMPTools::GetSingleThread(); |
| 1649 | const auto checkAbortInterval = |
| 1650 | std::min((faceEndCellId - faceBeginCellId) / 10 + 1, (vtkIdType)1000); |
| 1651 | for (vtkIdType faceCellId = faceBeginCellId; faceCellId < faceEndCellId; ++faceCellId) |
| 1652 | { |
| 1653 | if (faceCellId % checkAbortInterval == 0) |
| 1654 | { |
| 1655 | if (isFirst) |
| 1656 | { |
| 1657 | this->Self->CheckAbort(); |
| 1658 | } |
| 1659 | if (this->Self->GetAbortOutput()) |
| 1660 | { |
| 1661 | break; |
| 1662 | } |
| 1663 | } |
| 1664 | ijk[iAxis] = extent[iAxis2] + static_cast<int>(faceCellId % faceWidth_1); |
| 1665 | ijk[jAxis] = extent[jAxis2] + static_cast<int>(faceCellId / faceWidth_1); |
| 1666 | cellId = static_cast<TInputIdType>(vtkStructuredData::ComputeCellIdForExtent(extent, ijk)); |
| 1667 | if (!this->ForceSimpleVisibilityCheck || this->Input->IsCellVisible(cellId)) |
| 1668 | { |
| 1669 | const auto face = this->GetFace(ijk, this->MinFace, FaceMode::WHOLE_FACE); |
| 1670 | polys.template InsertNextCell<TInputIdType, decltype(face.data())>(4, face.data(), cellId); |
| 1671 | } |
| 1672 | } |
| 1673 | } |
| 1674 | |
| 1675 | /** |
| 1676 | * Implementation to compute the external polydata for a structured grid with |
no test coverage detected