iterators.cc 714 Bytes
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1
2
3
4
5
6
7
MyMesh mesh;

// iterate over all vertices
for (MyMesh::VertexIter v_it=mesh.vertices_begin(); v_it!=mesh.vertices_end(); ++v_it) 
   ...; // do something with *v_it, v_it->, or v_it.handle()

// iterate over all halfedges
8
for (MyMesh::HalfedgeIter h_it=mesh.halfedges_begin(); h_it!=mesh.halfedges_end(); ++h_it) 
Jan Möbius's avatar
Jan Möbius committed
9
10
11
   ...; // do something with *h_it, h_it->, or h_it.handle()

// iterate over all edges
12
for (MyMesh::EdgeIter e_it=mesh.edges_begin(); e_it!=mesh.edges_end(); ++e_it) 
Jan Möbius's avatar
Jan Möbius committed
13
14
15
   ...; // do something with *e_it, e_it->, or e_it.handle()

// iterator over all faces
16
for (MyMesh::FaceIter f_it=mesh.faces_begin(); f_it!=mesh.faces_end(); ++f_it) 
Jan Möbius's avatar
Jan Möbius committed
17
18
   ...; // do something with *f_it, f_it->, or f_it.handle()