50 #ifndef CGAL_SEGMENT_2_SEGMENT_2_INTERSECTION_H
51 #define CGAL_SEGMENT_2_SEGMENT_2_INTERSECTION_H
69 #ifndef CGAL_CFG_RETURN_TYPE_BUG_2
85 switch ( linepair.intersection_type()) {
96 typedef typename R::RT RT;
105 if (start1.x() < end1.
x()) {
112 if (start2.
x() < end2.
x()) {
113 if (start2.
x() > minpt->
x()) {
116 if (end2.
x() < maxpt->
x()) {
120 if (end2.
x() > minpt->
x()) {
123 if (start2.
x() < maxpt->
x()) {
127 if (maxpt->
x() < minpt->
x()) {
131 if (maxpt->
x() == minpt->
x()) {
141 if (start1.y() < end1.
y()) {
148 if (start2.
y() < end2.
y()) {
149 if (start2.
y() > minpt->
y()) {
152 if (end2.
y() < maxpt->
y()) {
156 if (end2.
y() > minpt->
y()) {
159 if (start2.
y() < maxpt->
y()) {
163 if (maxpt->
y() < minpt->
y()) {
167 if (maxpt->
y() == minpt->
y()) {
182 #endif // CGAL_CFG_RETURN_TYPE_BUG_2
208 PT
const &
p1, PT
const &p2, PT
const &p3, PT
const &p4)
225 PT
const &
p1, PT
const &p2, PT
const &p3, PT
const &p4)
453 #ifndef CGAL_CFG_RETURN_TYPE_BUG_2
462 if (!
do_overlap(_seg1->bbox(), _seg2->bbox())) {
466 Line_2<R> const &l1 = _seg1->supporting_line();
467 Line_2<R> const &l2 = _seg2->supporting_line();
475 _result = (_seg1->collinear_has_on(_intersection_point)
476 && _seg2->collinear_has_on(_intersection_point)) ? POINT : NO;
480 typedef typename R::RT RT;
489 if (start1.x() < end1.
x()) {
496 if (start2.
x() < end2.
x()) {
497 if (start2.
x() > minpt->
x()) {
500 if (end2.
x() < maxpt->
x()) {
504 if (end2.
x() > minpt->
x()) {
507 if (start2.
x() < maxpt->
x()) {
511 if (maxpt->
x() < minpt->
x()) {
515 if (maxpt->
x() == minpt->
x()) {
516 _intersection_point = *minpt;
520 _intersection_point = *minpt;
521 _other_point = *maxpt;
525 if (start1.y() < end1.
y()) {
532 if (start2.
y() < end2.
y()) {
533 if (start2.
y() > minpt->
y()) {
536 if (end2.
y() < maxpt->
y()) {
540 if (end2.
y() > minpt->
y()) {
543 if (start2.
y() < maxpt->
y()) {
547 if (maxpt->
y() < minpt->
y()) {
551 if (maxpt->
y() == minpt->
y()) {
552 _intersection_point = *minpt;
556 _intersection_point = *minpt;
557 _other_point = *maxpt;
566 #endif // CGAL_CFG_RETURN_TYPE_BUG_2
574 if (_result != POINT)
576 result = _intersection_point;
586 if (_result != SEGMENT)
588 result =
Segment_2<R>(_intersection_point, _other_point);
605 is_t ispair(&seg1, &seg2);
606 switch (ispair.intersection_type()) {
612 ispair.intersection(pt);
615 case is_t::SEGMENT: {
617 ispair.intersection(iseg);
bool collinear_has_on(const CGAL::Point_2< R > &p) const
CGAL::Line_2< R > supporting_line() const
bool intersection(Point_2< R > &result) const
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE Object intersection(const Line_2< R > &line1, const Line_2< R > &line2)
const Orientation LEFTTURN
bool lexicographically_xy_smaller(const Point_2< R > &p, const Point_2< R > &q)
bool do_intersect(const Line_2< R > &p1, const Line_2< R > &p2)
~Segment_2_Segment_2_pair()
bool seg_seg_do_intersect_contained(PT const &p1, PT const &p2, PT const &p3, PT const &p4)
CGAL::Point_2< R > target() const
bool intersection(Point_2< R > &result) const
bool do_intersect(const Segment_2< R > &seg1, const Segment_2< R > &seg2)
bool seg_seg_do_intersect_crossing(PT const &p1, PT const &p2, PT const &p3, PT const &p4)
bool rightturn(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
Intersection_results _result
CGAL::Point_2< R > source() const
bool lexicographically_yx_smaller(const Point_2< R > &p, const Point_2< R > &q)
Orientation orientation(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
Segment_2< R > const * _seg1
Point_2< R > _intersection_point
Segment_2< R > const * _seg2
Segment_2_Segment_2_pair()
CGAL::Point_2< R > end() const
Point_2< R > _other_point
Intersection_results intersection_type() const
bool do_overlap(const Bbox_2 &bb1, const Bbox_2 &bb2)
Comparison_result compare_lexicographically_xy(const Point_2< R > &p, const Point_2< R > &q)
#define CGAL_BEGIN_NAMESPACE
bool leftturn(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
const Orientation RIGHTTURN
const Orientation COLLINEAR
#define CGAL_END_NAMESPACE
CGAL::Point_2< R > start() const
Intersection_results intersection_type() const
SURF::Vector_2< Real > Point_2