area.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
  6. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  7. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  8. // Use, modification and distribution is subject to the Boost Software License,
  9. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  10. // http://www.boost.org/LICENSE_1_0.txt)
  11. #ifndef BOOST_GEOMETRY_STRATEGIES_AREA_HPP
  12. #define BOOST_GEOMETRY_STRATEGIES_AREA_HPP
  13. #include <boost/geometry/core/coordinate_type.hpp>
  14. #include <boost/geometry/util/select_most_precise.hpp>
  15. #include <boost/mpl/assert.hpp>
  16. namespace boost { namespace geometry
  17. {
  18. namespace strategy { namespace area
  19. {
  20. #ifndef DOXYGEN_NO_DETAIL
  21. namespace detail
  22. {
  23. // If user specified a CalculationType, use that type, whatever it is
  24. // and whatever the Geometry is.
  25. // Else, use Geometry's coordinate-type promoted to double if needed.
  26. template
  27. <
  28. typename Geometry,
  29. typename CalculationType
  30. >
  31. struct result_type
  32. {
  33. typedef CalculationType type;
  34. };
  35. template
  36. <
  37. typename Geometry
  38. >
  39. struct result_type<Geometry, void>
  40. : select_most_precise
  41. <
  42. typename coordinate_type<Geometry>::type,
  43. double
  44. >
  45. {};
  46. } // namespace detail
  47. #endif // DOXYGEN_NO_DETAIL
  48. namespace services
  49. {
  50. /*!
  51. \brief Traits class binding a default area strategy to a coordinate system
  52. \ingroup area
  53. \tparam Tag tag of coordinate system
  54. */
  55. template <typename Tag>
  56. struct default_strategy
  57. {
  58. BOOST_MPL_ASSERT_MSG
  59. (
  60. false, NOT_IMPLEMENTED_FOR_THIS_COORDINATE_SYSTEM
  61. , (types<Tag>)
  62. );
  63. };
  64. } // namespace services
  65. }} // namespace strategy::area
  66. }} // namespace boost::geometry
  67. #endif // BOOST_GEOMETRY_STRATEGIES_AREA_HPP