diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h index 0f25ed2873b..b1175708bd2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include @@ -402,9 +402,9 @@ public: {} }; - typedef Arr_spherical_inc_insertion_zone_visitor + typedef Arr_planar_inc_insertion_zone_visitor Zone_insertion_visitor; - + typedef Arr_naive_point_location Default_point_location_strategy; //@} diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h index 5e992784dfb..f5129d885c3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h @@ -51,12 +51,14 @@ void Arrangement_zone_2::init_with_hint { // The left endpoint is valid. has_left_pt = true; + left_on_boundary = (bx1 != NO_BOUNDARY || by1 != NO_BOUNDARY); left_pt = geom_traits->construct_min_vertex_2_object() (cv); } else { // The left end of the curve lies at infinity. has_left_pt = false; + left_on_boundary = true; } const Boundary_type bx2 = geom_traits->boundary_in_x_2_object()(cv, @@ -513,10 +515,10 @@ Arrangement_zone_2::_compute_next_intersection // Compare that current object with left_pt (if exists). ip = object_cast (&(inter_list.front())); - if (! has_left_pt) + if (left_on_boundary) { - // The left end is unbounded, so all intersections are valid, as - // they lie to its right. + // The left end lie on the left boundary, so all intersections are + // valid, as they lie to its right. valid_intersection = true; } else if (ip != NULL) @@ -585,20 +587,20 @@ Arrangement_zone_2::_compute_next_intersection if (ip != NULL) { // We have a simple intersection point - if we don't have to skip it, - // make sure it lies to the right of left_pt (if left_pt does not - // exist, all points lie to it right). + // make sure it lies to the right of left_pt (if left_pt is on the left + // boundary, all points lie to it right). if (is_first && skip_first_point) valid_intersection = false; - else if (! has_left_pt) + else if (left_on_boundary) valid_intersection = true; else valid_intersection = (geom_traits->compare_xy_2_object() (ip->first, left_pt) == LARGER); } - else if (! has_left_pt) + else if (left_on_boundary) { - // The left end is unbounded, so all overlapping curves are valid, as - // they lie to its right. + // The left end is on the boundary, so all overlapping curves are valid, + // as they lie to its right. valid_intersection = true; } else @@ -866,7 +868,7 @@ void Arrangement_zone_2:: // Check whether the two curves overlap in their x-range (in order // to avoid unnecessary intersection computations). if (! left_equals_curr_endpoint && - ((has_left_pt && _is_to_right (left_pt, he_curr)) || + ((! left_on_boundary && _is_to_right (left_pt, he_curr)) || ! is_in_x_range (cv, he_curr->curve()))) { // In case there is no overlap, the two x-monotone curves obviously @@ -1002,7 +1004,7 @@ void Arrangement_zone_2:: // Check whether the two curves overlap in their x-range (in order // to avoid unnecessary intersection computations). if (! left_equals_curr_endpoint && - ((has_left_pt && _is_to_right (left_pt, he_curr)) || + ((! left_on_boundary && _is_to_right (left_pt, he_curr)) || ! is_in_x_range (cv, he_curr->curve()))) { // In case there is no overlap, the two x-monotone curves obviously @@ -1172,6 +1174,7 @@ bool Arrangement_zone_2::_zone_in_face // Set cv to be the remaining portion. has_left_pt = true; + left_on_boundary = false; left_pt = intersect_p; cv = sub_cv2; } @@ -1485,6 +1488,7 @@ bool Arrangement_zone_2::_zone_in_overlap () // Set cv to be the remaining portion. has_left_pt = true; + left_on_boundary = false; left_pt = cv_right_pt; cv = sub_cv2; diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h index 4b7b89e1d67..7f6b02d4e18 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h @@ -105,6 +105,7 @@ protected: CGAL::Object obj; // The location of the left endpoint. bool has_left_pt; // Is the left end of the curve // bounded. + bool left_on_boundary;// Is the left point on the boundary. Point_2 left_pt; // Its current left endpoint. bool has_right_pt; // Is the right end of the curve // bounded. @@ -187,6 +188,7 @@ public: { // The curve has a finite left endpoint - locate it in the arrangement. has_left_pt = true; + left_on_boundary = (bx1 != NO_BOUNDARY || by1 != NO_BOUNDARY); left_pt = geom_traits->construct_min_vertex_2_object() (cv); obj = pl.locate (left_pt); @@ -196,6 +198,7 @@ public: // The left end of the curve is unbounded - use the topology traits use // the arrangement accessor to locate it. has_left_pt = false; + left_on_boundary = true; obj = arr_access.locate_unbounded_curve_end (cv, MIN_END, bx1, by1); } @@ -267,8 +270,8 @@ private: */ Halfedge_handle _direct_intersecting_edge_to_right (const X_monotone_curve_2& cv_ins, - const Point_2& cv_left_pt, - Halfedge_handle query_he); + const Point_2& cv_left_pt, + Halfedge_handle query_he); /*! * Direct the halfedge for the location of the given subcurve around a split @@ -284,7 +287,7 @@ private: */ Halfedge_handle _direct_intersecting_edge_to_left (const X_monotone_curve_2& cv_ins, - Halfedge_handle query_he); + Halfedge_handle query_he); /*! * Get the next intersection of cv with the given halfedge.