#include #include #include #include #include #include #include #include #include class MyEdge; class MyFace; class MyVertex: public vcg::VertexSimp2{}; class MyFace: public vcg::FaceSimp2{}; class MyMesh: public vcg::tri::TriMesh< std::vector, std::vector > {}; void OneRingNeighborhood( MyFace * f) { MyVertex * v = f->V(0); MyFace* start = f; vcg::face::Pos p(f,0,v);// constructor that takes face, edge and vertex do { p.FlipF(); p.FlipE(); }while(p.f!=start); } #include // include the definition of jumping pos void OneRingNeighborhoodJP( MyFace * f) { MyVertex * v = f->V(0); MyFace* start = f; vcg::face::JumpingPos p(f,0,v);// constructor that takes face, edge and vertex do { p.NextFE(); }while(p.f!=start); } int main() { MyMesh m; vcg::tri::Tetrahedron(m); vcg::tri::UpdateTopology::FaceFace(m); OneRingNeighborhood(&(*m.face.begin())); OneRingNeighborhoodJP(&(*m.face.begin())); return 0; }