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 , count_left(0) 39 , count_right(0) 40 , rank(-1) 41 , zone(-1) 42 , region_id(-1) 43 , isolated(false) 44 {} 45 get_next_turn_indexboost::geometry::detail::overlay::enrichment_info46 inline signed_size_type get_next_turn_index() const 47 { 48 return next_ip_index == -1 ? travels_to_ip_index : next_ip_index; 49 } 50 51 // vertex to which is free travel after this IP, 52 // so from "segment_index+1" to "travels_to_vertex_index", without IP-s, 53 // can be -1 54 signed_size_type travels_to_vertex_index; 55 56 // same but now IP index, so "next IP index" but not on THIS segment 57 signed_size_type travels_to_ip_index; 58 59 // index of next IP on this segment, -1 if there is no one 60 signed_size_type next_ip_index; 61 62 bool startable; // Can be used to start in traverse 63 64 // Counts if polygons left/right of this operation 65 std::size_t count_left; 66 std::size_t count_right; 67 signed_size_type rank; // in cluster 68 signed_size_type zone; // open zone, in cluster 69 signed_size_type region_id; 70 bool isolated; 71 }; 72 73 74 }} // namespace detail::overlay 75 #endif //DOXYGEN_NO_DETAIL 76 77 78 79 }} // namespace boost::geometry 80 81 82 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICHMENT_INFO_HPP 83