mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-17 13:52:09 +00:00
Linestring/polygon overlay, phase 6 (ring, counter clockwise)
[SVN r75574]
This commit is contained in:
@@ -66,15 +66,10 @@ class follow
|
||||
{
|
||||
// (Blocked means: blocked for polygon/polygon intersection, because
|
||||
// they are reversed. But for polygon/line it is similar to continue)
|
||||
switch(op.operation)
|
||||
{
|
||||
case operation_intersection :
|
||||
case operation_continue :
|
||||
case operation_blocked :
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return op.operation == operation_intersection
|
||||
|| op.operation == operation_continue
|
||||
|| op.operation == operation_blocked
|
||||
;
|
||||
}
|
||||
|
||||
template <typename Turn, typename Operation>
|
||||
@@ -105,12 +100,9 @@ class follow
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(op.operation)
|
||||
if (is_entering(turn, op))
|
||||
{
|
||||
case operation_intersection :
|
||||
case operation_continue :
|
||||
case operation_blocked :
|
||||
return entered || (first && geometry::within(linestring[0], polygon));
|
||||
return entered || (first && geometry::within(linestring[0], polygon));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -105,11 +105,11 @@ struct intersection_linestring_linestring_point
|
||||
|
||||
/*!
|
||||
\brief Version of linestring with an areal feature (polygon or multipolygon)
|
||||
\ingroup intersection
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename LineString, typename Areal,
|
||||
bool ReverseAreal,
|
||||
typename OutputIterator, typename LineStringOut,
|
||||
typename Strategy
|
||||
>
|
||||
@@ -150,7 +150,7 @@ struct intersection_of_linestring_with_areal
|
||||
detail::get_turns::no_interrupt_policy policy;
|
||||
geometry::get_turns
|
||||
<
|
||||
false, false, detail::overlay::calculate_distance_policy
|
||||
false, ReverseAreal, detail::overlay::calculate_distance_policy
|
||||
>(linestring, areal, turns, policy);
|
||||
|
||||
if (turns.empty())
|
||||
@@ -355,7 +355,7 @@ struct intersection_insert
|
||||
template
|
||||
<
|
||||
typename Linestring, typename Polygon,
|
||||
bool Reverse1, bool Reverse2, bool ReverseOut,
|
||||
bool ReverseLinestring, bool ReversePolygon, bool ReverseOut,
|
||||
typename OutputIterator, typename GeometryOut,
|
||||
overlay_type OverlayType,
|
||||
typename Strategy
|
||||
@@ -365,19 +365,46 @@ struct intersection_insert
|
||||
linestring_tag, polygon_tag, linestring_tag,
|
||||
false, true, false,
|
||||
Linestring, Polygon,
|
||||
Reverse1, Reverse2, ReverseOut,
|
||||
ReverseLinestring, ReversePolygon, ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
OverlayType,
|
||||
Strategy
|
||||
> : detail::intersection::intersection_of_linestring_with_areal
|
||||
<
|
||||
Linestring, Polygon,
|
||||
ReversePolygon,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Linestring, typename Ring,
|
||||
bool ReverseLinestring, bool ReverseRing, bool ReverseOut,
|
||||
typename OutputIterator, typename GeometryOut,
|
||||
overlay_type OverlayType,
|
||||
typename Strategy
|
||||
>
|
||||
struct intersection_insert
|
||||
<
|
||||
linestring_tag, ring_tag, linestring_tag,
|
||||
false, true, false,
|
||||
Linestring, Ring,
|
||||
ReverseLinestring, ReverseRing, ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
OverlayType,
|
||||
Strategy
|
||||
> : detail::intersection::intersection_of_linestring_with_areal
|
||||
<
|
||||
Linestring, Ring,
|
||||
ReverseRing,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
>
|
||||
{};
|
||||
|
||||
template
|
||||
<
|
||||
typename Segment, typename Box,
|
||||
|
||||
@@ -114,6 +114,7 @@ struct intersection_linestring_multi_linestring_point
|
||||
template
|
||||
<
|
||||
typename MultiLinestring, typename Areal,
|
||||
bool ReverseAreal,
|
||||
typename OutputIterator, typename LineStringOut,
|
||||
typename Strategy
|
||||
>
|
||||
@@ -133,7 +134,7 @@ struct intersection_of_multi_linestring_with_areal
|
||||
out = intersection_of_linestring_with_areal
|
||||
<
|
||||
typename boost::range_value<MultiLinestring>::type,
|
||||
Areal,
|
||||
Areal, ReverseAreal,
|
||||
OutputIterator, LineStringOut, Strategy
|
||||
>::apply(*it, areal, out, strategy);
|
||||
}
|
||||
@@ -147,6 +148,7 @@ struct intersection_of_multi_linestring_with_areal
|
||||
template
|
||||
<
|
||||
typename Areal, typename MultiLinestring,
|
||||
bool ReverseAreal,
|
||||
typename OutputIterator, typename LineStringOut,
|
||||
typename Strategy
|
||||
>
|
||||
@@ -158,7 +160,7 @@ struct intersection_of_areal_with_multi_linestring
|
||||
{
|
||||
return intersection_of_multi_linestring_with_areal
|
||||
<
|
||||
MultiLinestring, Areal,
|
||||
MultiLinestring, Areal, ReverseAreal,
|
||||
OutputIterator, LineStringOut,
|
||||
Strategy
|
||||
>::apply(ml, areal, out, strategy);
|
||||
@@ -283,7 +285,7 @@ struct intersection_insert
|
||||
template
|
||||
<
|
||||
typename Linestring, typename MultiPolygon,
|
||||
bool Reverse1, bool Reverse2, bool ReverseOut,
|
||||
bool ReverseLinestring, bool ReverseMultiPolygon, bool ReverseOut,
|
||||
typename OutputIterator, typename GeometryOut,
|
||||
overlay_type OverlayType,
|
||||
typename Strategy
|
||||
@@ -293,13 +295,14 @@ struct intersection_insert
|
||||
linestring_tag, multi_polygon_tag, linestring_tag,
|
||||
false, true, false,
|
||||
Linestring, MultiPolygon,
|
||||
Reverse1, Reverse2, ReverseOut,
|
||||
ReverseLinestring, ReverseMultiPolygon, ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
OverlayType,
|
||||
Strategy
|
||||
> : detail::intersection::intersection_of_linestring_with_areal
|
||||
<
|
||||
Linestring, MultiPolygon,
|
||||
ReverseMultiPolygon,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
>
|
||||
@@ -311,7 +314,7 @@ struct intersection_insert
|
||||
template
|
||||
<
|
||||
typename Polygon, typename MultiLinestring,
|
||||
bool Reverse1, bool Reverse2, bool ReverseOut,
|
||||
bool ReversePolygon, bool ReverseMultiLinestring, bool ReverseOut,
|
||||
typename OutputIterator, typename GeometryOut,
|
||||
overlay_type OverlayType,
|
||||
typename Strategy
|
||||
@@ -321,23 +324,53 @@ struct intersection_insert
|
||||
polygon_tag, multi_linestring_tag, linestring_tag,
|
||||
true, false, false,
|
||||
Polygon, MultiLinestring,
|
||||
Reverse1, Reverse2, ReverseOut,
|
||||
ReversePolygon, ReverseMultiLinestring, ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
OverlayType,
|
||||
Strategy
|
||||
> : detail::intersection::intersection_of_areal_with_multi_linestring
|
||||
<
|
||||
Polygon, MultiLinestring,
|
||||
ReversePolygon,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename MultiLinestring, typename Ring,
|
||||
bool ReverseMultiLinestring, bool ReverseRing, bool ReverseOut,
|
||||
typename OutputIterator, typename GeometryOut,
|
||||
overlay_type OverlayType,
|
||||
typename Strategy
|
||||
>
|
||||
struct intersection_insert
|
||||
<
|
||||
multi_linestring_tag, ring_tag, linestring_tag,
|
||||
false, true, false,
|
||||
MultiLinestring, Ring,
|
||||
ReverseMultiLinestring, ReverseRing, ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
OverlayType,
|
||||
Strategy
|
||||
> : detail::intersection::intersection_of_multi_linestring_with_areal
|
||||
<
|
||||
MultiLinestring, Ring,
|
||||
ReverseRing,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename MultiLinestring, typename MultiPolygon,
|
||||
bool Reverse1, bool Reverse2, bool ReverseOut,
|
||||
bool ReverseMultiLinestring, bool ReverseMultiPolygon, bool ReverseOut,
|
||||
typename OutputIterator, typename GeometryOut,
|
||||
overlay_type OverlayType,
|
||||
typename Strategy
|
||||
@@ -347,13 +380,14 @@ struct intersection_insert
|
||||
multi_linestring_tag, multi_polygon_tag, linestring_tag,
|
||||
false, true, false,
|
||||
MultiLinestring, MultiPolygon,
|
||||
Reverse1, Reverse2, ReverseOut,
|
||||
ReverseMultiLinestring, ReverseMultiPolygon, ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
OverlayType,
|
||||
Strategy
|
||||
> : detail::intersection::intersection_of_multi_linestring_with_areal
|
||||
<
|
||||
MultiLinestring, MultiPolygon,
|
||||
ReverseMultiPolygon,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user