Surface_mesh_geodesic_distances_3 missing method ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Surface_mesh_geodesic_distances_3 missing method ?

Sebastien Tourneux

Hello,

I use the Surface_mesh_geodesic_distances_3 computation and that's really great.

I can use this version :

void CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits >::estimate_geodesic_distances ( VertexDistanceMap  vdm)

(which  the distances for ALL input mesh vertices), but I cannot use the version for only one vertex :

double CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits >::estimate_geodesic_distance ( vertex_descriptor  vd) const

I get the error :

In file included from /work/stourneux/own/CGAL-5.0.2/examples/Heat_method_3/heat_method_surface_mesh.cpp:3:
/usr/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h:907:19: error: no member named
      'estimate_geodesic_distance' in
      'CGAL::Heat_method_3::internal::Surface_mesh_geodesic_distances_3<CGAL::Surface_mesh<CGAL::Point_3<CGAL::Simple_cartesian<double>
      > >, CGAL::Simple_cartesian<double>,
      CGAL::Eigen_solver_traits<Eigen::SimplicialLDLT<Eigen::SparseMatrix<double, 0, int>, 1,
      Eigen::AMDOrdering<int> > >, CGAL::Surface_mesh<CGAL::Point_3<CGAL::Simple_cartesian<double> >
      >::Property_map<CGAL::SM_Vertex_index, CGAL::Point_3<CGAL::Simple_cartesian<double> > > >'
    return base().estimate_geodesic_distance(vd);
           ~~~~~~ ^
/work/stourneux/own/CGAL-5.0.2/examples/Heat_method_3/heat_method_surface_mesh.cpp:35:24: note: in
      instantiation of member function
      'CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<CGAL::Surface_mesh<CGAL::Point_3<CGAL::Simple_cartesian<double>
      > >, CGAL::Heat_method_3::Direct, CGAL::Default, CGAL::Default,
      CGAL::Default>::estimate_geodesic_distance' requested here
  double distance = hm.estimate_geodesic_distance(source);


I have attached to this mail an example demonstrating the error (this is the example examples/Heat_method_3/heat_method_surface_mesh.cpp with minor modifications to use the one vertex distance computation method).


Am I missing something or is it a bug ?

Thank you,

-- 
Sebastien Tourneux
Buf Compagnie - R&D

heat_method_surface_mesh.cpp (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Surface_mesh_geodesic_distances_3 missing method ?

MaelRL

Hello,

That's a bug. The function behind that interface appears in the doc because it used to exist during development of the package, but was not kept in the end.

The reason that this function didn't make the cut was probably that it was judged a bit deceiving because it makes it seem like you can get a faster version of heat method if you just call it on the vertices you care about. However, the algorithm is based on solving global (but sparse) matrices, and so you will not be faster by calling that old function compared to initializing your full VDM property map: the old code for was actually pretty much equal to:

double estimate_geodesic_distances(vertex v)
{
  initialize_vdm;
  return get(vdm, v);
}

I will fix it on the CGAL side, thank you for the report.

Best,
Mael

On 24/04/2020 16:56, Sebastien Tourneux wrote:

Hello,

I use the Surface_mesh_geodesic_distances_3 computation and that's really great.

I can use this version :

void CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits >::estimate_geodesic_distances ( VertexDistanceMap  vdm)

(which  the distances for ALL input mesh vertices), but I cannot use the version for only one vertex :

double CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits >::estimate_geodesic_distance ( vertex_descriptor  vd) const

I get the error :

In file included from /work/stourneux/own/CGAL-5.0.2/examples/Heat_method_3/heat_method_surface_mesh.cpp:3:
/usr/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h:907:19: error: no member named
      'estimate_geodesic_distance' in
      'CGAL::Heat_method_3::internal::Surface_mesh_geodesic_distances_3<CGAL::Surface_mesh<CGAL::Point_3<CGAL::Simple_cartesian<double>
      > >, CGAL::Simple_cartesian<double>,
      CGAL::Eigen_solver_traits<Eigen::SimplicialLDLT<Eigen::SparseMatrix<double, 0, int>, 1,
      Eigen::AMDOrdering<int> > >, CGAL::Surface_mesh<CGAL::Point_3<CGAL::Simple_cartesian<double> >
      >::Property_map<CGAL::SM_Vertex_index, CGAL::Point_3<CGAL::Simple_cartesian<double> > > >'
    return base().estimate_geodesic_distance(vd);
           ~~~~~~ ^
/work/stourneux/own/CGAL-5.0.2/examples/Heat_method_3/heat_method_surface_mesh.cpp:35:24: note: in
      instantiation of member function
      'CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<CGAL::Surface_mesh<CGAL::Point_3<CGAL::Simple_cartesian<double>
      > >, CGAL::Heat_method_3::Direct, CGAL::Default, CGAL::Default,
      CGAL::Default>::estimate_geodesic_distance' requested here
  double distance = hm.estimate_geodesic_distance(source);


I have attached to this mail an example demonstrating the error (this is the example examples/Heat_method_3/heat_method_surface_mesh.cpp with minor modifications to use the one vertex distance computation method).


Am I missing something or is it a bug ?

Thank you,

-- 
Sebastien Tourneux
Buf Compagnie - R&D