From 8d4bdc467eb9030da8859a96feafd5a2a9ed26eb Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Sun, 14 Oct 2012 09:24:49 +0000 Subject: [PATCH] added function VFExtendedStarVF --- vcg/simplex/face/topology.h | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/vcg/simplex/face/topology.h b/vcg/simplex/face/topology.h index 36493724..e65aa2bb 100644 --- a/vcg/simplex/face/topology.h +++ b/vcg/simplex/face/topology.h @@ -646,6 +646,46 @@ void VFStarVF( typename FaceType::VertexType* vp, ++vfi; } } + + +/*! + * Compute the set of faces adjacent to a given vertex using VF adjacency. + * The set is faces is extended of a given number of step + * \param vp pointer to the vertex whose star has to be computed. + * \param num_step the number of step to extend the star + * \param faceVec a std::vector of Face pointer that is filled with the adjacent faces. + */ +template +static void VFExtendedStarVF(typename FaceType::VertexType* vp, + const int num_step, + std::vector &faceVec) + { + ///initialize front + faceVec.clear(); + vcg::face::VFStarVF(vp,faceVec); + ///then dilate front + ///for each step + for (int step=0;step toAdd; + for (unsigned int i=0;iFFp(k); + if (f1==f)continue; + toAdd.push_back(f1); + } + } + faceVec.insert(faceVec.end(),toAdd.begin(),toAdd.end()); + std::sort(faceVec.begin(),faceVec.end()); + typename std::vector::iterator new_end=std::unique(faceVec.begin(),faceVec.end()); + int dist=distance(faceVec.begin(),new_end); + faceVec.resize(dist); + } + } + /*! * Compute the ordered set of faces adjacent to a given vertex using VF adjacency.and FF adiacency * \param vp pointer to the vertex whose star has to be computed.