Chris@16
|
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
|
Chris@16
|
2
|
Chris@16
|
3 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
Chris@16
|
4 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
Chris@16
|
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
Chris@16
|
6
|
Chris@16
|
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
Chris@16
|
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
Chris@16
|
9
|
Chris@16
|
10 // Use, modification and distribution is subject to the Boost Software License,
|
Chris@16
|
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
12 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
13
|
Chris@16
|
14
|
Chris@16
|
15 #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
|
Chris@16
|
16 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
|
Chris@16
|
17
|
Chris@16
|
18
|
Chris@16
|
19 #include <boost/concept_check.hpp>
|
Chris@16
|
20 #include <boost/range/concepts.hpp>
|
Chris@16
|
21 #include <boost/type_traits/remove_const.hpp>
|
Chris@16
|
22
|
Chris@16
|
23 #include <boost/geometry/core/access.hpp>
|
Chris@16
|
24 #include <boost/geometry/core/mutable_range.hpp>
|
Chris@16
|
25 #include <boost/geometry/core/point_type.hpp>
|
Chris@16
|
26
|
Chris@16
|
27 #include <boost/geometry/geometries/concepts/point_concept.hpp>
|
Chris@16
|
28
|
Chris@16
|
29
|
Chris@16
|
30 namespace boost { namespace geometry { namespace concept
|
Chris@16
|
31 {
|
Chris@16
|
32
|
Chris@16
|
33
|
Chris@16
|
34 /*!
|
Chris@16
|
35 \brief ring concept
|
Chris@16
|
36 \ingroup concepts
|
Chris@16
|
37 \par Formal definition:
|
Chris@16
|
38 The ring concept is defined as following:
|
Chris@16
|
39 - there must be a specialization of traits::tag defining ring_tag as type
|
Chris@16
|
40 - it must behave like a Boost.Range
|
Chris@16
|
41 - there can optionally be a specialization of traits::point_order defining the
|
Chris@16
|
42 order or orientation of its points, clockwise or counterclockwise.
|
Chris@16
|
43 - it must implement a std::back_insert_iterator
|
Chris@16
|
44 (This is the same as the for the concept Linestring, and described there)
|
Chris@16
|
45
|
Chris@16
|
46 \note to fulfill the concepts, no traits class has to be specialized to
|
Chris@16
|
47 define the point type.
|
Chris@16
|
48 */
|
Chris@16
|
49 template <typename Geometry>
|
Chris@16
|
50 class Ring
|
Chris@16
|
51 {
|
Chris@16
|
52 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
Chris@16
|
53 typedef typename point_type<Geometry>::type point_type;
|
Chris@16
|
54
|
Chris@16
|
55 BOOST_CONCEPT_ASSERT( (concept::Point<point_type>) );
|
Chris@16
|
56 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
Chris@16
|
57
|
Chris@16
|
58 public :
|
Chris@16
|
59
|
Chris@16
|
60 BOOST_CONCEPT_USAGE(Ring)
|
Chris@16
|
61 {
|
Chris@16
|
62 Geometry* ring = 0;
|
Chris@16
|
63 traits::clear<Geometry>::apply(*ring);
|
Chris@16
|
64 traits::resize<Geometry>::apply(*ring, 0);
|
Chris@16
|
65 point_type* point = 0;
|
Chris@16
|
66 traits::push_back<Geometry>::apply(*ring, *point);
|
Chris@16
|
67 }
|
Chris@16
|
68 #endif
|
Chris@16
|
69 };
|
Chris@16
|
70
|
Chris@16
|
71
|
Chris@16
|
72 /*!
|
Chris@16
|
73 \brief (linear) ring concept (const version)
|
Chris@16
|
74 \ingroup const_concepts
|
Chris@16
|
75 \details The ConstLinearRing concept check the same as the Geometry concept,
|
Chris@16
|
76 but does not check write access.
|
Chris@16
|
77 */
|
Chris@16
|
78 template <typename Geometry>
|
Chris@16
|
79 class ConstRing
|
Chris@16
|
80 {
|
Chris@16
|
81 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
Chris@16
|
82 typedef typename point_type<Geometry>::type point_type;
|
Chris@16
|
83
|
Chris@16
|
84 BOOST_CONCEPT_ASSERT( (concept::ConstPoint<point_type>) );
|
Chris@16
|
85 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
Chris@16
|
86
|
Chris@16
|
87
|
Chris@16
|
88 public :
|
Chris@16
|
89
|
Chris@16
|
90 BOOST_CONCEPT_USAGE(ConstRing)
|
Chris@16
|
91 {
|
Chris@16
|
92 }
|
Chris@16
|
93 #endif
|
Chris@16
|
94 };
|
Chris@16
|
95
|
Chris@16
|
96 }}} // namespace boost::geometry::concept
|
Chris@16
|
97
|
Chris@16
|
98
|
Chris@16
|
99 #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
|