/
usr
/
include
/
boost
/
geometry
/
algorithms
/
detail
/
overlay
/
/usr/include/boost/geometry/algorithms/detail/overlay
mkdir
upload
Name
Size
Mode
Actions
add_rings.hpp
5964
0644
edit
dl
rm
append_no_duplicates.hpp
2101
0644
edit
dl
rm
append_no_dups_or_spikes.hpp
7434
0644
edit
dl
rm
assign_parents.hpp
14577
0644
edit
dl
rm
backtrack_check_si.hpp
6371
0644
edit
dl
rm
check_enrich.hpp
5361
0644
edit
dl
rm
clip_linestring.hpp
8718
0644
edit
dl
rm
cluster_exits.hpp
7817
0644
edit
dl
rm
cluster_info.hpp
1010
0644
edit
dl
rm
convert_ring.hpp
3113
0644
edit
dl
rm
copy_segments.hpp
11481
0644
edit
dl
rm
copy_segment_point.hpp
11107
0644
edit
dl
rm
debug_turn_info.hpp
1947
0644
edit
dl
rm
do_reverse.hpp
1246
0644
edit
dl
rm
enrichment_info.hpp
2343
0644
edit
dl
rm
enrich_intersection_points.hpp
19008
0644
edit
dl
rm
follow.hpp
16907
0644
edit
dl
rm
follow_linear_linear.hpp
15711
0644
edit
dl
rm
get_distance_measure.hpp
5092
0644
edit
dl
rm
get_intersection_points.hpp
4265
0644
edit
dl
rm
get_relative_order.hpp
3260
0644
edit
dl
rm
get_ring.hpp
3700
0644
edit
dl
rm
get_turns.hpp
42078
0644
edit
dl
rm
get_turn_info.hpp
45746
0644
edit
dl
rm
get_turn_info_for_endpoint.hpp
25337
0644
edit
dl
rm
get_turn_info_helpers.hpp
19708
0644
edit
dl
rm
get_turn_info_la.hpp
34941
0644
edit
dl
rm
get_turn_info_ll.hpp
28380
0644
edit
dl
rm
handle_colocations.hpp
28604
0644
edit
dl
rm
handle_self_turns.hpp
9962
0644
edit
dl
rm
inconsistent_turns_exception.hpp
1043
0644
edit
dl
rm
intersection_box_box.hpp
2623
0644
edit
dl
rm
intersection_insert.hpp
47296
0644
edit
dl
rm
is_self_turn.hpp
1611
0644
edit
dl
rm
less_by_segment_ratio.hpp
6161
0644
edit
dl
rm
linear_linear.hpp
9562
0644
edit
dl
rm
needs_self_turns.hpp
1911
0644
edit
dl
rm
overlay.hpp
15706
0644
edit
dl
rm
overlay_type.hpp
1746
0644
edit
dl
rm
pointlike_areal.hpp
9593
0644
edit
dl
rm
pointlike_linear.hpp
11547
0644
edit
dl
rm
pointlike_pointlike.hpp
11878
0644
edit
dl
rm
range_in_geometry.hpp
5066
0644
edit
dl
rm
ring_properties.hpp
2135
0644
edit
dl
rm
segment_as_subrange.hpp
1488
0644
edit
dl
rm
segment_identifier.hpp
3555
0644
edit
dl
rm
select_rings.hpp
12362
0644
edit
dl
rm
self_turn_points.hpp
10814
0644
edit
dl
rm
sort_by_side.hpp
22216
0644
edit
dl
rm
stream_info.hpp
2383
0644
edit
dl
rm
traversal.hpp
34432
0644
edit
dl
rm
traversal_info.hpp
1469
0644
edit
dl
rm
traversal_ring_creator.hpp
15319
0644
edit
dl
rm
traversal_switch_detector.hpp
22642
0644
edit
dl
rm
traverse.hpp
3256
0644
edit
dl
rm
turn_info.hpp
4468
0644
edit
dl
rm
visit_info.hpp
2350
0644
edit
dl
rm
Edit:
/usr/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp
(7434B)
// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // This file was modified by Oracle on 2014, 2017, 2018. // Modifications copyright (c) 2014-2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP #include <boost/range.hpp> #include <boost/static_assert.hpp> #include <boost/geometry/algorithms/append.hpp> #include <boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp> #include <boost/geometry/algorithms/detail/equals/point_point.hpp> #include <boost/geometry/core/closure.hpp> #include <boost/geometry/util/condition.hpp> #include <boost/geometry/util/range.hpp> namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL namespace detail { namespace overlay { // TODO: move this / rename this template <typename Point1, typename Point2, typename EqualsStrategy, typename RobustPolicy> inline bool points_equal_or_close(Point1 const& point1, Point2 const& point2, EqualsStrategy const& strategy, RobustPolicy const& robust_policy) { if (detail::equals::equals_point_point(point1, point2, strategy)) { return true; } if (BOOST_GEOMETRY_CONDITION(! RobustPolicy::enabled)) { return false; } // Try using specified robust policy typedef typename geometry::robust_point_type < Point1, RobustPolicy >::type robust_point_type; robust_point_type point1_rob, point2_rob; geometry::recalculate(point1_rob, point1, robust_policy); geometry::recalculate(point2_rob, point2, robust_policy); // Only if this is the case the same strategy can be used. BOOST_STATIC_ASSERT((boost::is_same < typename geometry::cs_tag<Point1>::type, typename geometry::cs_tag<robust_point_type>::type >::value)); return detail::equals::equals_point_point(point1_rob, point2_rob, strategy); } template <typename Range, typename Point, typename SideStrategy, typename RobustPolicy> inline void append_no_dups_or_spikes(Range& range, Point const& point, SideStrategy const& strategy, RobustPolicy const& robust_policy) { #ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION std::cout << " add: (" << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")" << std::endl; #endif // The code below this condition checks all spikes/dups // for geometries >= 3 points. // So we have to check the first potential duplicate differently if ( boost::size(range) == 1 && points_equal_or_close(*(boost::begin(range)), point, strategy.get_equals_point_point_strategy(), robust_policy) ) { return; } traits::push_back<Range>::apply(range, point); // If a point is equal, or forming a spike, remove the pen-ultimate point // because this one caused the spike. // If so, the now-new-pen-ultimate point can again cause a spike // (possibly at a corner). So keep doing this. // Besides spikes it will also avoid adding duplicates. while(boost::size(range) >= 3 && point_is_spike_or_equal(point, *(boost::end(range) - 3), *(boost::end(range) - 2), strategy, robust_policy)) { // Use the Concept/traits, so resize and append again traits::resize<Range>::apply(range, boost::size(range) - 2); traits::push_back<Range>::apply(range, point); } } template <typename Range, typename Point, typename SideStrategy, typename RobustPolicy> inline void append_no_collinear(Range& range, Point const& point, SideStrategy const& strategy, RobustPolicy const& robust_policy) { // Stricter version, not allowing any point in a linear row // (spike, continuation or same point) // The code below this condition checks all spikes/dups // for geometries >= 3 points. // So we have to check the first potential duplicate differently if ( boost::size(range) == 1 && points_equal_or_close(*(boost::begin(range)), point, strategy.get_equals_point_point_strategy(), robust_policy) ) { return; } traits::push_back<Range>::apply(range, point); // If a point is equal, or forming a spike, remove the pen-ultimate point // because this one caused the spike. // If so, the now-new-pen-ultimate point can again cause a spike // (possibly at a corner). So keep doing this. // Besides spikes it will also avoid adding duplicates. while(boost::size(range) >= 3 && point_is_collinear(point, *(boost::end(range) - 3), *(boost::end(range) - 2), strategy, robust_policy)) { // Use the Concept/traits, so resize and append again traits::resize<Range>::apply(range, boost::size(range) - 2); traits::push_back<Range>::apply(range, point); } } template <typename Range, typename SideStrategy, typename RobustPolicy> inline void clean_closing_dups_and_spikes(Range& range, SideStrategy const& strategy, RobustPolicy const& robust_policy) { std::size_t const minsize = core_detail::closure::minimum_ring_size < geometry::closure<Range>::value >::value; if (boost::size(range) <= minsize) { return; } typedef typename boost::range_iterator<Range>::type iterator_type; static bool const closed = geometry::closure<Range>::value == geometry::closed; // TODO: the following algorithm could be rewritten to first look for spikes // and then erase some number of points from the beginning of the Range bool found = false; do { found = false; iterator_type first = boost::begin(range); iterator_type second = first + 1; iterator_type ultimate = boost::end(range) - 1; if (BOOST_GEOMETRY_CONDITION(closed)) { ultimate--; } // Check if closing point is a spike (this is so if the second point is // considered as collinear w.r.t. the last segment) if (point_is_collinear(*second, *ultimate, *first, strategy, robust_policy)) { range::erase(range, first); if (BOOST_GEOMETRY_CONDITION(closed)) { // Remove closing last point range::resize(range, boost::size(range) - 1); // Add new closing point range::push_back(range, range::front(range)); } found = true; } } while(found && boost::size(range) > minsize); } }} // namespace detail::overlay #endif // DOXYGEN_NO_DETAIL }} // namespace boost::geometry #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP
Save
cmd:
run