|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75670 - trunk/boost/geometry/algorithms/detail/overlay
From: barend.gehrels_at_[hidden]
Date: 2011-11-26 12:30:17
Author: barendgehrels
Date: 2011-11-26 12:30:16 EST (Sat, 26 Nov 2011)
New Revision: 75670
URL: http://svn.boost.org/trac/boost/changeset/75670
Log:
Linestring/polygon overlay, phase 7 (collinear/equal)
Text files modified:
trunk/boost/geometry/algorithms/detail/overlay/follow.hpp | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
Modified: trunk/boost/geometry/algorithms/detail/overlay/follow.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/follow.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/follow.hpp 2011-11-26 12:30:16 EST (Sat, 26 Nov 2011)
@@ -16,10 +16,8 @@
#include <boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp>
#include <boost/geometry/algorithms/detail/overlay/copy_segments.hpp>
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
-#include <boost/geometry/core/access.hpp>
-#include <boost/geometry/core/coordinate_dimension.hpp>
-#include <boost/geometry/geometries/concepts/check.hpp>
+#include <boost/geometry/algorithms/within.hpp>
namespace boost { namespace geometry
@@ -108,6 +106,18 @@
return false;
}
+ template <typename Turn>
+ static inline bool was_entered(Turn const& turn, bool first)
+ {
+ if (first && (turn.method == method_collinear || turn.method == method_equal))
+ {
+ // If it is the very first point, and either equal or collinear, there is only one
+ // IP generated (on purpose). So consider this as having entered.
+ // Maybe it will leave immediately after that (u/i) but that is checked later.
+ return true;
+ }
+ return false;
+ }
public :
template<typename Turns, typename OutputIterator>
@@ -137,6 +147,12 @@
{
turn_operation_iterator_type iit = boost::begin(it->operations);
+ if (was_entered(*it, first))
+ {
+ debug_traverse(*it, *iit, "-> Was entered");
+ entered = true;
+ }
+
if (is_staying_inside(*it, *iit, entered, first, linestring, polygon))
{
debug_traverse(*it, *iit, "-> Staying inside");
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