multi_point.hpp 2.4 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. // 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_POINT_HPP
  11. #define BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POINT_HPP
  12. #include <memory>
  13. #include <vector>
  14. #include <boost/concept/requires.hpp>
  15. #include <boost/geometry/geometries/concepts/point_concept.hpp>
  16. #include <boost/geometry/multi/core/tags.hpp>
  17. namespace boost { namespace geometry
  18. {
  19. namespace model
  20. {
  21. /*!
  22. \brief multi_point, a collection of points
  23. \ingroup geometries
  24. \tparam Point \tparam_point
  25. \tparam Container \tparam_container
  26. \tparam Allocator \tparam_allocator
  27. \details Multipoint can be used to group points belonging to each other,
  28. e.g. a constellation, or the result set of an intersection
  29. \qbk{before.synopsis,
  30. [heading Model of]
  31. [link geometry.reference.concepts.concept_multi_point MultiPoint Concept]
  32. }
  33. */
  34. template
  35. <
  36. typename Point,
  37. template<typename, typename> class Container = std::vector,
  38. template<typename> class Allocator = std::allocator
  39. >
  40. class multi_point : public Container<Point, Allocator<Point> >
  41. {
  42. BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
  43. typedef Container<Point, Allocator<Point> > base_type;
  44. public :
  45. /// \constructor_default{multi_point}
  46. inline multi_point()
  47. : base_type()
  48. {}
  49. /// \constructor_begin_end{multi_point}
  50. template <typename Iterator>
  51. inline multi_point(Iterator begin, Iterator end)
  52. : base_type(begin, end)
  53. {}
  54. };
  55. } // namespace model
  56. #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
  57. namespace traits
  58. {
  59. template
  60. <
  61. typename Point,
  62. template<typename, typename> class Container,
  63. template<typename> class Allocator
  64. >
  65. struct tag< model::multi_point<Point, Container, Allocator> >
  66. {
  67. typedef multi_point_tag type;
  68. };
  69. } // namespace traits
  70. #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
  71. }} // namespace boost::geometry
  72. #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POINT_HPP