File indexing completed on 2025-01-18 09:35:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPLICATES_HPP
0015 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPLICATES_HPP
0016
0017
0018 #include <boost/geometry/algorithms/append.hpp>
0019 #include <boost/geometry/algorithms/detail/equals/point_point.hpp>
0020
0021 #include <boost/geometry/util/range.hpp>
0022
0023
0024 namespace boost { namespace geometry
0025 {
0026
0027
0028 #ifndef DOXYGEN_NO_DETAIL
0029 namespace detail { namespace overlay
0030 {
0031
0032 template <typename Range, typename Point>
0033 inline void append_with_duplicates(Range& range, Point const& point)
0034 {
0035 #ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
0036 std::cout << " add: ("
0037 << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")"
0038 << std::endl;
0039 #endif
0040 geometry::append(range, point);
0041 }
0042
0043 template <typename Range, typename Point, typename Strategy>
0044 inline void append_no_duplicates(Range& range, Point const& point,
0045 Strategy const& strategy)
0046 {
0047 if ( boost::empty(range)
0048 || ! geometry::detail::equals::equals_point_point(geometry::range::back(range),
0049 point,
0050 strategy) )
0051 {
0052 #ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
0053 std::cout << " add: ("
0054 << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")"
0055 << std::endl;
0056 #endif
0057 geometry::append(range, point);
0058 }
0059 }
0060
0061
0062 }}
0063 #endif
0064
0065
0066
0067 }}
0068
0069
0070 #endif