From 79f5ca02447aecacbb1414948b57ce81980c4010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 5 May 2017 13:26:27 +0200 Subject: [PATCH] Fixed some predicates -- traits must have Construct_point_2/3 now -- renamed power_test to satisfy the new convention --- .../Kinetic/Default_instantaneous_kernel.h | 44 +++++++++++++++++-- .../Kernel/Cartesian_kinetic_kernel_base.h | 16 +------ .../internal/Kernel/cartesian_predicates_3.h | 6 ++- 3 files changed, 47 insertions(+), 19 deletions(-) diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/Default_instantaneous_kernel.h b/Kinetic_data_structures/include/CGAL/Kinetic/Default_instantaneous_kernel.h index 446ee08e820..9b916af72b0 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/Default_instantaneous_kernel.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/Default_instantaneous_kernel.h @@ -343,6 +343,45 @@ public: return Compare_x_1(rep_, sp, rep_->kinetic_kernel().compare_x_1_object()); } + struct Construct_point_2 + { + template + struct result { + typedef Point_2 type; + }; + + template + struct result { + typedef const Point_2& type; + }; + + const Point_2& operator()(const Point_2& p) const { return p; } + }; + + struct Construct_point_3 + { + template + struct result { + typedef Point_3 type; + }; + + template + struct result { + typedef const Point_3& type; + }; + + template + struct result { + typedef const Point_3& type; + }; + + const Point_3& operator()(const Point_3& p) const { return p; } + Point_3 operator()(const Weighted_point_3& wp) const { return Point_3(wp.index()); } + }; + + Construct_point_2 construct_point_2_object() const { return Construct_point_2(); } + Construct_point_3 construct_point_3_object() const { return Construct_point_3(); } + CGAL_MSA(Side_of_oriented_circle,side_of_oriented_circle, Point_2, 2); CGAL_MSA(Orientation,orientation, Point_2, 2); CGAL_MSA(Compare_x, compare_x, Point_2, 2); @@ -363,10 +402,9 @@ public: CGAL_MSA(Less_z, less_z, Point_3, 3);*/ CGAL_MSA(Coplanar_orientation, coplanar_orientation, Point_3, 3); CGAL_MSA(Coplanar_side_of_bounded_circle, coplanar_side_of_bounded_circle, Point_3, 3); - //CGAL_MSA(Power_test,power_test, Weighted_point_3, 3); + CGAL_MSA(Equal, equal, Point_3, 3); + CGAL_MSA(Power_side_of_oriented_power_sphere,power_side_of_oriented_power_sphere, Weighted_point_3, 3); - - CGAL_TSO(Segment_3); CGAL_TSO(Triangle_3); CGAL_TSO(Tetrahedron_3); diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_kinetic_kernel_base.h b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_kinetic_kernel_base.h index 628d4b41fae..55da4bd2c92 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_kinetic_kernel_base.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_kinetic_kernel_base.h @@ -97,18 +97,12 @@ public: /*! Takes 4 Point_3. */ - typedef Certificate_generator > Orientation_3; + typedef Certificate_generator > Orientation_3; Orientation_3 orientation_3_object() const { return Orientation_3(k_); } - /*typedef Cartesian_orientation_3 Orientation_3; - Orientation_3 orientation_3_object() const - { - return Orientation_3(k_); - }*/ - //! The in_circle test. typedef Certificate_generator > Side_of_oriented_circle_2; Side_of_oriented_circle_2 side_of_oriented_circle_2_object() const @@ -124,7 +118,7 @@ public: } //! The power test for weighted points. - typedef Certificate_generator > Power_side_of_oriented_power_sphere_3; + typedef Certificate_generator > Power_side_of_oriented_power_sphere_3; Power_side_of_oriented_power_sphere_3 power_side_of_oriented_power_sphere_3_object() const { return Power_side_of_oriented_power_sphere_3(k_); @@ -137,12 +131,6 @@ public: return Weighted_orientation_3(k_); } - /*typedef Cartesian_weighted_orientation_3 Weighted_orientation_3; - Weighted_orientation_3 weighted_orientation_3_object() const - { - return Weighted_orientation_3(); - }*/ - template struct Null_generator { typedef Arg argument_type; diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/cartesian_predicates_3.h b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/cartesian_predicates_3.h index b4e779db753..6571735f5cf 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/cartesian_predicates_3.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/cartesian_predicates_3.h @@ -88,7 +88,7 @@ struct Cartesian_side_of_oriented_sphere_3 }; template -struct Cartesian_power_test_3 +struct Cartesian_power_side_of_oriented_power_sphere_3 { typedef typename KK::Certificate_function result_type; typedef typename KK::Weighted_point_3 first_argument_type; @@ -96,7 +96,9 @@ struct Cartesian_power_test_3 typedef typename KK::Weighted_point_3 third_argument_type; typedef typename KK::Weighted_point_3 fourth_argument_type; typedef typename KK::Weighted_point_3 fifth_argument_type; - Cartesian_power_test_3(){} + + Cartesian_power_side_of_oriented_power_sphere_3(){} + result_type operator()(const first_argument_type &a, const second_argument_type &b, const third_argument_type &c,