diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/Arr_segment_data_traits_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/Arr_segment_data_traits_2.h index 46bcdf819db..41dea9ccf12 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/Arr_segment_data_traits_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/Arr_segment_data_traits_2.h @@ -6,18 +6,18 @@ namespace CGAL { typedef std::pair state; struct Segment_data_label { - Segment_data_label(state min_id, state max_id, CGAL::Comparison_result orientation, int origin): + Segment_data_label(state min_id, state max_id, Comparison_result orientation, int origin): _min_id(min_id), _max_id(max_id), _orientation(orientation), _origin(origin) {} Segment_data_label() { _min_id = state(-1, -1); _max_id = state(-1, -1); - _orientation = CGAL::SMALLER; + _orientation = SMALLER; _origin = -1; } int _origin; - CGAL::Comparison_result _orientation; + Comparison_result _orientation; state _min_id, _max_id; }; @@ -166,7 +166,7 @@ public: // Split the base curve into two. m_traits->split_2_object()(cv, p, c1, c2); - if (cv.data()._orientation == CGAL::SMALLER) { + if (cv.data()._orientation == SMALLER) { c1.data()._min_id = cv.data()._min_id; c2.data()._max_id = cv.data()._max_id; } else { @@ -239,7 +239,7 @@ public: // code ONLY FOR SEGMENTS !!!!!!!! - std::list base_objs; + std::list base_objs; m_traits->intersect_2_object()(xcv1, xcv2, std::back_inserter(base_objs)); @@ -248,7 +248,7 @@ public: } // Attach labels to the intersection objects. - std::list::iterator obj_it; + std::list::iterator obj_it; const std::pair *base_pt; const Base_x_monotone_curve_2 *base_xcv; @@ -258,7 +258,7 @@ public: if (base_pt != NULL) { // Attach an invalid label to an itersection point. - *oi = CGAL::make_object + *oi = make_object (std::make_pair(Point_2(base_pt->first), base_pt->second)); ++oi; } else { @@ -266,7 +266,7 @@ public: CGAL_assertion(base_xcv != NULL); // Attach a merged label to the overlapping curve. - *oi = CGAL::make_object(X_monotone_curve_2(*base_xcv, Segment_data_label(no_state, no_state, xcv1.data()._orientation, -1))); + *oi = make_object(X_monotone_curve_2(*base_xcv, Segment_data_label(no_state, no_state, xcv1.data()._orientation, -1))); ++oi; } } @@ -340,7 +340,7 @@ public: Point_2 operator()(const X_monotone_curve_2 &xcv) { Point_2 min_p = m_base_min_v(xcv); - if (xcv.label()._orientation == CGAL::SMALLER) { + if (xcv.label()._orientation == SMALLER) { min_p.id = xcv.data()._min_id; } else { min_p.id = xcv.data()._max_id; @@ -382,7 +382,7 @@ public: Point_2 operator()(const X_monotone_curve_2 &xcv) const { Point_2 max_p = m_base_max_v(xcv); - if (xcv.label()._orientation == CGAL::SMALLER) { + if (xcv.label()._orientation == SMALLER) { max_p.id = xcv.data()._max_id; } else { max_p.id = xcv.data()._min_id; diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/Minkowski_sum_by_reduced_convolution_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/Minkowski_sum_by_reduced_convolution_2.h index a8903e2ffb4..ba21588be8a 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/Minkowski_sum_by_reduced_convolution_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/Minkowski_sum_by_reduced_convolution_2.h @@ -39,7 +39,7 @@ private: typedef Arr_default_dcel Dcel; - typedef CGAL::Arrangement_with_history_2 Arrangement_history_2; + typedef Arrangement_with_history_2 Arrangement_history_2; typedef typename Arrangement_history_2::Halfedge Halfedge; typedef typename Arrangement_history_2::Vertex_iterator Vertex_iterator; typedef typename Arrangement_history_2::Edge_iterator Edge_iterator; @@ -91,13 +91,13 @@ public: OutputIterator operator()(const Polygon_2 &pgn1, const Polygon_2 &pgn2, Polygon_2 &sum_bound, OutputIterator sum_holes) { - CGAL::Timer timer; + Timer timer; timer.start(); CGAL_precondition(pgn1.is_simple()); CGAL_precondition(pgn2.is_simple()); - CGAL_precondition(pgn1.orientation() == CGAL::COUNTERCLOCKWISE); - CGAL_precondition(pgn2.orientation() == CGAL::COUNTERCLOCKWISE); + CGAL_precondition(pgn1.orientation() == COUNTERCLOCKWISE); + CGAL_precondition(pgn2.orientation() == COUNTERCLOCKWISE); timer.stop(); std::cout << timer.time() << " s: Preconditions" << std::endl; @@ -123,7 +123,7 @@ public: // split the segments at their intersection points Arrangement_history_2 arr; - CGAL::insert(arr, reduced_conv.begin(), reduced_conv.end()); + insert(arr, reduced_conv.begin(), reduced_conv.end()); timer.stop(); std::cout << timer.time() << " s: Arrangement" << std::endl; @@ -208,7 +208,7 @@ private: Point_2 start_point = get_point(i1, i2, points_map, pgn1, pgn2); Point_2 end_point = get_point(i1, next_i2, points_map, pgn1, pgn2); - CGAL::Comparison_result cres = f_compare_xy(start_point, end_point); + Comparison_result cres = f_compare_xy(start_point, end_point); Segment_2 conv_seg = Segment_2(typename Traits_2_A::Segment_2(start_point, end_point), Segment_data_label(state(i1, i2), state(i1, next_i2), cres, 1)); reduced_conv.push_back(conv_seg); @@ -223,7 +223,7 @@ private: Point_2 start_point = get_point(i1, i2, points_map, pgn1, pgn2); Point_2 end_point = get_point(next_i1, i2, points_map, pgn1, pgn2); - CGAL::Comparison_result cres = f_compare_xy(start_point, end_point); + Comparison_result cres = f_compare_xy(start_point, end_point); Segment_2 conv_seg = Segment_2(typename Traits_2_A::Segment_2(start_point, end_point), Segment_data_label(state(i1, i2), state(next_i1, i2), cres, 0)); reduced_conv.push_back(conv_seg); } @@ -313,7 +313,7 @@ private: Originating_curve_iterator segment_itr; for (segment_itr = arr.originating_curves_begin(he); segment_itr != arr.originating_curves_end(he); ++segment_itr) { - if (segment_itr->label()._orientation == (CGAL::Comparison_result)he->direction()) { + if (segment_itr->label()._orientation == (Comparison_result)he->direction()) { return false; } } @@ -341,7 +341,7 @@ private: while (++next_edge != current_edge) { Point_2 q = next_edge->target()->point(); if (ear.has_on_bounded_side(q)) { - typename Kernel::FT distance = CGAL::squared_distance(q, v); + typename Kernel::FT distance = squared_distance(q, v); if (min_distance == -1 || distance < min_distance) { min_distance = distance; min_q = q; @@ -350,9 +350,9 @@ private: } if (min_distance != -1) { - return CGAL::midpoint(v, min_q); + return midpoint(v, min_q); } else { - return CGAL::centroid(ear); + return centroid(ear); } } }; diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_collision_detector_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_collision_detector_2.h index 8c472c92807..ec5eb5da004 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_collision_detector_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_collision_detector_2.h @@ -30,7 +30,7 @@ public: return true; } - Polygon_2 translated_p = transform(typename Kernel_::Aff_transformation_2(CGAL::Translation(), Vector_2(CGAL::ORIGIN, t)), m_p); + Polygon_2 translated_p = transform(typename Kernel_::Aff_transformation_2(Translation(), Vector_2(ORIGIN, t)), m_p); return (translated_p.has_on_bounded_side(*(m_q.vertices_begin())) || m_q.has_on_bounded_side(*(translated_p.vertices_begin()))); } diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_traits_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_traits_2.h index 59a4980afbe..08494b78944 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_traits_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_traits_2.h @@ -7,7 +7,7 @@ template class Point_2; template class Segment_2; double eps(double x) { - return CGAL::abs(CGAL::nextafter(x, DBL_MAX) - x); + return abs(nextafter(x, DBL_MAX) - x); } template @@ -15,7 +15,6 @@ class AABB_traits_2 { public: typedef AABB_traits_2 AT; typedef typename CGAL::Bbox_2 Bounding_box; - typedef typename CGAL::Object Object; typedef AABB_primitive_ Primitive; typedef typename Primitive::Id Id; @@ -44,10 +43,10 @@ public: Construct_cartesian_const_iterator_3; AABB_traits_2(const Point &point, const Container &p, const Container &q): m_t_point(point), m_p(p), m_q(q) { - m_x_interval = Interval_nt(CGAL::to_interval(point.x())); - m_y_interval = Interval_nt(CGAL::to_interval(point.y())); - m_px = CGAL::to_double(point.x()); - m_py = CGAL::to_double(point.y()); + m_x_interval = Interval_nt(to_interval(point.x())); + m_y_interval = Interval_nt(to_interval(point.y())); + m_px = to_double(point.x()); + m_py = to_double(point.y()); }; AABB_traits_2(): m_p(Container()), m_q(Container()) { @@ -156,9 +155,9 @@ public: /* Code for faster bbox, needs to be tested // Get x max error. - double x_epsilon = CGAL::max(CGAL::max(eps(m_traits->m_px),eps(bbox.xmin())),eps(bbox.xmax()))*2; + double x_epsilon = max(max(eps(m_traits->m_px),eps(bbox.xmin())),eps(bbox.xmax()))*2; // Get y max error. - double y_epsilon = CGAL::max(CGAL::max(eps(m_traits->m_py),eps(bbox.ymin())),eps(bbox.ymax()))*2; + double y_epsilon = max(max(eps(m_traits->m_py),eps(bbox.ymin())),eps(bbox.ymax()))*2; double t_left = (m_traits->m_px + bbox.xmin())-x_epsilon; double t_right = (m_traits->m_px + bbox.xmax())+x_epsilon; double t_bottom = (m_traits->m_py + bbox.ymin())-y_epsilon; @@ -172,15 +171,15 @@ public: double t_top = (m_traits->get_int_y() + bbox.ymax()).sup(); Bounding_box t_box(t_left, t_bottom, t_right, t_top); - return CGAL::do_overlap(q, t_box); + return do_overlap(q, t_box); } bool operator()(const Primitive &q, const Bounding_box &bbox) const { /* Code for faster bbox, needs to be tested // Get x max error. - double x_epsilon = CGAL::max(CGAL::max(eps(m_traits->m_px),eps(bbox.xmin())),eps(bbox.xmax()))*2; + double x_epsilon = max(max(eps(m_traits->m_px),eps(bbox.xmin())),eps(bbox.xmax()))*2; // Get y max error. - double y_epsilon = CGAL::max(CGAL::max(eps(m_traits->m_py),eps(bbox.ymin())),eps(bbox.ymax()))*2; + double y_epsilon = max(max(eps(m_traits->m_py),eps(bbox.ymin())),eps(bbox.ymax()))*2; double t_left = (m_traits->m_px + bbox.xmin())-x_epsilon; double t_right = (m_traits->m_px + bbox.xmax())+x_epsilon; double t_bottom = (m_traits->m_py + bbox.ymin())-y_epsilon; @@ -194,26 +193,26 @@ public: double t_top = (m_traits->get_int_y() + bbox.ymax()).sup(); Bounding_box t_box(t_left, t_bottom, t_right, t_top); - return CGAL::do_overlap(q.datum().bbox(), t_box); + return do_overlap(q.datum().bbox(), t_box); } bool operator()(const Bounding_box &q, const Primitive &pr) const { - typename Primitive::Datum tr_pr = pr.datum().transform(typename GeomTraits::Aff_transformation_2(CGAL::Translation(), Vector_2(CGAL::ORIGIN, m_traits->get_translation_point()))); - return CGAL::do_overlap(q, tr_pr.bbox()); + typename Primitive::Datum tr_pr = pr.datum().transform(typename GeomTraits::Aff_transformation_2(Translation(), Vector_2(ORIGIN, m_traits->get_translation_point()))); + return do_overlap(q, tr_pr.bbox()); } bool operator()(const Primitive &q, const Primitive &pr) const { - typename Primitive::Datum tr_pr = pr.datum().transform(typename GeomTraits::Aff_transformation_2(CGAL::Translation(), Vector_2(CGAL::ORIGIN, m_traits->get_translation_point()))); + typename Primitive::Datum tr_pr = pr.datum().transform(typename GeomTraits::Aff_transformation_2(Translation(), Vector_2(ORIGIN, m_traits->get_translation_point()))); - if (!CGAL::do_overlap(q.datum().bbox(), tr_pr.bbox())) { + if (!do_overlap(q.datum().bbox(), tr_pr.bbox())) { return false; } - CGAL::Object intersection_object = GeomTraits().intersect_2_object()(q.datum(), tr_pr); + Object intersection_object = GeomTraits().intersect_2_object()(q.datum(), tr_pr); - if (const CGAL::Point_2 *ipoint = CGAL::object_cast >(&intersection_object)) { + if (const CGAL::Point_2 *ipoint = object_cast >(&intersection_object)) { // handle weak intersections bool has_weak_intersection = false; bool p_intersect = false; @@ -259,9 +258,9 @@ public: } } - if (const CGAL::Segment_2 *iseg = CGAL::object_cast >(&intersection_object)) { // we have overlapping segments - CGAL::Comparison_result c1 = CGAL::compare_xy(tr_pr.source(), tr_pr.target()); - CGAL::Comparison_result c2 = CGAL::compare_xy(q.datum().source(), q.datum().target()); + if (const CGAL::Segment_2 *iseg = object_cast >(&intersection_object)) { // we have overlapping segments + Comparison_result c1 = compare_xy(tr_pr.source(), tr_pr.target()); + Comparison_result c2 = compare_xy(q.datum().source(), q.datum().target()); bool same_dir = (c1 == c2); return same_dir; @@ -277,7 +276,7 @@ public: Id itr_q = q.id(); Id p_other = get_other_segment(p_intersect_start, itr_p, m_traits->get_p()); Id q_other = get_other_segment(q_intersect_start, itr_q, m_traits->get_q()); - Datum p_other_translated = (*p_other).transform(typename GeomTraits::Aff_transformation_2(CGAL::Translation(), Vector_2(CGAL::ORIGIN, m_traits->get_translation_point()))); + Datum p_other_translated = (*p_other).transform(typename GeomTraits::Aff_transformation_2(Translation(), Vector_2(ORIGIN, m_traits->get_translation_point()))); if (p_intersect && !q_intersect) { if (p_intersect_start) { @@ -378,7 +377,7 @@ public: operator()(const Query &query, const typename AT::Primitive &primitive) const { typedef boost::optional Intersection; - CGAL::Object object = GeomTraits().intersect_2_object()(primitive.datum(), query); + Object object = GeomTraits().intersect_2_object()(primitive.datum(), query); if (object.empty()) { return Intersection(); @@ -402,7 +401,7 @@ public: Point operator()(const Point &p, const Primitive &pr, const Point &bound) const { // seems to be unused: - //return CGAL::nearest_point_2(p, pr.datum(), bound); + //return nearest_point_2(p, pr.datum(), bound); return p; } }; @@ -419,11 +418,11 @@ public: public: template - CGAL::Comparison_result operator()(const Point &p, const Solid &pr, const Point &bound) const { + Comparison_result operator()(const Point &p, const Solid &pr, const Point &bound) const { return GeomTraits().do_intersect_2_object() (GeomTraits().construct_sphere_2_object() (p, GeomTraits().compute_squared_distance_2_object()(p, bound)), pr) ? - CGAL::SMALLER : CGAL::LARGER; + SMALLER : LARGER; } }; diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_tree_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_tree_2.h index 69095a5f27a..e2afb801925 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_tree_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/new/aabb/AABB_tree_2.h @@ -468,7 +468,7 @@ private: bool do_intersect(const Point &query, const Node &node) const { return AABBTraits().compare_distance_object() - (query, node.bbox(), m_closest_point) == CGAL::SMALLER; + (query, node.bbox(), m_closest_point) == SMALLER; } Point closest_point() const {