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:
  • To:
  • Subject: Re: [cgal-discuss] indices of faces, halfedges, vertices
  • Date: Tue, 27 Apr 2010 12:14:30 +0200

It's what I want.
But it seems that by default the vertex class has no member id.
Is there an option ?

Le 27/04 - 11:49, Sebastien Loriot (GeometryFactory) a écrit :
>
> 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