Commit Graph

414 Commits

Author SHA1 Message Date
Laurent Rineau 78e2d5e4d2 Merge pull request #6478 from afabri/Nef_3-replace_deque_by_vector_and_reserve-GF
Nef_3: Add overloads with ORIGIN in predicates
2023-03-02 13:42:35 +01:00
Mael 0ff7882997
Merge branch 'master' into feature/bug_documentation_spell_20221113 2022-12-06 22:21:06 +01:00
albert-github 7a62583efa spelling corrections
Some spelling corrections (Directories starting with `C`)
2022-11-14 19:14:33 +01:00
Mael Rouxel-Labbé 2c23a6d5c5 Revert back to wrapping result_type to distinguish FT-necessary operator()s 2022-10-12 21:24:59 +02:00
Mael Rouxel-Labbé d0fe75e908 Add missing FT_necessary tags 2022-09-23 11:35:12 +02:00
Mael Rouxel-Labbé 24067447af Make some predicates division-free 2022-09-23 11:34:49 +02:00
Mael Rouxel-Labbé 214e072959 Switch from RT_sufficient to FT_necessary 2022-09-22 12:02:53 +02:00
Laurent Rineau f52298a8c5 WIP: try to always use Filtered_predicate_RT_FT 2022-09-08 17:30:14 +02:00
Laurent Rineau 4b660d9ec9 Another proposal for Filtered_predicate_RT_FT
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.
2022-09-07 11:10:13 +02:00
Laurent Rineau b114789abf Fix spelling 2022-09-06 13:56:31 +02:00
Laurent Rineau 7c92341be7 Introduce CGAL_Kernel_pred_RT_or_FT
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.
2022-09-02 11:31:47 +02:00
Sébastien Loriot 861588abe1 Merge 'sloriot/CGAL-std_type_traits' into master 2022-08-03 20:19:51 +02:00
Mael Rouxel-Labbé 93c47ec702 Use cmp_signed_dist_to_directionC2 for Compare_signed_distance_to_line_2 2022-06-30 16:23:09 +02:00
Sébastien Loriot 4f5f8341cc use std::enable_if_t 2022-06-10 07:37:53 +02:00
Laurent Rineau 288456950d Merge pull request #6488 from sloriot/ICC-workaround
Workaround issue with intel compiler
2022-04-27 16:32:06 +02:00
Sébastien Loriot cca0a1942f workaround issue with intel compiler
Cartesian_kernel/include/CGAL/Cartesian/Line_3.h(38): error: incomplete type is not allowed
      Point_3 first;
              ^
2022-04-12 16:14:39 +02:00
Andreas Fabri 9023aaa542 More code for ORIGIN 2022-04-07 10:39:01 +01:00
Mael Rouxel-Labbé 19162905eb Clean and factorize robust circumcenter filtered traits 2022-04-04 11:33:27 +02:00
Sébastien Loriot b9a14a447f Merge pull request #6426 from afabri/Kernel_23-Call_function_objects-GF
Kernel_23: Call function objects from CGAL::Segment_3
2022-03-29 17:47:06 +02:00
Sébastien Loriot 5e894656f5 Merge pull request #6422 from afabri/Nef_3-avoid_needless_tests-GF
Nef_3: Avoid needless tests
2022-03-29 17:46:42 +02:00
Andreas Fabri a7fc2c9bbb Remove unused parameter 2022-03-22 08:01:30 +01:00
Andreas Fabri 71bba3e226 Add Plane_3 constructor with Origin/Vector_3 2022-03-17 22:35:09 +01:00
Andreas Fabri d39c7742f1 Kernel_23: Call function objects from CGAL::Segment_3 2022-03-17 12:14:43 +01:00
Giles Bathgate 8445780e09 Merge remote-tracking branch 'afabri/Kernel_23-overload_for_origin-GF' into Nef_3-performance_sphere_circle-GilesBathgate 2022-03-14 21:44:36 +00:00
Andreas Fabri 9a2d782345 No need for parameter 2022-03-15 12:42:56 +01:00
Andreas Fabri 7a7e1d2724
Update Cartesian_kernel/include/CGAL/Cartesian/function_objects.h
Co-authored-by: Mael <mael.rouxel.labbe@geometryfactory.com>
2022-03-11 11:13:42 +01:00
Andreas Fabri 6e4483a7d0 The same for Construct_orthogonal_vector_3 2022-03-10 14:18:48 +00:00
Andreas Fabri f01e24c75b Add Orientation_3::operator()(Origin,Point_3,Point_3,Point_3) 2022-03-10 10:55:44 +00:00
Mael Rouxel-Labbé 3a0a4a6067 Do not forbid any non-fundamental type conversion:
This is because kernel converters are required before type equality
is established, and so one needs conversion for e.g. PointC3.

That could be added and then non-fundamental types could be forbidden
in parameters of converters, but that's for another time...
2021-12-17 12:22:40 +01:00
Mael Rouxel-Labbé 71cbd212dc Converters now simply forward fundamental types, forbid others 2021-12-03 16:48:51 +01:00
Mael Rouxel-Labbé 5aa34c9106 Add Aff_transformation_2 conversion, simplify Aff_tr_3's 2021-12-02 20:11:18 +01:00
Mael Rouxel-Labbé caba3482a6 Disable fundamental type conversions (other than potentially K1::RT / K1::FT) 2021-11-16 16:38:49 +01:00
Mael Rouxel-Labbé ad0378b648 Remove superfluous const& 2021-11-15 08:13:04 +01:00
Mael Rouxel-Labbé 9f1fef3408 Add a test 2021-11-10 16:24:22 +01:00
Mael Rouxel-Labbé c39ea7965f Do not cast fundamental types into bool in NT_converter
Instead, try to construct a NT1 from them. If it fails, give a compilation error.

This is to avoid converters silently doing nasty things like
Cartesian_converter<SC<CORE::Expr>, SC<double> >(2.) ==> 1 (bool true)
because there is no implicit conversion from double to SC<CORE::Expr>, so it
preferes using Enum_converter(bool) (with a double -> Boolean implicit
conversion...).
2021-11-10 15:56:48 +01:00
Mael Rouxel-Labbé 57c240980f Use some const& to avoid copies 2021-11-10 15:40:18 +01:00
Laurent Rineau 1fb32e70b4 Merge pull request #5978 from janetournois/Mesh_2-add_predicate_for_lloyd-jtournois
Mesh 2 and Kernel - add predicate oriented_side_2(segment, triangle)
2021-10-27 17:20:28 +02:00
Sébastien Loriot 65ea1e3621 use initial code in the function 2021-09-29 16:55:36 +02:00
Mael Rouxel-Labbé e424356ffa Add Construct_projected_point_3(P3, P3) + correct parameter order
Not a kernel requirement
2021-09-28 15:34:51 +02:00
Jane Tournois b3a0beb366 make implementation more consistent with the other functions in the same file 2021-09-21 10:58:45 +02:00
Jane Tournois b9de94de93 add assertions to avoid degenerate inputs 2021-09-10 14:10:11 +02:00
Jane Tournois 8bb7e62c1c apply review 2021-09-10 13:56:12 +02:00
Jane Tournois 7e3af5cbda move the implementation of segment_hides_circumcenter() to the kernel
to use filtered predicates
2021-09-10 11:26:53 +02:00
Mael Rouxel-Labbé 8a92d51601 Merge branch 'Distance_3-Add_Tri_Tri-GF-old' into Distance_3-Add_Tri_Tri-GF 2021-09-02 17:26:44 +02:00
Sebastien Loriot e5279db7fb
Merge pull request #5777 from MaelRL/AABB-Dont_call_global_do_intersect-GF
Misc fixes for Intersections_3 + related
2021-09-02 15:44:53 +02:00
Sebastien Loriot 92d90a4a11
Merge pull request #5667 from afabri/Kernel-compare_slopes-GF
Kernel: Add compare_slope with 4 points
2021-08-12 10:12:26 +02:00
Laurent Rineau 0f906ae606 Merge pull request #5545 from Dig-Doug/segment-midpoint
Segment_2/Segment_3 midpoint()
2021-07-07 14:37:38 +02:00
Mael Rouxel-Labbé 03ab79899b Fix Construct_radical_plane_3 for Homogeneous_kernel 2021-06-29 09:24:53 +02:00
Mael Rouxel-Labbé 084a1efe2d Merge remote-tracking branch 'cgal/master' into Distance_3-Add_Tri_Tri-GF 2021-06-23 22:30:03 +02:00
Mael Rouxel-Labbé 4a301448fe Comment an assertion that requires an exact kernel 2021-06-23 17:37:47 +02:00