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:
Adam Wulkiewicz
2014-02-15 01:21:57 +01:00
parent 551069e555
commit 00e69bbea3
2 changed files with 18 additions and 12 deletions

View File

@@ -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 )

View File

@@ -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);
}
}
}
}