From 285600fe633e7679ae54d4dc2718a88bf6cda058 Mon Sep 17 00:00:00 2001 From: Pedro Machado Manhaes de Castro Date: Thu, 24 Jul 2008 14:40:44 +0000 Subject: [PATCH] result_type inheritance --- .../function_objects_polynomial_circular.h | 58 +++++++------------ .../CGAL/Circular_kernel_2/interface_macros.h | 1 - .../function_objects_polynomial_sphere.h | 34 +++++------ 3 files changed, 38 insertions(+), 55 deletions(-) diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h index ace7676085a..5bf78f036b7 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h @@ -44,11 +44,12 @@ namespace CircularFunctors { typedef typename CK::Point_2 Point_2; public: - typedef CGAL::Comparison_result result_type; #ifndef CGAL_CFG_MATCHING_BUG_6 + typedef typename CK::Linear_kernel::Compare_x_2::result_type result_type; using CK::Linear_kernel::Compare_x_2::operator(); #else + typedef CGAL::Comparison_result result_type; result_type operator() (const Point_2 &p0, const Point_2 &p1) const @@ -77,12 +78,13 @@ namespace CircularFunctors { typedef typename CK::Point_2 Point_2; public: - typedef CGAL::Comparison_result result_type; - + #ifndef CGAL_CFG_MATCHING_BUG_6 + typedef typename CK::Linear_kernel::Compare_y_2::result_type result_type; using CK::Linear_kernel::Compare_y_2::operator(); #else - result_type + typedef CGAL::Comparison_result result_type; + result_type operator() (const Point_2 &p0, const Point_2 &p1) const { @@ -109,12 +111,13 @@ namespace CircularFunctors { typedef typename CK::Point_2 Point_2; public: - typedef CGAL::Comparison_result result_type; #ifndef CGAL_CFG_MATCHING_BUG_6 + typedef typename CK::Linear_kernel::Compare_xy_2::result_type result_type; using CK::Linear_kernel::Compare_xy_2::operator(); #else - result_type + typedef CGAL::Comparison_result result_type; + result_type operator() (const Point_2 &p0, const Point_2 &p1) const { @@ -163,7 +166,7 @@ namespace CircularFunctors { typedef typename CK::Line_2 Line_2; public: - typedef bool result_type; + typedef typename CK::Linear_kernel::Has_on_2::result_type result_type; using CK::Linear_kernel::Has_on_2::operator(); @@ -185,8 +188,6 @@ namespace CircularFunctors { }; - - template < class CK > class Compare_y_to_right_2 { @@ -277,8 +278,6 @@ namespace CircularFunctors { typedef typename CK::Line_arc_2 Line_arc_2; public: - typedef bool result_type; - typedef typename CK::Linear_kernel LK; typedef typename LK::Equal_2 LK_Equal_2; @@ -294,8 +293,11 @@ namespace CircularFunctors { #ifndef CGAL_CFG_MATCHING_BUG_6 + typedef typename CK::Linear_kernel::Equal_2::result_type result_type; using CK::Linear_kernel::Equal_2::operator(); #else + typedef bool result_type; + result_type operator() (const Point_2 &p0, const Point_2 &p1) const @@ -548,7 +550,7 @@ template < class CK > public: - typedef void result_type; + typedef typename CK::Linear_kernel::Intersect_2::result_type result_type; using CK::Linear_kernel::Intersect_2::operator(); @@ -631,7 +633,7 @@ template < class CK > public: - typedef bool result_type; + typedef typename CK::Linear_kernel::Is_vertical_2::result_type result_type; using CK::Linear_kernel::Is_vertical_2::operator(); @@ -1034,11 +1036,11 @@ template < class CK > public: - typedef CGAL::Bbox_2 result_type; - #ifndef CGAL_CFG_MATCHING_BUG_6 + typedef typename CK::Linear_kernel::Construct_bbox_2::result_type result_type; using CK::Linear_kernel::Construct_bbox_2::operator(); #else + typedef CGAL::Bbox_2 result_type; typedef typename CK::Linear_kernel LK; typedef typename LK::Construct_bbox_2 LK_Construct_bbox_2; typedef typename LK::Point_2 Point_2; @@ -1079,7 +1081,7 @@ template < class CK > typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; public: - typedef typename CK::Linear_kernel::Bounded_side result_type; + typedef typename CK::Linear_kernel::Bounded_side_2::result_type result_type; using CK::Linear_kernel::Bounded_side_2::operator(); @@ -1097,7 +1099,7 @@ template < class CK > typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; public: - typedef bool result_type; + typedef typename CK::Linear_kernel::Has_on_bounded_side_2::result_type result_type; using CK::Linear_kernel::Has_on_bounded_side_2::operator(); @@ -1115,7 +1117,7 @@ template < class CK > typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; public: - typedef bool result_type; + typedef typename CK::Linear_kernel::Has_on_unbounded_side_2::result_type result_type; using CK::Linear_kernel::Has_on_unbounded_side_2::operator(); @@ -1125,24 +1127,6 @@ template < class CK > }; - template - class Orientation_2 - : public CK::Linear_kernel::Orientation_2 - { - typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; - - public: - typedef typename CK::Linear_kernel::Orientation result_type; - - using CK::Linear_kernel::Orientation_2::operator(); - - result_type - operator()(const Circular_arc_point_2& p, - const Circular_arc_point_2& q, - const Circular_arc_point_2& r) const - { return orientation(p,q,r); } - }; - template class Collinear_2 : public CK::Linear_kernel::Collinear_2 @@ -1150,7 +1134,7 @@ template < class CK > typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; public: - typedef typename CK::Linear_kernel::Orientation result_type; + typedef typename CK::Linear_kernel::Collinear_2::result_type result_type; using CK::Linear_kernel::Collinear_2::operator(); diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/interface_macros.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/interface_macros.h index b1f40362095..c1a41c8097b 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/interface_macros.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/interface_macros.h @@ -98,7 +98,6 @@ CGAL_Circular_Kernel_pred(Has_on_bounded_side_2, has_on_bounded_side_2_object) CGAL_Circular_Kernel_pred(Has_on_unbounded_side_2, has_on_unbounded_side_2_object) CGAL_Circular_Kernel_pred(Bounded_side_2, bounded_side_2_object) - CGAL_Circular_Kernel_pred(Orientation_2, orientation_2_object) CGAL_Circular_Kernel_pred(Collinear_2, collinear_2_object) CGAL_Circular_Kernel_cons(Construct_supporting_circle_2, diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h index 64ddf63f7d7..246b0a00e13 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h @@ -131,11 +131,14 @@ template < class SK > \ typedef typename SK::Circular_arc_3 Circular_arc_3; public: - typedef bool result_type; - + + typedef typename SK::Linear_kernel::Equal_3::result_type result_type; + #ifndef CGAL_CFG_MATCHING_BUG_6 using SK::Linear_kernel::Equal_3::operator(); #else + typedef bool result_type; + result_type operator() (const Point_3 &p0, const Point_3 &p1) const @@ -317,7 +320,7 @@ template < class SK > \ { public: - typedef typename SK::Sphere_3 result_type; + typedef typename SK::Linear_kernel::Construct_sphere_3::result_type result_type; using SK::Linear_kernel::Construct_sphere_3::operator(); @@ -331,7 +334,7 @@ template < class SK > \ { public: - typedef typename SK::Plane_3 result_type; + typedef typename SK::Linear_kernel::Construct_plane_3::result_type result_type; using SK::Linear_kernel::Construct_plane_3::operator(); @@ -345,7 +348,7 @@ template < class SK > \ { public: - typedef typename SK::Line_3 result_type; + typedef typename SK::Linear_kernel::Construct_line_3::result_type result_type; using SK::Linear_kernel::Construct_line_3::operator(); @@ -369,7 +372,7 @@ template < class SK > \ typedef typename SK::Kernel_base::Circle_3 RCircle_3; typedef typename Circle_3::Rep Rep; - typedef Circle_3 result_type; + typedef typename SK::Linear_kernel::Construct_circle_3::result_type result_type; using SK::Linear_kernel::Construct_circle_3::operator(); @@ -388,8 +391,7 @@ template < class SK > \ public: - typedef Plane_3 result_type; - typedef const Plane_3& qualified_result_type; + typedef typename SK::Linear_kernel::Construct_supporting_plane_3::result_type result_type; using SK::Linear_kernel::Construct_supporting_plane_3::operator(); @@ -421,8 +423,7 @@ template < class SK > \ public: - typedef Sphere_3 result_type; - typedef const Sphere_3& qualified_result_type; + typedef typename SK::Linear_kernel::Construct_diametral_sphere_3::result_type result_type; using SK::Linear_kernel::Construct_diametral_sphere_3::operator(); @@ -718,7 +719,7 @@ template < class SK > \ public: - typedef bool result_type; + typedef typename SK::Linear_kernel::Has_on_3::result_type result_type; using SK::Linear_kernel::Has_on_3::operator(); @@ -842,8 +843,8 @@ template < class SK > \ public: - typedef void result_type; - // Is there some solution for this problem?? + typedef typename SK::Linear_kernel::Intersect_3::result_type result_type; + typedef typename SK::Object_3 Object_3; using SK::Linear_kernel::Intersect_3::operator(); @@ -1118,7 +1119,7 @@ template < class SK > \ public: - typedef CGAL::Bbox_3 result_type; + typedef typename SK::Linear_kernel::Construct_bbox_3::result_type result_type; using SK::Linear_kernel::Construct_bbox_3::operator(); @@ -1236,7 +1237,6 @@ template < class SK > \ typedef typename SK::Point_3 Point_3; public: - //~ typedef typename SK::Linear_kernel::Bounded_side result_type; typedef typename SK::Linear_kernel::Bounded_side_3::result_type result_type; using SK::Linear_kernel::Bounded_side_3::operator(); @@ -1263,7 +1263,7 @@ template < class SK > \ typedef typename SK::Point_3 Point_3; public: - typedef bool result_type; + typedef typename SK::Linear_kernel::Has_on_bounded_side_3::result_type result_type; using SK::Linear_kernel::Has_on_bounded_side_3::operator(); @@ -1289,7 +1289,7 @@ template < class SK > \ typedef typename SK::Point_3 Point_3; public: - typedef bool result_type; + typedef typename SK::Linear_kernel::Has_on_unbounded_side_3::result_type result_type; using SK::Linear_kernel::Has_on_unbounded_side_3::operator();