]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/geometries/linestring.hpp
bump version to 18.2.4-pve3
[ceph.git] / ceph / src / boost / boost / geometry / geometries / linestring.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 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
7
8 // Copyright (c) 2020, Oracle and/or its affiliates.
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
13
14 // Use, modification and distribution is subject to the Boost Software License,
15 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
17
18 #ifndef BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP
19 #define BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP
20
21 #include <memory>
22 #include <vector>
23
24 #include <boost/concept/assert.hpp>
25 #include <boost/config.hpp>
26
27 #include <boost/geometry/core/tag.hpp>
28 #include <boost/geometry/core/tags.hpp>
29
30 #include <boost/geometry/geometries/concepts/point_concept.hpp>
31
32 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
33 #include <initializer_list>
34 #endif
35
36 namespace boost { namespace geometry
37 {
38
39 namespace model
40 {
41
42 /*!
43 \brief A linestring (named so by OGC) is a collection (default a vector) of points.
44 \ingroup geometries
45 \tparam Point \tparam_point
46 \tparam Container \tparam_container
47 \tparam Allocator \tparam_allocator
48
49 \qbk{[include reference/geometries/linestring.qbk]}
50 \qbk{before.synopsis,
51 [heading Model of]
52 [link geometry.reference.concepts.concept_linestring Linestring Concept]
53 }
54
55 */
56 template
57 <
58 typename Point,
59 template<typename,typename> class Container = std::vector,
60 template<typename> class Allocator = std::allocator
61 >
62 class linestring : public Container<Point, Allocator<Point> >
63 {
64 BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
65
66 typedef Container<Point, Allocator<Point> > base_type;
67
68 public :
69 /// \constructor_default{linestring}
70 inline linestring()
71 : base_type()
72 {}
73
74 /// \constructor_begin_end{linestring}
75 template <typename Iterator>
76 inline linestring(Iterator begin, Iterator end)
77 : base_type(begin, end)
78 {}
79
80 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
81
82 /// \constructor_initializer_list{linestring}
83 inline linestring(std::initializer_list<Point> l)
84 : base_type(l.begin(), l.end())
85 {}
86
87 // Commented out for now in order to support Boost.Assign
88 // Without this assignment operator first the object should be created
89 // from initializer list, then it should be moved.
90 //// Without this workaround in MSVC the assignment operator is ambiguous
91 //#ifndef BOOST_MSVC
92 // /// \assignment_initializer_list{linestring}
93 // inline linestring & operator=(std::initializer_list<Point> l)
94 // {
95 // base_type::assign(l.begin(), l.end());
96 // return *this;
97 // }
98 //#endif
99
100 #endif
101 };
102
103 } // namespace model
104
105 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
106 namespace traits
107 {
108
109 template
110 <
111 typename Point,
112 template<typename,typename> class Container,
113 template<typename> class Allocator
114 >
115 struct tag<model::linestring<Point, Container, Allocator> >
116 {
117 typedef linestring_tag type;
118 };
119 } // namespace traits
120
121 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
122
123 }} // namespace boost::geometry
124
125 #endif // BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP