From cf71b05937f751715aece9048ce5cf245c1f23ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 24 Nov 2016 09:41:41 +0100 Subject: [PATCH] add an overload of CGAL::to_double for Lazy_alpha_nt_3 --- Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h | 3 ++- Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h | 6 ++++++ .../Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h index 304fb11c1f5..ca797d9979f 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h @@ -72,7 +72,8 @@ resorting to exact arithmetic). Access to the interval containing the exact valu `FT::Approximate_nt approx() const` where `FT::Approximate_nt` is `Interval_nt` with `Protected=true`. Access to the exact value is provided through the function `FT::Exact_nt exact() const` where `FT::Exact_nt` depends on the configuration of %CGAL -(it is `Gmpq` if `gmp` is available and `Quotient` otherwise). +(it is `Gmpq` if `gmp` is available and `Quotient` otherwise). +An overload for the function `double to_double(FT)` is also available. It must be noted that an object of type `FT` is valid as long as the alpha shapes class that creates it is valid and has not been modified. For convenience, classical comparison operators are provided for the type `FT`. diff --git a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h index 6d4c7f20fe3..02ff302c514 100644 --- a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h +++ b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h @@ -337,6 +337,12 @@ struct Alpha_nt_selector_3: } //namespace internal +template +double to_double(const internal::Lazy_alpha_nt_3& a) +{ + return to_double(a.approx()); +} + } //namespace CGAL #endif //CGAL_INTERNAL_LAZY_ALPHA_NT_3_H diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h index f79893edad5..0d251acb720 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h +++ b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h @@ -111,6 +111,7 @@ _test_cls_alpha_shape_3() a1.set_alpha(*alpha_it); if (verbose) { std::cerr << std::endl; + CGAL::to_double(* alpha_it); std::cerr << "alpha value " << * alpha_it << std::endl; } count_faces(a1, verbose);