diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index 974e2718d55..99a9322ada2 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -2924,9 +2924,10 @@ namespace CartesianKernelFunctors { template class Construct_point_3 { - typedef typename K::RT RT; - typedef typename K::Point_3 Point_3; - typedef typename Point_3::Rep Rep; + typedef typename K::RT RT; + typedef typename K::Point_3 Point_3; + typedef typename K::Weighted_point_3 Weighted_point_3; + typedef typename Point_3::Rep Rep; public: typedef Point_3 result_type; @@ -2942,6 +2943,9 @@ namespace CartesianKernelFunctors { operator()(Return_base_tag, const RT& x, const RT& y, const RT& z, const RT& w) const { return Rep(x, y, z, w); } + const Point_3& + operator()(const Weighted_point_3 & p) const + { return p.rep().point(); } Point_3 operator()(Origin o) const diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index e28f61821ed..f283e7055ba 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -3083,6 +3083,7 @@ namespace HomogeneousKernelFunctors { typedef typename K::RT RT; typedef typename K::FT FT; typedef typename K::Point_3 Point_3; + typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename Point_3::Rep Rep; public: typedef Point_3 result_type; @@ -3104,6 +3105,9 @@ namespace HomogeneousKernelFunctors { operator()(Return_base_tag, const RT& x, const RT& y, const RT& z, const RT& w) const { return Rep(x, y, z, w); } + const Point_3& + operator()(const Weighted_point_3 & p) const + { return p.rep().point(); } Point_3 operator()(Origin o) const diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index 337f0e05778..046fbab0ea0 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -5451,7 +5451,7 @@ public: introduces a variable with Cartesian coordinates \f$ (0,0)\f$. */ - Kernel::Point_2 operator()(const Origin &ORIGIN); + Kernel::Point_2 operator()(const CGAL::Origin &CGAL::ORIGIN); ///@} @@ -5476,7 +5476,7 @@ public: /*! introduces a point with Cartesian coordinates\f$ (0,0,0)\f$. */ - Kernel::Point_3 operator()(const Origin &ORIGIN); + Kernel::Point_3 operator()(const CGAL::Origin &CGAL::ORIGIN); ///@} @@ -6243,7 +6243,7 @@ public: returns the point obtained by translating a point at the origin by the vector `v`. */ - Kernel::Point_2 operator()(const Origin& o, + Kernel::Point_2 operator()(const CGAL::Origin& o, const Kernel::Vector_2& v); @@ -6400,14 +6400,14 @@ public: /*! introduces the vector `b`. */ - Kernel::Vector_2 operator()(const Origin &o, + Kernel::Vector_2 operator()(const CGAL::Origin &o, const Kernel::Point_2 &b); /*! introduces the vector `-a`. */ Kernel::Vector_2 operator()(const Kernel::Point_2 &a, - const Origin &o); + const CGAL::Origin &o); /*! introduces the vector `s.target()-s.source()`. @@ -6459,14 +6459,14 @@ public: /*! introduces the vector `b`. */ - Kernel::Vector_3 operator()(const Origin &o, + Kernel::Vector_3 operator()(const CGAL::Origin &o, const Kernel::Point_3 &b); /*! introduces the vector `-a`. */ Kernel::Vector_3 operator()(const Kernel::Point_3 &a, - const Origin &o); + const CGAL::Origin &o); /*! introduces the vector `s.target()-s.source()`. diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index f8a3958bf01..b1bf8026d47 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -516,20 +516,6 @@ public: } }; -template < typename K > -class Compute_point_3 -{ -public: - typedef typename K::Weighted_point_3 Weighted_point_3; - typedef typename K::Point_3 Point_3; - - typedef const Point_3& result_type; - - const Point_3& operator()(const Weighted_point_3 & p) const - { - return p.rep().point(); - } -}; template < typename K > class Compute_weight_3 diff --git a/Kernel_23/include/CGAL/Kernel/interface_macros.h b/Kernel_23/include/CGAL/Kernel/interface_macros.h index 74cf23a9a33..357339cf838 100644 --- a/Kernel_23/include/CGAL/Kernel/interface_macros.h +++ b/Kernel_23/include/CGAL/Kernel/interface_macros.h @@ -259,8 +259,6 @@ CGAL_Kernel_cons(Compute_zmin_3, compute_zmin_3_object) CGAL_Kernel_cons(Compute_zmax_3, compute_zmax_3_object) -CGAL_Kernel_cons(Compute_point_3, - compute_point_3_object) CGAL_Kernel_cons(Compute_weight_3, compute_weight_3_object) CGAL_Kernel_cons(Construct_barycenter_2, diff --git a/Kernel_23/include/CGAL/Weighted_point_3.h b/Kernel_23/include/CGAL/Weighted_point_3.h index 4e2a37ba314..7b06c80c24a 100644 --- a/Kernel_23/include/CGAL/Weighted_point_3.h +++ b/Kernel_23/include/CGAL/Weighted_point_3.h @@ -100,10 +100,10 @@ public: : Rep(typename R::Construct_weighted_point_3()(Return_base_tag(), hx, hy, hz, hw)) {} - typename cpp11::result_of::type + typename cpp11::result_of::type point() const { - return typename R::Compute_point_3()(*this); + return typename R::Construct_point_3()(*this); } typename cpp11::result_of::type diff --git a/Triangulation_3/test/Triangulation_3/test_static_filters.cpp b/Triangulation_3/test/Triangulation_3/test_static_filters.cpp index c1c657f29dd..4d91586704c 100644 --- a/Triangulation_3/test/Triangulation_3/test_static_filters.cpp +++ b/Triangulation_3/test/Triangulation_3/test_static_filters.cpp @@ -106,7 +106,7 @@ void test_compare_weighted_squared_radius_3(){ K3().compare_weighted_squared_radius_3_object()(p,q, NT_pair(alpha,alpha)); K3().compare_weighted_squared_radius_3_object()(p, NT_pair(alpha,alpha)); - CGAL::Weighted_converter_3,FTr_with_SF,Exact_traits > convert_to_exact; + CGAL::Cartesian_converter convert_to_exact; Exact_traits::Weighted_point_3 p_e=convert_to_exact(p.first); Exact_traits::Weighted_point_3 q_e=convert_to_exact(q.first); Exact_traits::Weighted_point_3 r_e=convert_to_exact(r.first); @@ -141,8 +141,8 @@ void test_compare_weighted_squared_radius_3(){ Weighted_point_3 convert_to_pair(const Exact_traits::Weighted_point_3& wp) { - CGAL::Weighted_converter_3,Exact_traits,FTr_with_SF > convert_to_double; - CGAL::Weighted_converter_3,FTr_with_SF,FTr_without_SF > convert_to_double_noSF; + CGAL::Cartesian_converter convert_to_double; + CGAL::Cartesian_converter convert_to_double_noSF; FTr_with_SF::Weighted_point_3 wp_with_sf = convert_to_double(wp); FTr_without_SF::Weighted_point_3 wp_without_sf = convert_to_double_noSF(wp_with_sf); @@ -150,7 +150,7 @@ Weighted_point_3 convert_to_pair(const Exact_traits::Weighted_point_3& wp) } void test_power_test_3(){ - CGAL::Weighted_converter_3,FTr_without_SF,Exact_traits > convert_to_exact; + CGAL::Cartesian_converter convert_to_exact; Weighted_point_3 p=my_rand_wp3(); Weighted_point_3 q=my_rand_wp3();