]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Boost.Geometry (aka GGL, Generic Geometry Library) |
2 | ||
3 | // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. | |
4 | // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. | |
5 | // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. | |
6 | // Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland | |
7 | ||
1e59de90 TL |
8 | // This file was modified by Oracle on 2013-2021. |
9 | // Modifications copyright (c) 2013-2021, Oracle and/or its affiliates. | |
7c673cae FG |
10 | // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle |
11 | // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle | |
12 | ||
13 | // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library | |
14 | // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. | |
15 | ||
16 | // Use, modification and distribution is subject to the Boost Software License, | |
17 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
18 | // http://www.boost.org/LICENSE_1_0.txt) | |
19 | ||
20 | #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_BOX_HPP | |
21 | #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_BOX_HPP | |
22 | ||
23 | #include <cstddef> | |
24 | ||
1e59de90 TL |
25 | #include <boost/geometry/algorithms/dispatch/disjoint.hpp> |
26 | ||
7c673cae FG |
27 | #include <boost/geometry/core/access.hpp> |
28 | #include <boost/geometry/core/coordinate_dimension.hpp> | |
29 | #include <boost/geometry/core/tags.hpp> | |
30 | ||
1e59de90 | 31 | #include <boost/geometry/strategies/detail.hpp> |
7c673cae FG |
32 | |
33 | namespace boost { namespace geometry | |
34 | { | |
35 | ||
36 | #ifndef DOXYGEN_NO_DETAIL | |
37 | namespace detail { namespace disjoint | |
38 | { | |
39 | ||
40 | ||
41 | /*! | |
42 | \brief Internal utility function to detect if point/box are disjoint | |
43 | */ | |
1e59de90 TL |
44 | template |
45 | < | |
46 | typename Point, typename Box, typename Strategy, | |
47 | std::enable_if_t<strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0 | |
48 | > | |
49 | inline bool disjoint_point_box(Point const& point, Box const& box, | |
50 | Strategy const& strategy) | |
51 | { | |
52 | typedef decltype(strategy.covered_by(point, box)) strategy_type; | |
53 | // ! covered_by(point, box) | |
54 | return ! strategy_type::apply(point, box); | |
55 | } | |
56 | ||
57 | template | |
58 | < | |
59 | typename Point, typename Box, typename Strategy, | |
60 | std::enable_if_t<! strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0 | |
61 | > | |
62 | inline bool disjoint_point_box(Point const& point, Box const& box, | |
63 | Strategy const& ) | |
7c673cae FG |
64 | { |
65 | // ! covered_by(point, box) | |
92f5a8d4 | 66 | return ! Strategy::apply(point, box); |
7c673cae FG |
67 | } |
68 | ||
69 | ||
70 | }} // namespace detail::disjoint | |
71 | #endif // DOXYGEN_NO_DETAIL | |
72 | ||
73 | ||
74 | #ifndef DOXYGEN_NO_DISPATCH | |
75 | namespace dispatch | |
76 | { | |
77 | ||
78 | ||
79 | template <typename Point, typename Box, std::size_t DimensionCount> | |
80 | struct disjoint<Point, Box, DimensionCount, point_tag, box_tag, false> | |
81 | { | |
b32b8144 | 82 | template <typename Strategy> |
1e59de90 TL |
83 | static inline bool apply(Point const& point, Box const& box, |
84 | Strategy const& strategy) | |
7c673cae | 85 | { |
1e59de90 | 86 | typedef decltype(strategy.covered_by(point, box)) strategy_type; |
7c673cae | 87 | // ! covered_by(point, box) |
1e59de90 | 88 | return ! strategy_type::apply(point, box); |
7c673cae FG |
89 | } |
90 | }; | |
91 | ||
92 | ||
93 | } // namespace dispatch | |
94 | #endif // DOXYGEN_NO_DISPATCH | |
95 | ||
96 | }} // namespace boost::geometry | |
97 | ||
98 | #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_BOX_HPP |