Developer Documentation

Iterators and Circulators

In order to iterate over the entities of a mesh or just a certain neighborhood (circulator) of an entity, OpenVolumeMesh provides a set of iterators and circulators. These iterators are entirely STL-compatible and can as such be used in all algorithms of the C++ standard template library. We distinguish between two different kinds of iterators:

- Intrinsic Iterators: Iterators that do not require bottom-up incidences to be computed.
- Bottom-Up Incidence Dependent Iterators: Iterators that need bottom-up incidences to be computed before they can be used.

For information on bottom-up incidences, refer to Section Concepts of OpenVolumeMesh. Note since OpenVolumeMesh is an index-based data structure, the iterators encapsulate handles to entities. Dereferencing an iterator thus never returns a reference to the entity itself but only a handle to the entity.

The following sections provide a concise overview of the iterators that come along with OpenVolumeMesh.

# Intrinsic Iterators

- OpenVolumeMesh::VertexIter: Iterate over all vertices of a mesh.
- OpenVolumeMesh::EdgeIter: Iterate over all edges of a mesh.
- OpenVolumeMesh::HalfEdgeIter: Iterate over all half-edges of a mesh.
- OpenVolumeMesh::FaceIter: Iterate over all faces of a mesh.
- OpenVolumeMesh::HalfFaceIter: Iterate over all half-faces of a mesh.
- OpenVolumeMesh::CellIter: Iterate over all cells of a mesh.
- OpenVolumeMesh::CellVertexIter: Iterate over all vertices of a given cell.

# Bottom-Up Incidence Dependent Iterators and Circulators

## Iterators for General Polyhedral Meshes

- OpenVolumeMesh::BoundaryFaceIter: Iterate over all boundary faces of a mesh.
- OpenVolumeMesh::CellCellIter: Iterate over all adjacent cells of a given reference cell.
- OpenVolumeMesh::VertexOHalfEdgeIter: Iterate over all incident outgoing half-edges of a given vertex.
- OpenVolumeMesh::HalfEdgeHalfFaceIter: Iterate over all incident half-faces of a given half-edge.
- OpenVolumeMesh::VertexCellIter: Iterate over all incident cells of a given vertex.
- OpenVolumeMesh::HalfEdgeCellIter: Iterate over all incident cells of a given half-edge.

## Specializations for Hexahedral Meshes

- OpenVolumeMesh::CellSheetCellIter: Iterate over all adjacent hexahedra in the same sheet of a given hexahedron. Also see Tutorial 02: Using Iterators, last example.
- OpenVolumeMesh::HalfFaceSheetHalfFaceIter: Iterate over all adjacent half-faces of a given half-face in the same sheet of hexahedra.
- OpenVolumeMesh::OutsideNeighborHalfFaceIter: Iterate over all adjacent boundary half-faces (outside) of a given boundary half-face.

Todo:
  Make figures for all iterators.