Skip to Content.
Sympa Menu

cgal-discuss - Computing a convex hull with points derived from Point_2

Subject: CGAL users discussion list

List archive

Computing a convex hull with points derived from Point_2


Chronological Thread 
  • From: Ole Schulz-Trieglaff <>
  • To:
  • Subject: Computing a convex hull with points derived from Point_2
  • Date: Mon, 17 Dec 2007 12:46:49 +0100

Hi,

I'm trying to compute a convex hull with points in 2D that
carry some "meta information" (e.g. two unsigned ints).

My first idea was to derive a class from Point_2 which has
two addition member. However, this does not seem to work as
I get a lengthy error message in IO/Tee_for_output_iterator.h,
line 52 where CGAL tries to assign a Point_2 to my derived class.

My code looks as follows:

-----

#include <CGAL/Cartesian.h>
#include <CGAL/convex_hull_2.h>

// "MyPointClass" derives from Point_2
vector<MyPointClass> cgal_points;

// fill cgal_points
....

// compute convex hull
std::vector<PointIndex> cgal_result;
CGAL::convex_hull_2(cgal_points.begin(), cgal_points.end(),
std::inserter(cgal_result, cgal_result.begin()));

-----


Does anyone have an idea how to attach meta information
to CGAL 2D points or how to compute a convex hull using classes
derived from Point_2 ?


Many thanks !

Ole Schulz-Trieglaff

Free University Berlin
Department of Computer Science and Mathematics



Archive powered by MHonArc 2.6.16.

Top of Page