Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/geometry/geometries/multi_polygon.hpp @ 102:f46d142149f5
Whoops, finish that update
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:13:41 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
101:c530137014c0 | 102:f46d142149f5 |
---|---|
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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library | |
9 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. | |
10 | |
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) | |
14 | |
15 #ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP | |
16 #define BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP | |
17 | |
18 #include <memory> | |
19 #include <vector> | |
20 | |
21 #include <boost/concept/requires.hpp> | |
22 | |
23 #include <boost/geometry/core/tags.hpp> | |
24 #include <boost/geometry/geometries/concepts/polygon_concept.hpp> | |
25 | |
26 #ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST | |
27 #include <boost/config.hpp> | |
28 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST | |
29 #include <initializer_list> | |
30 #endif | |
31 #endif | |
32 | |
33 namespace boost { namespace geometry | |
34 { | |
35 | |
36 namespace model | |
37 { | |
38 | |
39 /*! | |
40 \brief multi_polygon, a collection of polygons | |
41 \details Multi-polygon can be used to group polygons belonging to each other, | |
42 e.g. Hawaii | |
43 \ingroup geometries | |
44 | |
45 \qbk{before.synopsis, | |
46 [heading Model of] | |
47 [link geometry.reference.concepts.concept_multi_polygon MultiPolygon Concept] | |
48 } | |
49 */ | |
50 template | |
51 < | |
52 typename Polygon, | |
53 template<typename, typename> class Container = std::vector, | |
54 template<typename> class Allocator = std::allocator | |
55 > | |
56 class multi_polygon : public Container<Polygon, Allocator<Polygon> > | |
57 { | |
58 BOOST_CONCEPT_ASSERT( (concept::Polygon<Polygon>) ); | |
59 | |
60 #ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST | |
61 | |
62 typedef Container<Polygon, Allocator<Polygon> > base_type; | |
63 | |
64 public: | |
65 /// \constructor_default{multi_polygon} | |
66 multi_polygon() | |
67 : base_type() | |
68 {} | |
69 | |
70 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST | |
71 | |
72 /// \constructor_initializer_list{multi_polygon} | |
73 inline multi_polygon(std::initializer_list<Polygon> l) | |
74 : base_type(l.begin(), l.end()) | |
75 {} | |
76 | |
77 // Commented out for now in order to support Boost.Assign | |
78 // Without this assignment operator first the object should be created | |
79 // from initializer list, then it shoudl be moved. | |
80 //// Without this workaround in MSVC the assignment operator is ambiguous | |
81 //#ifndef BOOST_MSVC | |
82 // /// \assignment_initializer_list{multi_polygon} | |
83 // inline multi_polygon & operator=(std::initializer_list<Polygon> l) | |
84 // { | |
85 // base_type::assign(l.begin(), l.end()); | |
86 // return *this; | |
87 // } | |
88 //#endif | |
89 | |
90 #endif | |
91 #endif | |
92 }; | |
93 | |
94 | |
95 } // namespace model | |
96 | |
97 | |
98 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS | |
99 namespace traits | |
100 { | |
101 | |
102 template | |
103 < | |
104 typename Polygon, | |
105 template<typename, typename> class Container, | |
106 template<typename> class Allocator | |
107 > | |
108 struct tag< model::multi_polygon<Polygon, Container, Allocator> > | |
109 { | |
110 typedef multi_polygon_tag type; | |
111 }; | |
112 | |
113 } // namespace traits | |
114 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS | |
115 | |
116 }} // namespace boost::geometry | |
117 | |
118 #endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP |