Completed tutorial page on mesh iterators and circulators.
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@233 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
34
Doc/Examples/circulator_functions.cc
Normal file
34
Doc/Examples/circulator_functions.cc
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/**************************************************
|
||||||
|
* Vertex circulators
|
||||||
|
**************************************************/
|
||||||
|
|
||||||
|
// Get the vertex-vertex circulator (1-ring) of vertex _vh
|
||||||
|
VertexVertexIter OpenMesh::PolyConnectivity::vv_iter (VertexHandle _vh);
|
||||||
|
|
||||||
|
// Get the vertex-incoming halfedges circulator of vertex _vh
|
||||||
|
VertexIHalfedgeIter OpenMesh::PolyConnectivity::vih_iter (VertexHandle _vh);
|
||||||
|
|
||||||
|
// Get the vertex-outgoing halfedges circulator of vertex _vh
|
||||||
|
VertexOHalfedgeIter OpenMesh::PolyConnectivity::voh_iter (VertexHandle _vh);
|
||||||
|
|
||||||
|
// Get the vertex-edge circulator of vertex _vh
|
||||||
|
VertexEdgeIter OpenMesh::PolyConnectivity::ve_iter (VertexHandle _vh);
|
||||||
|
|
||||||
|
// Get the vertex-face circulator of vertex _vh
|
||||||
|
VertexFaceIter OpenMesh::PolyConnectivity::vf_iter (VertexHandle _vh);
|
||||||
|
|
||||||
|
/**************************************************
|
||||||
|
* Face circulators
|
||||||
|
**************************************************/
|
||||||
|
|
||||||
|
// Get the face-vertex circulator of face _fh
|
||||||
|
FaceVertexIter OpenMesh::PolyConnectivity::fv_iter (FaceHandle _fh);
|
||||||
|
|
||||||
|
// Get the face-halfedge circulator of face _fh
|
||||||
|
FaceHalfedgeIter OpenMesh::PolyConnectivity::fh_iter (FaceHandle _fh);
|
||||||
|
|
||||||
|
// Get the face-edge circulator of face _fh
|
||||||
|
FaceEdgeIter OpenMesh::PolyConnectivity::fe_iter (FaceHandle _fh);
|
||||||
|
|
||||||
|
// Get the face-face circulator of face _fh
|
||||||
|
FaceFaceIter OpenMesh::PolyConnectivity::ff_iter (FaceHandle _fh);
|
||||||
@@ -717,7 +717,6 @@ MyMesh::VertexIter instead of \c
|
|||||||
OpenMesh::Iterators::VertexIterT<MyMesh>.
|
OpenMesh::Iterators::VertexIterT<MyMesh>.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\subsection subsec_iterators Linear Iterators
|
\subsection subsec_iterators Linear Iterators
|
||||||
|
|
||||||
The linear iterators are used to enumerate all mesh items, e.g. for
|
The linear iterators are used to enumerate all mesh items, e.g. for
|
||||||
@@ -782,14 +781,26 @@ i.e. it takes a mesh and the handle of the item to iterate
|
|||||||
around.
|
around.
|
||||||
|
|
||||||
All circulators provide the operations listed in
|
All circulators provide the operations listed in
|
||||||
OpenMesh::Concepts::CirculatorT, which are basically the same as the
|
CirculatorT<Mesh>, which are basically the same as the
|
||||||
iterator funtions.
|
iterator funtions.
|
||||||
|
|
||||||
Furthermore, circulators provide \c operator \c bool(), which returns
|
Furthermore, circulators provide \c operator \c bool(), which returns
|
||||||
true, as long as the circulator hasn't reached the end of the
|
true, as long as the circulator hasn't reached the end of the
|
||||||
sequence.
|
sequence.
|
||||||
|
|
||||||
Example: The following code enumerates the 1-ring of each vertex:
|
%OpenMesh provides the following functions (defined in OpenMesh::PolyConnectivity)
|
||||||
|
to get circulators around a specified center item:
|
||||||
|
|
||||||
|
\include circulator_functions.cc
|
||||||
|
|
||||||
|
Note that for every circulator there also exists a constant version.
|
||||||
|
To make use of these constant circulators just add the prefix<br />
|
||||||
|
"Const" to the type specifier and add the prefix "c" to the function used to request
|
||||||
|
the circulator of an item. Example:<br/>
|
||||||
|
|
||||||
|
<code>ConstVertexVertexIter cvvit = mesh.cvv_iter(some_vertex_handle);</code>
|
||||||
|
|
||||||
|
The following code example now shows how to enumerate the 1-ring of each vertex:
|
||||||
|
|
||||||
\include circulators.cc
|
\include circulators.cc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user