Chris@102
|
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
|
Chris@102
|
2
|
Chris@102
|
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
Chris@102
|
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
Chris@102
|
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
Chris@102
|
6 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
Chris@102
|
7
|
Chris@102
|
8 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
Chris@102
|
9 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
Chris@102
|
10
|
Chris@102
|
11 // Use, modification and distribution is subject to the Boost Software License,
|
Chris@102
|
12 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@102
|
13 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@102
|
14
|
Chris@102
|
15 #ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
|
Chris@102
|
16 #define BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
|
Chris@102
|
17
|
Chris@102
|
18 #include <memory>
|
Chris@102
|
19 #include <vector>
|
Chris@102
|
20
|
Chris@102
|
21 #include <boost/concept/requires.hpp>
|
Chris@102
|
22
|
Chris@102
|
23 #include <boost/geometry/core/tags.hpp>
|
Chris@102
|
24 #include <boost/geometry/geometries/concepts/point_concept.hpp>
|
Chris@102
|
25
|
Chris@102
|
26 #ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST
|
Chris@102
|
27 #include <boost/config.hpp>
|
Chris@102
|
28 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
Chris@102
|
29 #include <initializer_list>
|
Chris@102
|
30 #endif
|
Chris@102
|
31 #endif
|
Chris@102
|
32
|
Chris@102
|
33 namespace boost { namespace geometry
|
Chris@102
|
34 {
|
Chris@102
|
35
|
Chris@102
|
36 namespace model
|
Chris@102
|
37 {
|
Chris@102
|
38
|
Chris@102
|
39
|
Chris@102
|
40 /*!
|
Chris@102
|
41 \brief multi_point, a collection of points
|
Chris@102
|
42 \ingroup geometries
|
Chris@102
|
43 \tparam Point \tparam_point
|
Chris@102
|
44 \tparam Container \tparam_container
|
Chris@102
|
45 \tparam Allocator \tparam_allocator
|
Chris@102
|
46 \details Multipoint can be used to group points belonging to each other,
|
Chris@102
|
47 e.g. a constellation, or the result set of an intersection
|
Chris@102
|
48 \qbk{before.synopsis,
|
Chris@102
|
49 [heading Model of]
|
Chris@102
|
50 [link geometry.reference.concepts.concept_multi_point MultiPoint Concept]
|
Chris@102
|
51 }
|
Chris@102
|
52 */
|
Chris@102
|
53 template
|
Chris@102
|
54 <
|
Chris@102
|
55 typename Point,
|
Chris@102
|
56 template<typename, typename> class Container = std::vector,
|
Chris@102
|
57 template<typename> class Allocator = std::allocator
|
Chris@102
|
58 >
|
Chris@102
|
59 class multi_point : public Container<Point, Allocator<Point> >
|
Chris@102
|
60 {
|
Chris@102
|
61 BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
|
Chris@102
|
62
|
Chris@102
|
63 typedef Container<Point, Allocator<Point> > base_type;
|
Chris@102
|
64
|
Chris@102
|
65 public :
|
Chris@102
|
66 /// \constructor_default{multi_point}
|
Chris@102
|
67 inline multi_point()
|
Chris@102
|
68 : base_type()
|
Chris@102
|
69 {}
|
Chris@102
|
70
|
Chris@102
|
71 /// \constructor_begin_end{multi_point}
|
Chris@102
|
72 template <typename Iterator>
|
Chris@102
|
73 inline multi_point(Iterator begin, Iterator end)
|
Chris@102
|
74 : base_type(begin, end)
|
Chris@102
|
75 {}
|
Chris@102
|
76
|
Chris@102
|
77 #ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST
|
Chris@102
|
78 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
Chris@102
|
79
|
Chris@102
|
80 /// \constructor_initializer_list{multi_point}
|
Chris@102
|
81 inline multi_point(std::initializer_list<Point> l)
|
Chris@102
|
82 : base_type(l.begin(), l.end())
|
Chris@102
|
83 {}
|
Chris@102
|
84
|
Chris@102
|
85 // Commented out for now in order to support Boost.Assign
|
Chris@102
|
86 // Without this assignment operator first the object should be created
|
Chris@102
|
87 // from initializer list, then it shoudl be moved.
|
Chris@102
|
88 //// Without this workaround in MSVC the assignment operator is ambiguous
|
Chris@102
|
89 //#ifndef BOOST_MSVC
|
Chris@102
|
90 // /// \assignment_initializer_list{multi_point}
|
Chris@102
|
91 // inline multi_point & operator=(std::initializer_list<Point> l)
|
Chris@102
|
92 // {
|
Chris@102
|
93 // base_type::assign(l.begin(), l.end());
|
Chris@102
|
94 // return *this;
|
Chris@102
|
95 // }
|
Chris@102
|
96 //#endif
|
Chris@102
|
97
|
Chris@102
|
98 #endif
|
Chris@102
|
99 #endif
|
Chris@102
|
100 };
|
Chris@102
|
101
|
Chris@102
|
102 } // namespace model
|
Chris@102
|
103
|
Chris@102
|
104
|
Chris@102
|
105 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
Chris@102
|
106 namespace traits
|
Chris@102
|
107 {
|
Chris@102
|
108
|
Chris@102
|
109 template
|
Chris@102
|
110 <
|
Chris@102
|
111 typename Point,
|
Chris@102
|
112 template<typename, typename> class Container,
|
Chris@102
|
113 template<typename> class Allocator
|
Chris@102
|
114 >
|
Chris@102
|
115 struct tag< model::multi_point<Point, Container, Allocator> >
|
Chris@102
|
116 {
|
Chris@102
|
117 typedef multi_point_tag type;
|
Chris@102
|
118 };
|
Chris@102
|
119
|
Chris@102
|
120 } // namespace traits
|
Chris@102
|
121 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
Chris@102
|
122
|
Chris@102
|
123 }} // namespace boost::geometry
|
Chris@102
|
124
|
Chris@102
|
125 #endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
|