Subject: CGAL users discussion list
List archive
- From: Philipp Moeller <>
- To: Alessandro Attanasi <>
- Cc:
- Subject: Re: [cgal-discuss] lower_hull_2() problem
- Date: Tue, 14 Jan 2014 23:59:21 +0100
- Organization: GeometryFactory
Alessandro Attanasi
<>
writes:
> Hi,
>
> I'm a CGAL newbie and I'm learning convex_hull_2D package. I tried to use
> lower_hull_points_2() and upper_hull_points_2() functions but I obtained a
> lot of compilation errors. Maybe I'm not using properly the functions.
>
> I'm using CGAL 4.1 on MacOSX, building the file the cgal script to create
> the cmake building chain
>
> here there is my code
The first error comes from this call:
`CGAL::lower_hull_points_2( points_vect.begin(), points_vect.end(),
result_vect);`
The third argument should be an OutputIterator, but you pass in a
`std::vector`. Use std::back_inserter(result_vect), if this is what you
want. `CGAL::lower_hull_points_2( points_vect.begin(), points_vect.end(),
std::back_inserter(result_vect));`
You might also want to clear the vector in between calls.
The variable `ch_points` isn't declared anywhere. I suppose you want
this to be `std::size_t ch_points = result_vect.size();`
A few random things:
- `typedef enum blabla { FOO } blabla_t;` is not necessary in C++.
`enum blabla_t { FOO };` is enough
- I suppose your compiler comes with C++11. Don't initialize vectors with
`push_back` if you know the elements in advance. Use an
initializer_list, for example `std::vector<Point_2> v = {p1, p2, p3}`;
[...snipped huge code block and error message...]
- [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/14/2014
- Re: [cgal-discuss] lower_hull_2() problem, Philipp Moeller, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Philipp Moeller, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Philipp Moeller, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Philipp Moeller, 01/16/2014
- Re: [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/16/2014
- Re: [cgal-discuss] lower_hull_2() problem, Philipp Moeller, 01/16/2014
- Re: [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/17/2014
- Re: [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Philipp Moeller, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Philipp Moeller, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Alessandro Attanasi, 01/15/2014
- Re: [cgal-discuss] lower_hull_2() problem, Philipp Moeller, 01/15/2014
Archive powered by MHonArc 2.6.18.