1
// Copyright (c) 2007,2009,2010,2011 Tel-Aviv University (Israel).
1
// Copyright (c) 2007,2009,2010,2011,2013 Tel-Aviv University (Israel).
2
2
// All rights reserved.
4
4
// This file is part of CGAL (www.cgal.org).
49
49
typedef Sweep_line_empty_visitor<Traits_2> Base_visitor;
50
50
typedef typename Base_visitor::Event Event;
51
51
typedef typename Base_visitor::Subcurve Subcurve;
52
typedef typename Event::Subcurve_iterator Subcurve_iterator;
58
59
//! The topology-traits class.
59
const Topology_traits * m_top_traits;
60
const Topology_traits* m_top_traits;
61
62
//! The unbounded arrangement face.
62
Face_const_handle m_unb_face;
63
Face_const_handle m_spherical_face;
66
67
* \param arr The arrangement.
68
Arr_spherical_batched_pl_helper(const Arrangement_2 *arr) :
69
Arr_spherical_batched_pl_helper(const Arrangement_2* arr) :
69
70
m_top_traits(arr->topology_traits())
75
76
/*! A notification issued before the sweep process starts. */
76
77
void before_sweep()
78
// Get the unbounded face.
79
m_unb_face = Face_const_handle(m_top_traits->unbounded_face());
78
{ m_spherical_face = Face_const_handle(m_top_traits->spherical_face()); }
82
80
/*! A notification invoked after the sweep-line finishes handling the given
85
void after_handle_event(Event * ) { return; }
83
void after_handle_event(Event* event) {
85
if (event->parameter_space_in_y() == ARR_TOP_BOUNDARY) {
86
Arr_curve_end ind = ((event->number_of_left_curves() == 0) &&
87
(event->number_of_right_curves() != 0)) ?
88
ARR_MIN_END : ARR_MAX_END;
89
Subcurve_iterator it, nit, it_end;
90
if (ind == ARR_MIN_END) {
91
it = nit = event->right_curves_begin();
92
it_end = event->right_curves_end();
94
it = nit = event->left_curves_begin();
95
it_end = event->left_curves_end();
100
while (nit != it_end) {
105
const Subcurve* sc = *it;
106
// pick the one facing the top right corner now
107
m_spherical_face = sc->last_curve().halfedge_handle()->face();
110
// EBEB 2013-12-012 do similar stuff for right boundary
111
if (event->parameter_space_in_y() == ARR_RIGHT_BOUNDARY) {
112
Subcurve_iterator it, nit, it_end;
113
it = nit = event->left_curves_begin();
114
it_end = event->left_curves_end();
118
while (nit != it_end) {
123
const Subcurve* sc = *it;
124
// pick the one facing the top right corner now
125
CGAL_assertion(sc->last_curve().halfedge_handle()->direction() == ARR_LEFT_TO_RIGHT);
126
m_spherical_face = sc->last_curve().halfedge_handle()->face();
88
/*! Get the current top face. */
89
Face_const_handle top_face() const
134
/*! Obtain the current top face. */
135
Face_const_handle top_face() const { return m_spherical_face; }
95
138
} //namespace CGAL