1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 
5 // Use, modification and distribution is subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 
9 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICHMENT_INFO_HPP
10 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICHMENT_INFO_HPP
11 
12 #include <boost/geometry/algorithms/detail/signed_size_type.hpp>
13 
14 
15 namespace boost { namespace geometry
16 {
17 
18 
19 #ifndef DOXYGEN_NO_DETAIL
20 namespace detail { namespace overlay
21 {
22 
23 
24 /*!
25 \brief Keeps info to enrich intersection info (per source)
26 \details Class to keep information necessary for traversal phase (a phase
27     of the overlay process). The information is gathered during the
28     enrichment phase
29  */
30 template<typename Point>
31 struct enrichment_info
32 {
enrichment_infoboost::geometry::detail::overlay::enrichment_info33     inline enrichment_info()
34         : travels_to_vertex_index(-1)
35         , travels_to_ip_index(-1)
36         , next_ip_index(-1)
37         , startable(true)
38         , prefer_start(true)
39         , count_left(0)
40         , count_right(0)
41         , rank(-1)
42         , zone(-1)
43         , region_id(-1)
44         , isolated(false)
45     {}
46 
get_next_turn_indexboost::geometry::detail::overlay::enrichment_info47     inline signed_size_type get_next_turn_index() const
48     {
49         return next_ip_index == -1 ? travels_to_ip_index : next_ip_index;
50     }
51 
52     // vertex to which is free travel after this IP,
53     // so from "segment_index+1" to "travels_to_vertex_index", without IP-s,
54     // can be -1
55     signed_size_type travels_to_vertex_index;
56 
57     // same but now IP index, so "next IP index" but not on THIS segment
58     signed_size_type travels_to_ip_index;
59 
60     // index of next IP on this segment, -1 if there is no one
61     signed_size_type next_ip_index;
62 
63     bool startable; // Can be used to start in traverse
64     bool prefer_start; // Is preferred as starting point (if true)
65 
66     // Counts if polygons left/right of this operation
67     std::size_t count_left;
68     std::size_t count_right;
69     signed_size_type rank; // in cluster
70     signed_size_type zone; // open zone, in cluster
71     signed_size_type region_id;
72     bool isolated;
73 };
74 
75 
76 }} // namespace detail::overlay
77 #endif //DOXYGEN_NO_DETAIL
78 
79 
80 
81 }} // namespace boost::geometry
82 
83 
84 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICHMENT_INFO_HPP
85