#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>
#include <iostream>
#include <fstream>
typedef boost::graph_traits<Triangle_mesh>::vertex_descriptor vertex_descriptor;
typedef Triangle_mesh::Property_map<vertex_descriptor,double> Vertex_distance_map;
int main(int argc, char* argv[])
{
const char* filename = (argc > 1) ? argv[1] : "./data/elephant.off";
Triangle_mesh tm;
{
std::cerr << "Invalid input file." << std::endl;
return EXIT_FAILURE;
}
Vertex_distance_map vertex_distance = tm.
add_property_map<vertex_descriptor,
double>(
"v:distance", 0).first;
vertex_descriptor source = *(vertices(tm).first);
std::cout << "Source vertex " << source << " at: " << tm.point(source) << std::endl;
for(vertex_descriptor vd : vertices(tm))
{
std::cout << vd << " ("<< tm.point(vd) << ")"
<< " is at distance " << get(vertex_distance, vd) << std::endl;
}
return 0;
}