default_distance_result.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_DEFAULT_DISTANCE_RESULT_HPP
  11. #define BOOST_GEOMETRY_STRATEGIES_DEFAULT_DISTANCE_RESULT_HPP
  12. #include <boost/geometry/core/cs.hpp>
  13. #include <boost/geometry/core/point_type.hpp>
  14. #include <boost/geometry/strategies/distance.hpp>
  15. namespace boost { namespace geometry
  16. {
  17. /*!
  18. \brief Meta-function defining return type of distance function
  19. \ingroup distance
  20. \note The strategy defines the return-type (so this situation is different
  21. from length, where distance is sqr/sqrt, but length always squared)
  22. */
  23. template <typename Geometry1, typename Geometry2 = Geometry1>
  24. struct default_distance_result
  25. {
  26. typedef typename strategy::distance::services::return_type
  27. <
  28. typename strategy::distance::services::default_strategy
  29. <
  30. point_tag,
  31. typename point_type<Geometry1>::type,
  32. typename point_type<Geometry2>::type
  33. >::type,
  34. typename point_type<Geometry1>::type,
  35. typename point_type<Geometry2>::type
  36. >::type type;
  37. };
  38. }} // namespace boost::geometry
  39. #endif // BOOST_GEOMETRY_STRATEGIES_DEFAULT_DISTANCE_RESULT_HPP