|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75568 - in trunk/boost/geometry: algorithms/detail/overlay multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-11-20 07:33:56
Author: barendgehrels
Date: 2011-11-20 07:33:55 EST (Sun, 20 Nov 2011)
New Revision: 75568
URL: http://svn.boost.org/trac/boost/changeset/75568
Log:
Linestring/polygon overlay, phase 4 (linestring/multi_polygon, which effectively uses the same implementation)
Text files modified:
trunk/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp | 21 ++++++++++++---------
trunk/boost/geometry/multi/algorithms/intersection.hpp | 26 ++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 9 deletions(-)
Modified: trunk/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp 2011-11-20 07:33:55 EST (Sun, 20 Nov 2011)
@@ -103,13 +103,17 @@
}
};
+/*!
+\brief Version of linestring with an areal feature (polygon or multipolygon)
+\ingroup intersection
+*/
template
<
- typename LineString, typename Polygon,
+ typename LineString, typename Areal,
typename OutputIterator, typename LineStringOut,
typename Strategy
>
-struct intersection_linestring_polygon
+struct intersection_of_linestring_with_areal
{
#if defined(BOOST_GEOMETRY_DEBUG_FOLLOW)
@@ -129,7 +133,7 @@
}
#endif
- static inline OutputIterator apply(LineString const& linestring, Polygon const& polygon,
+ static inline OutputIterator apply(LineString const& linestring, Areal const& areal,
OutputIterator out,
Strategy const& strategy)
{
@@ -147,13 +151,13 @@
geometry::get_turns
<
false, false, detail::overlay::calculate_distance_policy
- >(linestring, polygon, turns, policy);
+ >(linestring, areal, turns, policy);
if (turns.empty())
{
// No intersection points, it is either completely inside
// or completely outside
- if (geometry::within(linestring[0], polygon))
+ if (geometry::within(linestring[0], areal))
{
LineStringOut copy;
geometry::convert(linestring, copy);
@@ -174,10 +178,10 @@
<
LineStringOut,
LineString,
- Polygon
+ Areal
>::apply
(
- linestring, polygon,
+ linestring, areal,
geometry::detail::overlay::operation_intersection,
turns, out
);
@@ -185,7 +189,6 @@
};
-
}} // namespace detail::intersection
#endif // DOXYGEN_NO_DETAIL
@@ -366,7 +369,7 @@
OutputIterator, GeometryOut,
OverlayType,
Strategy
- > : detail::intersection::intersection_linestring_polygon
+ > : detail::intersection::intersection_of_linestring_with_areal
<
Linestring, Polygon,
OutputIterator, GeometryOut,
Modified: trunk/boost/geometry/multi/algorithms/intersection.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/intersection.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/intersection.hpp 2011-11-20 07:33:55 EST (Sun, 20 Nov 2011)
@@ -222,6 +222,32 @@
{};
+template
+<
+ typename Linestring, typename MultiPolygon,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
+ typename OutputIterator, typename GeometryOut,
+ overlay_type OverlayType,
+ typename Strategy
+>
+struct intersection_insert
+ <
+ linestring_tag, multi_polygon_tag, linestring_tag,
+ false, true, false,
+ Linestring, MultiPolygon,
+ Reverse1, Reverse2, ReverseOut,
+ OutputIterator, GeometryOut,
+ OverlayType,
+ Strategy
+ > : detail::intersection::intersection_of_linestring_with_areal
+ <
+ Linestring, MultiPolygon,
+ OutputIterator, GeometryOut,
+ Strategy
+ >
+{};
+
+
} // namespace dispatch
#endif
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk