From 4d74a938519c3a0953e455d2540bda32bdb472e3 Mon Sep 17 00:00:00 2001 From: malomo Date: Wed, 18 Mar 2015 19:48:03 +0000 Subject: [PATCH] minor changes --- vcg/complex/algorithms/geodesic.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/vcg/complex/algorithms/geodesic.h b/vcg/complex/algorithms/geodesic.h index 4a82e86d..419221d2 100644 --- a/vcg/complex/algorithms/geodesic.h +++ b/vcg/complex/algorithms/geodesic.h @@ -420,7 +420,7 @@ public: \param maxDistanceThr max distance that we travel on the mesh starting from the sources \param withinDistanceVec a pointer to a vector for storing the vertexes reached within the passed maxDistanceThr \param sourceSeed pointer to the handle to keep for each vertex its seed -\param parentSeed pointer to the handle to keep for each vertex its parent in the closest tree +\param 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. @@ -442,6 +442,7 @@ 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. +\todo fix sourceSeed output */ static bool Compute( MeshType & m, const std::vector & seedVec) @@ -509,6 +510,9 @@ It is just a simple wrapper of the basic Compute() return true; } + static inline std::string sourcesAttributeName(void) { return "sources"; } + static inline std::string parentsAttributeName(void) { return "parent"; } + template static void PerFaceDijsktraCompute(MeshType &m, const std::vector &seedVec, DistanceFunctor &distFunc, @@ -522,10 +526,10 @@ It is just a simple wrapper of the basic Compute() tri::RequirePerFaceQuality(m); typename MeshType::template PerFaceAttributeHandle sourceHandle - = tri::Allocator::template GetPerFaceAttribute (m,"sources"); + = tri::Allocator::template GetPerFaceAttribute(m, sourcesAttributeName()); typename MeshType::template PerFaceAttributeHandle parentHandle - = tri::Allocator::template GetPerFaceAttribute (m,"parent"); + = tri::Allocator::template GetPerFaceAttribute(m, parentsAttributeName()); std::vector Heap; tri::UnMarkAll(m); @@ -586,10 +590,10 @@ It is just a simple wrapper of the basic Compute() tri::RequirePerVertexQuality(m); typename MeshType::template PerVertexAttributeHandle sourceHandle - = tri::Allocator::template GetPerVertexAttribute (m,"sources"); + = tri::Allocator::template GetPerVertexAttribute(m, sourcesAttributeName()); typename MeshType::template PerVertexAttributeHandle parentHandle - = tri::Allocator::template GetPerVertexAttribute (m,"parent"); + = tri::Allocator::template GetPerVertexAttribute (m, parentsAttributeName()); std::vector Heap; tri::UnMarkAll(m);