diff --git a/vcg/complex/trimesh/update/halfedge_topology.h b/vcg/complex/trimesh/update/halfedge_topology.h index 8af18121..f43f53dc 100644 --- a/vcg/complex/trimesh/update/halfedge_topology.h +++ b/vcg/complex/trimesh/update/halfedge_topology.h @@ -1669,6 +1669,31 @@ namespace vcg } + static vector get_adjacent_faces(FacePointer fp) + { + assert(fp); + assert(!fp->IsD()); + + vector ret; + + Pos p( fp->FHp() ); + assert(p.F() == fp); + + do + { + p.FlipF(); + ret.push_back( p.F() ); + p.FlipF(); + + p.FlipV(); + p.FlipE(); + + } while(p.HE() != fp->FHp()); + + return ret; + + } + /*! * Gets all hedges incident to a vertex * diff --git a/vcg/connectors/halfedge_pos.h b/vcg/connectors/halfedge_pos.h index 7d05fa7b..c2ba15c5 100644 --- a/vcg/connectors/halfedge_pos.h +++ b/vcg/connectors/halfedge_pos.h @@ -100,6 +100,17 @@ namespace vcg return he->HOp()->HVp(); } + /*! + * Gets opposite vertex + */ + VertexPointer Vo() + { + if(!direction) + return he->HVp(); + else + return he->HOp()->HVp(); + } + /*! * Gets pointed hedge */