File indexing completed on 2025-12-16 09:50:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_GEOMETRY_GEOMETRIES_RING_HPP
0016 #define BOOST_GEOMETRY_GEOMETRIES_RING_HPP
0017
0018 #include <memory>
0019 #include <vector>
0020
0021 #include <boost/concept/assert.hpp>
0022
0023 #include <boost/geometry/core/closure.hpp>
0024 #include <boost/geometry/core/point_order.hpp>
0025 #include <boost/geometry/core/tag.hpp>
0026 #include <boost/geometry/core/tags.hpp>
0027
0028 #include <boost/geometry/geometries/concepts/point_concept.hpp>
0029
0030 #include <boost/config.hpp>
0031
0032 #include <initializer_list>
0033
0034 namespace boost { namespace geometry
0035 {
0036
0037 namespace model
0038 {
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 template
0057 <
0058 typename Point,
0059 bool ClockWise = true, bool Closed = true,
0060 template<typename, typename> class Container = std::vector,
0061 template<typename> class Allocator = std::allocator
0062 >
0063 class ring : public Container<Point, Allocator<Point> >
0064 {
0065 BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
0066
0067 typedef Container<Point, Allocator<Point> > base_type;
0068
0069 public :
0070
0071 inline ring()
0072 : base_type()
0073 {}
0074
0075
0076 template <typename Iterator>
0077 inline ring(Iterator begin, Iterator end)
0078 : base_type(begin, end)
0079 {}
0080
0081
0082 inline ring(std::initializer_list<Point> l)
0083 : base_type(l.begin(), l.end())
0084 {}
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099 };
0100
0101 }
0102
0103
0104 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0105 namespace traits
0106 {
0107
0108 template
0109 <
0110 typename Point,
0111 bool ClockWise, bool Closed,
0112 template<typename, typename> class Container,
0113 template<typename> class Allocator
0114 >
0115 struct tag<model::ring<Point, ClockWise, Closed, Container, Allocator> >
0116 {
0117 using type = ring_tag;
0118 };
0119
0120
0121 template
0122 <
0123 typename Point,
0124 bool Closed,
0125 template<typename, typename> class Container,
0126 template<typename> class Allocator
0127 >
0128 struct point_order<model::ring<Point, false, Closed, Container, Allocator> >
0129 {
0130 static const order_selector value = counterclockwise;
0131 };
0132
0133
0134 template
0135 <
0136 typename Point,
0137 bool Closed,
0138 template<typename, typename> class Container,
0139 template<typename> class Allocator
0140 >
0141 struct point_order<model::ring<Point, true, Closed, Container, Allocator> >
0142 {
0143 static const order_selector value = clockwise;
0144 };
0145
0146 template
0147 <
0148 typename Point,
0149 bool PointOrder,
0150 template<typename, typename> class Container,
0151 template<typename> class Allocator
0152 >
0153 struct closure<model::ring<Point, PointOrder, true, Container, Allocator> >
0154 {
0155 static const closure_selector value = closed;
0156 };
0157
0158 template
0159 <
0160 typename Point,
0161 bool PointOrder,
0162 template<typename, typename> class Container,
0163 template<typename> class Allocator
0164 >
0165 struct closure<model::ring<Point, PointOrder, false, Container, Allocator> >
0166 {
0167 static const closure_selector value = open;
0168 };
0169
0170
0171 }
0172 #endif
0173
0174
0175 }}
0176
0177 #endif