Imported Upstream version 1.57.0
[platform/upstream/boost.git] / boost / geometry / geometries / multi_point.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
6
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
9
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
13
14 #ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
15 #define BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
16
17 #include <memory>
18 #include <vector>
19
20 #include <boost/concept/requires.hpp>
21
22 #include <boost/geometry/core/tags.hpp>
23 #include <boost/geometry/geometries/concepts/point_concept.hpp>
24
25
26 namespace boost { namespace geometry
27 {
28
29 namespace model
30 {
31
32
33 /*!
34 \brief multi_point, a collection of points
35 \ingroup geometries
36 \tparam Point \tparam_point
37 \tparam Container \tparam_container
38 \tparam Allocator \tparam_allocator
39 \details Multipoint can be used to group points belonging to each other,
40         e.g. a constellation, or the result set of an intersection
41 \qbk{before.synopsis,
42 [heading Model of]
43 [link geometry.reference.concepts.concept_multi_point MultiPoint Concept]
44 }
45 */
46 template
47 <
48     typename Point,
49     template<typename, typename> class Container = std::vector,
50     template<typename> class Allocator = std::allocator
51 >
52 class multi_point : public Container<Point, Allocator<Point> >
53 {
54     BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
55
56     typedef Container<Point, Allocator<Point> > base_type;
57
58 public :
59     /// \constructor_default{multi_point}
60     inline multi_point()
61         : base_type()
62     {}
63
64     /// \constructor_begin_end{multi_point}
65     template <typename Iterator>
66     inline multi_point(Iterator begin, Iterator end)
67         : base_type(begin, end)
68     {}
69 };
70
71 } // namespace model
72
73
74 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
75 namespace traits
76 {
77
78 template
79 <
80     typename Point,
81     template<typename, typename> class Container,
82     template<typename> class Allocator
83 >
84 struct tag< model::multi_point<Point, Container, Allocator> >
85 {
86     typedef multi_point_tag type;
87 };
88
89 } // namespace traits
90 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
91
92 }} // namespace boost::geometry
93
94 #endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP