$darkmode
class for computing approximate geodesic distances on a mesh More...
#include <geodesic.h>
Classes | |
struct | DIJKDist |
struct | FaceDist |
struct | pred |
struct | TempData |
struct | VertDist |
Public Types | |
typedef MeshType::VertexType | VertexType |
typedef MeshType::VertexIterator | VertexIterator |
typedef MeshType::VertexPointer | VertexPointer |
typedef MeshType::FacePointer | FacePointer |
typedef MeshType::FaceType | FaceType |
typedef MeshType::CoordType | CoordType |
typedef MeshType::ScalarType | ScalarType |
typedef SimpleTempData< std::vector< VertexType >, TempData > | TempDataType |
Static Public Member Functions | |
template<class DistanceFunctor > | |
static ScalarType | Distance (DistanceFunctor &distFunc, const VertexPointer &pw, const VertexPointer &pw1, const VertexPointer &curr, const ScalarType &d_pw1, const ScalarType &d_curr) |
template<class DistanceFunctor > | |
static VertexPointer | Visit (MeshType &m, std::vector< VertDist > &seedVec, DistanceFunctor &distFunc, ScalarType distance_threshold=std::numeric_limits< ScalarType >::max(), typename MeshType::template PerVertexAttributeHandle< VertexPointer > *vertSource=NULL, typename MeshType::template PerVertexAttributeHandle< VertexPointer > *vertParent=NULL, std::vector< VertexPointer > *InInterval=NULL) |
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. More... | |
template<class DistanceFunctor > | |
static bool | Compute (MeshType &m, const std::vector< VertexPointer > &seedVec, DistanceFunctor &distFunc, ScalarType maxDistanceThr=std::numeric_limits< ScalarType >::max(), std::vector< VertexPointer > *withinDistanceVec=NULL, typename MeshType::template PerVertexAttributeHandle< VertexPointer > *sourceSeed=NULL, typename MeshType::template PerVertexAttributeHandle< VertexPointer > *parentSeed=NULL) |
static bool | DistanceFromBorder (MeshType &m, typename MeshType::template PerVertexAttributeHandle< VertexPointer > *sources=NULL) |
static bool | ConvertPerVertexSeedToPerFaceSeed (MeshType &m, const std::vector< VertexPointer > &vertexSeedVec, std::vector< FacePointer > &faceSeedVec) |
static std::string | sourcesAttributeName (void) |
static std::string | parentsAttributeName (void) |
template<class DistanceFunctor > | |
static void | PerFaceDijkstraCompute (MeshType &m, const std::vector< FacePointer > &seedVec, DistanceFunctor &distFunc, ScalarType maxDistanceThr=std::numeric_limits< ScalarType >::max(), std::vector< FacePointer > *InInterval=NULL, FacePointer FaceTarget=NULL, bool avoid_selected=false) |
template<class DistanceFunctor > | |
static void | PerVertexDijkstraCompute (MeshType &m, const std::vector< VertexPointer > &seedVec, DistanceFunctor &distFunc, ScalarType maxDistanceThr=std::numeric_limits< ScalarType >::max(), std::vector< VertexPointer > *InInterval=NULL, typename MeshType::template PerVertexAttributeHandle< VertexPointer > *sourceHandle=NULL, typename MeshType::template PerVertexAttributeHandle< VertexPointer > *parentHandle=NULL, bool avoid_selected=false, VertexPointer target=NULL) |
class for computing approximate geodesic distances on a mesh
require VF Adjacency relation
|
inlinestatic |
Given a set of source vertices compute the approximate geodesic distance to all the other vertices.
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:
It requires VF adjacency relation (e.g. vertex::VFAdj and face::VFAdj components) It requires per vertex Quality (e.g. vertex::Quality component)
make it O(output) by using incremental mark and persistent attributes.
fix sourceSeed output