add an overload of CGAL::to_double for Lazy_alpha_nt_3

This commit is contained in:
Sébastien Loriot 2016-11-24 09:41:41 +01:00
parent c3fc9093f1
commit cf71b05937
3 changed files with 9 additions and 1 deletions

View File

@ -73,6 +73,7 @@ resorting to exact arithmetic). Access to the interval containing the exact valu
with `Protected=true`. Access to the exact value is provided through the function 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 `FT::Exact_nt exact() const` where `FT::Exact_nt` depends on the configuration of %CGAL
(it is `Gmpq` if `gmp` is available and `Quotient<CGAL::MP_Float>` otherwise). (it is `Gmpq` if `gmp` is available and `Quotient<CGAL::MP_Float>` 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 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. it is valid and has not been modified.
For convenience, classical comparison operators are provided for the type `FT`. For convenience, classical comparison operators are provided for the type `FT`.

View File

@ -337,6 +337,12 @@ struct Alpha_nt_selector_3:
} //namespace internal } //namespace internal
template<class Input_traits, class Kernel_input, bool mode, class Weighted_tag>
double to_double(const internal::Lazy_alpha_nt_3<Input_traits, Kernel_input, mode, Weighted_tag>& a)
{
return to_double(a.approx());
}
} //namespace CGAL } //namespace CGAL
#endif //CGAL_INTERNAL_LAZY_ALPHA_NT_3_H #endif //CGAL_INTERNAL_LAZY_ALPHA_NT_3_H

View File

@ -111,6 +111,7 @@ _test_cls_alpha_shape_3()
a1.set_alpha(*alpha_it); a1.set_alpha(*alpha_it);
if (verbose) { if (verbose) {
std::cerr << std::endl; std::cerr << std::endl;
CGAL::to_double(* alpha_it);
std::cerr << "alpha value " << * alpha_it << std::endl; std::cerr << "alpha value " << * alpha_it << std::endl;
} }
count_faces(a1, verbose); count_faces(a1, verbose);