]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategy/cartesian/envelope_point.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / geometry / strategy / cartesian / envelope_point.hpp
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
7 // This file was modified by Oracle on 2015, 2016, 2017, 2018.
8 // Modifications copyright (c) 2015-2018, Oracle and/or its affiliates.
9
10 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
11 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
12 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
13
14 // Distributed under the Boost Software License, Version 1.0.
15 // (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
17
18 #ifndef BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_POINT_HPP
19 #define BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_POINT_HPP
20
21 #include <cstddef>
22
23 #include <boost/geometry/core/access.hpp>
24 #include <boost/geometry/core/cs.hpp>
25 #include <boost/geometry/core/coordinate_dimension.hpp>
26 #include <boost/geometry/core/coordinate_system.hpp>
27 #include <boost/geometry/core/tags.hpp>
28
29 #include <boost/geometry/views/detail/indexed_point_view.hpp>
30
31 #include <boost/geometry/algorithms/detail/convert_point_to_point.hpp>
32
33 #include <boost/geometry/strategy/envelope.hpp>
34
35
36 namespace boost { namespace geometry
37 {
38
39 #ifndef DOXYGEN_NO_DETAIL
40 namespace detail { namespace envelope
41 {
42
43 template <std::size_t Dimension, std::size_t DimensionCount>
44 struct envelope_one_point
45 {
46 template <std::size_t Index, typename Point, typename Box>
47 static inline void apply(Point const& point, Box& mbr)
48 {
49 detail::indexed_point_view<Box, Index> box_corner(mbr);
50 detail::conversion::point_to_point
51 <
52 Point,
53 detail::indexed_point_view<Box, Index>,
54 Dimension,
55 DimensionCount
56 >::apply(point, box_corner);
57 }
58
59 template <typename Point, typename Box>
60 static inline void apply(Point const& point, Box& mbr)
61 {
62 apply<min_corner>(point, mbr);
63 apply<max_corner>(point, mbr);
64 }
65 };
66
67
68 }} // namespace detail::envelope
69 #endif // DOXYGEN_NO_DETAIL
70
71
72 namespace strategy { namespace envelope
73 {
74
75 struct cartesian_point
76 {
77 template <typename Point, typename Box>
78 static inline void apply(Point const& point, Box& mbr)
79 {
80 geometry::detail::envelope::envelope_one_point
81 <
82 0, dimension<Point>::value
83 >::apply(point, mbr);
84 }
85 };
86
87
88 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
89
90 namespace services
91 {
92
93 template <typename CalculationType>
94 struct default_strategy<point_tag, cartesian_tag, CalculationType>
95 {
96 typedef strategy::envelope::cartesian_point type;
97 };
98
99
100 }
101
102 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
103
104
105 }} // namespace strategy::envelope
106
107
108 }} // namespace boost::geometry
109
110
111 #endif // BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_POINT_HPP