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 14:02:16 +0200


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

Have a look at this item class
CGAL/Polyhedron_items_with_id_3.h

Facets, halfedges and vertices will have an id.

S.


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