12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPLICATES_HPP
- #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPLICATES_HPP
- #include <boost/geometry/algorithms/append.hpp>
- #include <boost/geometry/algorithms/detail/equals/point_point.hpp>
- #include <boost/geometry/util/range.hpp>
- namespace boost { namespace geometry
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail { namespace overlay
- {
- template <typename Range, typename Point>
- inline void append_with_duplicates(Range& range, Point const& point)
- {
- #ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
- std::cout << " add: ("
- << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")"
- << std::endl;
- #endif
- geometry::append(range, point);
- }
- template <typename Range, typename Point, typename Strategy>
- inline void append_no_duplicates(Range& range, Point const& point,
- Strategy const& strategy)
- {
- if ( boost::empty(range)
- || ! geometry::detail::equals::equals_point_point(geometry::range::back(range),
- point,
- strategy) )
- {
- #ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
- std::cout << " add: ("
- << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")"
- << std::endl;
- #endif
- geometry::append(range, point);
- }
- }
- }}
- #endif
- }}
- #endif
|