Class SurfaceGeodesic

Nested Relationships

Nested Types

Class Documentation

class SurfaceGeodesic

Compute geodesic distance from a set of seed vertices.

The method works by a Dykstra-like breadth first traversal from the seed vertices, implemented by a heap structure. See kimmel_1998_geodesic for details.

Public Functions

SurfaceGeodesic(SurfaceMesh &mesh, bool use_virtual_edges = true)

Construct from mesh.

See also

compute() to actually compute the geodesic distances.

Parameters:
  • mesh – The mesh on which to compute the geodesic distances.

  • use_virtual_edges – A flag to control the use of virtual edges. Default: true.

~SurfaceGeodesic()
unsigned int compute(const std::vector<Vertex> &seed, Scalar maxdist = std::numeric_limits<Scalar>::max(), unsigned int maxnum = INT_MAX, std::vector<Vertex> *neighbors = nullptr)

Compute geodesic distances from specified seed points.

Parameters:
  • seed[in] The vector of seed vertices.

  • maxdist[in] The maximum distance up to which to compute the geodesic distances.

  • maxnum[in] The maximum number of neighbors up to which to compute the geodesic distances.

  • neighbors[out] The vector of neighbor vertices.

Returns:

The number of neighbors that have been found.

inline Scalar operator()(Vertex v) const

Access the computed geodesic distance.

Parameters:

v[in] The vertex for which to return the geodesic distance.

Returns:

The geodesic distance of vertex v.

Pre:

The function compute() has been called before.

Pre:

The vertex v needs to be a valid vertex handle of the mesh used during construction.

void distance_to_texture_coordinates()

Use the normalized distances as texture coordinates.

Stores the normalized distances in a vertex property of type TexCoord named “v:tex”. Re-uses any existing vertex property of the same type and name.