Add operator for line/point/point

This commit is contained in:
Andreas Fabri
2020-02-25 16:47:12 +00:00
parent a4acfb0c56
commit 99eea7ac21
4 changed files with 29 additions and 4 deletions
@@ -541,8 +541,10 @@ namespace CartesianKernelFunctors {
typedef typename K::Point_2 Point_2;
typedef typename K::Line_2 Line_2;
typedef typename K::Equal_2 Equal_2;
typedef typename K::Less_signed_distance_to_line_2 Less_signed_distance_to_line_2;
public:
typedef Comparison_result result_type;
typedef typename K::Comparison_result result_type;
result_type
operator()(const Point_2& a, const Point_2& b,
@@ -555,6 +557,15 @@ namespace CartesianKernelFunctors {
c.x(), c.y(),
d.x(), d.y());
}
result_type
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();
if (less(l, p, q)) return SMALLER;
if (less(l, q, p)) return LARGER;
return EQUAL;
}
};
template <typename K>