\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 5.0.2 - The Heat Method
CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits > Class Template Reference

#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>

Definition

template<typename TriangleMesh, typename Mode = Direct, typename VertexPointMap = Default, typename LA = Default, typename Traits = Default>
class CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits >

Class Surface_mesh_geodesic_distances_3 computes estimated geodesic distances for a set of source vertices where sources can be added and removed.

The class performs a preprocessing step that only depends on the mesh, so that the distance computation takes less time after changes to the set of sources.

Template Parameters
TriangleMesha triangulated surface mesh, model of FaceListGraph and HalfedgeListGraph
Modemust be Intrinsic_Delaunay to indicate that an intrinsic Delaunay triangulation is internally constructed or Direct to indicate that the input mesh should be used as is. If Intrinsic_Delaunay, then the type TriangleMesh must have an internal property for vertex_point and its value type must be the same as the value type of VertexPointMap.
VertexPointMapa model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key and Traits::Point_3 as value type. The default is typename boost::property_map< TriangleMesh, vertex_point_t>::const_type.
LAa model of SparseLinearAlgebraWithFactorTraits_d. If CGAL_EIGEN3_ENABLED is defined, then Eigen_solver_traits<Eigen::SimplicialLDLT<typename Eigen_sparse_matrix<double>::EigenType > > is used as default
Traitsa model of HeatMethodTraits_3. The default is the Kernel of the value type of the vertex point map (extracted using Kernel_traits).
Examples:
Heat_method_3/heat_method_surface_mesh.cpp, and Heat_method_3/heat_method_surface_mesh_direct.cpp.

Public Types

typedef boost::graph_traits< TriangleMesh >::vertex_descriptor vertex_descriptor
 Vertex descriptor type.
 
typedef unspecified_type Vertex_const_range
 a model of ConstRange with an iterator that is model of ForwardIterator with vertex_descriptor as value type.
 
typedef unspecified_type Vertex_point_map
 Vertex point map type derived from VertexPointMap.
 

Public Member Functions

 Surface_mesh_geodesic_distances_3 (const TriangleMesh &tm)
 Constructor.
 
 Surface_mesh_geodesic_distances_3 (const TriangleMesh &tm, Vertex_point_map vpm)
 Constructor.
 
const TriangleMesh & triangle_mesh () const
 returns the triangle mesh the algorithm is running on.
 
bool add_source (vertex_descriptor vd)
 adds vd to the source set, returning false if vd is already in the set.
 
template<typename VertexConstRange >
void add_sources (const VertexConstRange &vrange)
 adds the range of vertices to the source set. More...
 
bool remove_source (vertex_descriptor vd)
 removes vd from the source set, returning true if vd was in the set.
 
void clear_sources ()
 clears the current source set.
 
double estimate_geodesic_distance (vertex_descriptor vd) const
 get estimated distance from the current source set to a vertex vd. More...
 
const Vertex_const_rangesources () const
 returns the source set.
 
template<class VertexDistanceMap >
void estimate_geodesic_distances (VertexDistanceMap vdm)
 fills the distance property map with the estimated geodesic distance of each vertex to the closest source vertex. More...
 

Member Function Documentation

◆ add_sources()

template<typename TriangleMesh , typename Mode = Direct, typename VertexPointMap = Default, typename LA = Default, typename Traits = Default>
template<typename VertexConstRange >
void CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits >::add_sources ( const VertexConstRange &  vrange)

adds the range of vertices to the source set.

Template Parameters
VertexConstRangea model of the concept ConstRange with value type boost::graph_traits<TriangleMesh>::vertex_descriptor

◆ estimate_geodesic_distance()

template<typename TriangleMesh , typename Mode = Direct, typename VertexPointMap = Default, typename LA = Default, typename Traits = Default>
double CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits >::estimate_geodesic_distance ( vertex_descriptor  vd) const

get estimated distance from the current source set to a vertex vd.

Warning
The return type is double even when used with an exact kernel.

◆ estimate_geodesic_distances()

template<typename TriangleMesh , typename Mode = Direct, typename VertexPointMap = Default, typename LA = Default, typename Traits = Default>
template<class VertexDistanceMap >
void CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3< TriangleMesh, Mode, VertexPointMap, LA, Traits >::estimate_geodesic_distances ( VertexDistanceMap  vdm)

fills the distance property map with the estimated geodesic distance of each vertex to the closest source vertex.

Template Parameters
VertexDistanceMapa property map model of WritablePropertyMap with vertex_descriptor as key type and double as value type.
Parameters
vdmthe vertex distance map to be filled
Warning
The key type is double even when used with an exact kernel.