Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Converting data under one kernel to another

Subject: CGAL users discussion list

List archive

[cgal-discuss] Converting data under one kernel to another


Chronological Thread 
  • From: "Amit Pendharkar" <>
  • To:
  • Subject: [cgal-discuss] Converting data under one kernel to another
  • Date: Fri, 10 Oct 2008 01:05:44 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=uUP3HHru7nW39Y5XqlMkOSF3mQkmHam+nLhfGSmrlECfr8M07l9XJFgvJCiZlYCSE3 QzxDLvDyS54mfQf4RwEJy0nBRsqE6n3HFc/0/nGTaKNJD+HRNluYtGz5ihiqz1gU3RrK GFl9Qmtyl0ANR3j5ijbaj71WnfX6xpPkOtL84=

Hi All,

I have a general question about converting data from one class to another.

E.g. How do I convert a segment from one 'Traits' to another.
typedef CGAL :: Exact_predicates_inexact_constructions_kernel                K;
typedef CGAL :: Segment_Delaunay_graph_traits_2<K>                    SDGT2;
typedef CGAL :: Segment_Delaunay_graph_2<SDGT2>                         SDG2;

typedef CGAL::Arr_segment_traits_2<K>                    Traits_2;

SDG2::Site_2    site;

Traits_2::Segment_2 seg;


How do I convert site into seg???

Currently I am going all the way down up to the x & y coordinates of the endpoints and build the segment from there. Like,

seg = Traits_2::Curve_2(Traits_2::Point_2(site.source().hx(), site.source().hy()), Traits_2::Point_2(site.target().hx(), site.target().hy()));

But then I lose the precision, probably since the x & y coordinates get approximated and the site and seg refer to two different segments.

I face the same problem whenever I want to convert points from one kernel to another like Exact_predicates_inexact_constructions_kernel::Point_2 to Exact_circular_kernel_2::Point_2. I have to go all the way down upto the x,y coordinate level. And then you are bound to lose the precision then, isnt it? Am I missing something here?

Is there any better or rather proper way to do it?

Thanks & Regards,
Amit Pendharkar



Archive powered by MHonArc 2.6.16.

Top of Page