]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / geometry / strategies / agnostic / point_in_poly_winding.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
5
6 // This file was modified by Oracle on 2013, 2014, 2016, 2017.
7 // Modifications copyright (c) 2013-2017 Oracle and/or its affiliates.
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
9
10 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
11 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
12
13 // Use, modification and distribution is subject to the Boost Software License,
14 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
16
17 #ifndef BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP
18 #define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP
19
20
21 #include <boost/mpl/assert.hpp>
22
23 #include <boost/geometry/core/cs.hpp>
24 #include <boost/geometry/core/tag_cast.hpp>
25 #include <boost/geometry/core/tags.hpp>
26
27 #include <boost/geometry/strategies/cartesian/point_in_poly_winding.hpp>
28 #include <boost/geometry/strategies/side.hpp>
29 #include <boost/geometry/strategies/spherical/point_in_poly_winding.hpp>
30
31
32 namespace boost { namespace geometry
33 {
34
35 namespace strategy { namespace within
36 {
37
38
39 #ifndef DOXYGEN_NO_DETAIL
40 namespace detail
41 {
42
43
44 template
45 <
46 typename Point,
47 typename PointOfSegment,
48 typename CalculationType,
49 typename CSTag = typename tag_cast
50 <
51 typename cs_tag<Point>::type,
52 spherical_tag
53 >::type
54 >
55 struct winding_base_type
56 {
57 BOOST_MPL_ASSERT_MSG(false,
58 NOT_IMPLEMENTED_FOR_THIS_COORDINATE_SYSTEM,
59 (CSTag));
60 };
61
62 template <typename Point, typename PointOfSegment, typename CalculationType>
63 struct winding_base_type<Point, PointOfSegment, CalculationType, cartesian_tag>
64 {
65 typedef within::cartesian_winding<Point, PointOfSegment, CalculationType> type;
66 };
67
68 template <typename Point, typename PointOfSegment, typename CalculationType>
69 struct winding_base_type<Point, PointOfSegment, CalculationType, spherical_tag>
70 {
71 typedef within::detail::spherical_winding_base
72 <
73 Point,
74 PointOfSegment,
75 typename strategy::side::services::default_strategy
76 <
77 typename cs_tag<Point>::type
78 >::type,
79 CalculationType
80 > type;
81 };
82
83
84 } // namespace detail
85 #endif // DOXYGEN_NO_DETAIL
86
87
88 /*!
89 \brief Within detection using winding rule. Side strategy used internally is
90 choosen based on Point's coordinate system.
91 \ingroup strategies
92 \tparam Point \tparam_point
93 \tparam PointOfSegment \tparam_segment_point
94 \tparam CalculationType \tparam_calculation
95
96 \qbk{
97 [heading See also]
98 [link geometry.reference.algorithms.within.within_3_with_strategy within (with strategy)]
99 }
100 */
101 template
102 <
103 typename Point,
104 typename PointOfSegment = Point,
105 typename CalculationType = void
106 >
107 class winding
108 : public within::detail::winding_base_type
109 <
110 Point, PointOfSegment, CalculationType
111 >::type
112 {
113 typedef typename within::detail::winding_base_type
114 <
115 Point, PointOfSegment, CalculationType
116 >::type base_t;
117
118 public:
119 winding() {}
120
121 template <typename Model>
122 explicit winding(Model const& model)
123 : base_t(model)
124 {}
125 };
126
127
128 }} // namespace strategy::within
129
130
131 }} // namespace boost::geometry
132
133
134 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP