]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/geometries/concepts/multi_polygon_concept.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / geometry / geometries / concepts / multi_polygon_concept.hpp
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 // This file was modified by Oracle on 2020.
8 // Modifications copyright (c) 2020 Oracle and/or its affiliates.
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
13
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)
17
18
19 #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
20 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
21
22
23 #include <boost/concept_check.hpp>
24 #include <boost/range/concepts.hpp>
25 #include <boost/range/value_type.hpp>
26
27 #include <boost/geometry/geometries/concepts/polygon_concept.hpp>
28
29
30 namespace boost { namespace geometry { namespace concepts
31 {
32
33
34 /*!
35 \brief multi-polygon concept
36 \ingroup concepts
37 \par Formal definition:
38 The multi polygon concept is defined as following:
39 - there must be a specialization of traits::tag defining multi_polygon_tag
40 as type
41 - it must behave like a Boost.Range
42 - its range value must fulfil the Polygon concept
43
44 */
45 template <typename Geometry>
46 class MultiPolygon
47 {
48 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
49 typedef typename boost::range_value<Geometry>::type polygon_type;
50
51 BOOST_CONCEPT_ASSERT( (concepts::Polygon<polygon_type>) );
52 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
53
54
55 public :
56
57 BOOST_CONCEPT_USAGE(MultiPolygon)
58 {
59 Geometry* mp = 0;
60 traits::clear<Geometry>::apply(*mp);
61 traits::resize<Geometry>::apply(*mp, 0);
62 polygon_type* poly = 0;
63 traits::push_back<Geometry>::apply(*mp, *poly);
64 }
65 #endif
66 };
67
68
69 /*!
70 \brief concept for multi-polygon (const version)
71 \ingroup const_concepts
72 */
73 template <typename Geometry>
74 class ConstMultiPolygon
75 {
76 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
77 typedef typename boost::range_value<Geometry>::type polygon_type;
78
79 BOOST_CONCEPT_ASSERT( (concepts::ConstPolygon<polygon_type>) );
80 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
81
82
83 public :
84
85 BOOST_CONCEPT_USAGE(ConstMultiPolygon)
86 {
87 }
88 #endif
89 };
90
91
92 }}} // namespace boost::geometry::concepts
93
94
95 #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP