Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] indices of faces, halfedges, vertices

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] indices of faces, halfedges, vertices


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] indices of faces, halfedges, vertices
  • Date: Tue, 27 Apr 2010 11:49:33 +0200


wrote:
I have a polyhedron P.
And I want to associate to each face an index : the distance from
P->facets_begin() to the iterator pointing to the face (for example).

Now, given a halfedge h, I would like to know the number of h.facets().
I tried std::distance(P.facets_begin(), h.facets()) but it doesn't work
since one is an iterator and the other a handle.

Is there a simple way to do that ?

Is something like this a correct solution for your problem?

unsigned i=0
for (Polyhedron::Facet_iterator it=P.facets_begin();it!=P.facets_end();++it){
it->id()=i++;
}

S.



Archive powered by MHonArc 2.6.16.

Top of Page