Use cmp_signed_dist_to_directionC2 for Compare_signed_distance_to_line_2

This commit is contained in:
Mael Rouxel-Labbé 2022-06-30 16:23:09 +02:00
parent 2b245d870e
commit 93c47ec702
1 changed files with 5 additions and 6 deletions

View File

@ -631,7 +631,6 @@ namespace CartesianKernelFunctors {
typedef typename K::Point_2 Point_2; typedef typename K::Point_2 Point_2;
typedef typename K::Line_2 Line_2; typedef typename K::Line_2 Line_2;
typedef typename K::Equal_2 Equal_2; typedef typename K::Equal_2 Equal_2;
typedef typename K::Less_signed_distance_to_line_2 Less_signed_distance_to_line_2;
public: public:
typedef typename K::Comparison_result result_type; typedef typename K::Comparison_result result_type;
@ -642,6 +641,7 @@ namespace CartesianKernelFunctors {
{ {
CGAL_kernel_precondition_code(Equal_2 equal;) CGAL_kernel_precondition_code(Equal_2 equal;)
CGAL_kernel_precondition(! equal(a,b)); CGAL_kernel_precondition(! equal(a,b));
return cmp_signed_dist_to_lineC2( a.x(), a.y(), return cmp_signed_dist_to_lineC2( a.x(), a.y(),
b.x(), b.y(), b.x(), b.y(),
c.x(), c.y(), c.x(), c.y(),
@ -651,10 +651,9 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()(const Line_2& l, const Point_2& p, const Point_2& q) const operator()(const Line_2& l, const Point_2& p, const Point_2& q) const
{ {
Less_signed_distance_to_line_2 less = K().less_signed_distance_to_line_2_object(); return cmp_signed_dist_to_directionC2(l.a(), l.b(),
if (less(l, p, q)) return SMALLER; p.x(), p.y(),
if (less(l, q, p)) return LARGER; q.x(), q.y());
return EQUAL;
} }
}; };