add methods to exporter for accessing halfedges for vertices and faces and for accessing next halfface, incident vertex and incident face for halfedges

This commit is contained in:
Max Lyon
2018-08-08 10:55:44 +02:00
parent 3e4e954730
commit b511128131
2 changed files with 33 additions and 0 deletions

View File

@@ -110,6 +110,14 @@ public:
virtual unsigned int
get_vhandles(FaceHandle _fh,
std::vector<VertexHandle>& _vhandles) const=0;
// information needed for a halfedge based data structure such as OpenMesh
virtual int get_halfedge_id(VertexHandle _vh) = 0;
virtual int get_halfedge_id(FaceHandle _vh) = 0;
virtual int get_next_halfedge_id(HalfedgeHandle _heh) = 0;
virtual int get_to_vertex_id(HalfedgeHandle _heh) = 0;
virtual int get_face_id(HalfedgeHandle _heh) = 0;
///
/// \brief getHeh returns the HalfEdgeHandle that belongs to the face
/// specified by _fh and has a toVertexHandle that corresponds to _vh.

View File

@@ -230,6 +230,31 @@ public:
return count;
}
int get_halfedge_id(VertexHandle _vh) override
{
return mesh_.halfedge_handle(_vh).idx();
}
int get_halfedge_id(FaceHandle _fh) override
{
return mesh_.halfedge_handle(_fh).idx();
}
int get_next_halfedge_id(HalfedgeHandle _heh) override
{
return mesh_.next_halfedge_handle(_heh).idx();
}
int get_to_vertex_id(HalfedgeHandle _heh) override
{
return mesh_.to_vertex_handle(_heh).idx();
}
int get_face_id(HalfedgeHandle _heh) override
{
return mesh_.face_handle(_heh).idx();
}
unsigned int get_face_texcoords(std::vector<Vec2f>& _hehandles) const
{
unsigned int count(0);