]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
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 | ||
20effc67 TL |
6 | // This file was modified by Oracle on 2013-2020. |
7 | // Modifications copyright (c) 2013-2020 Oracle and/or its affiliates. | |
b32b8144 FG |
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 | ||
b32b8144 | 21 | #include <boost/geometry/core/cs.hpp> |
20effc67 | 22 | #include <boost/geometry/core/static_assert.hpp> |
b32b8144 FG |
23 | #include <boost/geometry/core/tag_cast.hpp> |
24 | #include <boost/geometry/core/tags.hpp> | |
25 | ||
26 | #include <boost/geometry/strategies/cartesian/point_in_poly_winding.hpp> | |
27 | #include <boost/geometry/strategies/side.hpp> | |
28 | #include <boost/geometry/strategies/spherical/point_in_poly_winding.hpp> | |
29 | ||
30 | ||
31 | namespace boost { namespace geometry | |
32 | { | |
33 | ||
34 | namespace strategy { namespace within | |
35 | { | |
36 | ||
37 | ||
38 | #ifndef DOXYGEN_NO_DETAIL | |
39 | namespace detail | |
40 | { | |
41 | ||
42 | ||
43 | template | |
44 | < | |
45 | typename Point, | |
46 | typename PointOfSegment, | |
47 | typename CalculationType, | |
48 | typename CSTag = typename tag_cast | |
49 | < | |
50 | typename cs_tag<Point>::type, | |
51 | spherical_tag | |
52 | >::type | |
53 | > | |
54 | struct winding_base_type | |
55 | { | |
20effc67 TL |
56 | BOOST_GEOMETRY_STATIC_ASSERT_FALSE( |
57 | "Not implemented for this coordinate system.", | |
58 | Point, PointOfSegment, CSTag); | |
b32b8144 FG |
59 | }; |
60 | ||
61 | template <typename Point, typename PointOfSegment, typename CalculationType> | |
62 | struct winding_base_type<Point, PointOfSegment, CalculationType, cartesian_tag> | |
63 | { | |
92f5a8d4 | 64 | typedef within::cartesian_winding<void, void, CalculationType> type; |
b32b8144 FG |
65 | }; |
66 | ||
67 | template <typename Point, typename PointOfSegment, typename CalculationType> | |
68 | struct winding_base_type<Point, PointOfSegment, CalculationType, spherical_tag> | |
69 | { | |
70 | typedef within::detail::spherical_winding_base | |
71 | < | |
b32b8144 FG |
72 | typename strategy::side::services::default_strategy |
73 | < | |
74 | typename cs_tag<Point>::type | |
75 | >::type, | |
76 | CalculationType | |
77 | > type; | |
78 | }; | |
79 | ||
80 | ||
81 | } // namespace detail | |
82 | #endif // DOXYGEN_NO_DETAIL | |
83 | ||
84 | ||
85 | /*! | |
86 | \brief Within detection using winding rule. Side strategy used internally is | |
87 | choosen based on Point's coordinate system. | |
88 | \ingroup strategies | |
89 | \tparam Point \tparam_point | |
90 | \tparam PointOfSegment \tparam_segment_point | |
91 | \tparam CalculationType \tparam_calculation | |
92 | ||
93 | \qbk{ | |
94 | [heading See also] | |
95 | [link geometry.reference.algorithms.within.within_3_with_strategy within (with strategy)] | |
96 | } | |
97 | */ | |
98 | template | |
99 | < | |
100 | typename Point, | |
101 | typename PointOfSegment = Point, | |
102 | typename CalculationType = void | |
103 | > | |
104 | class winding | |
105 | : public within::detail::winding_base_type | |
106 | < | |
107 | Point, PointOfSegment, CalculationType | |
108 | >::type | |
109 | { | |
110 | typedef typename within::detail::winding_base_type | |
111 | < | |
112 | Point, PointOfSegment, CalculationType | |
113 | >::type base_t; | |
114 | ||
115 | public: | |
116 | winding() {} | |
117 | ||
118 | template <typename Model> | |
119 | explicit winding(Model const& model) | |
120 | : base_t(model) | |
121 | {} | |
122 | }; | |
123 | ||
124 | ||
125 | }} // namespace strategy::within | |
126 | ||
127 | ||
128 | }} // namespace boost::geometry | |
129 | ||
130 | ||
131 | #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP |