From f6c5f694952cb4ac574733da8b23ec047148372e Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 11 Jun 2014 10:15:36 +0200 Subject: [PATCH] [buffer] split rescaling piece rings / turns to support coming use of partition for calculate turns --- .../algorithms/buffer/buffered_piece_collection.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp b/include/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp index 32fdf264d..92118de37 100644 --- a/include/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp @@ -686,7 +686,7 @@ struct buffered_piece_collection return true; } - inline void rescale_pieces() + inline void rescale_piece_rings() { for (typename piece_vector_type::iterator it = boost::begin(m_pieces); it != boost::end(m_pieces); @@ -727,7 +727,10 @@ struct buffered_piece_collection } } } + } + inline void insert_rescaled_piece_turns() + { // Add rescaled turn points to corresponding pieces // (after this, each turn occurs twice) int index = 0; @@ -748,8 +751,6 @@ struct buffered_piece_collection } } - // All pieces now have closed robust rings. - // Insert all rescaled turn-points into these rings, to form a // reliable integer-based ring. All turns can be compared (inside) to this // rings to see if they are inside. @@ -793,6 +794,8 @@ struct buffered_piece_collection template inline void get_turns(Geometry const& input_geometry, DistanceStrategy const& distance_strategy) { + rescale_piece_rings(); + // Now: quadratic // TODO use partition @@ -811,7 +814,7 @@ struct buffered_piece_collection } } - rescale_pieces(); + insert_rescaled_piece_turns(); classify_turns(); get_occupation();