]>
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 | ||
92f5a8d4 TL |
6 | // This file was modified by Oracle on 2013, 2014, 2016, 2017, 2019. |
7 | // Modifications copyright (c) 2013-2019 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 | ||
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 | { | |
92f5a8d4 | 65 | typedef within::cartesian_winding<void, void, CalculationType> type; |
b32b8144 FG |
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 | < | |
b32b8144 FG |
73 | typename strategy::side::services::default_strategy |
74 | < | |
75 | typename cs_tag<Point>::type | |
76 | >::type, | |
77 | CalculationType | |
78 | > type; | |
79 | }; | |
80 | ||
81 | ||
82 | } // namespace detail | |
83 | #endif // DOXYGEN_NO_DETAIL | |
84 | ||
85 | ||
86 | /*! | |
87 | \brief Within detection using winding rule. Side strategy used internally is | |
88 | choosen based on Point's coordinate system. | |
89 | \ingroup strategies | |
90 | \tparam Point \tparam_point | |
91 | \tparam PointOfSegment \tparam_segment_point | |
92 | \tparam CalculationType \tparam_calculation | |
93 | ||
94 | \qbk{ | |
95 | [heading See also] | |
96 | [link geometry.reference.algorithms.within.within_3_with_strategy within (with strategy)] | |
97 | } | |
98 | */ | |
99 | template | |
100 | < | |
101 | typename Point, | |
102 | typename PointOfSegment = Point, | |
103 | typename CalculationType = void | |
104 | > | |
105 | class winding | |
106 | : public within::detail::winding_base_type | |
107 | < | |
108 | Point, PointOfSegment, CalculationType | |
109 | >::type | |
110 | { | |
111 | typedef typename within::detail::winding_base_type | |
112 | < | |
113 | Point, PointOfSegment, CalculationType | |
114 | >::type base_t; | |
115 | ||
116 | public: | |
117 | winding() {} | |
118 | ||
119 | template <typename Model> | |
120 | explicit winding(Model const& model) | |
121 | : base_t(model) | |
122 | {} | |
123 | }; | |
124 | ||
125 | ||
126 | }} // namespace strategy::within | |
127 | ||
128 | ||
129 | }} // namespace boost::geometry | |
130 | ||
131 | ||
132 | #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP |