1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands.
5 // This file was modified by Oracle on 2015.
6 // Modifications copyright (c) 2015, Oracle and/or its affiliates.
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
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)
14 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_FUNCTIONS_HPP
15 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_FUNCTIONS_HPP
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>
23 namespace boost { namespace geometry
26 #ifndef DOXYGEN_NO_DETAIL
27 namespace detail { namespace section
32 std::size_t Dimension,
37 static inline bool preceding(int dir, Point const& point,
38 RobustBox const& robust_box,
39 RobustPolicy const& robust_policy)
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));
49 std::size_t Dimension,
54 static inline bool exceeding(int dir, Point const& point,
55 RobustBox const& robust_box,
56 RobustPolicy const& robust_policy)
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));
65 }} // namespace detail::section
69 }} // namespace boost::geometry
71 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_FUNCTIONS_HPP