From be2d3613b9b1fb9a5e5c3085fc59ef734a445427 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Mon, 3 Sep 2012 15:57:52 +0000 Subject: [PATCH] added one more call of VFStarVF that returns also the indexes of vertices as seen from the faces --- vcg/simplex/face/topology.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/vcg/simplex/face/topology.h b/vcg/simplex/face/topology.h index 1a69ad5b..5040c7c5 100644 --- a/vcg/simplex/face/topology.h +++ b/vcg/simplex/face/topology.h @@ -625,6 +625,27 @@ void VFStarVF( typename FaceType::VertexType* vp, std::vector &faceV } } +/*! +* Compute the set of faces adjacent to a given vertex using VF adjacency. +* \param vp pointer to the vertex whose star has to be computed. +* \param faceVec a std::vector of Face pointer that is filled with the adjacent faces. +* \param indexes a std::vector of integer of the vertex as it is seen from the faces +*/ +template +void VFStarVF( typename FaceType::VertexType* vp, + std::vector &faceVec, + std::vector &indexes) +{ + typedef typename FaceType::VertexType* VertexPointer; + faceVec.clear(); + face::VFIterator vfi(vp); + while(!vfi.End()) + { + faceVec.push_back(vfi.F()); + indexes.push_back(vfi.I()); + ++vfi; + } +} /*! * 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. @@ -632,7 +653,7 @@ void VFStarVF( typename FaceType::VertexType* vp, std::vector &faceV * */ template -static void VFOrderedStarVF_FF(typename FaceType::VertexType &vp, +static void VFOrderedStarVF_FF(const typename FaceType::VertexType &vp, std::vector &faceVec) { @@ -640,8 +661,8 @@ static void VFOrderedStarVF_FF(typename FaceType::VertexType &vp, assert (!vp.IsB()); ///get first face sharing the edge - FaceType *f_init=vp.VFp(); - int edge_init=vp.VFi(); + FaceType *f_init=vp.cVFp(); + int edge_init=vp.cVFi(); ///and initialize the pos vcg::face::Pos VFI(f_init,edge_init);