Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Getting handles from circulators

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Getting handles from circulators


Chronological Thread 
  • From: "Laurent Rineau (CGAL/GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Getting handles from circulators
  • Date: Wed, 06 May 2015 17:16:56 +0200
  • Organization: GeometryFactory

Le Wednesday 06 May 2015 07:43:07 KHartmann a écrit :
> The following code compiles. (CDT is a constrained delaunay triangulation)
>
> CDT::Vertex_handle v;
> CDT::Vertex_circulator vc = cdt->incident_vertices( v );
> CDT::Vertex_handle ivh = vc->handle();
> CDT::Vertex_handle ivh1 = vc;
>
> CDT::Face_handle f;
> CDT::Face_circulator fc = cdt->incident_faces( v );
> // CDT::Face_handle ifh = fc->handle();
> CDT::Face_handle ifh1 = fc;
>
> //////////////////////////////////////////////////////
>
> Are lines 3 an 4 equivalent?
> If I uncomment the commented-out line, it doesn't compile. Why?
>
> What is the proper way to get a handle from a circulator?
> Does it change given the circulator type?
>
> I have read the documentation which is said to be my friend, but it tells me
> to use *, but that doesn't compile either.
>
> http://doc.cgal.org/latest/Circulator/index.html#Chapter_Handles_Ranges_and_
> Circulators

'*vc' is a handle: that is a Vertex. Same: '*fc' is a Face.

In the documentation of Triangulation_2, where you found the documentation of
`incident_vertices`, it is said:

« The circulators and iterators are convertible to handles with the same
value
type, so that whenever a handle appear in the parameter list of a function,
an
appropriate iterator or circulator can be passed as well. »

In section "Handles, Iterators, and Circulators" of:
http://doc.cgal.org/latest/Triangulation_2/classCGAL_1_1Triangulation__2.html

That is the only documented way to convert circulators to handles.

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




Archive powered by MHonArc 2.6.18.

Top of Page