]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Boost.Geometry (aka GGL, Generic Geometry Library) |
2 | ||
3 | // Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. | |
4 | ||
5 | // This file was modified by Oracle on 2015. | |
6 | // Modifications copyright (c) 2015, Oracle and/or its affiliates. | |
7 | ||
8 | // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle | |
9 | ||
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_SECTIONS_FUNCTIONS_HPP | |
15 | #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_FUNCTIONS_HPP | |
16 | ||
17 | ||
18 | #include <boost/geometry/core/access.hpp> | |
19 | #include <boost/geometry/algorithms/detail/recalculate.hpp> | |
20 | #include <boost/geometry/policies/robustness/robust_point_type.hpp> | |
21 | ||
22 | ||
23 | namespace boost { namespace geometry | |
24 | { | |
25 | ||
26 | #ifndef DOXYGEN_NO_DETAIL | |
27 | namespace detail { namespace section | |
28 | { | |
29 | ||
30 | template | |
31 | < | |
32 | std::size_t Dimension, | |
33 | typename Point, | |
34 | typename RobustBox, | |
35 | typename RobustPolicy | |
36 | > | |
37 | static inline bool preceding(int dir, Point const& point, | |
38 | RobustBox const& robust_box, | |
39 | RobustPolicy const& robust_policy) | |
40 | { | |
41 | typename geometry::robust_point_type<Point, RobustPolicy>::type robust_point; | |
42 | geometry::recalculate(robust_point, point, robust_policy); | |
43 | return (dir == 1 && get<Dimension>(robust_point) < get<min_corner, Dimension>(robust_box)) | |
44 | || (dir == -1 && get<Dimension>(robust_point) > get<max_corner, Dimension>(robust_box)); | |
45 | } | |
46 | ||
47 | template | |
48 | < | |
49 | std::size_t Dimension, | |
50 | typename Point, | |
51 | typename RobustBox, | |
52 | typename RobustPolicy | |
53 | > | |
54 | static inline bool exceeding(int dir, Point const& point, | |
55 | RobustBox const& robust_box, | |
56 | RobustPolicy const& robust_policy) | |
57 | { | |
58 | typename geometry::robust_point_type<Point, RobustPolicy>::type robust_point; | |
59 | geometry::recalculate(robust_point, point, robust_policy); | |
60 | return (dir == 1 && get<Dimension>(robust_point) > get<max_corner, Dimension>(robust_box)) | |
61 | || (dir == -1 && get<Dimension>(robust_point) < get<min_corner, Dimension>(robust_box)); | |
62 | } | |
63 | ||
64 | ||
65 | }} // namespace detail::section | |
66 | #endif | |
67 | ||
68 | ||
69 | }} // namespace boost::geometry | |
70 | ||
71 | #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_FUNCTIONS_HPP |