#include <vector>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
typedef Mesh::Vertex_index vertex_descriptor;
typedef Mesh::Face_index face_descriptor;
int main()
{
Mesh m;
vertex_descriptor u = m.
add_vertex(K::Point_3(0,1,0));
vertex_descriptor v = m.add_vertex(K::Point_3(0,0,0));
vertex_descriptor w = m.add_vertex(K::Point_3(1,0,0));
vertex_descriptor x = m.add_vertex(K::Point_3(1,1,0));
m.add_face(u,v,w,x);
{
std::cout << "all vertices " << std::endl;
Mesh::Vertex_range::iterator vb, ve;
Mesh::Vertex_range r = m.vertices();
vb = r.begin();
ve = r.end();
vb = boost::begin(r);
ve = boost::end(r);
for(boost::tie(vb, ve) = m.vertices(); vb != ve; ++vb){
std::cout << *vb << " " << m.point(*vb) << std::endl;
}
for(vertex_descriptor vd : m.vertices()){
std::cout << vd << std::endl;
}
for(vertex_descriptor vd : m.vertices()){
std::cout << vd << std::endl;
}
}
return 0;
}
This class is a data structure that can be used as halfedge data structure or polyhedral surface.
Definition: Surface_mesh.h:335
Vertex_index add_vertex()
adds a new vertex, and resizes vertex properties if necessary.
Definition: Surface_mesh.h:987