Downside: we copy points at each comparison, which is terrible! No noticeable
changes when profiling the construction of a triangulation.
We need this copy because of Lazy kernel: despite construct_point_3 having
const Point_3& construct_point_3_object()(const Point_3&)
the Lazy kernel can return some copies.
Other solutions that were not used:
-- Distinguish the Ouput type of Unary_function_to_property map depending on
the type of Kernel (ugly and not safe)
-- Use Weighted_point_mappers traits (but that blood will not be on my hands)
-- Fix Weighted_point_3 / Point_3 incompatibilities
-- Generator of weighted points also generates random weights
-- Do not use Regular_euclidean_triangulation_traits since they are deprecated
-- Do not use 'using namespace'
-- Use the new policy tag to disable hidden point caching (see b925281)
-- Remove unused objects (such as pts2_bbox)
-Some wrong Bare_point/Weighted_point usage
-Fully instantiate the Regular_triangulation_cell_base_with_weighted_circum...
with all the template parameters of the regular cell base
Triangulation_cell_base_3 cannot be used anymore as a cell base of a regular
triangulation and thus there is no point keeping these functions.
People wishing to disable caching of hidden points in regular triangulations
should use the new policy, see commit b92528171c)
Before WP<->P implicit conversion changes, one could choose to not keep hidden
points by using `Triangulation_cell_base_3` as cell base instead of
`Regular_triangulation_cell_base_3`. This is not possible anymore as point types
will conflict.
This changes introduces a new template parameter to pass a policy on whether
to keep or discard hidden points.
It is a breaking change since it is placed before the container template
parameter, but it makes more sense that way and the container type template
was not documented.
There is no need anymore for sneaky traits adaptors to make Triangulation_3
a compatible base of Regular_triangulation_3:
- The Point type in Triangulation_3 is obtained through TDS::Vertex::Point (see
commit 13d5e89)
- Triangulation_3 always ensures that we are passing bare points to the kernel
functors that require bare point arguments (see commit db5da73)
This greatly clarifies the code of Regular_triangulation_3: there is only a
single traits type, a single base type, etc.
Note that if the type `Point` is already `Point_3`, Construct_point_3 does not
do anything (except in the lazy kernel, but in that case, the running time is
horrible anyway).
Since we have a distinc vertex_base for regular triangulations and that this
regular vertex base defines a type Point, it is redundant to get the Point
type from the Geom_traits.
This also allows to remove the Weighted_point_mapper trick, and pass more easily
custom point types.
Similarly to Regular_triangulation_euclidean_traits, the Kernel concept has now
absorbed all the functors that are needed by the alpha shape traits concept and
the weighted alpha shape traits can thus simply be empty shells.
The functor members cannot be references because the Regular_triangulation
might be templated by a traits class that is not simply a Kernel (that is
the case in the package Interpolation).
When that is the case, calling this->K::function_object() might be a call
to a constructor in the base traits class. Thus, the functor members
of Reg_traits_adaptors get initialized to temporaries, which is problematic
because these temporaries are at a much lower scope and thus are quickly
cleaned, leaving us with references to nothing in Reg_traits_adaptor.
-- the traits class is not a model of InterpolationTraits
-- plenty of typedef that were not documented
-- added new requirements due to changes in points/weighted_points
-- constructor with a kernel parameter
-- Required fixes due to the removal of implicit conversions between Point and
Weighted_point
-- Removed 'Bare_point' typedef: it is not for the traits to define this type
-- The traits class derives from a Kernel so that it can still provide
the functors that are not redeclared in this traits class
-- Use const& for predicate members to avoid copies (the traits will live
longer than the predicates so it's safe)
-- Minor changes (trailing whitespace, useless semicolons) that was
too difficult to separate into a different commit
Additional:
-- Simplify the hierarchy_2: there is no need to distinguish between
Bare_point and Weighted_point, that is the point (!) of the type "Point"
in Triangulation_2.
-- Use Weighted_point in tests
-- Code added as consequence of disabling implicit conversion between points and
weighted points implies that defining
typedef weighted_point point;
creates ambiguous functors.
This typedef is nevertheless still used, in Weighted_point_mappers.
-- The traits are not supposed to define Bare_point