diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp index d42b13640..de44f08d7 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -314,23 +314,15 @@ struct buffered_piece_collection } } - // 4: From these vectors, get the left turns - // and mark all other turns as to-skip + // 4: Mark all turns as not selectable as a starting point for traversing + // rings. They still can be used to continue already started rings. for (typename occupation_map_type::iterator it = occupation_map.begin(); it != occupation_map.end(); ++it) { - buffer_occupation_info& info = it->second; - - std::vector turns_to_keep; - info.get_left_turns(it->first, turns_to_keep); - - if (turns_to_keep.empty()) + typename buffer_occupation_info::turn_vector_type const& turns = it->second.turns; + for (int i = 0; i < turns.size(); i++) { - typename buffer_occupation_info::turn_vector_type const& turns = it->second.turns; - for (int i = 0; i < turns.size(); i++) - { - m_turns[turns[i].turn_index].count_on_occupied++; - } + m_turns[turns[i].turn_index].selectable_start = false; } } } @@ -551,7 +543,7 @@ struct buffered_piece_collection } - //get_occupation(); // Temporarily disabled, all tests passing... + get_occupation(); classify_turns(); diff --git a/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp b/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp index b210fd04b..03be18e07 100644 --- a/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp @@ -137,7 +137,7 @@ inline bool check_graph(TurnPoints& turn_points, operation_type for_operation) it != boost::end(meta_turns); ++it) { - if (! (it->turn->blocked() || it->turn->is_discarded())) + if (! (it->turn->blocked() || it->turn->discarded)) { for (int i = 0 ; i < 2; i++) { diff --git a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp index d3c9997e8..bde86b4d7 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp @@ -268,7 +268,7 @@ public : ++it) { // Skip discarded ones - if (! (it->is_discarded() || it->blocked())) + if (! (it->discarded || ! it->selectable_start || it->blocked())) { for (turn_operation_iterator_type iit = boost::begin(it->operations); state.good() && iit != boost::end(it->operations); diff --git a/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp index 9dd54d377..bdd676e97 100644 --- a/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp @@ -93,6 +93,7 @@ struct turn_info Point point; method_type method; bool discarded; + bool selectable_start; // Can be used as starting-turn in traverse Container operations; @@ -100,6 +101,7 @@ struct turn_info inline turn_info() : method(method_none) , discarded(false) + , selectable_start(true) {} inline bool both(operation_type type) const