CGAL 5.6.3 - CGAL and the Boost Graph Library

Loading...
Searching...
No Matches
Property_map/dynamic_properties.cpp
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <string>
typedef CGAL::Simple_cartesian<double> K;
typedef K::Point_3 Point_3;
typedef CGAL::Surface_mesh<Point_3> Mesh;
int main()
{
Mesh mesh;
CGAL::make_triangle(Point_3(0,0,0),Point_3(1,0,0),Point_3(1,1,0), mesh);
typedef boost::property_map<Mesh, CGAL::dynamic_vertex_property_t<std::string> >::type VertexNameMap;
VertexNameMap vnm = get(CGAL::dynamic_vertex_property_t<std::string>(), mesh);
put(vnm, *(vertices(mesh).first), "Paris");
std::cout << get(vnm, *(vertices(mesh).first)) << std::endl;
typedef boost::property_map<Mesh, CGAL::dynamic_halfedge_property_t<double> >::type TrafficDensityMap;
TrafficDensityMap tdm = get(CGAL::dynamic_halfedge_property_t<double>(), mesh);
put(tdm, *(halfedges(mesh).first), 0.7);
std::cout << get(tdm, *(halfedges(mesh).first)) << std::endl;
return 0;
}
CGAL::Surface_mesh
CGAL::make_triangle
boost::graph_traits< Graph >::halfedge_descriptor make_triangle(const P &p0, const P &p1, const P &p2, Graph &g)
creates an isolated triangle with its vertices initialized to p0, p1 and p2, and adds it to the graph...
Definition: generators.h:138
CGAL::Simple_cartesian
CGAL::dynamic_halfedge_property_t
Dynamic halfedge property tag.
Definition: properties.h:69
CGAL::dynamic_vertex_property_t
Dynamic vertex property tag.
Definition: properties.h:60