cgal icon indicating copy to clipboard operation
cgal copied to clipboard

<CGAL/Triangulation_euclidean_traits_2.h> not found in CGAL 6.0

Open DarkSun812 opened this issue 1 year ago • 5 comments

Please use the following template to help us solving your issue.

Issue Details

I install CGAL 6.0 download the file.zip and not exist the Triangulation_euclidean_traits_2.h file.

DarkSun812 avatar Oct 09 '24 14:10 DarkSun812

This class was deprecated since CGAL 4.9 and has been removed. Remove the include directive and directly use the template parameter of Triangulation_euclidean_traits_2 as traits template parameter to the triangulation.

sloriot avatar Oct 09 '24 14:10 sloriot

I don't understand what you mean, can you show me an example of how to do that?

My code is something like this:

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_euclidean_traits_2<K> Gt;

typedef CGAL::Triangulation_vertex_base_with_info_2<RT, Gt> Vertex_base;
typedef CGAL::Triangulation_face_base_with_info_2<Face_Info, Gt> Face_base;
typedef CGAL::Triangulation_data_structure_2<Vertex_base, Face_base> TDS;
typedef CGAL::Delaunay_triangulation_2<Gt, TDS> Delaunay_2;

DarkSun812 avatar Oct 09 '24 16:10 DarkSun812

You probably had typedef CGAL::Triangulation_euclidean_traits_2<K> Gt; Just remove this typedef and use K where you write Gt. That is typedef CGAL::Triangulation_vertex_base_with_info_2<RT, K> Vertex_base; etc.

afabri avatar Oct 09 '24 16:10 afabri

Thank you very much, it seems to work that change, but I have a problem with this version with a function that I had:

double RT_to_double(CGAL::Lazy_exact_nt<CGAL::Gmpq> const& x) {
	return CGAL::to_double(x);
}

It says: “there is no suitable ‘CGAL::Null_functor::result_type’ (aka ‘CGAL::Null_tag’) to ‘double’ conversion function.”

Any idea how to solve it?

DarkSun812 avatar Oct 09 '24 17:10 DarkSun812

If the type of x is K::RT (kind of implied by the name of the function), you should spell it that way, trying to guess that it may be the same as Lazy_exact_nt<Gmpq> is not reliable. If you explicitly want to use Lazy_exact_nt<Gmpq>, you should include the relevant headers.

mglisse avatar Oct 10 '24 22:10 mglisse