Commit 3362dd55 authored by Jan Möbius's avatar Jan Möbius

Fixed ugly documentation layout of code snippet




git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1244 fdac6126-5c0c-442c-9429-916003d36597
parent 24708d0f
...@@ -76,9 +76,13 @@ collapsing edges by calling OpenMesh::PolyConnectivity::is_collapse_ok(). ...@@ -76,9 +76,13 @@ collapsing edges by calling OpenMesh::PolyConnectivity::is_collapse_ok().
A simple code example related to the illustration might look like this: A simple code example related to the illustration might look like this:
\code \code
PolyMesh mesh; PolyMesh mesh;
// Request required status flags
mesh.request_vertex_status(); mesh.request_vertex_status();
mesh.request_edge_status(); mesh.request_edge_status();
mesh.request_face_status();
// Add some vertices as in the illustration above // Add some vertices as in the illustration above
PolyMesh::VertexHandle vhandle[7]; PolyMesh::VertexHandle vhandle[7];
vhandle[0] = mesh.add_vertex(MyMesh::Point(-1, 1, 0)); vhandle[0] = mesh.add_vertex(MyMesh::Point(-1, 1, 0));
...@@ -88,6 +92,7 @@ PolyMesh mesh; ...@@ -88,6 +92,7 @@ PolyMesh mesh;
vhandle[4] = mesh.add_vertex(MyMesh::Point(0, 4, 0)); vhandle[4] = mesh.add_vertex(MyMesh::Point(0, 4, 0));
vhandle[5] = mesh.add_vertex(MyMesh::Point(1, 1, 0)); vhandle[5] = mesh.add_vertex(MyMesh::Point(1, 1, 0));
vhandle[6] = mesh.add_vertex(MyMesh::Point(1, 3, 0)); vhandle[6] = mesh.add_vertex(MyMesh::Point(1, 3, 0));
// Add three quad faces // Add three quad faces
std::vector<PolyMesh::VertexHandle> face_vhandles; std::vector<PolyMesh::VertexHandle> face_vhandles;
face_vhandles.push_back(vhandle[1]); face_vhandles.push_back(vhandle[1]);
...@@ -95,18 +100,21 @@ PolyMesh mesh; ...@@ -95,18 +100,21 @@ PolyMesh mesh;
face_vhandles.push_back(vhandle[2]); face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[3]); face_vhandles.push_back(vhandle[3]);
mesh.add_face(face_vhandles); mesh.add_face(face_vhandles);
face_vhandles.clear(); face_vhandles.clear();
face_vhandles.push_back(vhandle[1]); face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[3]); face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[5]); face_vhandles.push_back(vhandle[5]);
face_vhandles.push_back(vhandle[4]); face_vhandles.push_back(vhandle[4]);
mesh.add_face(face_vhandles); mesh.add_face(face_vhandles);
face_vhandles.clear(); face_vhandles.clear();
face_vhandles.push_back(vhandle[3]); face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[2]); face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[6]); face_vhandles.push_back(vhandle[6]);
face_vhandles.push_back(vhandle[5]); face_vhandles.push_back(vhandle[5]);
mesh.add_face(face_vhandles); mesh.add_face(face_vhandles);
// Now find the edge between vertex vhandle[2] // Now find the edge between vertex vhandle[2]
// and vhandle[3] // and vhandle[3]
for(PolyMesh::HalfedgeIter it = mesh.halfedges_begin(); it != mesh.halfedges_end(); ++it) { for(PolyMesh::HalfedgeIter it = mesh.halfedges_begin(); it != mesh.halfedges_end(); ++it) {
...@@ -118,6 +126,7 @@ PolyMesh mesh; ...@@ -118,6 +126,7 @@ PolyMesh mesh;
break; break;
} }
} }
// Our mesh now looks like in the illustration above after the collapsing. // Our mesh now looks like in the illustration above after the collapsing.
\endcode \endcode
......
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