Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] sweep line

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] sweep line


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] sweep line
  • Date: Tue, 31 Jan 2012 17:03:21 +0100

On 01/31/2012 01:40 PM, Winnie Hellmann wrote:
Because the typo is consistently used in the code :)
That's why I love auto completion. ;-)

I want to sort my arrangement vertices by y-coordinate using a sweep
line.
So this leaves me with the question: Can I do a sweep line inside an
arrangement in y-direction? As far as I have seen the Basic_sweep_line_2
does sweeping in x-direction, but I haven't found any documentation for
this class.

That's doable by providing another model of ArrangementTraits_2 to
handle that. In that traits, you need to define you own functors
Make_x_monotone_2, Compare_x_2 ...
In each functor you can reuse existing implementation and swap usage of
x and y. This is definitely not an easy solution.

The lazy solution is to have a preprocessing step to convert your input
by swapping x and y coordinates of points (and use handmade global
functions get_x(Point_2),get_y(Point_2) to avoid confusion in the rest
of your code).


Sebastien.




http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Arrangement_on_surface_2_ref/Concept_ArrangementTraits_2.html

Thanks,
Winnie Hellmann





Archive powered by MHonArc 2.6.16.

Top of Page