]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/geometry/strategies/cartesian/index.hpp
buildsys: change download over to reef release
[ceph.git] / ceph / src / boost / boost / geometry / strategies / cartesian / index.hpp
CommitLineData
92f5a8d4
TL
1// Boost.Geometry Index
2//
3// R-tree strategies
4//
20effc67 5// Copyright (c) 2019-2020, Oracle and/or its affiliates.
92f5a8d4
TL
6// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7//
8// Use, modification and distribution is subject to the Boost Software License,
9// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10// http://www.boost.org/LICENSE_1_0.txt)
11
12#ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_INDEX_HPP
13#define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_INDEX_HPP
14
15
20effc67
TL
16#include <boost/geometry/strategy/cartesian/envelope_box.hpp>
17#include <boost/geometry/strategy/cartesian/envelope_point.hpp>
18#include <boost/geometry/strategy/cartesian/envelope_segment.hpp>
19#include <boost/geometry/strategy/cartesian/expand_box.hpp>
20#include <boost/geometry/strategy/cartesian/expand_point.hpp>
21#include <boost/geometry/strategy/cartesian/expand_segment.hpp>
22
92f5a8d4
TL
23#include <boost/geometry/strategies/cartesian/box_in_box.hpp>
24#include <boost/geometry/strategies/cartesian/disjoint_box_box.hpp>
25//#include <boost/geometry/strategies/cartesian/disjoint_segment_box.hpp>
26#include <boost/geometry/strategies/cartesian/distance_projected_point.hpp>
27#include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
28#include <boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp>
29#include <boost/geometry/strategies/cartesian/distance_segment_box.hpp>
92f5a8d4
TL
30#include <boost/geometry/strategies/cartesian/intersection.hpp>
31#include <boost/geometry/strategies/cartesian/point_in_box.hpp>
32#include <boost/geometry/strategies/cartesian/point_in_point.hpp>
33#include <boost/geometry/strategies/cartesian/point_in_poly_winding.hpp>
34
35#include <boost/geometry/strategies/index.hpp>
36
37
38namespace boost { namespace geometry { namespace strategy { namespace index
39{
40
41template
42<
43 typename CalculationType = void
44>
45struct cartesian
46{
47 typedef cartesian_tag cs_tag;
48
49 typedef geometry::strategy::envelope::cartesian_point envelope_point_strategy_type;
50 typedef geometry::strategy::envelope::cartesian_box envelope_box_strategy_type;
51 typedef geometry::strategy::envelope::cartesian_segment
52 <
53 CalculationType
54 > envelope_segment_strategy_type;
55
56 static inline envelope_segment_strategy_type get_envelope_segment_strategy()
57 {
58 return envelope_segment_strategy_type();
59 }
60
61 typedef geometry::strategy::expand::cartesian_point expand_point_strategy_type;
62 typedef geometry::strategy::expand::cartesian_box expand_box_strategy_type;
63 typedef geometry::strategy::expand::cartesian_segment expand_segment_strategy_type;
64
65 static inline expand_segment_strategy_type get_expand_segment_strategy()
66 {
67 return expand_segment_strategy_type();
68 }
69
70 typedef geometry::strategy::covered_by::cartesian_point_box covered_by_point_box_strategy_type;
71 typedef geometry::strategy::covered_by::cartesian_box_box covered_by_box_box_strategy_type;
72 typedef geometry::strategy::within::cartesian_point_point within_point_point_strategy_type;
73 /*
74 typedef geometry::strategy::within::cartesian_point_box within_point_box_strategy_type;
75 typedef geometry::strategy::within::cartesian_box_box within_box_box_strategy_type;
76 typedef geometry::strategy::within::cartesian_winding
77 <
78 void, void, CalculationType
79 > within_point_segment_strategy_type;
80
81 static inline within_point_segment_strategy_type get_within_point_segment_strategy()
82 {
83 return within_point_segment_strategy_type();
84 }
85 */
86
87 // used in equals(Seg, Seg) but only to get_point_in_point_strategy()
88 typedef geometry::strategy::intersection::cartesian_segments
89 <
90 CalculationType
91 > relate_segment_segment_strategy_type;
92
93 static inline relate_segment_segment_strategy_type get_relate_segment_segment_strategy()
94 {
95 return relate_segment_segment_strategy_type();
96 }
97
98 // used in intersection_content
99 typedef geometry::strategy::disjoint::cartesian_box_box disjoint_box_box_strategy_type;
100
101 typedef geometry::strategy::distance::comparable::pythagoras
102 <
103 CalculationType
104 > comparable_distance_point_point_strategy_type;
105
106 static inline comparable_distance_point_point_strategy_type get_comparable_distance_point_point_strategy()
107 {
108 return comparable_distance_point_point_strategy_type();
109 }
110
111 typedef geometry::strategy::distance::comparable::pythagoras_point_box
112 <
113 CalculationType
114 > comparable_distance_point_box_strategy_type;
115
116 static inline comparable_distance_point_box_strategy_type get_comparable_distance_point_box_strategy()
117 {
118 return comparable_distance_point_box_strategy_type();
119 }
120
121 // TODO: comparable version should be possible
122 typedef geometry::strategy::distance::projected_point
123 <
124 CalculationType,
125 geometry::strategy::distance::pythagoras<CalculationType>
126 > comparable_distance_point_segment_strategy_type;
127
128 static inline comparable_distance_point_segment_strategy_type get_comparable_distance_point_segment_strategy()
129 {
130 return comparable_distance_point_segment_strategy_type();
131 }
132
133 typedef geometry::strategy::distance::cartesian_segment_box
134 <
135 CalculationType,
136 geometry::strategy::distance::pythagoras<CalculationType>
137 > comparable_distance_segment_box_strategy_type;
138
139 static inline comparable_distance_segment_box_strategy_type get_comparable_distance_segment_box_strategy()
140 {
141 return comparable_distance_segment_box_strategy_type();
142 }
143};
144
145
146namespace services
147{
148
149template <typename Geometry>
150struct default_strategy<Geometry, cartesian_tag>
151{
152 typedef cartesian<> type;
153};
154
155
156// within and relate (MPt, Mls/MPoly)
157template <typename Point1, typename Point2, typename CalculationType>
158struct from_strategy<within::cartesian_winding<Point1, Point2, CalculationType> >
159{
160 typedef strategy::index::cartesian<CalculationType> type;
161
162 static inline type get(within::cartesian_winding<Point1, Point2, CalculationType> const&)
163 {
164 return type();
165 }
166};
167
168// distance (MPt, MPt)
169template <typename CalculationType>
170struct from_strategy<distance::comparable::pythagoras<CalculationType> >
171{
172 typedef strategy::index::cartesian<CalculationType> type;
173
174 static inline type get(distance::comparable::pythagoras<CalculationType> const&)
175 {
176 return type();
177 }
178};
179
180// distance (MPt, Linear/Areal)
181template <typename CalculationType, typename PPStrategy>
182struct from_strategy<distance::projected_point<CalculationType, PPStrategy> >
183{
184 typedef strategy::index::cartesian<CalculationType> type;
185
186 static inline type get(distance::projected_point<CalculationType, PPStrategy> const&)
187 {
188 return type();
189 }
190};
191
192
193} // namespace services
194
195
196}}}} // namespace boost::geometry::strategy::index
197
198#endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_INDEX_HPP