adapted VVStarVF to work with polygonal meshes as well

This commit is contained in:
Luigi Malomo 2018-07-15 15:05:01 +02:00
parent d5831911d2
commit 9af6950914
1 changed files with 13 additions and 12 deletions

View File

@ -794,19 +794,20 @@ void VFAppend(FaceType* & f, int z)
template <class FaceType> template <class FaceType>
void VVStarVF( typename FaceType::VertexType* vp, std::vector<typename FaceType::VertexType *> &starVec) void VVStarVF( typename FaceType::VertexType* vp, std::vector<typename FaceType::VertexType *> &starVec)
{ {
typedef typename FaceType::VertexType* VertexPointer; typedef typename FaceType::VertexType* VertexPointer;
starVec.clear(); starVec.clear();
face::VFIterator<FaceType> vfi(vp); face::VFIterator<FaceType> vfi(vp);
while(!vfi.End()) while(!vfi.End())
{ {
starVec.push_back(vfi.F()->V1(vfi.I())); const int vn = vfi.F()->VN();
starVec.push_back(vfi.F()->V2(vfi.I())); starVec.push_back(vfi.F()->V1(vfi.I()));
++vfi; starVec.push_back(vfi.F()->V((vfi.I()+vn-1)%vn));
} ++vfi;
}
std::sort(starVec.begin(),starVec.end()); std::sort(starVec.begin(),starVec.end());
typename std::vector<VertexPointer>::iterator new_end = std::unique(starVec.begin(),starVec.end()); typename std::vector<VertexPointer>::iterator new_end = std::unique(starVec.begin(),starVec.end());
starVec.resize(new_end-starVec.begin()); starVec.resize(new_end-starVec.begin());
} }
/*! /*!