mirror of https://github.com/CGAL/cgal
<, <=, >=, > operations for Circular_arc_point_2
This commit is contained in:
parent
24de52a1cf
commit
71b58f8eb3
|
|
@ -112,6 +112,44 @@ public:
|
||||||
{
|
{
|
||||||
return ! (p == q);
|
return ! (p == q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template < typename CircularKernel >
|
||||||
|
inline
|
||||||
|
bool
|
||||||
|
operator<(const Circular_arc_point_2<CircularKernel> &p,
|
||||||
|
const Circular_arc_point_2<CircularKernel> &q)
|
||||||
|
{
|
||||||
|
return CircularKernel().compare_xy_2_object()(p, q) == CGAL::SMALLER;
|
||||||
|
}
|
||||||
|
|
||||||
|
template < typename CircularKernel >
|
||||||
|
inline
|
||||||
|
bool
|
||||||
|
operator>(const Circular_arc_point_2<CircularKernel> &p,
|
||||||
|
const Circular_arc_point_2<CircularKernel> &q)
|
||||||
|
{
|
||||||
|
return CircularKernel().compare_xy_2_object()(p, q) == CGAL::LARGER;
|
||||||
|
}
|
||||||
|
|
||||||
|
template < typename CircularKernel >
|
||||||
|
inline
|
||||||
|
bool
|
||||||
|
operator<=(const Circular_arc_point_2<CircularKernel> &p,
|
||||||
|
const Circular_arc_point_2<CircularKernel> &q)
|
||||||
|
{
|
||||||
|
CGAL::Comparison_result c = CircularKernel().compare_xy_2_object()(p, q);
|
||||||
|
return (c == CGAL::SMALLER) || (c == CGAL::EQUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
template < typename CircularKernel >
|
||||||
|
inline
|
||||||
|
bool
|
||||||
|
operator>=(const Circular_arc_point_2<CircularKernel> &p,
|
||||||
|
const Circular_arc_point_2<CircularKernel> &q)
|
||||||
|
{
|
||||||
|
CGAL::Comparison_result c = CircularKernel().compare_xy_2_object()(p, q);
|
||||||
|
return (c == CGAL::LARGER) || (c == CGAL::EQUAL);
|
||||||
|
}
|
||||||
|
|
||||||
template < typename CK >
|
template < typename CK >
|
||||||
std::istream &
|
std::istream &
|
||||||
|
|
|
||||||
|
|
@ -395,4 +395,15 @@ void _test_circle_predicat(CK ck)
|
||||||
assert(typename CK::FT(bb.ymin()) <= arc_random.target().y());
|
assert(typename CK::FT(bb.ymin()) <= arc_random.target().y());
|
||||||
assert(typename CK::FT(bb.ymax()) >= arc_random.target().y());
|
assert(typename CK::FT(bb.ymax()) >= arc_random.target().y());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Testing Comparison Operators
|
||||||
|
Circular_arc_point_2 p[3];
|
||||||
|
p[0] = Point_2(1,0);
|
||||||
|
p[1] = Point_2(1,0);
|
||||||
|
p[2] = Point_2(0,1);
|
||||||
|
std::cout << "Testing lexico_operations(Circular_arc_point, Circular_arc_point)..." << std::endl;
|
||||||
|
assert(p[0] > p[2]);
|
||||||
|
assert(p[0] >= p[1]);
|
||||||
|
assert(p[0] <= p[1]);
|
||||||
|
assert(p[2] < p[0]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue