Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-13 08:36:16

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
0005 
0006 // This file was modified by Oracle on 2013-2020.
0007 // Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
0008 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0009 
0010 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0011 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0012 
0013 // Use, modification and distribution is subject to the Boost Software License,
0014 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 #ifndef BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP
0018 #define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP
0019 
0020 
0021 #include <boost/geometry/core/cs.hpp>
0022 #include <boost/geometry/core/static_assert.hpp>
0023 #include <boost/geometry/core/tag_cast.hpp>
0024 #include <boost/geometry/core/tags.hpp>
0025 
0026 #include <boost/geometry/strategies/cartesian/point_in_poly_winding.hpp>
0027 #include <boost/geometry/strategies/side.hpp>
0028 #include <boost/geometry/strategies/spherical/point_in_poly_winding.hpp>
0029 
0030 
0031 namespace boost { namespace geometry
0032 {
0033 
0034 namespace strategy { namespace within
0035 {
0036 
0037 
0038 #ifndef DOXYGEN_NO_DETAIL
0039 namespace detail
0040 {
0041 
0042 
0043 template
0044 <
0045     typename Point,
0046     typename PointOfSegment,
0047     typename CalculationType,
0048     typename CSTag = tag_cast_t<cs_tag_t<Point>, spherical_tag>
0049 >
0050 struct winding_base_type
0051 {
0052     BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0053         "Not implemented for this coordinate system.",
0054         Point, PointOfSegment, CSTag);
0055 };
0056 
0057 template <typename Point, typename PointOfSegment, typename CalculationType>
0058 struct winding_base_type<Point, PointOfSegment, CalculationType, cartesian_tag>
0059 {
0060     using type = within::detail::cartesian_winding_base
0061         <
0062             typename strategy::side::services::default_strategy
0063                 <
0064                     cs_tag_t<Point>
0065                 >::type,
0066             CalculationType
0067         >;
0068 };
0069 
0070 template <typename Point, typename PointOfSegment, typename CalculationType>
0071 struct winding_base_type<Point, PointOfSegment, CalculationType, spherical_tag>
0072 {
0073     using type = within::detail::spherical_winding_base
0074         <
0075             typename strategy::side::services::default_strategy<cs_tag_t<Point>>::type,
0076             CalculationType
0077         >;
0078 };
0079 
0080 
0081 } // namespace detail
0082 #endif // DOXYGEN_NO_DETAIL
0083 
0084 
0085 /*!
0086 \brief Within detection using winding rule. Side strategy used internally is
0087        choosen based on Point's coordinate system.
0088 \ingroup strategies
0089 \tparam Point \tparam_point
0090 \tparam PointOfSegment \tparam_segment_point
0091 \tparam CalculationType \tparam_calculation
0092 
0093 \qbk{
0094 [heading See also]
0095 [link geometry.reference.algorithms.within.within_3_with_strategy within (with strategy)]
0096 }
0097  */
0098 template
0099 <
0100     typename Point,
0101     typename PointOfSegment = Point,
0102     typename CalculationType = void
0103 >
0104 class winding
0105     : public within::detail::winding_base_type
0106         <
0107             Point, PointOfSegment, CalculationType
0108         >::type
0109 {
0110     typedef typename within::detail::winding_base_type
0111         <
0112             Point, PointOfSegment, CalculationType
0113         >::type base_t;
0114 
0115 public:
0116     winding() {}
0117 
0118     template <typename Model>
0119     explicit winding(Model const& model)
0120         : base_t(model)
0121     {}
0122 };
0123 
0124 
0125 }} // namespace strategy::within
0126 
0127 
0128 }} // namespace boost::geometry
0129 
0130 
0131 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP