trimesh_vfiter_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,vcg::vert::VFAdj>{};
00019 class MyFace: public vcg::FaceSimp2<MyVertex,MyEdge,MyFace, vcg::face::VertexRef,vcg::face::VFAdj>{};
00020 class MyMesh: public vcg::tri::TriMesh< std::vector<MyVertex>, std::vector<MyFace> > {};
00021 
00022 void OneRingNeighborhoodVF( MyVertex * v)
00023 {  
00024         vcg::face::VFIterator<MyFace> vfi(v); //initialize the iterator tohe first face
00025         for(;!vfi.End();++vfi)
00026         {
00027                 MyFace* f = vfi.F();
00028                 // ...do something with face f
00029         }
00030 }
00031 
00032 int main()
00033 {
00034         MyMesh m;
00035         vcg::tri::Tetrahedron(m);
00036         vcg::tri::UpdateTopology<MyVCGMesh>::VertexFace(m);
00037         OneRingNeighborhoodVF(&(*m.vert.begin()));
00038         return 0;
00039 }


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