1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
6 // This file was modified by Oracle on 2013-2020.
7 // Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
11 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
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)
17 #ifndef BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP
18 #define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP
21 #include <boost/geometry/core/cs.hpp>
22 #include <boost/geometry/core/static_assert.hpp>
23 #include <boost/geometry/core/tag_cast.hpp>
24 #include <boost/geometry/core/tags.hpp>
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>
31 namespace boost { namespace geometry
34 namespace strategy { namespace within
38 #ifndef DOXYGEN_NO_DETAIL
46 typename PointOfSegment,
47 typename CalculationType,
48 typename CSTag = typename tag_cast
50 typename cs_tag<Point>::type,
54 struct winding_base_type
56 BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
57 "Not implemented for this coordinate system.",
58 Point, PointOfSegment, CSTag);
61 template <typename Point, typename PointOfSegment, typename CalculationType>
62 struct winding_base_type<Point, PointOfSegment, CalculationType, cartesian_tag>
64 typedef within::cartesian_winding<void, void, CalculationType> type;
67 template <typename Point, typename PointOfSegment, typename CalculationType>
68 struct winding_base_type<Point, PointOfSegment, CalculationType, spherical_tag>
70 typedef within::detail::spherical_winding_base
72 typename strategy::side::services::default_strategy
74 typename cs_tag<Point>::type
82 #endif // DOXYGEN_NO_DETAIL
86 \brief Within detection using winding rule. Side strategy used internally is
87 choosen based on Point's coordinate system.
89 \tparam Point \tparam_point
90 \tparam PointOfSegment \tparam_segment_point
91 \tparam CalculationType \tparam_calculation
95 [link geometry.reference.algorithms.within.within_3_with_strategy within (with strategy)]
101 typename PointOfSegment = Point,
102 typename CalculationType = void
105 : public within::detail::winding_base_type
107 Point, PointOfSegment, CalculationType
110 typedef typename within::detail::winding_base_type
112 Point, PointOfSegment, CalculationType
118 template <typename Model>
119 explicit winding(Model const& model)
125 }} // namespace strategy::within
128 }} // namespace boost::geometry
131 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP