Commit 3c666dd9 authored by Mike Kremer's avatar Mike Kremer

Renamed HalfedgeCellIter to HalfEdgeCellIter, added another tutorial

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@76 66977474-1d4b-4f09-8fe9-267525286df2
parent def7c4d5
......@@ -2,4 +2,51 @@
\page iterators_and_circulators 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:
\li \b Intrinsic \b Iterators: Iterators that do not require bottom-up adjacencies to
be computed.
\li \b Bottom-Up \b Adjacency \b Dependent \b Iterators: Iterators that need bottom-up
adjacencies to be computed before they can be used.
For information on bottom-up adjacencies, refer to Section \ref concepts. Bottom-up
adjacencies can be computed by calling OpenVolumeMesh::PolyhedralMesh::update_adjacencies().
Note since %OpenVolumeMesh is an index-based data structure, the iterators encapsulate
\e 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.
\section intrinsic_iterators Intrinsic Iterators
\li OpenVolumeMesh::VertexIter: Iterate over all vertices of a mesh.
\li OpenVolumeMesh::EdgeIter: Iterate over all edges of a mesh.
\li OpenVolumeMesh::HalfEdgeIter: Iterate over all half-edges of a mesh.
\li OpenVolumeMesh::FaceIter: Iterate over all faces of a mesh.
\li OpenVolumeMesh::HalfFaceIter: Iterate over all half-faces of a mesh.
\li OpenVolumeMesh::CellIter: Iterate over all cells of a mesh.
\li OpenVolumeMesh::CellVertexIter: Iterate over all vertices of a given cell.
\section adjacency_depending_iterators Bottom-Up Adjacency Dependent Iterators and Circulators
\subsection general_iterators Iterators for General Polyhedral Meshes
\li OpenVolumeMesh::BoundaryFaceIter: Iterate over all boundary faces of a mesh.
\li OpenVolumeMesh::CellCellIter: Iterate over all adjacent cells of a given reference cell.
\li OpenVolumeMesh::VertexOHalfEdgeIter: Iterate over all incident outgoing half-edges of a given vertex.
\li OpenVolumeMesh::HalfEdgeHalfFaceIter: Iterate over all incident half-faces of a given half-edge.
\li OpenVolumeMesh::VertexCellIter: Iterate over all incident cells of a given vertex.
\li OpenVolumeMesh::HalfEdgeCellIter: Iterate over all incident cells of a given half-edge.
\subsection hexahedral_mesh_iterators Specializations for Hexahedral Meshes
\li OpenVolumeMesh::CellSheetCellIter
\li OpenVolumeMesh::HalfFaceSheetHalfFaceIter
\li OpenVolumeMesh::OutsideNeighborHalfFaceIter
**/
......@@ -124,7 +124,7 @@ public:
friend class HalfFaceSheetHalfFaceIter<VecT>;
friend class OutsideNeighborHalfFaceIter<VecT>;
typedef class CellSheetCellIter<VecT> CellSheetCellIter;
typedef class CellSheetCellIter<VecT> CellSheetCellIter;
typedef class HalfFaceSheetHalfFaceIter<VecT> HalfFaceSheetHalfFaceIter;
typedef class OutsideNeighborHalfFaceIter<VecT> OutsideNeighborHalfFaceIter;
......
......@@ -170,7 +170,7 @@ public:
friend class VertexOHalfEdgeIter<VecT>;
friend class HalfEdgeHalfFaceIter<VecT>;
friend class VertexCellIter<VecT>;
friend class HalfedgeCellIter<VecT>;
friend class HalfEdgeCellIter<VecT>;
friend class CellVertexIter<VecT>;
friend class CellCellIter<VecT>;
friend class BoundaryFaceIter<VecT>;
......@@ -181,19 +181,19 @@ public:
friend class HalfFaceIter<VecT>;
friend class CellIter<VecT>;
typedef class VertexOHalfEdgeIter<VecT> VertexOHalfEdgeIter;
typedef class HalfEdgeHalfFaceIter<VecT> HalfEdgeHalfFaceIter;
typedef class VertexOHalfEdgeIter<VecT> VertexOHalfEdgeIter;
typedef class HalfEdgeHalfFaceIter<VecT> HalfEdgeHalfFaceIter;
typedef class VertexCellIter<VecT> VertexCellIter;
typedef class HalfedgeCellIter<VecT> HalfedgeCellIter;
typedef class HalfEdgeCellIter<VecT> HalfEdgeCellIter;
typedef class CellVertexIter<VecT> CellVertexIter;
typedef class CellCellIter<VecT> CellCellIter;
typedef class BoundaryFaceIter<VecT> BoundaryFaceIter;
typedef class VertexIter<VecT> VertexIter;
typedef class EdgeIter<VecT> EdgeIter;
typedef class HalfEdgeIter<VecT> HalfEdgeIter;
typedef class FaceIter<VecT> FaceIter;
typedef class HalfFaceIter<VecT> HalfFaceIter;
typedef class CellIter<VecT> CellIter;
typedef class CellCellIter<VecT> CellCellIter;
typedef class BoundaryFaceIter<VecT> BoundaryFaceIter;
typedef class VertexIter<VecT> VertexIter;
typedef class EdgeIter<VecT> EdgeIter;
typedef class HalfEdgeIter<VecT> HalfEdgeIter;
typedef class FaceIter<VecT> FaceIter;
typedef class HalfFaceIter<VecT> HalfFaceIter;
typedef class CellIter<VecT> CellIter;
VertexOHalfEdgeIter voh_iter(const VertexHandle& _idx) const {
return VertexOHalfEdgeIter(_idx, this);
......@@ -207,8 +207,8 @@ public:
return VertexCellIter(_idx, this);
}
HalfedgeCellIter hec_iter(const HalfEdgeHandle& _idx) const {
return HalfedgeCellIter(_idx, this);
HalfEdgeCellIter hec_iter(const HalfEdgeHandle& _idx) const {
return HalfEdgeCellIter(_idx, this);
}
CellVertexIter cv_iter(const CellHandle& _idx) const {
......
......@@ -333,7 +333,7 @@ private:
typename std::set<CellHandle>::const_iterator cell_iter_;
};
template <class VecT> class HalfedgeCellIter : public BaseIterator<VecT,
template <class VecT> class HalfEdgeCellIter : public BaseIterator<VecT,
typename PolyhedralMesh<VecT>::HalfEdgeHandle,
typename PolyhedralMesh<VecT>::CellHandle> {
public:
......@@ -342,48 +342,48 @@ public:
typename PolyhedralMesh<VecT>::CellHandle> BaseIter;
typedef typename PolyhedralMesh<VecT>::HalfEdgeHandle HalfEdgeHandle;
HalfedgeCellIter(const HalfEdgeHandle& _heIdx, const PolyhedralMesh<VecT>* _mesh);
HalfEdgeCellIter(const HalfEdgeHandle& _heIdx, const PolyhedralMesh<VecT>* _mesh);
// Post increment/decrement operator
HalfedgeCellIter operator++(int) {
HalfedgeCellIter cpy = *this;
HalfEdgeCellIter operator++(int) {
HalfEdgeCellIter cpy = *this;
++(*this);
return cpy;
}
HalfedgeCellIter operator--(int) {
HalfedgeCellIter cpy = *this;
HalfEdgeCellIter operator--(int) {
HalfEdgeCellIter cpy = *this;
--(*this);
return cpy;
}
HalfedgeCellIter operator+(int _n) {
HalfedgeCellIter cpy = *this;
HalfEdgeCellIter operator+(int _n) {
HalfEdgeCellIter cpy = *this;
for(int i = 0; i < _n; ++i) {
++cpy;
}
return cpy;
}
HalfedgeCellIter operator-(int _n) {
HalfedgeCellIter cpy = *this;
HalfEdgeCellIter operator-(int _n) {
HalfEdgeCellIter cpy = *this;
for(int i = 0; i < _n; ++i) {
--cpy;
}
return cpy;
}
HalfedgeCellIter& operator+=(int _n) {
HalfEdgeCellIter& operator+=(int _n) {
for(int i = 0; i < _n; ++i) {
++(*this);
}
return *this;
}
HalfedgeCellIter& operator-=(int _n) {
HalfEdgeCellIter& operator-=(int _n) {
for(int i = 0; i < _n; ++i) {
--(*this);
}
return *this;
}
HalfedgeCellIter& operator++();
HalfedgeCellIter& operator--();
HalfEdgeCellIter& operator++();
HalfEdgeCellIter& operator--();
private:
int cur_index_;
......
......@@ -263,11 +263,11 @@ VertexCellIter<VecT>& VertexCellIter<VecT>::operator++() {
}
////================================================================================================
//// HalfedgeCellIter
//// HalfEdgeCellIter
////================================================================================================
template <class VecT>
HalfedgeCellIter<VecT>::HalfedgeCellIter(const HalfEdgeHandle& _ref_h,
HalfEdgeCellIter<VecT>::HalfEdgeCellIter(const HalfEdgeHandle& _ref_h,
const PolyhedralMesh<VecT>* _mesh) :
BaseIter(_mesh, _ref_h),
cur_index_(0) {
......@@ -299,7 +299,7 @@ cur_index_(0) {
}
template <class VecT>
HalfedgeCellIter<VecT>& HalfedgeCellIter<VecT>::operator--() {
HalfEdgeCellIter<VecT>& HalfEdgeCellIter<VecT>::operator--() {
--cur_index_;
if(cur_index_ < 0) {
......@@ -312,7 +312,7 @@ HalfedgeCellIter<VecT>& HalfedgeCellIter<VecT>::operator--() {
}
template <class VecT>
HalfedgeCellIter<VecT>& HalfedgeCellIter<VecT>::operator++() {
HalfEdgeCellIter<VecT>& HalfEdgeCellIter<VecT>::operator++() {
++cur_index_;
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle()].size()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment