trimesh_pos_demo.cpp
Go to the documentation of this file.
00001 #include <vector>
00002 
00003 #include <vcg/simplex/vertex/base.h>   
00004 #include <vcg/simplex/vertex/component.h>   
00005 #include <vcg/simplex/face/base.h>   
00006 #include <vcg/simplex/face/component.h>   
00007 
00008 #include <vcg/complex/complex.h>   
00009 #include<vcg/complex/algorithms/create/platonic.h>
00010 
00011 #include<vcg/complex/algorithms/update/topology.h>
00012 
00013 #include <vcg/simplex/face/pos.h> 
00014 
00015 class MyEdge;
00016 class MyFace;
00017 
00018 class MyVertex: public vcg::VertexSimp2<MyVertex,MyEdge,MyFace, vcg::vert::Coord3d, vcg::vert::Normal3f>{};
00019 class MyFace: public vcg::FaceSimp2<MyVertex,MyEdge,MyFace, vcg::face::VertexRef,vcg::face::FFAdj>{};
00020 
00021 class MyMesh: public vcg::tri::TriMesh< std::vector<MyVertex>, std::vector<MyFace> > {};
00022 
00023 void OneRingNeighborhood( MyFace * f)
00024 {
00025         MyVertex * v = f->V(0);  
00026         MyFace* start = f;
00027         vcg::face::Pos<MyFace> p(f,0,v);// constructor that takes face, edge and vertex
00028         do
00029         {
00030                 p.FlipF();
00031                 p.FlipE();
00032         }while(p.f!=start);
00033 }
00034 
00035 #include <vcg/simplex/face/jumping_pos.h> // include the definition of jumping pos
00036 
00037 void OneRingNeighborhoodJP( MyFace * f)
00038 {
00039         MyVertex * v = f->V(0);  
00040         MyFace* start = f;
00041         vcg::face::JumpingPos<MyFace> p(f,0,v);// constructor that takes face, edge and vertex
00042         do
00043         {
00044                 p.NextFE();
00045         }while(p.f!=start);
00046 }
00047 
00048 int main()
00049 {
00050         MyMesh m;
00051         vcg::tri::Tetrahedron(m);
00052         vcg::tri::UpdateTopology<MyVCGMesh>::FaceFace(m);
00053         OneRingNeighborhood(&(*m.face.begin()));
00054         OneRingNeighborhoodJP(&(*m.face.begin()));
00055         return 0;
00056 }


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:38:21