diff --git a/Packages/Arrangement/demo/Arrangement_2/Conics_arr_from_file.C b/Packages/Arrangement/demo/Arrangement_2/Conics_arr_from_file.C index 4f36d3c6590..1ec45729bf2 100644 --- a/Packages/Arrangement/demo/Arrangement_2/Conics_arr_from_file.C +++ b/Packages/Arrangement/demo/Arrangement_2/Conics_arr_from_file.C @@ -43,7 +43,7 @@ typedef Traits::Point_2 Point_2; typedef Traits::Curve_2 Curve_2; typedef Traits::Circle_2 Circle_2; typedef Traits::Segment_2 Segment_2; -typedef Traits::X_monotone_curve_2 X_monotone_curve_2; +typedef Traits::X_monotone_curve_2 X_monotone_curve_2; typedef std::list CurveList; typedef CGAL::Pm_default_point_location Trap_point_location; diff --git a/Packages/Arrangement/demo/Arrangement_2/Segment_arr_from_file.C b/Packages/Arrangement/demo/Arrangement_2/Segment_arr_from_file.C index ac304111e80..f89b913990f 100644 --- a/Packages/Arrangement/demo/Arrangement_2/Segment_arr_from_file.C +++ b/Packages/Arrangement/demo/Arrangement_2/Segment_arr_from_file.C @@ -39,7 +39,7 @@ typedef CGAL::Pm_default_dcel Dcel; typedef CGAL::Planar_map_2 Pm; typedef CGAL::Planar_map_with_intersections_2 Pmwx; typedef Traits::Point_2 Point; -typedef Traits::X_monotone_curve_2 Curve; +typedef Traits::X_monotone_curve_2 Curve; typedef std::list CurveList; typedef CGAL::Pm_default_point_location Trap_point_location; @@ -150,7 +150,8 @@ public: /*! redraw */ -static void redraw(leda_window * wp, double x0, double y0, double x1, double y1) +static void redraw(leda_window * wp, double x0, double y0, + double x1, double y1) { wp->flush_buffer(x0, y0, x1, y1); } /*! diff --git a/Packages/Arrangement/examples/Arrangement_2/example3.C b/Packages/Arrangement/examples/Arrangement_2/example3.C index 67aa074c269..0282987b672 100644 --- a/Packages/Arrangement/examples/Arrangement_2/example3.C +++ b/Packages/Arrangement/examples/Arrangement_2/example3.C @@ -16,7 +16,7 @@ typedef double NT; typedef CGAL::Arr_circles_real_traits Traits; typedef Traits::Point_2 Point_2; -typedef Traits::X_monotone_curve_2 X_monotone_curve_2; +typedef Traits::X_monotone_curve_2 X_monotone_curve_2; typedef Traits::Curve_2 Curve_2; typedef CGAL::Arr_base_node Base_node; typedef CGAL::Arr_2_default_dcel Dcel; diff --git a/Packages/Arrangement/examples/Pm_with_intersections/example1.C b/Packages/Arrangement/examples/Pm_with_intersections/example1.C index 86078d66cbf..886d0ced8cf 100644 --- a/Packages/Arrangement/examples/Pm_with_intersections/example1.C +++ b/Packages/Arrangement/examples/Pm_with_intersections/example1.C @@ -9,14 +9,14 @@ #include #include -typedef CGAL::Quotient NT; -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits; -typedef Traits::Point_2 Point_2; -typedef Traits::X_monotone_curve_2 X_monotone_curve_2; -typedef CGAL::Pm_default_dcel Dcel; -typedef CGAL::Planar_map_2 Planar_map_2; -typedef CGAL::Planar_map_with_intersections_2 Pmwx; +typedef CGAL::Quotient NT; +typedef CGAL::Cartesian Kernel; +typedef CGAL::Arr_segment_traits_2 Traits; +typedef Traits::Point_2 Point_2; +typedef Traits::X_monotone_curve_2 X_monotone_curve_2; +typedef CGAL::Pm_default_dcel Dcel; +typedef CGAL::Planar_map_2 Planar_map_2; +typedef CGAL::Planar_map_with_intersections_2 Pmwx; int main() { diff --git a/Packages/Arrangement/examples/Pm_with_intersections/example2.C b/Packages/Arrangement/examples/Pm_with_intersections/example2.C index 0b56777d05a..b6cbe68e01b 100644 --- a/Packages/Arrangement/examples/Pm_with_intersections/example2.C +++ b/Packages/Arrangement/examples/Pm_with_intersections/example2.C @@ -11,14 +11,14 @@ #include #include -typedef CGAL::Quotient NT; -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits; -typedef Traits::Point_2 Point_2; -typedef Traits::X_monotone_curve_2 X_monotone_curve_2; -typedef CGAL::Pm_default_dcel Dcel; -typedef CGAL::Planar_map_2 Planar_map_2; -typedef CGAL::Planar_map_with_intersections_2 Pmwx; +typedef CGAL::Quotient NT; +typedef CGAL::Cartesian Kernel; +typedef CGAL::Arr_segment_traits_2 Traits; +typedef Traits::Point_2 Point_2; +typedef Traits::X_monotone_curve_2 X_monotone_curve_2; +typedef CGAL::Pm_default_dcel Dcel; +typedef CGAL::Planar_map_2 Planar_map_2; +typedef CGAL::Planar_map_with_intersections_2 Pmwx; typedef Pmwx::Pmwx_change_notification Pmwx_change_notification; class My_notification : public Pmwx_change_notification @@ -28,7 +28,8 @@ public: My_notification() {i = 0;} - void add_edge(const Traits::X_monotone_curve_2 &, Planar_map::Halfedge_handle, + void add_edge(const Traits::X_monotone_curve_2 &, + Planar_map::Halfedge_handle, bool /* left_to_right */, bool overlap = false) { (void) overlap; @@ -38,7 +39,8 @@ public: void split_edge(Planar_map::Halfedge_handle /* orig_edge */, Planar_map::Halfedge_handle /* new_edge */, - const Traits::X_monotone_curve_2 &, const Traits::X_monotone_curve_2 &) + const Traits::X_monotone_curve_2 &, + const Traits::X_monotone_curve_2 &) { std::cout << "split_edge" << std::endl; i++; diff --git a/Packages/Arrangement/examples/Pm_with_intersections/example3.C b/Packages/Arrangement/examples/Pm_with_intersections/example3.C index 41428fc50d2..e706bb75785 100644 --- a/Packages/Arrangement/examples/Pm_with_intersections/example3.C +++ b/Packages/Arrangement/examples/Pm_with_intersections/example3.C @@ -17,7 +17,7 @@ typedef CGAL::Quotient NT; typedef CGAL::Cartesian Kernel; typedef CGAL::Arr_segment_traits_2 Traits; typedef Traits::Point_2 Point; -typedef Traits::X_monotone_curve_2 Curve; +typedef Traits::X_monotone_curve_2 Curve; typedef CGAL::Pm_default_dcel Dcel; typedef CGAL::Planar_map_2 PM; typedef CGAL::Planar_map_with_intersections_2 Pmwx; diff --git a/Packages/Arrangement/include/CGAL/Arr_circles_real_traits.h b/Packages/Arrangement/include/CGAL/Arr_circles_real_traits.h index 02cb018737a..78fe1231c0d 100644 --- a/Packages/Arrangement/include/CGAL/Arr_circles_real_traits.h +++ b/Packages/Arrangement/include/CGAL/Arr_circles_real_traits.h @@ -375,7 +375,7 @@ public: } Comparison_result curve_compare_y_at_x (const X_monotone_curve_2 &cv, - const Point_2& p) const + const Point_2& p) const { CGAL_precondition(is_x_monotone(cv)); CGAL_precondition(point_in_x_range(cv, p)); @@ -388,7 +388,8 @@ public: return is_same(p, q); } - bool curve_equal(const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2) const { + bool curve_equal(const X_monotone_curve_2& cv1, + const X_monotone_curve_2& cv2) const { CGAL_precondition(is_x_monotone(cv1)); CGAL_precondition(is_x_monotone(cv2)); @@ -422,7 +423,8 @@ public: return cv.is_x_monotone(); } - void curve_make_x_monotone(const Curve_2 & cv, std::list& l) const + void curve_make_x_monotone(const Curve_2 & cv, + std::list& l) const { // Require: // CGAL_precondition( ! is_x_monotone(cv) ); @@ -584,8 +586,10 @@ public: - void curve_split(const X_monotone_curve_2& cv, X_monotone_curve_2& c1, X_monotone_curve_2& c2, - const Point_2& split_pt) const { + void curve_split(const X_monotone_curve_2& cv, + X_monotone_curve_2& c1, X_monotone_curve_2& c2, + const Point_2& split_pt) const + { CGAL_precondition(is_x_monotone(cv)); //split curve at split point (x coordinate) into c1 and c2 @@ -738,7 +742,8 @@ public: } - X_monotone_curve_2 curve_reflect_in_x_and_y (const X_monotone_curve_2& cv) const + X_monotone_curve_2 + curve_reflect_in_x_and_y (const X_monotone_curve_2& cv) const { Circle circ( point_reflect_in_x_and_y (cv.circle().center()), cv.circle().squared_radius(), @@ -753,7 +758,9 @@ public: //currently we assume that no two circles overlap (might change in future) - bool curves_overlap(const X_monotone_curve_2& c1, const X_monotone_curve_2& c2) const { + bool curves_overlap(const X_monotone_curve_2& c1, + const X_monotone_curve_2& c2) const + { CGAL_precondition(is_x_monotone(c1)); CGAL_precondition(is_x_monotone(c2)); @@ -805,8 +812,11 @@ private: } - //calculates the point on the X_monotone_curve_2 with the same x coordinate as p - Point_2 curve_calc_point(const X_monotone_curve_2& cv, const Point_2& p) const { + //calculates the point on the X_monotone_curve_2 with the same x coordinate + // as p + Point_2 curve_calc_point(const X_monotone_curve_2& cv, + const Point_2& p) const + { //simple cases if (compare_x(cv.s,p)==EQUAL) return cv.s; @@ -839,7 +849,8 @@ private: } - Vector derivative_vec(const X_monotone_curve_2& cv, const Point_2& p) const { + Vector derivative_vec(const X_monotone_curve_2& cv, const Point_2& p) const + { if (cv.c.orientation()==COUNTERCLOCKWISE) { //ccw - (-y,x) return Vector((cv.c.center().y()-p.y()), (p.x()-cv.c.center().x())); } diff --git a/Packages/Arrangement/include/CGAL/Arr_conic_traits_2.h b/Packages/Arrangement/include/CGAL/Arr_conic_traits_2.h index 354f9555cd3..5ca3b44dc29 100644 --- a/Packages/Arrangement/include/CGAL/Arr_conic_traits_2.h +++ b/Packages/Arrangement/include/CGAL/Arr_conic_traits_2.h @@ -104,7 +104,8 @@ class Arr_conic_traits_2 // Check whether the x co-ordinate of the given point is contained in the // x-range of the given x-monotone curve. - bool point_in_x_range(const X_monotone_curve_2& curve, const Point_2& p) const + bool point_in_x_range(const X_monotone_curve_2& curve, + const Point_2& p) const { CGAL_precondition(is_x_monotone(curve)); diff --git a/Packages/Arrangement/include/CGAL/Arr_leda_polyline_traits.h b/Packages/Arrangement/include/CGAL/Arr_leda_polyline_traits.h index 3239e3e2c4b..7ef1864b9cf 100644 --- a/Packages/Arrangement/include/CGAL/Arr_leda_polyline_traits.h +++ b/Packages/Arrangement/include/CGAL/Arr_leda_polyline_traits.h @@ -57,14 +57,15 @@ public: // Obsolete, for backward compatibility typedef Point_2 Point; typedef Vector_2 Vector; - typedef X_monotone_curve_2 X_curve; + typedef X_monotone_curve_2 X_curve; typedef Curve_2 Curve; typedef Segment_2 Segment; Arr_leda_polyline_traits() { } - Comparison_result compare_x(const Point_2& p0, const Point_2& p1) const { + Comparison_result compare_x(const Point_2& p0, const Point_2& p1) const + { return (Comparison_result)( #if (__LEDA__ >= 380) @@ -76,7 +77,8 @@ public: ); } - Comparison_result compare_xy(const Point_2& p0, const Point_2& p1) const { + Comparison_result compare_xy(const Point_2& p0, const Point_2& p1) const + { int res; #if (__LEDA__ >= 380) // full specification is required for msvc: @@ -94,20 +96,22 @@ public: } //on X_curve only - not Curve! - bool curve_is_vertical(const X_monotone_curve_2& cv) const { + bool curve_is_vertical(const X_monotone_curve_2& cv) const + { CGAL_assertion(is_x_monotone(cv)); return compare_x(curve_source(cv),curve_target(cv))==EQUAL; } - bool point_in_x_range(const X_monotone_curve_2& cv, const Point_2& p) const { + bool point_in_x_range(const X_monotone_curve_2& cv, const Point_2& p) const + { CGAL_assertion(is_x_monotone(cv)); return (compare_x(p,curve_source(cv)) * compare_x(p,curve_target(cv))) <=0 ; } Comparison_result curves_compare_y_at_x(const X_monotone_curve_2& cv1, - const X_monotone_curve_2& cv2, - const Point_2& p) const + const X_monotone_curve_2& cv2, + const Point_2& p) const { CGAL_assertion(is_x_monotone(cv1)); CGAL_assertion(is_x_monotone(cv2)); @@ -138,13 +142,14 @@ public: l2 = l2.reversal(); //leda function : - return (Comparison_result)CGAL_LEDA_SCOPE::cmp_segments_at_xcoord(l1,l2,p); + return + (Comparison_result)CGAL_LEDA_SCOPE::cmp_segments_at_xcoord(l1,l2,p); } - Comparison_result curves_compare_y_at_x_left(const X_monotone_curve_2& cv1, - const X_monotone_curve_2& cv2, - const Point_2& p) const + Comparison_result curves_compare_y_at_x_left(const X_monotone_curve_2& cv1, + const X_monotone_curve_2& cv2, + const Point_2& p) const { CGAL_assertion(is_x_monotone(cv1)); CGAL_assertion(is_x_monotone(cv2)); @@ -199,8 +204,8 @@ public: Comparison_result curves_compare_y_at_x_right(const X_monotone_curve_2& cv1, - const X_monotone_curve_2& cv2, - const Point_2& p) const + const X_monotone_curve_2& cv2, + const Point_2& p) const { CGAL_assertion(is_x_monotone(cv1)); CGAL_assertion(is_x_monotone(cv2)); @@ -274,10 +279,10 @@ public: //taken from Eyal's LedaTraits Orientation o; - if (compare_x(l.source(), l.target()) < 0) - o = (Orientation)CGAL_LEDA_SCOPE::orientation(l.source(), l.target(), p); - else - o = (Orientation)CGAL_LEDA_SCOPE::orientation(l.target(), l.source(), p); + + o = (compare_x(l.source(), l.target()) < 0) ? + (Orientation)CGAL_LEDA_SCOPE::orientation(l.source(), l.target(), p) : + (Orientation)CGAL_LEDA_SCOPE::orientation(l.target(), l.source(), p); if (o < 0) return LARGER; @@ -291,7 +296,9 @@ public: return is_same(p, q); } - bool curve_equal(const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2) const { + bool curve_equal(const X_monotone_curve_2& cv1, + const X_monotone_curve_2& cv2) const + { CGAL_assertion(is_x_monotone(cv1)); CGAL_assertion(is_x_monotone(cv2)); @@ -320,7 +327,8 @@ public: - X_monotone_curve_2 curve_opposite(const X_monotone_curve_2& cv) const { + X_monotone_curve_2 curve_opposite(const X_monotone_curve_2& cv) const + { X_monotone_curve_2 cv1(cv); std::reverse(cv1.begin(),cv1.end()); //more generic return cv1; @@ -394,7 +402,8 @@ public: } - void curve_split(const X_monotone_curve_2& cv, X_monotone_curve_2& c1, X_monotone_curve_2& c2, + void curve_split(const X_monotone_curve_2& cv, + X_monotone_curve_2& c1, X_monotone_curve_2& c2, const Point_2& split_pt) { //split curve at split point into c1 and c2 @@ -619,7 +628,8 @@ public: // if the x point is at the end of a segment, then there might be // an overlap in the continious of the polyline if ( found && CGAL_LEDA_SCOPE::compare( p1, p2 ) == 0 ){ - typename X_monotone_curve_2::const_iterator s1=i1s, t1=i1t, s2=i2s, t2=i2t; + typename X_monotone_curve_2::const_iterator s1=i1s, + t1=i1t, s2=i2s, t2=i2t; s1++; t1++; s2++; t2++; if( t1 != i1e && t2 != i2e){ @@ -656,7 +666,8 @@ public: return found; } - bool curves_overlap (const X_monotone_curve_2& ca, const X_monotone_curve_2& cb) const + bool curves_overlap (const X_monotone_curve_2& ca, + const X_monotone_curve_2& cb) const { CGAL_assertion(is_x_monotone(ca)); CGAL_assertion(is_x_monotone(cb)); @@ -730,7 +741,8 @@ public: } } - X_monotone_curve_2 curve_reflect_in_x_and_y( const X_monotone_curve_2& cv) const + X_monotone_curve_2 + curve_reflect_in_x_and_y(const X_monotone_curve_2 & cv) const { X_monotone_curve_2 reflected_cv; typename Curve_2::const_iterator it = cv.begin(); @@ -752,7 +764,8 @@ public: ///////////////////////////////////////////////////////////////// private: - Comparison_result _compare_y(const Point_2& p0, const Point_2& p1) const { + Comparison_result _compare_y(const Point_2& p0, const Point_2& p1) const + { return (Comparison_result)( #if (__LEDA__ >= 380) @@ -776,7 +789,8 @@ private: return Point_2(p.xcoord()+1, p.ycoord()); } - //returns true iff the intersection is lexicographically strictly right of pt + //returns true iff the intersection is lexicographically strictly right of + // pt bool _do_curves_intersect_to_right (const X_monotone_curve_2 & ca, const X_monotone_curve_2 & cb, const Point_2 & pt) const @@ -880,8 +894,8 @@ private: protected: - Point_2 point_normalize(const Point_2 &pt) const { - + Point_2 point_normalize(const Point_2 &pt) const + { leda_integer g, x, y, w; x = pt.X(); y = pt.Y(); @@ -903,4 +917,4 @@ protected: CGAL_END_NAMESPACE -#endif // CGAL_ARR_LEDA_POLYLINE_TRAITS_H +#endif diff --git a/Packages/Arrangement/include/CGAL/Arr_segment_cached_traits_2.h b/Packages/Arrangement/include/CGAL/Arr_segment_cached_traits_2.h index ec24bcbf404..5de67857bc6 100644 --- a/Packages/Arrangement/include/CGAL/Arr_segment_cached_traits_2.h +++ b/Packages/Arrangement/include/CGAL/Arr_segment_cached_traits_2.h @@ -325,9 +325,10 @@ public: * \return The relative position of cv1 with respect to cv2 to the right of * x(q): LARGER, SMALLER or EQUAL. */ - Comparison_result curves_compare_y_at_x_right(const X_monotone_curve_2 & cv1, - const X_monotone_curve_2 & cv2, - const Point_2 & q) const + Comparison_result + curves_compare_y_at_x_right(const X_monotone_curve_2 & cv1, + const X_monotone_curve_2 & cv2, + const Point_2 & q) const { // The two curves must not be vertical. CGAL_precondition(! cv1.is_vert); @@ -513,8 +514,8 @@ public: * Find the nearest intersection point (or points) of two given curves to * the right lexicographically of a given point not includin the point * itself, (with one exception explained below). - * If the intersection of the two curves is an X_monotone_curve_2, that is, they - * overlap at infinitely many points, then if the right endpoint and the + * If the intersection of the two curves is an X_monotone_curve_2, that is, + * they overlap at infinitely many points, then if the right endpoint and the * left endpoint of the overlapping subcurve are strickly to the right of * the given point, they are returned through the two other point * references respectively. If the given point is between the diff --git a/Packages/Arrangement/include/CGAL/Arr_segment_circle_traits.h b/Packages/Arrangement/include/CGAL/Arr_segment_circle_traits.h index ff99669a15a..0b372c10172 100644 --- a/Packages/Arrangement/include/CGAL/Arr_segment_circle_traits.h +++ b/Packages/Arrangement/include/CGAL/Arr_segment_circle_traits.h @@ -55,7 +55,7 @@ class Arr_segment_circle_traits // Obsolete, for backward compatibility typedef Point_2 Point; - typedef X_monotone_curve_2 X_curve; + typedef X_monotone_curve_2 X_curve; typedef Curve_2 Curve; typedef Segment_2 Segment; typedef Circle_2 Circle; @@ -92,7 +92,8 @@ class Arr_segment_circle_traits // Check whether the x co-ordinate of the given point is contained in the // x-range of the given x-monotone curve. - bool point_in_x_range (const X_monotone_curve_2& curve, const Point_2& p) const + bool point_in_x_range (const X_monotone_curve_2& curve, + const Point_2& p) const { CGAL_precondition(is_x_monotone(curve)); @@ -113,9 +114,9 @@ class Arr_segment_circle_traits // Decide wether curve1 is above, below or equal to curve2 at the // x co-ordinate of the given point. - Comparison_result curves_compare_y_at_x (const X_monotone_curve_2& curve1, - const X_monotone_curve_2& curve2, - const Point_2& p) const + Comparison_result curves_compare_y_at_x(const X_monotone_curve_2& curve1, + const X_monotone_curve_2& curve2, + const Point_2& p) const { CGAL_precondition(is_x_monotone(curve1)); CGAL_precondition(is_x_monotone(curve2)); @@ -215,9 +216,10 @@ class Arr_segment_circle_traits // Decide wether curve1 is above, below or equal to curve2 immediately to // the left of the x co-ordinate of the given point. - Comparison_result curves_compare_y_at_x_left (const X_monotone_curve_2& curve1, - const X_monotone_curve_2& curve2, - const Point_2& p) const + Comparison_result + curves_compare_y_at_x_left(const X_monotone_curve_2& curve1, + const X_monotone_curve_2& curve2, + const Point_2& p) const { CGAL_precondition(is_x_monotone(curve1)); CGAL_precondition(is_x_monotone(curve2)); @@ -419,9 +421,10 @@ class Arr_segment_circle_traits // Decide wether curve1 is above, below or equal to curve2 immediately to // the right of the x co-ordinate of the given point. - Comparison_result curves_compare_y_at_x_right (const X_monotone_curve_2& curve1, - const X_monotone_curve_2& curve2, - const Point_2& p) const + Comparison_result + curves_compare_y_at_x_right(const X_monotone_curve_2& curve1, + const X_monotone_curve_2& curve2, + const Point_2& p) const { CGAL_precondition(is_x_monotone(curve1)); CGAL_precondition(is_x_monotone(curve2)); @@ -622,8 +625,8 @@ class Arr_segment_circle_traits } // Check whether the given point is above, under or on the given curve. - Comparison_result curve_compare_y_at_x (const X_monotone_curve_2& curve, - const Point_2& p) const + Comparison_result curve_compare_y_at_x(const X_monotone_curve_2& curve, + const Point_2& p) const { CGAL_precondition(is_x_monotone(curve)); CGAL_precondition(point_in_x_range(curve, p)); @@ -654,13 +657,14 @@ class Arr_segment_circle_traits } // Check whether the two curves are identical. - bool curve_equal (const Point_2 & p, const Point_2 & q) const + bool curve_equal(const Point_2 & p, const Point_2 & q) const { return (p == q); } // Check whether the two curves are identical. - bool curve_equal (const X_monotone_curve_2& curve1, const X_monotone_curve_2& curve2) const + bool curve_equal(const X_monotone_curve_2& curve1, + const X_monotone_curve_2& curve2) const { CGAL_precondition(is_x_monotone(curve1)); CGAL_precondition(is_x_monotone(curve2)); @@ -701,7 +705,7 @@ class Arr_segment_circle_traits } // Reflect a curve in y. - X_monotone_curve_2 curve_reflect_in_y (const X_monotone_curve_2& curve) const + X_monotone_curve_2 curve_reflect_in_y(const X_monotone_curve_2& curve) const { Conic ref_conic (curve.conic().r(), curve.conic().s(), @@ -723,7 +727,8 @@ class Arr_segment_circle_traits } // Reflect a curve in x and y. - X_monotone_curve_2 curve_reflect_in_x_and_y (const X_monotone_curve_2& curve) const + X_monotone_curve_2 + curve_reflect_in_x_and_y(const X_monotone_curve_2& curve) const { Conic ref_conic (curve.conic().r(), curve.conic().s(), @@ -855,7 +860,8 @@ class Arr_segment_circle_traits // Split the given curve into two sub-curves at the given point. void curve_split (const X_monotone_curve_2& curve, - X_monotone_curve_2& sub_curve1, X_monotone_curve_2& sub_curve2, + X_monotone_curve_2& sub_curve1, + X_monotone_curve_2& sub_curve2, const Point_2& p) const { CGAL_precondition(is_x_monotone(curve)); @@ -1005,7 +1011,8 @@ class Arr_segment_circle_traits } // Check whether two curves overlap. - bool curves_overlap (const X_monotone_curve_2& curve1, const X_monotone_curve_2& curve2) const + bool curves_overlap(const X_monotone_curve_2& curve1, + const X_monotone_curve_2& curve2) const { CGAL_precondition(is_x_monotone(curve1)); CGAL_precondition(is_x_monotone(curve2)); @@ -1040,7 +1047,8 @@ private: // Split the given curve into two sub-curves at the given point. // Since this is a private function, there are no preconditions. void _curve_split (const X_monotone_curve_2& curve, - X_monotone_curve_2& sub_curve1, X_monotone_curve_2& sub_curve2, + X_monotone_curve_2& sub_curve1, + X_monotone_curve_2& sub_curve2, const Point_2 & p) const { // Split the curve to source->p and p->target. diff --git a/Packages/Arrangement/include/CGAL/Arr_segment_traits_2.h b/Packages/Arrangement/include/CGAL/Arr_segment_traits_2.h index 52645b3b2af..ee4beece078 100644 --- a/Packages/Arrangement/include/CGAL/Arr_segment_traits_2.h +++ b/Packages/Arrangement/include/CGAL/Arr_segment_traits_2.h @@ -75,9 +75,9 @@ public: */ bool is_x_monotone(const Curve_2 &) {return true;} - /*! curve_make_x_monotone() cuts the given curve into x-monotone subcurves and - * stores them in the given list. The order in which they are inserted into - * the list defines their order in the hierarchy tree. + /*! curve_make_x_monotone() cuts the given curve into x-monotone subcurves + * and stores them in the given list. The order in which they are inserted + * into the list defines their order in the hierarchy tree. * While segments are x_monotone, still need to cast their type. */ void curve_make_x_monotone(const Curve_2 & cv, diff --git a/Packages/Arrangement/include/CGAL/IO/Arr_polyline_traits_iostream.h b/Packages/Arrangement/include/CGAL/IO/Arr_polyline_traits_iostream.h index bca8e84c875..1379930666d 100644 --- a/Packages/Arrangement/include/CGAL/IO/Arr_polyline_traits_iostream.h +++ b/Packages/Arrangement/include/CGAL/IO/Arr_polyline_traits_iostream.h @@ -48,10 +48,13 @@ operator<<(std::ostream & os, template std::ostream & operator<<(std::ostream & os, - const typename Arr_polyline_traits::X_monotone_curve_2 & cv) + const typename + Arr_polyline_traits::X_monotone_curve_2 & cv) { - typedef typename Arr_polyline_traits::X_monotone_curve_2 X_monotone_curve_2; - typedef typename X_monotone_curve_2::const_iterator Points_iterator; + typedef typename Arr_polyline_traits::X_monotone_curve_2 + X_monotone_curve_2; + typedef typename X_monotone_curve_2::const_iterator + Points_iterator; os << cv.size() << std::endl; for (Points_iterator points_iter = cv.begin(); @@ -89,7 +92,8 @@ std::istream& operator>>(std::istream& in, typename Arr_polyline_traits::X_monotone_curve_2 & cv) { - typedef typename Arr_polyline_traits::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Arr_polyline_traits::X_monotone_curve_2 + X_monotone_curve_2; typedef typename X_monotone_curve_2::value_type Point_2; typedef typename X_monotone_curve_2::size_type size_type; diff --git a/Packages/Arrangement/include/CGAL/Pm_with_intersections.h b/Packages/Arrangement/include/CGAL/Pm_with_intersections.h index cb3ed0a4741..5cd48a2e461 100644 --- a/Packages/Arrangement/include/CGAL/Pm_with_intersections.h +++ b/Packages/Arrangement/include/CGAL/Pm_with_intersections.h @@ -53,7 +53,7 @@ public: typedef typename Planar_map::Halfedge_handle Halfedge_handle; typedef typename Planar_map::Vertex_handle Vertex_handle; typedef typename Planar_map::Face_handle Face_handle; - typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; typedef typename Traits::Curve_2 Curve_2; typedef typename Traits::Point_2 Point_2; typedef typename Planar_map::Change_notification Change_notification; @@ -62,7 +62,7 @@ public: // Obsolete, for backward compatability typedef Point_2 Point; - typedef X_monotone_curve_2 X_curve; + typedef X_monotone_curve_2 X_curve; typedef Curve_2 Curve; typedef Change_notification Pmwx_change_notification; @@ -138,14 +138,15 @@ public: // halfedge . The returned intersections is based on the intersection // of the supporting curves (if they exist). bool - directed_nearest_intersection_with_halfedge(const X_monotone_curve_2 & /* cv */, - const X_monotone_curve_2 & orig_cv, - Halfedge_handle he, - const Point_2 & ref_point, - bool direction_right, - Point_2 & xp1, - Point_2 & xp2, - Change_notification * en) + directed_nearest_intersection_with_halfedge + (const X_monotone_curve_2 & /* cv */, + const X_monotone_curve_2 & orig_cv, + Halfedge_handle he, + const Point_2 & ref_point, + bool direction_right, + Point_2 & xp1, + Point_2 & xp2, + Change_notification * en) { bool intersection_exists; @@ -222,7 +223,7 @@ public: CGAL_PM_START_OP(1); typename Planar_map::Halfedge_around_vertex_circulator next, prev, start, - last_next_checked; + last_next_checked; X_monotone_curve_2 xcv; Point_2 xp1, xp2; Point_2 start_point; @@ -847,7 +848,7 @@ public: Halfedge_handle - insert_intersecting_xcurve(const X_monotone_curve_2 &cv_, // inserted curve + insert_intersecting_xcurve(const X_monotone_curve_2 &cv_, // inserted curve Vertex_handle &source_vertex, // to be set by the function : Vertex_handle &target_vertex, @@ -1230,9 +1231,10 @@ public: //! iterates through a given range of curves, inserting the curves into the // map. template - Halfedge_iterator non_intersecting_insert(const X_monotone_curve_2_iterator & begin, - const X_monotone_curve_2_iterator & end, - Change_notification * en = NULL) + Halfedge_iterator + non_intersecting_insert(const X_monotone_curve_2_iterator & begin, + const X_monotone_curve_2_iterator & end, + Change_notification * en = NULL) { return Planar_map::insert(begin, end, en); } //! inserts a given curve as a new inner component of a given face. @@ -1244,48 +1246,54 @@ public: //! inserts a given curve that one of its endpoints is held by the target // vertex of a given halfedge into the map. - Halfedge_handle non_intersecting_insert_from_vertex(const X_monotone_curve_2 & cv, - Halfedge_handle h, - Change_notification * - en = NULL) + Halfedge_handle + non_intersecting_insert_from_vertex(const X_monotone_curve_2 & cv, + Halfedge_handle h, + Change_notification * + en = NULL) { return Planar_map::insert_from_vertex(cv, h, en); } //! inserts a given curve that both of its endpoints are held by the target // vertices of two given halfedges respectively into the map. - Halfedge_handle non_intersecting_insert_at_vertices(const X_monotone_curve_2 & cv, - Halfedge_handle h1, - Halfedge_handle h2, - Change_notification * - en = NULL) + Halfedge_handle + non_intersecting_insert_at_vertices(const X_monotone_curve_2 & cv, + Halfedge_handle h1, + Halfedge_handle h2, + Change_notification * + en = NULL) { return Planar_map::insert_at_vertices(cv, h1, h2, en); } //! inserts a given curve that one of its endpoints is held by a given vertex // into the map. - Halfedge_handle non_intersecting_insert_from_vertex(const X_monotone_curve_2 & cv, - Vertex_handle v1, - Change_notification * - en = NULL) + Halfedge_handle + non_intersecting_insert_from_vertex(const X_monotone_curve_2 & cv, + Vertex_handle v1, + Change_notification * + en = NULL) { return Planar_map::insert_from_vertex(cv, v1, en); } //! inserts a given curve that both of its endpoints are held by two given // vertices respectively into the map. - Halfedge_handle non_intersecting_insert_at_vertices(const X_monotone_curve_2 & cv, - Vertex_handle v1, - Vertex_handle v2, - Change_notification * - en = NULL) + Halfedge_handle + non_intersecting_insert_at_vertices(const X_monotone_curve_2 & cv, + Vertex_handle v1, + Vertex_handle v2, + Change_notification * + en = NULL) { return Planar_map::insert_at_vertices(cv, v1, v2, en); } // Data Members // ------------ protected: - bool in_x_range(const X_monotone_curve_2 & cv1, const X_monotone_curve_2 & cv2) + bool in_x_range(const X_monotone_curve_2 & cv1, + const X_monotone_curve_2 & cv2) { return (curve_in_x_range(cv1,cv2) || curve_in_x_range(cv2,cv1)); } - bool curve_in_x_range(const X_monotone_curve_2 & cv1, const X_monotone_curve_2 & cv2) + bool curve_in_x_range(const X_monotone_curve_2 & cv1, + const X_monotone_curve_2 & cv2) { return ((traits->point_in_x_range(cv1, traits->curve_source(cv2)) || @@ -1321,7 +1329,7 @@ private: }; -//----------------------------------------------------------------------------- +//! template Planar_map_with_intersections_2:: Planar_map_with_intersections_2(const Self & rhs) @@ -1331,7 +1339,7 @@ Planar_map_with_intersections_2(const Self & rhs) pmwx_traits = (Pmwx_traits_wrap*)traits; } -//----------------------------------------------------------------------------- +//! template Planar_map_with_intersections_2:: Planar_map_with_intersections_2(const Planar_map& pm) : @@ -1342,7 +1350,7 @@ Planar_map_with_intersections_2(const Planar_map& pm) : //use_delete_pmwx_traits = true; } -//----------------------------------------------------------------------------- +//! template Planar_map_with_intersections_2::~Planar_map_with_intersections_2() { @@ -1354,7 +1362,6 @@ Planar_map_with_intersections_2::~Planar_map_with_intersections_2() } } -//----------------------------------------------------------------------------- CGAL_END_NAMESPACE #endif diff --git a/Packages/Arrangement/include/CGAL/Sweep_line_2/Pmwx_aggregate_insert_impl.h b/Packages/Arrangement/include/CGAL/Sweep_line_2/Pmwx_aggregate_insert_impl.h index 8d119a87760..709c584b9d3 100644 --- a/Packages/Arrangement/include/CGAL/Sweep_line_2/Pmwx_aggregate_insert_impl.h +++ b/Packages/Arrangement/include/CGAL/Sweep_line_2/Pmwx_aggregate_insert_impl.h @@ -670,7 +670,7 @@ private: return res; } - Halfedge_handle insertToPmV(const X_monotone_curve_2 &a, SubCurve *origCurve, + Halfedge_handle insertToPmV(const X_monotone_curve_2 &a, SubCurve *origCurve, Event *topEvent, Event *bottomEvent, Halfedge_handle hhandle, PM &pm) { diff --git a/Packages/Arrangement/include/CGAL/Sweep_line_2/Pmwx_aggregate_insert_tight.h b/Packages/Arrangement/include/CGAL/Sweep_line_2/Pmwx_aggregate_insert_tight.h index 1b5529e9706..1ad3533e53a 100644 --- a/Packages/Arrangement/include/CGAL/Sweep_line_2/Pmwx_aggregate_insert_tight.h +++ b/Packages/Arrangement/include/CGAL/Sweep_line_2/Pmwx_aggregate_insert_tight.h @@ -631,7 +631,7 @@ private: * @param hhandle a prev halfedge handle (may be NULL) * @param pm a reference to the planar map */ - Halfedge_handle insertToPm(const X_monotone_curve_2 &cv, SubCurve *leftCurve, + Halfedge_handle insertToPm(const X_monotone_curve_2 &cv, SubCurve *leftCurve, Halfedge_handle hhandle, PM &pm) {