1 // Boost.Geometry (aka GGL, Generic Geometry Library)
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 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
8 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
9 // (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)
15 #ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
16 #define BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
21 #include <boost/concept/requires.hpp>
23 #include <boost/geometry/core/tags.hpp>
24 #include <boost/geometry/geometries/concepts/point_concept.hpp>
26 #include <boost/config.hpp>
27 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
28 #include <initializer_list>
31 namespace boost { namespace geometry
39 \brief multi_point, a collection of points
41 \tparam Point \tparam_point
42 \tparam Container \tparam_container
43 \tparam Allocator \tparam_allocator
44 \details Multipoint can be used to group points belonging to each other,
45 e.g. a constellation, or the result set of an intersection
47 \qbk{[include reference/geometries/multi_point.qbk]}
50 [link geometry.reference.concepts.concept_multi_point MultiPoint Concept]
56 template<typename, typename> class Container = std::vector,
57 template<typename> class Allocator = std::allocator
59 class multi_point : public Container<Point, Allocator<Point> >
61 BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
63 typedef Container<Point, Allocator<Point> > base_type;
66 /// \constructor_default{multi_point}
71 /// \constructor_begin_end{multi_point}
72 template <typename Iterator>
73 inline multi_point(Iterator begin, Iterator end)
74 : base_type(begin, end)
77 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
79 /// \constructor_initializer_list{multi_point}
80 inline multi_point(std::initializer_list<Point> l)
81 : base_type(l.begin(), l.end())
84 // Commented out for now in order to support Boost.Assign
85 // Without this assignment operator first the object should be created
86 // from initializer list, then it shoudl be moved.
87 //// Without this workaround in MSVC the assignment operator is ambiguous
89 // /// \assignment_initializer_list{multi_point}
90 // inline multi_point & operator=(std::initializer_list<Point> l)
92 // base_type::assign(l.begin(), l.end());
103 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
110 template<typename, typename> class Container,
111 template<typename> class Allocator
113 struct tag< model::multi_point<Point, Container, Allocator> >
115 typedef multi_point_tag type;
118 } // namespace traits
119 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
121 }} // namespace boost::geometry
123 #endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP