From fb9a9bbac67e8a8a9dda99f43b2981132210dc49 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Wed, 12 Dec 2012 16:04:26 +0000 Subject: [PATCH] added function FFExtendedStarFF --- vcg/simplex/face/topology.h | 43 ++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/vcg/simplex/face/topology.h b/vcg/simplex/face/topology.h index 86a60b44..b639add1 100644 --- a/vcg/simplex/face/topology.h +++ b/vcg/simplex/face/topology.h @@ -670,6 +670,42 @@ void EFStarFF( FaceType* fp, int ei, } + /* Compute the set of faces adjacent to a given face using FF adjacency. + * The set is faces is extended of a given number of step + * \param fp pointer to the face 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 FFExtendedStarFF(FaceType *fp, + const int num_step, + std::vector &faceVec) + { + ///initialize front + faceVec.push_back(fp); + ///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); + } + } + /*! * \brief Compute the set of faces adjacent to a given vertex using VF adjacency. * @@ -833,9 +869,10 @@ bool FindSharedFaces(typename FaceType::VertexType *v0, { std::vector faces0; std::vector faces1; - - VFOrderedStarVF_FF(*v0,faces0); - VFOrderedStarVF_FF(v1,faces1); + std::vector index0; + std::vector index1; + VFStarVF(v0,faces0,index0); + VFStarVF(v1,faces1,index1); ///then find the intersection std::sort(faces0.begin(),faces0.end()); std::sort(faces1.begin(),faces1.end());