This wrapper around Regular_triangulation_3 adds undocumented, straightforward
functions which are required for Mesh_3 because of Periodic_3_mesh_3:
they are functions for which both (periodic and non-periodic) triangulations
have fundamentally different implementations, usually because Periodic_3_mesh_3
does not know the offset of a point and must brute-force check all
possibilities. To allow Periodic_3_mesh_3 to use Mesh_3's files,
each mesh triangulation implements its own version.
Now that we require CMake>=3.1, we can forget a lot of old CMake policies.
`CMP0053` `OLD` behavior is still needed, because of a bug in Qt5 CMake files, but it will
not be set with CMake>=3.10. Let's assume that a recent CMake version means
a recent Qt5 version.
- MeshCellBase_3 loses "invalidate_circumcenter" and refines the new concept
- Reg_tr_cell_base_with_weighted_circumcenter_3 is a model of the new concept
-- Do not use concept names as template names in the doc
-- Fixed point / point_3 issues and other problems of coherence between concept
and model
-- Fixed some wrong refinement relationships
When the geom_traits given as parameter of `circumcenter` and/or
`weighted_circumcenter` was deriving from the cell base GT
(first template parameter), the gt was up-casted to the
cell base GT, and the function construct_circumcenter_3_object()
(or construct_weighted_circumcenter_3_object()) not
called on the right geom traits type --> possibly missing
the actual input of the function (the robust_circumcenter_traits in Mesh_3)
we add a static assert to check at compile time that point types are the same
When the geom_traits given as parameter of `circumcenter` and/or
`weighted_circumcenter` was deriving from the cell base GT
(first template parameter), the gt was up-casted to the
cell base GT, and the function construct_circumcenter_3_object()
(or construct_weighted_circumcenter_3_object()) not
called on the right geom traits type --> possibly missing
the actual input of the function (the robust_circumcenter_traits in Mesh_3)
we add a static assert to check at compile time that both geom traits
are compatible
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.
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.
-- 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
Instead of calling Criteria(element), one must now call Criteria(tr, element).
The idea is that the triangulation should be responsible of geometric data
while elements only handle connectivity (using ids for example).
This is already the case for Periodic_3_mesh_3 which must obtain
"true" geometric information through the (periodic) triangulation class's
methods.
These changes are transparent for Mesh_3 but allow Periodic_3_mesh_3 to use
Mesh_3's criteria.
- MeshCellBase_3 loses "invalidate_circumcenter" and refines the new concept
- Reg_tr_cell_base_with_weighted_circumcenter_3 is a model of the new concept
-- Do not use concept names as template names in the doc
-- Fixed point / point_3 issues and other problems of coherence between concept
and model
-- Fixed some wrong refinement relationships
When the geom_traits given as parameter of `circumcenter` and/or
`weighted_circumcenter` was deriving from the cell base GT
(first template parameter), the gt was up-casted to the
cell base GT, and the function construct_circumcenter_3_object()
(or construct_weighted_circumcenter_3_object()) not
called on the right geom traits type --> possibly missing
the actual input of the function (the robust_circumcenter_traits in Mesh_3)
we add a static assert to check at compile time that point types are the same
When the geom_traits given as parameter of `circumcenter` and/or
`weighted_circumcenter` was deriving from the cell base GT
(first template parameter), the gt was up-casted to the
cell base GT, and the function construct_circumcenter_3_object()
(or construct_weighted_circumcenter_3_object()) not
called on the right geom traits type --> possibly missing
the actual input of the function (the robust_circumcenter_traits in Mesh_3)
we add a static assert to check at compile time that both geom traits
are compatible
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.
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.
-- 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