Subject: CGAL users discussion list
List archive
- From: Chansophea Chuon <>
- To:
- Subject: Define my own geometric point class
- Date: Thu, 29 Mar 2007 14:12:26 -0700 (PDT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=bnHxj69XuTHcDf94w1ybMuKjPMTRnY+6P4kj53Xy+1rLj/tmSRW9KP6OSZac8BLR848SH8zH4M16bo1IR7G5YxJfiTjfLh4WkcH5MDigK04e6yV+n0AiH82uLYPGpezaNFS1qHCSHEHbWA9XRjVcwG1c4YCS4wNY95Yh4LLnWhs=;
Dear all:
I could not find a tutorial on defining our own geometric class and use that with CGAL.
Suppose that I would like to define my own class
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Triangle_2.h>
typedef CGAL::Cartesian<double> K;
typedef CGAL::Point_2<K> Point_2;
class MyPoint{
Point_2 point;
CGAL::Color c;
bool deleted;
}
What should I do so that I could use MyPoint objects with CGAL functions? Should I derive my own class from the CGAL Point_2 ?
For example:
MyPoint mp1 (x, y, ....), mp2(x1, y1, ...), mp3(x2, y2, ...);
and I would like to use these object with some CGAL functions like
CGAL::orientation (mp1, mp2, mp2), find convex hull, find K nearest neighbor, mke triangle from these point by using CGAL::Triangle, etc...
Thanks so much for your help in advance.
Best regards,
Sophea
I could not find a tutorial on defining our own geometric class and use that with CGAL.
Suppose that I would like to define my own class
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Triangle_2.h>
typedef CGAL::Cartesian<double> K;
typedef CGAL::Point_2<K> Point_2;
class MyPoint{
Point_2 point;
CGAL::Color c;
bool deleted;
}
What should I do so that I could use MyPoint objects with CGAL functions? Should I derive my own class from the CGAL Point_2 ?
For example:
MyPoint mp1 (x, y, ....), mp2(x1, y1, ...), mp3(x2, y2, ...);
and I would like to use these object with some CGAL functions like
CGAL::orientation (mp1, mp2, mp2), find convex hull, find K nearest neighbor, mke triangle from these point by using CGAL::Triangle, etc...
Thanks so much for your help in advance.
Best regards,
Sophea
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
- Define my own geometric point class, Chansophea Chuon, 03/30/2007
Archive powered by MHonArc 2.6.16.