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 1ba07e793..b2319a0a2 100644 --- a/include/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp @@ -104,60 +104,6 @@ struct check_original }; -template -class relaxed_side -{ -public : - - // Template member function, because it is not always trivial - // or convenient to explicitly mention the typenames in the - // strategy-struct itself. - - // Types can be all three different. Therefore it is - // not implemented (anymore) as "segment" - - static inline int apply(P const& p1, P const& p2, P const& p) - { - typedef typename coordinate_type

::type coordinate_type; - - coordinate_type const x = get<0>(p); - coordinate_type const y = get<1>(p); - - coordinate_type const sx1 = get<0>(p1); - coordinate_type const sy1 = get<1>(p1); - coordinate_type const sx2 = get<0>(p2); - coordinate_type const sy2 = get<1>(p2); - - // Promote float->double, small int->int - typedef typename geometry::select_most_precise - < - coordinate_type, - double - >::type promoted_type; - - promoted_type const dx = sx2 - sx1; - promoted_type const dy = sy2 - sy1; - promoted_type const dpx = x - sx1; - promoted_type const dpy = y - sy1; - - promoted_type const s - = geometry::detail::determinant - ( - dx, dy, - dpx, dpy - ); - - promoted_type const zero = promoted_type(); - promoted_type const relaxed_epsilon = std::numeric_limits::epsilon() * 5.0; - - return math::abs(s) < relaxed_epsilon ? 0 - : s > zero ? 1 - : -1; - } -}; - - - template struct buffered_piece_collection { @@ -365,31 +311,6 @@ struct buffered_piece_collection } } - inline segment_relation_code get_segment_relation(point_type const& point, - segment_identifier const& seg_id) const - { - typedef typename boost::range_iterator const>::type iterator_type; - iterator_type it = boost::begin(offsetted_rings[seg_id.multi_index]) + seg_id.segment_index; - iterator_type prev = it++; - int side = side_strategy::apply(point, *prev, *it); - if (side == 0) - { - if (detail::overlay::points_equal_or_close(point, *prev, m_rescale_policy)) - { - return segment_relation_on_left; - } - else if (detail::overlay::points_equal_or_close(point, *it, m_rescale_policy)) - { - return segment_relation_on_right; - } - else if (collinear_point_on_segment(point, *prev, *it)) - { - return segment_relation_within; - } - } - return segment_relation_disjoint; - } - inline void add_angles(int turn_index, int operation_index, point_type const& point, buffer_turn_operation_type const& operation) { point_type mapped_point; @@ -717,17 +638,6 @@ struct buffered_piece_collection } } -#define BOOST_GEOMETRY_DEBUG_BUFFER_SITUATION_MAP -#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_SITUATION_MAP - inline int get_side(point_type const& point, Ring const& ring, int segment_index) - { - typedef typename boost::range_iterator iterator_type; - iterator_type it = boost::begin(ring) + segment_index; - iterator_type prev = it++; - return side_strategy::apply(point, *prev, *it); - } -#endif - template static inline point_type const& select_for_side(Iterator first, Iterator second, int index) { @@ -778,20 +688,6 @@ struct buffered_piece_collection return 0; } - - - inline void debug_segment(segment_identifier id) - { - typedef typename boost::range_iterator const>::type iterator; - - buffered_ring const& ring = offsetted_rings[id.multi_index]; - iterator it = boost::begin(ring) + id.segment_index; - iterator prev = it++; - geometry::model::referring_segment segment(*prev, *it); - //std::cout << geometry::wkt(*prev) << " " << geometry::wkt(*it) << std::endl; - } - - struct cluster_info { inline cluster_info(int i, point_type p, buffer_turn_operation_type op) @@ -816,14 +712,6 @@ struct buffered_piece_collection std::vector intersecting_segments; }; -#ifdef OLD - struct situation_info - { - std::set turn_indices; - std::set seg_ids; - }; -#endif - static inline bool add_mutual_intersection(clustered_info const& cluster, segment_identifier const& seg_id) { bool result = false;