1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
4 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // This file was modified by Oracle on 2020-2021.
8 // Modifications copyright (c) 2020-2021 Oracle and/or its affiliates.
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
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)
19 #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
20 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
23 #include <boost/concept_check.hpp>
24 #include <boost/range/concepts.hpp>
26 #include <boost/geometry/core/access.hpp>
27 #include <boost/geometry/core/mutable_range.hpp>
28 #include <boost/geometry/core/point_type.hpp>
30 #include <boost/geometry/geometries/concepts/concept_type.hpp>
31 #include <boost/geometry/geometries/concepts/point_concept.hpp>
34 namespace boost { namespace geometry { namespace concepts
41 \par Formal definition:
42 The ring concept is defined as following:
43 - there must be a specialization of traits::tag defining ring_tag as type
44 - it must behave like a Boost.Range
45 - there can optionally be a specialization of traits::point_order defining the
46 order or orientation of its points, clockwise or counterclockwise.
47 - it must implement a std::back_insert_iterator
48 (This is the same as the for the concept Linestring, and described there)
50 \note to fulfill the concepts, no traits class has to be specialized to
51 define the point type.
53 template <typename Geometry>
56 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
57 typedef typename point_type<Geometry>::type point_type;
59 BOOST_CONCEPT_ASSERT( (concepts::Point<point_type>) );
60 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
64 BOOST_CONCEPT_USAGE(Ring)
67 traits::clear<Geometry>::apply(*ring);
68 traits::resize<Geometry>::apply(*ring, 0);
69 point_type* point = 0;
70 traits::push_back<Geometry>::apply(*ring, *point);
77 \brief (linear) ring concept (const version)
78 \ingroup const_concepts
79 \details The ConstLinearRing concept check the same as the Geometry concept,
80 but does not check write access.
82 template <typename Geometry>
85 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
86 typedef typename point_type<Geometry>::type point_type;
88 BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point_type>) );
89 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
94 BOOST_CONCEPT_USAGE(ConstRing)
101 template <typename Geometry>
102 struct concept_type<Geometry, ring_tag>
104 using type = Ring<Geometry>;
107 template <typename Geometry>
108 struct concept_type<Geometry const, ring_tag>
110 using type = ConstRing<Geometry>;
114 }}} // namespace boost::geometry::concepts
117 #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP