Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Supporting the new type of for loop

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Supporting the new type of for loop


Chronological Thread 
  • From: 杨成林 <>
  • To:
  • Subject: Re: [cgal-discuss] Supporting the new type of for loop
  • Date: Wed, 24 Apr 2013 16:26:39 +0800

Maybe let dt.finite_vertices() and dt.finite_vertex_handles() both available.
Handles are needed to manipulate vertices and cells, while facets and edges are used directly. I was confused when I first used CGAL.


2013/4/23 Laurent Rineau (CGAL/GeometryFactory) <>
Le mardi 23 avril 2013 22:07:46 æ ¨æˆ æž— a écrit :
> I want to write like this *for(auto f : dt.finite_facets() )*. Can this be
> added to CGAL?

For Facet that would be easy to add.

But for vertices, in the following loop:

  for(auto v, dt.finite_vertices())

do you expect 'v' to be of type 'Vertex_handle' or of type 'Vertex'?
Currently, the iterators returned by dt.finite_vertices_begin() and
dt.finite_vertices_end() have 'Vertex' as value type, but the iterators are
implicitly convertible to 'Vertex_handle'. As most of the API of the
triangulations use handles to manipulate vertices and cells, a variable of
type Vertex or Cell is not that useful.

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss





--
杨成林
Yang Chenglin



Archive powered by MHonArc 2.6.18.

Top of Page