multi_polygon.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_GEOMETRIES_MULTI_POLYGON_HPP
  11. #define BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POLYGON_HPP
  12. #include <memory>
  13. #include <vector>
  14. #include <boost/concept/requires.hpp>
  15. #include <boost/geometry/multi/core/tags.hpp>
  16. #include <boost/geometry/geometries/concepts/polygon_concept.hpp>
  17. namespace boost { namespace geometry
  18. {
  19. namespace model
  20. {
  21. /*!
  22. \brief multi_polygon, a collection of polygons
  23. \details Multi-polygon can be used to group polygons belonging to each other,
  24. e.g. Hawaii
  25. \ingroup geometries
  26. \qbk{before.synopsis,
  27. [heading Model of]
  28. [link geometry.reference.concepts.concept_multi_polygon MultiPolygon Concept]
  29. }
  30. */
  31. template
  32. <
  33. typename Polygon,
  34. template<typename, typename> class Container = std::vector,
  35. template<typename> class Allocator = std::allocator
  36. >
  37. class multi_polygon : public Container<Polygon, Allocator<Polygon> >
  38. {
  39. BOOST_CONCEPT_ASSERT( (concept::Polygon<Polygon>) );
  40. };
  41. } // namespace model
  42. #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
  43. namespace traits
  44. {
  45. template
  46. <
  47. typename Polygon,
  48. template<typename, typename> class Container,
  49. template<typename> class Allocator
  50. >
  51. struct tag< model::multi_polygon<Polygon, Container, Allocator> >
  52. {
  53. typedef multi_polygon_tag type;
  54. };
  55. } // namespace traits
  56. #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
  57. }} // namespace boost::geometry
  58. #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POLYGON_HPP