]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / detail / overlay / append_no_duplicates.hpp
CommitLineData
7c673cae
FG
1// Boost.Geometry (aka GGL, Generic Geometry Library)
2
3// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4
20effc67
TL
5// This file was modified by Oracle on 2018-2020.
6// Modifications copyright (c) 2018-2020 Oracle and/or its affiliates.
92f5a8d4
TL
7
8// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
9
7c673cae
FG
10// Use, modification and distribution is subject to the Boost Software License,
11// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12// http://www.boost.org/LICENSE_1_0.txt)
13
14#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPLICATES_HPP
15#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPLICATES_HPP
16
17
7c673cae
FG
18#include <boost/geometry/algorithms/append.hpp>
19#include <boost/geometry/algorithms/detail/equals/point_point.hpp>
20
92f5a8d4 21#include <boost/geometry/util/range.hpp>
7c673cae
FG
22
23
24namespace boost { namespace geometry
25{
26
27
28#ifndef DOXYGEN_NO_DETAIL
29namespace detail { namespace overlay
30{
31
32template <typename Range, typename Point>
92f5a8d4
TL
33inline void append_with_duplicates(Range& range, Point const& point)
34{
35#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
36 std::cout << " add: ("
37 << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")"
38 << std::endl;
39#endif
40 geometry::append(range, point);
41}
42
43template <typename Range, typename Point, typename EqPPStrategy>
44inline void append_no_duplicates(Range& range, Point const& point,
45 EqPPStrategy const& strategy)
7c673cae 46{
92f5a8d4
TL
47 if ( boost::empty(range)
48 || ! geometry::detail::equals::equals_point_point(geometry::range::back(range),
49 point,
50 strategy) )
7c673cae
FG
51 {
52#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
53 std::cout << " add: ("
54 << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")"
55 << std::endl;
56#endif
57 geometry::append(range, point);
58 }
59}
60
61
62}} // namespace detail::overlay
63#endif // DOXYGEN_NO_DETAIL
64
65
66
67}} // namespace boost::geometry
68
69
70#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPLICATES_HPP