linear.hpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
  5. // This file was modified by Oracle on 2015, 2016.
  6. // Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
  7. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
  8. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  9. // Distributed under the Boost Software License, Version 1.0.
  10. // (See accompanying file LICENSE_1_0.txt or copy at
  11. // http://www.boost.org/LICENSE_1_0.txt)
  12. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_LINEAR_HPP
  13. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_LINEAR_HPP
  14. #include <boost/geometry/core/cs.hpp>
  15. #include <boost/geometry/core/tags.hpp>
  16. #include <boost/geometry/iterators/segment_iterator.hpp>
  17. #include <boost/geometry/algorithms/detail/envelope/range.hpp>
  18. #include <boost/geometry/algorithms/dispatch/envelope.hpp>
  19. namespace boost { namespace geometry
  20. {
  21. #ifndef DOXYGEN_NO_DETAIL
  22. namespace detail { namespace envelope
  23. {
  24. struct envelope_linestring_or_ring_on_spheroid
  25. {
  26. template <typename LinestringRing, typename Box, typename Strategy>
  27. static inline void apply(LinestringRing const& linestring_or_ring,
  28. Box& mbr,
  29. Strategy const& strategy)
  30. {
  31. envelope_range::apply(geometry::segments_begin(linestring_or_ring),
  32. geometry::segments_end(linestring_or_ring),
  33. mbr,
  34. strategy);
  35. }
  36. };
  37. }} // namespace detail::envelope
  38. #endif // DOXYGEN_NO_DETAIL
  39. #ifndef DOXYGEN_NO_DISPATCH
  40. namespace dispatch
  41. {
  42. template <typename Linestring, typename CS_Tag>
  43. struct envelope<Linestring, linestring_tag, CS_Tag>
  44. : detail::envelope::envelope_range
  45. {};
  46. template <typename Linestring>
  47. struct envelope<Linestring, linestring_tag, spherical_equatorial_tag>
  48. : detail::envelope::envelope_linestring_or_ring_on_spheroid
  49. {};
  50. template <typename Linestring>
  51. struct envelope<Linestring, linestring_tag, geographic_tag>
  52. : detail::envelope::envelope_linestring_or_ring_on_spheroid
  53. {};
  54. template <typename MultiLinestring, typename CS_Tag>
  55. struct envelope
  56. <
  57. MultiLinestring, multi_linestring_tag, CS_Tag
  58. > : detail::envelope::envelope_multi_range
  59. <
  60. detail::envelope::envelope_range
  61. >
  62. {};
  63. template <typename MultiLinestring>
  64. struct envelope
  65. <
  66. MultiLinestring, multi_linestring_tag, spherical_equatorial_tag
  67. > : detail::envelope::envelope_multi_range_on_spheroid
  68. <
  69. detail::envelope::envelope_linestring_or_ring_on_spheroid
  70. >
  71. {};
  72. template <typename MultiLinestring>
  73. struct envelope
  74. <
  75. MultiLinestring, multi_linestring_tag, geographic_tag
  76. > : detail::envelope::envelope_multi_range_on_spheroid
  77. <
  78. detail::envelope::envelope_linestring_or_ring_on_spheroid
  79. >
  80. {};
  81. } // namespace dispatch
  82. #endif // DOXYGEN_NO_DISPATCH
  83. }} // namespace boost::geometry
  84. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_LINEAR_HPP