VCG Library
vcg::tri::Geodesic< MeshType > Class Template Reference

class for computing approximate geodesic distances on a mesh More...

`#include <geodesic.h>`

## Static Public Member Functions

static bool Compute (MeshType &m, const std::vector< VertexPointer > &seedVec)
Given a set of source vertices compute the approximate geodesic distance to all the other vertices.

## Detailed Description

### template<class MeshType> class vcg::tri::Geodesic< MeshType >

class for computing approximate geodesic distances on a mesh

trimesh_geodesic.cpp

Definition at line 154 of file geodesic.h.

## Member Function Documentation

template<class MeshType >
 static bool vcg::tri::Geodesic< MeshType >::Compute ( MeshType & m, const std::vector< VertexPointer > & seedVec )
inlinestatic

Given a set of source vertices compute the approximate geodesic distance to all the other vertices.

Parameters
 m the mesh seedVec a vector of Vertex pointers with the sources of the flood fill maxDistanceThr max distance that we travel on the mesh starting from the sources withinDistanceVec a pointer to a vector for storing the vertexes reached within the passed maxDistanceThr sourceSeed pointer to the handle to keep for each vertex its seed parentSeed pointer to the handle to keep for each vertex its parent in the closest tree (UNRELIABLE)

Given a mesh and a vector of pointers to seed vertices, this function compute the approximated geodesic distance from the given sources to all the mesh vertices within the given maximum distance threshold. The computed distance is stored in the vertex::Quality component. Optionally for each vertex it can store, in a passed attribute, the corresponding seed vertex (e.g. the vertex of the source set closest to him) and the 'parent' in a tree forest that connects each vertex to the closest source.

To allocate the attributes:

typename MeshType::template PerVertexAttributeHandle<VertexPointer> sourcesHandle;
typename MeshType::template PerVertexAttributeHandle<VertexPointer> parentHandle;

It requires VF adjacency relation (e.g. vertex::VFAdj and face::VFAdj components) It requires per vertex Quality (e.g. vertex::Quality component)

Warning
that this function has ALWAYS at least a linear cost (it use additional attributes that have a linear initialization)
Todo:

make it O(output) by using incremental mark and persistent attributes.

fix sourceSeed output

Definition at line 448 of file geodesic.h.

The documentation for this class was generated from the following file: