Commit Graph

73715 Commits

Author SHA1 Message Date
Mael Rouxel-Labbé e59e8c2aa0 Removed useless construct_point_3
Construct_weighted_circumcenter_3 already returns a Bare_point
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 1db071e3ee Moved up the force_exact test to avoid computing useless determinants 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 47b3e7193e Comparison result should be of type Comparison_result
(it worked anyway since Comparison_result is a Sign internally)
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 0f8f34c9d4 Fixed compilation of add_temporary_points_on_far_sphere() 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 94abc23da9 Adapted the call to spatial_sort() to handle weighted points
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)
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 91ea1b4049 Adapted sorting algorithms based on compare_xyz to handle weighted point vectors 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 6e15032a1c Added the Unary_function_to_property_map property map
It is the opposite of Property_map_to_unary_function and allows to make
a property map out of a unary function: get(k) = f(k)
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 12fb8d35fc Construct_plane() must use bare points arguments 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 42fa20881c Fixed point typedef in Tr_3/benchmarks 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 1e30446d7e Fixed Triangulation_benchmark_3.cpp
-- 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)
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé b4eed5b64c Fixed test_RT_cell_base_with_weigh... and added it to the CMakeLists
-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
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé b50098bb1e Removed hiding-related functions from Triangulation_cell_base_3
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)
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 98226c97c4 Added a template parameter to Regular_tr_cell_base on hidden points handling
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.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé de76ccf545 Removed Weighted_point_mapper_3 and RegTraits_3 shenanigans
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.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé cd9a908393 Ensured that we call kernel functions with the correct (bare) point type
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).
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé ae1fb2bfec Deduce Triangulation_3's point type from the TDS
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.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 3e25674957 Weighted alpha shape traits are not based on RT_euclidean_traits anymore
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.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé e9efcb3984 Fixed doc typo 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 7a7ac15f42 Fixed weighted Alpha_shapes_3 TDS construction
When weighted, Alpha_cell_base_3 must use Regular_triangulation_cell_base_3
as base
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé d7cd4e2955 Improved readability of Lazy_alpha_nt_2 (no real changes) 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé b31e954edc Fixed default constructed traits 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé e421fe92f9 Fixed Regular_traits_adaptor
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.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 42e04a3522 Fixed a comment in Interpolation
The OutputIterator type in regular_neighbor_coordinates is a pair of a weighted
point (and _not_ a point) and a FT
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 5d8b882294 Voronoi_intersection_2_traits_3.h should not define a Weight type 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé d3d63b579a Corrected documentation of Voronoi_intersection_2_traits_3
-- 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
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 8c9817852f Fixed Interpolation demo
The regular triangulation must be built using weighted points
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé c65c15b2c1 Improved Interpolation readability (no real changes)
-- Removed trailing whitespace
-- Fixed (some) includes
-- Fixed indentation
-- Fixed some remaining french
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé eddc79f39d Proper use of Bare_point/Weighted_point 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé b5233c93d7 Simplified the usage of traits' functors in NN_coordinates_3
There is no need to define local versions of functors that are already available
through the traits / kernel.

Also do not default construct traits.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé b638cb4d66 Fixed surface_neighbors_3
Short version: the regular triangulation must be build using weighted points,
but the return type is (bare) points
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé e3941a663e Fixed surface_neighbor_coordinates
Short version: the regular triangulation must be build using weighted points,
but the return type is (bare) points
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 0b187c3499 Fixed Voronoi_intersection_2_traits_3
-- 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
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 1043965fe8 Removed useless includes 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 73f4a3d6cc Removed an empty line 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé befccc1acc Cleaned uses of obsolete traits class Regular_triangulation_euclidean_traits 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé accc098c52 Renamed Bare_point_3 > Bare_point 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 026058a20d Removed useless semicolon 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé bf37f6580d Fixed using Weighted_point_creator to construct weighted point
This class is obsolete; kernel functors should be used.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé cc8d0da913 Fixed (almost all) default constructed traits in Mesh_3
Also fixed constructing points/weighted_points not through the traits and
uses of point().point()
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 860886dfc2 Improved readiblity of Regular_triangulation_2.h (no real changes)
Only whitespace cleaning, indentation fixing, empty lines removal, etc.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 5f37a4bea6 Improved readability of Triangulation_2.h (no real changes)
Only whitespace cleaning, indentation fixing, empty lines removal, etc.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 2dc4974871 Improved readability of Delaunay_triangulation_2.h (no real changes)
Only whitespace cleaning, indentation fixing, empty lines removal, etc.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 1091661007 Do not provide Bare_point overloads in Regular_triangulation_2
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
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé e96f05f31b Fixed Bare_point / Weighted_point usage in Triangulation_2 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé d668d42f44 Do not provide Bare_point overloads in Regular_triangulation 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé f0d3e77558 Fixed usage of Bare point and Weighted point across Triangulation_3 2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé e08b054aff Trimmed Regular triangulation euclidean traits (doc version)
Now that the traits is exactly the kernel, there isn't a big need for a lot of
documentation.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé d2abb2d981 Trimmed Regular triangulation euclidean traits
-- 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
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé 7bdd0b1383 Fixed Triangulation_3's regular test
Constructing weighted points with (x,y,z,w) is ambiguous and that is why it was
disabled.
2017-06-28 10:14:35 +02:00
Mael Rouxel-Labbé e88b643874 Removed ambiguous weighted point constructor
This constructor was already cleaned in the branch that this branch
is based upon... I must have messed up a merge conflict...
2017-06-28 10:14:35 +02:00