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, 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
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/mpl/assert.hpp>
23 #include <boost/geometry/core/cs.hpp>
24 #include <boost/geometry/core/tag_cast.hpp>
25 #include <boost/geometry/core/tags.hpp>
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>
32 namespace boost { namespace geometry
35 namespace strategy { namespace within
39 #ifndef DOXYGEN_NO_DETAIL
47 typename PointOfSegment,
48 typename CalculationType,
49 typename CSTag = typename tag_cast
51 typename cs_tag<Point>::type,
55 struct winding_base_type
57 BOOST_MPL_ASSERT_MSG(false,
58 NOT_IMPLEMENTED_FOR_THIS_COORDINATE_SYSTEM,
62 template <typename Point, typename PointOfSegment, typename CalculationType>
63 struct winding_base_type<Point, PointOfSegment, CalculationType, cartesian_tag>
65 typedef within::cartesian_winding<Point, PointOfSegment, CalculationType> type;
68 template <typename Point, typename PointOfSegment, typename CalculationType>
69 struct winding_base_type<Point, PointOfSegment, CalculationType, spherical_tag>
71 typedef within::detail::spherical_winding_base
75 typename strategy::side::services::default_strategy
77 typename cs_tag<Point>::type
85 #endif // DOXYGEN_NO_DETAIL
89 \brief Within detection using winding rule. Side strategy used internally is
90 choosen based on Point's coordinate system.
92 \tparam Point \tparam_point
93 \tparam PointOfSegment \tparam_segment_point
94 \tparam CalculationType \tparam_calculation
98 [link geometry.reference.algorithms.within.within_3_with_strategy within (with strategy)]
104 typename PointOfSegment = Point,
105 typename CalculationType = void
108 : public within::detail::winding_base_type
110 Point, PointOfSegment, CalculationType
113 typedef typename within::detail::winding_base_type
115 Point, PointOfSegment, CalculationType
121 template <typename Model>
122 explicit winding(Model const& model)
128 }} // namespace strategy::within
131 }} // namespace boost::geometry
134 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP