diff --git a/Old_Packages/Kernel_basic/include/CGAL/Kernel/function_objects.h b/Old_Packages/Kernel_basic/include/CGAL/Kernel/function_objects.h index df8542ddb98..976fa00949c 100644 --- a/Old_Packages/Kernel_basic/include/CGAL/Kernel/function_objects.h +++ b/Old_Packages/Kernel_basic/include/CGAL/Kernel/function_objects.h @@ -1334,6 +1334,93 @@ struct p_Less_dist_to_point { return has_smaller_dist_to_point(p0, p1, p2); } }; +template +struct p_Less_xy +{ + typedef bool result_type; + typedef Arity_tag< 2 > Arity; + + bool operator()( const Point& p1, const Point& p2) const + { return lexicographically_xy_smaller( p1, p2); } +}; + +template +struct p_Less_yx +{ + typedef bool result_type; + typedef Arity_tag< 2 > Arity; + + bool operator()( const Point& p1, const Point& p2) const + { return lexicographically_yx_smaller( p1, p2); } +}; + +template +class p_Less_dist_to_line_2 +{ +public: + typedef bool result_type; + typedef Arity_tag< 4 > Arity; + + bool operator()(const Point&a, const Point& b, + const Point& c, const Point& d) const + { + Comparison_result + res = compare_signed_distance_to_line( a, b, c, d); + if ( res == LARGER ) + { + return false; + } + else if ( res == SMALLER ) + { + return true; + } + else + { + return lexicographically_xy_smaller( c, d ); + } + } + +}; + +template +class p_Less_rotate_ccw +{ +public: + typedef bool result_type; + typedef Arity_tag< 3 > Arity; + + bool operator()(const Point& r, const Point& p, const Point& q) const + { + Orientation ori = orientation(r, p, q); + if ( ori == LEFTTURN ) + { + return true; + } + else if ( ori == RIGHTTURN ) + { + return false; + } + else + { + if (p == r) return false; + if (q == r) return true; + if (p == q) return false; + return collinear_are_ordered_along_line( r, q, p); + } + } +}; + +template +struct p_Left_turn +{ + typedef bool result_type; + typedef Arity_tag< 3 > Arity; + + bool operator()(const Point& p, const Point& q, const Point& r) const + { return left_turn(p,q,r); } +}; + + } // end namespace CGALi CGAL_END_NAMESPACE diff --git a/Old_Packages/Kernel_basic/include/CGAL/Kernel/interface_macros.h b/Old_Packages/Kernel_basic/include/CGAL/Kernel/interface_macros.h index 8eb9a7d398b..5559bbcf6f5 100644 --- a/Old_Packages/Kernel_basic/include/CGAL/Kernel/interface_macros.h +++ b/Old_Packages/Kernel_basic/include/CGAL/Kernel/interface_macros.h @@ -215,10 +215,10 @@ CGAL_Kernel_pred(CGALi::Less_x, CGAL_Kernel_pred(CGALi::Less_y, Less_y_2, less_y_2_object) -CGAL_Kernel_pred(CGAL::p_Less_xy, +CGAL_Kernel_pred(CGALi::p_Less_xy, Less_xy_2, less_xy_2_object) -CGAL_Kernel_pred(CGAL::p_Less_yx, +CGAL_Kernel_pred(CGALi::p_Less_yx, Less_yx_2, less_yx_2_object) CGAL_Kernel_pred(CGALi::Compare_x, @@ -245,10 +245,10 @@ CGAL_Kernel_pred(CGALi::Compare_slope, CGAL_Kernel_pred(CGALi::p_Less_dist_to_point, Less_distance_to_point_2, less_distance_to_point_2_object) -CGAL_Kernel_pred(CGAL ::p_Less_dist_to_line_2, +CGAL_Kernel_pred(CGALi::p_Less_dist_to_line_2, Less_signed_distance_to_line_2, less_signed_distance_to_line_2_object) -CGAL_Kernel_pred(CGAL ::p_Less_rotate_ccw, +CGAL_Kernel_pred(CGALi::p_Less_rotate_ccw, Less_rotate_ccw_2, less_rotate_ccw_2_object) CGAL_Kernel_pred(CGALi::Compare_angle_with_x_axis, @@ -257,11 +257,11 @@ CGAL_Kernel_pred(CGALi::Compare_angle_with_x_axis, CGAL_Kernel_pred(CGALi::Counterclockwise_in_between, Counterclockwise_in_between_2, counterclockwise_in_between_2_object) -CGAL_Kernel_pred(CGAL ::p_Left_turn, +CGAL_Kernel_pred(CGALi::p_Left_turn, Left_turn_2, left_turn_2_object) #ifndef CGAL_NO_DEPRECATED_CODE -CGAL_Kernel_pred(CGAL ::p_Left_turn, +CGAL_Kernel_pred(CGALi::p_Left_turn, Leftturn_2, leftturn_2_object) #endif // CGAL_NO_DEPRECATED_CODE diff --git a/Old_Packages/Kernel_basic/include/CGAL/predicate_objects_on_points_2.h b/Old_Packages/Kernel_basic/include/CGAL/predicate_objects_on_points_2.h deleted file mode 100644 index efe8a6fc9ae..00000000000 --- a/Old_Packages/Kernel_basic/include/CGAL/predicate_objects_on_points_2.h +++ /dev/null @@ -1,190 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 1999 The CGAL Consortium -// -// This software and related documentation is part of an INTERNAL release -// of the Computational Geometry Algorithms Library (CGAL). It is not -// intended for general use. -// -// ---------------------------------------------------------------------- -// release : -// release_date : -// -// file : include/CGAL/predicate_objects_on_points_2.h -// package : Kernel_basic -// revision : $Revision$ -// revision_date : $Date$ -// author(s) : Stefan Schirra -// -// coordinator : MPI, Saarbruecken -// ====================================================================== - -#ifndef CGAL_PREDICATE_OBJECTS_ON_POINTS_2_H -#define CGAL_PREDICATE_OBJECTS_ON_POINTS_2_H - -CGAL_BEGIN_NAMESPACE - -template -struct p_Less_xy -{ - typedef bool result_type; - typedef Arity_tag< 2 > Arity; - - bool operator()( const Point& p1, const Point& p2) const - { return lexicographically_xy_smaller( p1, p2); } -}; - -template -struct p_Less_yx -{ - typedef bool result_type; - typedef Arity_tag< 2 > Arity; - - bool operator()( const Point& p1, const Point& p2) const - { return lexicographically_yx_smaller( p1, p2); } -}; - -template -class p_Less_dist_to_line_2p -{ -public: - typedef bool result_type; - typedef Arity_tag< 2 > Arity; - - p_Less_dist_to_line_2p(const Point& a, const Point& b) - : p_a(a), p_b(b) - {} - - bool operator()(const Point& c, const Point& d) const - { - Comparison_result - res = compare_signed_distance_to_line( p_a, p_b, c, d); - if ( res == LARGER ) - { - return false; - } - else if ( res == SMALLER ) - { - return true; - } - else - { - return lexicographically_xy_smaller( c, d ); - } - } - -private: - Point p_a; - Point p_b; -}; - -template -class p_Less_dist_to_line_2 -{ -public: - typedef bool result_type; - typedef Arity_tag< 4 > Arity; - - bool operator()(const Point&a, const Point& b, - const Point& c, const Point& d) const - { - Comparison_result - res = compare_signed_distance_to_line( a, b, c, d); - if ( res == LARGER ) - { - return false; - } - else if ( res == SMALLER ) - { - return true; - } - else - { - return lexicographically_xy_smaller( c, d ); - } - } - -}; - -template -class p_Less_rotate_ccw -{ -public: - typedef bool result_type; - typedef Arity_tag< 3 > Arity; - - bool operator()(const Point& r, const Point& p, const Point& q) const - { - Orientation ori = orientation(r, p, q); - if ( ori == LEFTTURN ) - { - return true; - } - else if ( ori == RIGHTTURN ) - { - return false; - } - else - { - if (p == r) return false; - if (q == r) return true; - if (p == q) return false; - return collinear_are_ordered_along_line( r, q, p); - } - } -}; - -template -class r_Less_dist_to_line -{ -public: - typedef bool result_type; - typedef Arity_tag< 4 > Arity; - - typedef typename R::Point_2 Point; - typedef typename R::Line_2 Line; - - r_Less_dist_to_line() : line_constructed( false ) - { } - - bool operator()(const Point& a, const Point& b, - const Point& c, const Point& d) const - { - if (!line_constructed) - { - line_constructed = true; - l_ab = Line(a,b); - } - Comparison_result res = compare_signed_distance_to_line(l_ab, c, d); - if ( res == SMALLER ) - { - return true; - } - else if ( res == EQUAL ) - { - return lexicographically_xy_smaller( c, d ); - } - else - { - return false; - } - } - -private: - mutable bool line_constructed; - mutable Line l_ab; -}; - -template -struct p_Left_turn -{ - typedef bool result_type; - typedef Arity_tag< 3 > Arity; - - bool operator()(const Point& p, const Point& q, const Point& r) const - { return left_turn(p,q,r); } -}; - -CGAL_END_NAMESPACE - -#endif // CGAL_PREDICATE_OBJECTS_ON_POINTS_2_H diff --git a/Packages/Kernel_23/include/CGAL/Kernel/function_objects.h b/Packages/Kernel_23/include/CGAL/Kernel/function_objects.h index df8542ddb98..976fa00949c 100644 --- a/Packages/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Packages/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -1334,6 +1334,93 @@ struct p_Less_dist_to_point { return has_smaller_dist_to_point(p0, p1, p2); } }; +template +struct p_Less_xy +{ + typedef bool result_type; + typedef Arity_tag< 2 > Arity; + + bool operator()( const Point& p1, const Point& p2) const + { return lexicographically_xy_smaller( p1, p2); } +}; + +template +struct p_Less_yx +{ + typedef bool result_type; + typedef Arity_tag< 2 > Arity; + + bool operator()( const Point& p1, const Point& p2) const + { return lexicographically_yx_smaller( p1, p2); } +}; + +template +class p_Less_dist_to_line_2 +{ +public: + typedef bool result_type; + typedef Arity_tag< 4 > Arity; + + bool operator()(const Point&a, const Point& b, + const Point& c, const Point& d) const + { + Comparison_result + res = compare_signed_distance_to_line( a, b, c, d); + if ( res == LARGER ) + { + return false; + } + else if ( res == SMALLER ) + { + return true; + } + else + { + return lexicographically_xy_smaller( c, d ); + } + } + +}; + +template +class p_Less_rotate_ccw +{ +public: + typedef bool result_type; + typedef Arity_tag< 3 > Arity; + + bool operator()(const Point& r, const Point& p, const Point& q) const + { + Orientation ori = orientation(r, p, q); + if ( ori == LEFTTURN ) + { + return true; + } + else if ( ori == RIGHTTURN ) + { + return false; + } + else + { + if (p == r) return false; + if (q == r) return true; + if (p == q) return false; + return collinear_are_ordered_along_line( r, q, p); + } + } +}; + +template +struct p_Left_turn +{ + typedef bool result_type; + typedef Arity_tag< 3 > Arity; + + bool operator()(const Point& p, const Point& q, const Point& r) const + { return left_turn(p,q,r); } +}; + + } // end namespace CGALi CGAL_END_NAMESPACE diff --git a/Packages/Kernel_23/include/CGAL/Kernel/interface_macros.h b/Packages/Kernel_23/include/CGAL/Kernel/interface_macros.h index 8eb9a7d398b..5559bbcf6f5 100644 --- a/Packages/Kernel_23/include/CGAL/Kernel/interface_macros.h +++ b/Packages/Kernel_23/include/CGAL/Kernel/interface_macros.h @@ -215,10 +215,10 @@ CGAL_Kernel_pred(CGALi::Less_x, CGAL_Kernel_pred(CGALi::Less_y, Less_y_2, less_y_2_object) -CGAL_Kernel_pred(CGAL::p_Less_xy, +CGAL_Kernel_pred(CGALi::p_Less_xy, Less_xy_2, less_xy_2_object) -CGAL_Kernel_pred(CGAL::p_Less_yx, +CGAL_Kernel_pred(CGALi::p_Less_yx, Less_yx_2, less_yx_2_object) CGAL_Kernel_pred(CGALi::Compare_x, @@ -245,10 +245,10 @@ CGAL_Kernel_pred(CGALi::Compare_slope, CGAL_Kernel_pred(CGALi::p_Less_dist_to_point, Less_distance_to_point_2, less_distance_to_point_2_object) -CGAL_Kernel_pred(CGAL ::p_Less_dist_to_line_2, +CGAL_Kernel_pred(CGALi::p_Less_dist_to_line_2, Less_signed_distance_to_line_2, less_signed_distance_to_line_2_object) -CGAL_Kernel_pred(CGAL ::p_Less_rotate_ccw, +CGAL_Kernel_pred(CGALi::p_Less_rotate_ccw, Less_rotate_ccw_2, less_rotate_ccw_2_object) CGAL_Kernel_pred(CGALi::Compare_angle_with_x_axis, @@ -257,11 +257,11 @@ CGAL_Kernel_pred(CGALi::Compare_angle_with_x_axis, CGAL_Kernel_pred(CGALi::Counterclockwise_in_between, Counterclockwise_in_between_2, counterclockwise_in_between_2_object) -CGAL_Kernel_pred(CGAL ::p_Left_turn, +CGAL_Kernel_pred(CGALi::p_Left_turn, Left_turn_2, left_turn_2_object) #ifndef CGAL_NO_DEPRECATED_CODE -CGAL_Kernel_pred(CGAL ::p_Left_turn, +CGAL_Kernel_pred(CGALi::p_Left_turn, Leftturn_2, leftturn_2_object) #endif // CGAL_NO_DEPRECATED_CODE