VCG Library
adjacency.dxy
1  >{};
181 class MyFace: public vcg::FaceSimp2<MyVertex,MyEdge,MyFace, vcg::face::VertexRef,vcg::face::VFAd>{};
182 
183 void OneRingNeighborhoodVF( MyVertex * v)
184 {
185  vcg::face::VFIterator<MyFace> vfi(v); //initialize the iterator tohe first face
186  for(;!vfi.End();++vfi)
187  {
188  MyFace* f = vfi.F();
189  // ...do something with face f
190  }
191 }
192 \endcode
193 Stars and Rings
194 ---------------
195 We have a few handy functions to recover the set of faces/vertices incident on vertex:
196 
198 - \ref vcg::face::VVStarVF
199 - \ref vcg::face::VFStarVF
201 - \ref vcg::face::EFStarFF
202 
203 Few facts on FF adjacency and VF adjacency
204 ------------------------------------------
205 
206 Here we make a series of simple statements just to avoid confusion and try to help up choosing the adjacencies the best fit your needs.
207 
208 If the mesh is manifold, the one-ring neighborhood of a vertex computed by using Pos ( needs FF adjacency) is the same as the one computed by using VFIterator (needs VF adjacency). The order in which the faces are visited can be CW or CCW if using Pos, unspecified by using VIterator
209 If the mesh is non-manifold, Pos may not find all the faces of the one-ring neighborhood of he vertex, VFIterator always does
210 
211 Boundary relations and adjacency
212 --------------------------------
213 In many algorithms you need to simply the boundary/border condition of a face, e.g. to know if a given face f has one or more adjacent faces on a specified edge e. Using FF adjacency this can be done simply by using the face::IsBorder(f,e) static function that simply checks if the pointer stored in face f on the edge e points to f itself. If you are navigating the mesh using a Pos, you have a Pos member function IsBorder() that reports the boundary condition of the current pos. Similarly, for testing manifoldness of specific places over a mesh, there is a face::IsManifold(f,e) static function and a IsManifold(e) function member of the pos class.
214 
215 If you are not using FF adjacency evaluating the boundary conditions could be not very efficient, so vcg library provides a technique to cook the current boundary conditions of the mesh into vertex and face flags. Use the members of the UpdateFlags static class to compute flags that reflects the current mesh status and the access these flags using the IsB(e) member function of the face class. Remember that flags based boundary information can become invalid if you change the mesh topology. On the other hand consider that many non-mesh-modifying algorithms do not require explicit FF adjacency but just boundary information (typical examples: most mesh smoothing and curvature computation algorithms).
216 
217 Please note that the boundary flags are set true also for non manifold conditions.
218 
219 */