enrichment_info.hpp 2.3 KB

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