area.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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_MULTI_ALGORITHMS_AREA_HPP
  11. #define BOOST_GEOMETRY_MULTI_ALGORITHMS_AREA_HPP
  12. #include <boost/range/metafunctions.hpp>
  13. #include <boost/geometry/algorithms/area.hpp>
  14. #include <boost/geometry/multi/core/tags.hpp>
  15. #include <boost/geometry/multi/core/point_type.hpp>
  16. #include <boost/geometry/multi/geometries/concepts/check.hpp>
  17. #include <boost/geometry/multi/algorithms/detail/multi_sum.hpp>
  18. #include <boost/geometry/multi/algorithms/num_points.hpp>
  19. namespace boost { namespace geometry
  20. {
  21. #ifndef DOXYGEN_NO_DISPATCH
  22. namespace dispatch
  23. {
  24. template <typename MultiGeometry>
  25. struct area<MultiGeometry, multi_polygon_tag> : detail::multi_sum
  26. {
  27. template <typename Strategy>
  28. static inline typename Strategy::return_type
  29. apply(MultiGeometry const& multi, Strategy const& strategy)
  30. {
  31. return multi_sum::apply
  32. <
  33. typename Strategy::return_type,
  34. area<typename boost::range_value<MultiGeometry>::type>
  35. >(multi, strategy);
  36. }
  37. };
  38. } // namespace dispatch
  39. #endif
  40. }} // namespace boost::geometry
  41. #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_AREA_HPP