Classes | Public Types | Static Public Member Functions
vcg::tri::Geodesic< MeshType > Class Template Reference

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

#include <geodesic.h>

List of all members.

Classes

struct  DIJKDist
struct  FaceDist
struct  pred
struct  TempData
struct  VertDist

Public Types

typedef MeshType::CoordType CoordType
typedef MeshType::FacePointer FacePointer
typedef MeshType::FaceType FaceType
typedef MeshType::ScalarType ScalarType
typedef SimpleTempData
< std::vector< VertexType >
, TempData
TempDataType
typedef MeshType::VertexIterator VertexIterator
typedef MeshType::VertexPointer VertexPointer
typedef MeshType::VertexType VertexType

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.
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 ConvertPerVertexSeedToPerFaceSeed (MeshType &m, const std::vector< VertexPointer > &vertexSeedVec, std::vector< FacePointer > &faceSeedVec)
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)
static bool DistanceFromBorder (MeshType &m, typename MeshType::template PerVertexAttributeHandle< VertexPointer > *sources=NULL)
static std::string parentsAttributeName (void)
template<class DistanceFunctor >
static void PerFaceDijsktraCompute (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 PerVertexDijsktraCompute (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)
static std::string sourcesAttributeName (void)
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)

Detailed Description

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

class for computing approximate geodesic distances on a mesh

require VF Adjacency relation

See also:
trimesh_geodesic.cpp

Definition at line 154 of file geodesic.h.


Member Typedef Documentation

template<class MeshType >
typedef MeshType::CoordType vcg::tri::Geodesic< MeshType >::CoordType

Definition at line 163 of file geodesic.h.

template<class MeshType >
typedef MeshType::FacePointer vcg::tri::Geodesic< MeshType >::FacePointer

Definition at line 161 of file geodesic.h.

template<class MeshType >
typedef MeshType::FaceType vcg::tri::Geodesic< MeshType >::FaceType

Definition at line 162 of file geodesic.h.

template<class MeshType >
typedef MeshType::ScalarType vcg::tri::Geodesic< MeshType >::ScalarType

Definition at line 164 of file geodesic.h.

template<class MeshType >
typedef SimpleTempData<std::vector<VertexType>, TempData > vcg::tri::Geodesic< MeshType >::TempDataType

Definition at line 212 of file geodesic.h.

template<class MeshType >
typedef MeshType::VertexIterator vcg::tri::Geodesic< MeshType >::VertexIterator

Definition at line 159 of file geodesic.h.

template<class MeshType >
typedef MeshType::VertexPointer vcg::tri::Geodesic< MeshType >::VertexPointer

Definition at line 160 of file geodesic.h.

template<class MeshType >
typedef MeshType::VertexType vcg::tri::Geodesic< MeshType >::VertexType

Definition at line 158 of file geodesic.h.


Member Function Documentation

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

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

Parameters:
mthe mesh
seedVeca vector of Vertex pointers with the sources of the flood fill
maxDistanceThrmax distance that we travel on the mesh starting from the sources
withinDistanceVeca pointer to a vector for storing the vertexes reached within the passed maxDistanceThr
sourceSeedpointer to the handle to keep for each vertex its seed
parentSeedpointer 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;
      sourcesHandle =  tri::Allocator<CMeshO>::AddPerVertexAttribute<MeshType::VertexPointer> (m,"sources");

      typename MeshType::template PerVertexAttributeHandle<VertexPointer> parentHandle;
      parentHandle =  tri::Allocator<CMeshO>::AddPerVertexAttribute<MeshType::VertexPointer> (m,"parent");

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 447 of file geodesic.h.

template<class MeshType >
template<class DistanceFunctor >
static bool vcg::tri::Geodesic< MeshType >::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 
) [inline, static]

Definition at line 455 of file geodesic.h.

template<class MeshType >
static bool vcg::tri::Geodesic< MeshType >::ConvertPerVertexSeedToPerFaceSeed ( MeshType &  m,
const std::vector< VertexPointer > &  vertexSeedVec,
std::vector< FacePointer > &  faceSeedVec 
) [inline, static]

Definition at line 493 of file geodesic.h.

template<class MeshType >
template<class DistanceFunctor >
static ScalarType vcg::tri::Geodesic< MeshType >::Distance ( DistanceFunctor &  distFunc,
const VertexPointer pw,
const VertexPointer pw1,
const VertexPointer curr,
const ScalarType d_pw1,
const ScalarType d_curr 
) [inline, static]

Definition at line 243 of file geodesic.h.

template<class MeshType >
static bool vcg::tri::Geodesic< MeshType >::DistanceFromBorder ( MeshType &  m,
typename MeshType::template PerVertexAttributeHandle< VertexPointer > *  sources = NULL 
) [inline, static]

Definition at line 480 of file geodesic.h.

template<class MeshType >
static std::string vcg::tri::Geodesic< MeshType >::parentsAttributeName ( void  ) [inline, static]

Definition at line 514 of file geodesic.h.

template<class MeshType >
template<class DistanceFunctor >
static void vcg::tri::Geodesic< MeshType >::PerFaceDijsktraCompute ( 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 
) [inline, static]

Definition at line 517 of file geodesic.h.

template<class MeshType >
template<class DistanceFunctor >
static void vcg::tri::Geodesic< MeshType >::PerVertexDijsktraCompute ( 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 
) [inline, static]

Definition at line 582 of file geodesic.h.

template<class MeshType >
static std::string vcg::tri::Geodesic< MeshType >::sourcesAttributeName ( void  ) [inline, static]

Definition at line 513 of file geodesic.h.

template<class MeshType >
template<class DistanceFunctor >
static VertexPointer vcg::tri::Geodesic< MeshType >::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 
) [inline, static]

Definition at line 299 of file geodesic.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:42:30