YipengQin/VTP_source_code

one source must create one object?

Opened this issue · 0 comments

Hi, I cteated one object of geodesic::GeodesicAlgorithmExact algorithm(&mesh), and I want to get >1 sources' distance to all targets.I wrote the code like below:
geodesic::GeodesicAlgorithmExact algorithm(&mesh)
algorithm.propagate(source_vertex_index1);
double distance1 = mesh.vertices()[target_vertex_index1].geodesic_distance();
algorithm.propagate(source_vertex_index2);
double distance2 = mesh.vertices()[target_vertex_index2].geodesic_distance();
algorithm.propagate(source_vertex_index3);
double distance3 = mesh.vertices()[target_vertex_index3].geodesic_distance();
But the result seems wrong, and the result of the first propagate does seem to affect the result of the second propagate.Must I have to create one object of geodesic::GeodesicAlgorithmExact for each source_vertex_index?