Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:06

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-2020.
0008 // Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
0009 
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 #include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
0032 
0033 #include <boost/geometry/strategies/relate/services.hpp>
0034 
0035 
0036 namespace boost { namespace geometry
0037 {
0038 
0039 #ifndef DOXYGEN_NO_DETAIL
0040 namespace detail { namespace intersects
0041 {
0042 
0043 template <typename Geometry>
0044 struct self_intersects
0045 {
0046     static bool apply(Geometry const& geometry)
0047     {
0048         concepts::check<Geometry const>();
0049 
0050         typedef typename geometry::point_type<Geometry>::type point_type;
0051         typedef typename strategies::relate::services::default_strategy
0052                 <
0053                     Geometry, Geometry
0054                 >::type strategy_type;
0055 
0056         typedef detail::overlay::turn_info<point_type> turn_info;
0057 
0058         std::deque<turn_info> turns;
0059 
0060         typedef detail::overlay::get_turn_info
0061             <
0062                 detail::overlay::assign_null_policy
0063             > turn_policy;
0064 
0065         strategy_type strategy;
0066 
0067         detail::disjoint::disjoint_interrupt_policy policy;
0068     // TODO: skip_adjacent should be set to false
0069         detail::self_get_turn_points::get_turns
0070             <
0071                 false, turn_policy
0072             >::apply(geometry, strategy, detail::no_rescale_policy(), turns, policy, 0, true);
0073         return policy.has_intersections;
0074     }
0075 };
0076 
0077 }} // namespace detail::intersects
0078 #endif // DOXYGEN_NO_DETAIL
0079 
0080 }} // namespace boost::geometry
0081 
0082 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTS_IMPLEMENTATION_HPP