mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-11 11:52:11 +00:00
relate(L,L) - restored asserts in boundary_checker, added proper calculation of seg_ids for the first and last point of a range
This commit is contained in:
@@ -51,14 +51,12 @@ public:
|
||||
|
||||
if ( BoundaryQuery == boundary_front_explicit )
|
||||
{
|
||||
// TODO: temporarily disable
|
||||
//BOOST_ASSERT(this->template is_boundary<boundary_front>(pt, sid));
|
||||
BOOST_ASSERT(this->template is_boundary<boundary_front>(pt, sid));
|
||||
return true;
|
||||
}
|
||||
else if ( BoundaryQuery == boundary_back_explicit )
|
||||
{
|
||||
// TODO: temporarily disable
|
||||
//BOOST_ASSERT(this->template is_boundary<boundary_back>(pt, sid));
|
||||
BOOST_ASSERT(this->template is_boundary<boundary_back>(pt, sid));
|
||||
return true;
|
||||
}
|
||||
else if ( BoundaryQuery == boundary_front )
|
||||
|
||||
@@ -469,9 +469,12 @@ struct linear_linear
|
||||
// if it's the first IP then the first point is outside
|
||||
if ( first_in_range )
|
||||
{
|
||||
segment_identifier first_seg_id = seg_id;
|
||||
first_seg_id.segment_index = 0;
|
||||
|
||||
// if there is a boundary on the first point
|
||||
if ( boundary_checker.template is_boundary<boundary_front_explicit>
|
||||
(range::front(sub_geometry::get(geometry, seg_id)), seg_id) )
|
||||
(range::front(sub_geometry::get(geometry, first_seg_id)), first_seg_id) )
|
||||
{
|
||||
update_result<boundary, exterior, '0', reverse_result>(res);
|
||||
}
|
||||
@@ -601,14 +604,19 @@ struct linear_linear
|
||||
// PREV MAY NOT BE VALID!
|
||||
TurnIt prev = last;
|
||||
--prev;
|
||||
segment_identifier const& prev_seg_id = prev->operations[OpId].seg_id;
|
||||
|
||||
// if there is a boundary on the last point
|
||||
if ( boost::size(sub_geometry::get(geometry, prev_seg_id)) > 1
|
||||
&& boundary_checker.template is_boundary<boundary_back_explicit>
|
||||
(range::back(sub_geometry::get(geometry, prev_seg_id)), prev_seg_id) )
|
||||
segment_identifier prev_seg_id = prev->operations[OpId].seg_id;
|
||||
std::size_t points_count = boost::size(sub_geometry::get(geometry, prev_seg_id));
|
||||
|
||||
if ( points_count > 1 )
|
||||
{
|
||||
update_result<boundary, exterior, '0', reverse_result>(res);
|
||||
prev_seg_id.segment_index = points_count - 2;
|
||||
|
||||
// if there is a boundary on the last point
|
||||
if ( boundary_checker.template is_boundary<boundary_back_explicit>
|
||||
(range::back(sub_geometry::get(geometry, prev_seg_id)), prev_seg_id) )
|
||||
{
|
||||
update_result<boundary, exterior, '0', reverse_result>(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user