distance.hpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  6. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  7. // Use, modification and distribution is subject to the Boost Software License,
  8. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. #ifndef BOOST_GEOMETRY_STRATEGIES_DISTANCE_HPP
  11. #define BOOST_GEOMETRY_STRATEGIES_DISTANCE_HPP
  12. #include <boost/mpl/assert.hpp>
  13. #include <boost/geometry/core/cs.hpp>
  14. #include <boost/geometry/strategies/tags.hpp>
  15. namespace boost { namespace geometry
  16. {
  17. namespace strategy { namespace distance { namespace services
  18. {
  19. template <typename Strategy> struct tag {};
  20. template <typename Strategy, typename P1, typename P2>
  21. struct return_type
  22. {
  23. BOOST_MPL_ASSERT_MSG
  24. (
  25. false, NOT_IMPLEMENTED_FOR_THIS_STRATEGY, (types<Strategy, P1, P2>)
  26. );
  27. };
  28. template <typename Strategy> struct comparable_type
  29. {
  30. BOOST_MPL_ASSERT_MSG
  31. (
  32. false, NOT_IMPLEMENTED_FOR_THIS_STRATEGY, (types<Strategy>)
  33. );
  34. };
  35. template <typename Strategy> struct get_comparable
  36. {
  37. BOOST_MPL_ASSERT_MSG
  38. (
  39. false, NOT_IMPLEMENTED_FOR_THIS_STRATEGY, (types<Strategy>)
  40. );
  41. };
  42. template <typename Strategy, typename P1, typename P2>
  43. struct result_from_distance {};
  44. // For point-segment only:
  45. template <typename Strategy> struct strategy_point_point {};
  46. // Default strategy
  47. /*!
  48. \brief Traits class binding a default strategy for distance
  49. to one (or possibly two) coordinate system(s)
  50. \ingroup distance
  51. \tparam GeometryTag tag (point/segment) for which this strategy is the default
  52. \tparam Point1 first point-type
  53. \tparam Point2 second point-type
  54. \tparam CsTag1 tag of coordinate system of first point type
  55. \tparam CsTag2 tag of coordinate system of second point type
  56. */
  57. template
  58. <
  59. typename GeometryTag,
  60. typename Point1,
  61. typename Point2 = Point1,
  62. typename CsTag1 = typename cs_tag<Point1>::type,
  63. typename CsTag2 = typename cs_tag<Point2>::type,
  64. typename UnderlyingStrategy = void
  65. >
  66. struct default_strategy
  67. {
  68. BOOST_MPL_ASSERT_MSG
  69. (
  70. false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE_COMBINATION
  71. , (types<Point1, Point2, CsTag1, CsTag2>)
  72. );
  73. };
  74. }}} // namespace strategy::distance::services
  75. }} // namespace boost::geometry
  76. #endif // BOOST_GEOMETRY_STRATEGIES_DISTANCE_HPP