Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:07

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2018-2020.
0006 // Modifications copyright (c) 2018-2020 Oracle and/or its affiliates.
0007 
0008 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0009 
0010 // Use, modification and distribution is subject to the Boost Software License,
0011 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0012 // http://www.boost.org/LICENSE_1_0.txt)
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 }} // namespace detail::overlay
0063 #endif // DOXYGEN_NO_DETAIL
0064 
0065 
0066 
0067 }} // namespace boost::geometry
0068 
0069 
0070 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPLICATES_HPP