• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 
3 // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
6 // Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.
7 
8 // This file was modified by Oracle on 2013-2014.
9 // Modifications copyright (c) 2013-2014, Oracle and/or its affiliates.
10 
11 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
12 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
13 
14 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
15 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
16 
17 // Use, modification and distribution is subject to the Boost Software License,
18 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
19 // http://www.boost.org/LICENSE_1_0.txt)
20 
21 #ifndef BOOST_GEOMETRY_ALGORITHMS_POLICIES_DISJOINT_INTERRUPT_POLICY_HPP
22 #define BOOST_GEOMETRY_ALGORITHMS_POLICIES_DISJOINT_INTERRUPT_POLICY_HPP
23 
24 #include <boost/range.hpp>
25 
26 
27 namespace boost { namespace geometry
28 {
29 
30 
31 #ifndef DOXYGEN_NO_DETAIL
32 namespace detail { namespace disjoint
33 {
34 
35 
36 struct disjoint_interrupt_policy
37 {
38     static bool const enabled = true;
39     bool has_intersections;
40 
disjoint_interrupt_policyboost::geometry::detail::disjoint::disjoint_interrupt_policy41     inline disjoint_interrupt_policy()
42         : has_intersections(false)
43     {}
44 
45     template <typename Range>
applyboost::geometry::detail::disjoint::disjoint_interrupt_policy46     inline bool apply(Range const& range)
47     {
48         // If there is any IP in the range, it is NOT disjoint
49         if (boost::size(range) > 0)
50         {
51             has_intersections = true;
52             return true;
53         }
54         return false;
55     }
56 };
57 
58 
59 
60 }} // namespace detail::disjoint
61 #endif // DOXYGEN_NO_DETAIL
62 
63 
64 }} // namespace boost::geometry
65 
66 
67 #endif // BOOST_GEOMETRY_ALGORITHMS_POLICIES_DISJOINT_INTERRUPT_POLICY_HPP
68