comparison DEPENDENCIES/generic/include/boost/geometry/geometries/ring.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
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_RING_HPP
15 #define BOOST_GEOMETRY_GEOMETRIES_RING_HPP
16
17 #include <memory>
18 #include <vector>
19
20 #include <boost/concept/assert.hpp>
21
22 #include <boost/geometry/core/closure.hpp>
23 #include <boost/geometry/core/point_order.hpp>
24 #include <boost/geometry/core/tag.hpp>
25 #include <boost/geometry/core/tags.hpp>
26
27 #include <boost/geometry/geometries/concepts/point_concept.hpp>
28
29
30 namespace boost { namespace geometry
31 {
32
33 namespace model
34 {
35 /*!
36 \brief A ring (aka linear ring) is a closed line which should not be selfintersecting
37 \ingroup geometries
38 \tparam Point point type
39 \tparam ClockWise true for clockwise direction,
40 false for CounterClockWise direction
41 \tparam Closed true for closed polygons (last point == first point),
42 false open points
43 \tparam Container container type, for example std::vector, std::deque
44 \tparam Allocator container-allocator-type
45
46 \qbk{before.synopsis,
47 [heading Model of]
48 [link geometry.reference.concepts.concept_ring Ring Concept]
49 }
50 */
51 template
52 <
53 typename Point,
54 bool ClockWise = true, bool Closed = true,
55 template<typename, typename> class Container = std::vector,
56 template<typename> class Allocator = std::allocator
57 >
58 class ring : public Container<Point, Allocator<Point> >
59 {
60 BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
61
62 typedef Container<Point, Allocator<Point> > base_type;
63
64 public :
65 /// \constructor_default{ring}
66 inline ring()
67 : base_type()
68 {}
69
70 /// \constructor_begin_end{ring}
71 template <typename Iterator>
72 inline ring(Iterator begin, Iterator end)
73 : base_type(begin, end)
74 {}
75 };
76
77 } // namespace model
78
79
80 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
81 namespace traits
82 {
83
84 template
85 <
86 typename Point,
87 bool ClockWise, bool Closed,
88 template<typename, typename> class Container,
89 template<typename> class Allocator
90 >
91 struct tag<model::ring<Point, ClockWise, Closed, Container, Allocator> >
92 {
93 typedef ring_tag type;
94 };
95
96
97 template
98 <
99 typename Point,
100 bool Closed,
101 template<typename, typename> class Container,
102 template<typename> class Allocator
103 >
104 struct point_order<model::ring<Point, false, Closed, Container, Allocator> >
105 {
106 static const order_selector value = counterclockwise;
107 };
108
109
110 template
111 <
112 typename Point,
113 bool Closed,
114 template<typename, typename> class Container,
115 template<typename> class Allocator
116 >
117 struct point_order<model::ring<Point, true, Closed, Container, Allocator> >
118 {
119 static const order_selector value = clockwise;
120 };
121
122 template
123 <
124 typename Point,
125 bool PointOrder,
126 template<typename, typename> class Container,
127 template<typename> class Allocator
128 >
129 struct closure<model::ring<Point, PointOrder, true, Container, Allocator> >
130 {
131 static const closure_selector value = closed;
132 };
133
134 template
135 <
136 typename Point,
137 bool PointOrder,
138 template<typename, typename> class Container,
139 template<typename> class Allocator
140 >
141 struct closure<model::ring<Point, PointOrder, false, Container, Allocator> >
142 {
143 static const closure_selector value = open;
144 };
145
146
147 } // namespace traits
148 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
149
150
151 }} // namespace boost::geometry
152
153 #endif // BOOST_GEOMETRY_GEOMETRIES_RING_HPP