area.hpp 2.1 KB

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