mirror of https://github.com/CGAL/cgal
Remove references to the CGAL namespace, as we're already in it
This commit is contained in:
parent
f6bd2fda24
commit
d6a58be770
|
|
@ -6,18 +6,18 @@ namespace CGAL {
|
|||
typedef std::pair<int, int> 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<CGAL::Object> base_objs;
|
||||
std::list<Object> 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<CGAL::Object>::iterator obj_it;
|
||||
std::list<Object>::iterator obj_it;
|
||||
const std::pair<Base_point_2, unsigned int> *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;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ private:
|
|||
|
||||
typedef Arr_default_dcel<Traits_2> Dcel;
|
||||
|
||||
typedef CGAL::Arrangement_with_history_2<Traits_2, Dcel> Arrangement_history_2;
|
||||
typedef Arrangement_with_history_2<Traits_2, Dcel> 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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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())));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ template <class R_> class Point_2;
|
|||
template <class R_> class Segment_2;
|
||||
|
||||
double eps(double x) {
|
||||
return CGAL::abs(CGAL::nextafter(x, DBL_MAX) - x);
|
||||
return abs(nextafter(x, DBL_MAX) - x);
|
||||
}
|
||||
|
||||
template<typename GeomTraits, typename AABB_primitive_>
|
||||
|
|
@ -15,7 +15,6 @@ class AABB_traits_2 {
|
|||
public:
|
||||
typedef AABB_traits_2<GeomTraits, AABB_primitive_> 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<true>(CGAL::to_interval(point.x()));
|
||||
m_y_interval = Interval_nt<true>(CGAL::to_interval(point.y()));
|
||||
m_px = CGAL::to_double(point.x());
|
||||
m_py = CGAL::to_double(point.y());
|
||||
m_x_interval = Interval_nt<true>(to_interval(point.x()));
|
||||
m_y_interval = Interval_nt<true>(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<GeomTraits> *ipoint = CGAL::object_cast<CGAL::Point_2<GeomTraits> >(&intersection_object)) {
|
||||
if (const CGAL::Point_2<GeomTraits> *ipoint = object_cast<CGAL::Point_2<GeomTraits> >(&intersection_object)) {
|
||||
// handle weak intersections
|
||||
bool has_weak_intersection = false;
|
||||
bool p_intersect = false;
|
||||
|
|
@ -259,9 +258,9 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
if (const CGAL::Segment_2<GeomTraits> *iseg = CGAL::object_cast<CGAL::Segment_2<GeomTraits> >(&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<GeomTraits> *iseg = object_cast<CGAL::Segment_2<GeomTraits> >(&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<Object_and_primitive_id> 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 <class Solid>
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue