Instead of having the return type wrapped in a `Needs_FT` tag,
not the call operator overloads that can be called with `RT` are
"tagged" by adding a last argument of type `RT_sufficient` with a
default value.
This commit introduces a new kind of predicate in
`<CGAL/Kernel/interface_macros.h>`. In addition to
- `CGAL_kernel_pred` for predicates,
- `CGAL_Kernel_pred_RT` for predicates that can be implemented using a
ring-type,
now there is also:
- `CGAL_Kernel_pred_RT_or_FT` for predicates with multiple overloads of
`operator()`, some needing a field type and other needing a ring type
(without the division operator).
The C++ code can discriminate between the two cases with a special wrapper
for the return type: `CGAL::Needs_FT<result_type` instead of `result_type`
(defined in `<CGAL/tags.h>`.
In `<CGAL/Filtered_predicate.h>`, in addition to the usual class template
`Filtered_predicate`, there is now also `Filtered_predicate_RT_FT` that
takes three predicates as template parameters instead of two:
- the exact predicate with an ring-type,
- the exact predicate with a field-type,
- the approximate predicate (with `Interval_nt` as number-type).
For the moment, only `Compare_distance_3` in
`<CGAL/Cartesian/function_objects.h>` is using the new
`Filtered_predicate_RT_FT`.
Before this commit, the file
`Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h` was testing
`Compare_distance_3` only with three points or for points. This commit adds:
- a test with `Point_3, Point_3, Segment_3`, and
- a test with `Line_3, Point_3, Point_3`, that actually needs a field type
with its current implementation.
In the test `Kernel_23/test/Kernel_23/Filtered_cartesian.cpp`, the macro
`CGAL_NO_MPZF_DIVISION_OPERATOR` is defined, to remove the division operator
from `CGAL::Mpzf`. `CGAL::Mpzf` is a ring-type, even with its `operator/`
(because that `operator/` can only compute exact divisions), but with
`CGAL_NO_MPZF_DIVISION_OPERATOR` defined, that is now checked by the compiler.
The code is not ready for that. A lot of overloads of
`Do_interesect_[23]` are implemented by calling the equivalent
overloads from `Intersect_23` (that requires division of coordinates).
right after the merge of the 5.0 release branch
+ manual fix of the files (indentation was changed in the meantime):
* Spatial_sorting/include/CGAL/Multiscale_sort.h
* Spatial_sorting/test/Spatial_sorting/test_multiscale.cpp
Compare_distance_3 is a generic functor that is comparing
the returned value of Squared_distance_3. If called to
compare the distance of a point to a plane/segment/triangle
a division is used leading to runtime error.
A partial implementation was deleted from the Alpha_shapes_2 package without
moving the functions to the kernel...
This implementation adds the missing overloads (4, 3, and 2 points)
Test + doc included
The Homogeneous kernel doesn't know how to run that predicate
for 3 or 4 arguments so it must be defined in Kernel/function_objects until
those operators are added
as well as the corresponding functor
This is a function where the implementation is in the file
Kernel_23/include/CGAL/Kernel/function_objects.h
When the implementation is different for Cartesia and Homogeneous coordinates
the code should go into the function_objects.h files
in the packages Cartesian_kernel and Homogeneous_kernel