Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:30:32

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2013-2024.
0008 // Modifications copyright (c) 2013-2024, Oracle and/or its affiliates.
0009 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0010 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0011 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0012 
0013 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0014 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0015 
0016 // Use, modification and distribution is subject to the Boost Software License,
0017 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0018 // http://www.boost.org/LICENSE_1_0.txt)
0019 
0020 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTS_IMPLEMENTATION_HPP
0021 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTS_IMPLEMENTATION_HPP
0022 
0023 
0024 #include <deque>
0025 
0026 #include <boost/geometry/algorithms/detail/intersects/interface.hpp>
0027 #include <boost/geometry/algorithms/detail/disjoint/implementation.hpp>
0028 
0029 #include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
0030 #include <boost/geometry/policies/disjoint_interrupt_policy.hpp>
0031 
0032 #include <boost/geometry/strategies/relate/services.hpp>
0033 
0034 
0035 namespace boost { namespace geometry
0036 {
0037 
0038 #ifndef DOXYGEN_NO_DETAIL
0039 namespace detail { namespace intersects
0040 {
0041 
0042 template <typename Geometry>
0043 struct self_intersects
0044 {
0045     static bool apply(Geometry const& geometry)
0046     {
0047         concepts::check<Geometry const>();
0048 
0049         using point_type = geometry::point_type_t<Geometry>;
0050         using strategy_type = typename strategies::relate::services::default_strategy
0051                 <
0052                     Geometry, Geometry
0053                 >::type;
0054 
0055         using turn_info = detail::overlay::turn_info<point_type>;
0056 
0057         std::deque<turn_info> turns;
0058 
0059         using turn_policy = detail::overlay::get_turn_info
0060             <
0061                 detail::overlay::assign_null_policy
0062             >;
0063 
0064         strategy_type strategy;
0065 
0066         detail::disjoint::disjoint_interrupt_policy policy;
0067     // TODO: skip_adjacent should be set to false
0068         detail::self_get_turn_points::get_turns
0069             <
0070                 false, turn_policy
0071             >::apply(geometry, strategy, turns, policy, 0, true);
0072         return policy.has_intersections;
0073     }
0074 };
0075 
0076 }} // namespace detail::intersects
0077 #endif // DOXYGEN_NO_DETAIL
0078 
0079 }} // namespace boost::geometry
0080 
0081 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTS_IMPLEMENTATION_HPP