Handle open boundary in indexed sweep (fallback to unindexed mode)

This commit is contained in:
Simon Giraudot 2020-08-17 10:22:03 +02:00
parent 36a210065f
commit 47f3372ad9
1 changed files with 22 additions and 10 deletions

View File

@ -316,6 +316,8 @@ _init_curve_end(const X_monotone_curve_2& cv, Arr_curve_end ind, Subcurve* sc,
// Create the corresponding event and push it into the event queue.
std::pair<Event*, bool> pair_res;
if (m_traits->is_closed_2_object()(cv, ind)) {
// The curve end is closed and thus associated with a valid endpoint.
const Point_2& pt = (ind == ARR_MIN_END) ?
m_traits->construct_min_vertex_2_object()(cv) :
m_traits->construct_max_vertex_2_object()(cv);
@ -329,6 +331,16 @@ _init_curve_end(const X_monotone_curve_2& cv, Arr_curve_end ind, Subcurve* sc,
CGAL_assertion(e->is_closed());
m_visitor->update_event(e, pt, cv, ind, pair_res.second);
}
else {
// The curve end is open, insert it into the event queue.
pair_res = _push_event(cv, ind, end_attr, ps_x, ps_y, sc);
// Inform the visitor in case we updated an existing event.
Event* e = pair_res.first;
CGAL_assertion(! e->is_closed());
_update_event_at_open_boundary(e, cv, ind, pair_res.second);
}
}
//-----------------------------------------------------------------------------
// Handle the subcurves to the left of the current event point.