diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha_projection_traits.cpp b/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha_projection_traits.cpp index 3b7cbeb92a0..19717ea1adb 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha_projection_traits.cpp +++ b/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha_projection_traits.cpp @@ -1,6 +1,12 @@ #include #include +#include + +#include +#include + #include + #include #include #include @@ -8,10 +14,6 @@ #include #include -#include -#include -#include - typedef double coord_type; typedef CGAL::Simple_cartesian SC; @@ -21,6 +23,40 @@ typedef CGAL::Projection_traits_xy_3 K; typedef K::Point_2 Point; typedef K::Segment_2 Segment; +// ------------------------------------------------------------------- +// Since K::Point_2 is here in fact CGAL::Point_3, the basic Cartesian_converter +// cannot be used (and thus ExactAlphaComparisonTag can't be set to 'true') because +// it does not know how to convert from CGAL::Point_3 to CGAL::Point_2. + +// Thus, we must provide a specialization for our case + +namespace CGAL { + +template < class K2, class C > +class Cartesian_converter +{ +public: + typedef CGAL::Projection_traits_xy_3 Source_kernel; + typedef K2 Target_kernel; + typedef C Number_type_converter; + + typedef typename Source_kernel::Point_2 SP2; + typedef typename Target_kernel::Point_2 TP2; + + TP2 operator()(const SP2& p) const + { + return TP2(c(p.x()), c(p.y())); + } + +private: + C c; +}; + +} // namespace CGAL + +// The include is only here because the partial specialization above must be before +#include + //ExactAlphaComparisonTag is false typedef K Gt; typedef CGAL::Alpha_shape_vertex_base_2 Vb;