Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:41

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 = typename tag_cast
0049                         <
0050                             typename cs_tag<Point>::type,
0051                             spherical_tag
0052                         >::type
0053 >
0054 struct winding_base_type
0055 {
0056     BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0057         "Not implemented for this coordinate system.",
0058         Point, PointOfSegment, CSTag);
0059 };
0060 
0061 template <typename Point, typename PointOfSegment, typename CalculationType>
0062 struct winding_base_type<Point, PointOfSegment, CalculationType, cartesian_tag>
0063 {
0064     using type = within::detail::cartesian_winding_base
0065         <
0066             typename strategy::side::services::default_strategy
0067                 <
0068                     typename cs_tag<Point>::type
0069                 >::type,
0070             CalculationType
0071         >;
0072 };
0073 
0074 template <typename Point, typename PointOfSegment, typename CalculationType>
0075 struct winding_base_type<Point, PointOfSegment, CalculationType, spherical_tag>
0076 {
0077     using type = within::detail::spherical_winding_base
0078         <
0079             typename strategy::side::services::default_strategy
0080                 <
0081                     typename cs_tag<Point>::type
0082                 >::type,
0083             CalculationType
0084         >;
0085 };
0086 
0087 
0088 } // namespace detail
0089 #endif // DOXYGEN_NO_DETAIL
0090 
0091 
0092 /*!
0093 \brief Within detection using winding rule. Side strategy used internally is
0094        choosen based on Point's coordinate system.
0095 \ingroup strategies
0096 \tparam Point \tparam_point
0097 \tparam PointOfSegment \tparam_segment_point
0098 \tparam CalculationType \tparam_calculation
0099 
0100 \qbk{
0101 [heading See also]
0102 [link geometry.reference.algorithms.within.within_3_with_strategy within (with strategy)]
0103 }
0104  */
0105 template
0106 <
0107     typename Point,
0108     typename PointOfSegment = Point,
0109     typename CalculationType = void
0110 >
0111 class winding
0112     : public within::detail::winding_base_type
0113         <
0114             Point, PointOfSegment, CalculationType
0115         >::type
0116 {
0117     typedef typename within::detail::winding_base_type
0118         <
0119             Point, PointOfSegment, CalculationType
0120         >::type base_t;
0121 
0122 public:
0123     winding() {}
0124 
0125     template <typename Model>
0126     explicit winding(Model const& model)
0127         : base_t(model)
0128     {}
0129 };
0130 
0131 
0132 }} // namespace strategy::within
0133 
0134 
0135 }} // namespace boost::geometry
0136 
0137 
0138 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP