Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Face_handle from face?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Face_handle from face?


Chronological Thread 
  • From: Chris Marsh <>
  • To:
  • Subject: Re: [cgal-discuss] Face_handle from face?
  • Date: Tue, 25 Nov 2014 13:00:52 -0600

Mmh sorry, I misunderstood. Why not wrap DoSomething() in a lambda that does the cast? Although that is predicated on C++11 compiler features, which may be a no-go. 

On Tue, Nov 25, 2014 at 12:55 PM, Jack Stalnaker <> wrote:
That works well for a for loop, but not for an STL algorithm like for_each like this:

std::for_each(cdt.finite_faces_begin(), cdt.finite_faces_end(), DoSomething())

where DoSomething is a functor. DoSomething gets *fit instead of fit, which is a face. I'd like to call cdt.triangle, but that only accepts Face_handles.

On Tue, Nov 25, 2014 at 12:45 PM, Chris Marsh <> wrote:
I do this:

    for (Delaunay::Finite_faces_iterator fit = this->finite_faces_begin();
         fit != this->finite_faces_end(); ++fit)
    {
        Delaunay::Face_handle face = fit;

Where Delaunay is just
typedef CGAL::Delaunay_triangulation_2<Gt, Tds> Delaunay; //specify a delauany triangulation

Cheers
Chris

On Tue, Nov 25, 2014 at 12:41 PM, Jack Stalnaker <> wrote:
How do I get a Face_handle from a face? If I use a finite_faces_iterator in an STL algorithm, it dereferences the iterator to a face, but I'd like to use Triangle CGAL::Triangulation_2< Traits, Tds >::triangle, which only accepts Face_handles.  

Thanks.






Archive powered by MHonArc 2.6.18.

Top of Page