added JumpingPos sample

This commit is contained in:
granzuglia 2008-05-06 15:38:48 +00:00
parent 647985b802
commit 6f7899846d
1 changed files with 15 additions and 1 deletions

View File

@ -22,7 +22,7 @@ void OneRingNeighborhood( MyFace * f)
{
MyVertex * v = f->V(0);
MyFace* start = f;
vcg::face::Pos<MyFace> p(f,0,0);// constructor that takes face, edge and vertex
vcg::face::Pos<MyFace> p(f,0,v);// constructor that takes face, edge and vertex
do
{
p.FlipF();
@ -30,10 +30,24 @@ void OneRingNeighborhood( MyFace * f)
}while(p.f!=start);
}
#include <vcg/simplex/face/jumping_pos.h> // include the definition of jumping pos
void OneRingNeighborhoodJP( MyFace * f)
{
MyVertex * v = f->V(0);
MyFace* start = f;
vcg::face::JumpingPos<MyFace> 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);
OneRingNeighborhood(&(*m.face.begin()));
OneRingNeighborhoodJP(&(*m.face.begin()));
return 0;
}