File indexing completed on 2025-01-18 09:35:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
0020 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
0021
0022
0023 #include <boost/concept_check.hpp>
0024 #include <boost/range/concepts.hpp>
0025 #include <boost/range/value_type.hpp>
0026
0027 #include <boost/geometry/geometries/concepts/concept_type.hpp>
0028 #include <boost/geometry/geometries/concepts/polygon_concept.hpp>
0029
0030
0031 namespace boost { namespace geometry { namespace concepts
0032 {
0033
0034 template <typename Geometry>
0035 class MultiPolygon
0036 {
0037 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0038 typedef typename boost::range_value<Geometry>::type polygon_type;
0039
0040 BOOST_CONCEPT_ASSERT( (concepts::Polygon<polygon_type>) );
0041 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
0042
0043
0044 public :
0045
0046 BOOST_CONCEPT_USAGE(MultiPolygon)
0047 {
0048 Geometry* mp = 0;
0049 traits::clear<Geometry>::apply(*mp);
0050 traits::resize<Geometry>::apply(*mp, 0);
0051
0052 polygon_type* poly = 0;
0053 traits::push_back<Geometry>::apply(*mp, std::move(*poly));
0054 }
0055 #endif
0056 };
0057
0058
0059
0060
0061
0062
0063 template <typename Geometry>
0064 class ConstMultiPolygon
0065 {
0066 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0067 typedef typename boost::range_value<Geometry>::type polygon_type;
0068
0069 BOOST_CONCEPT_ASSERT( (concepts::ConstPolygon<polygon_type>) );
0070 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
0071
0072
0073 public :
0074
0075 BOOST_CONCEPT_USAGE(ConstMultiPolygon)
0076 {
0077 }
0078 #endif
0079 };
0080
0081
0082 template <typename Geometry>
0083 struct concept_type<Geometry, multi_polygon_tag>
0084 {
0085 using type = MultiPolygon<Geometry>;
0086 };
0087
0088 template <typename Geometry>
0089 struct concept_type<Geometry const, multi_polygon_tag>
0090 {
0091 using type = ConstMultiPolygon<Geometry>;
0092 };
0093
0094
0095 }}}
0096
0097
0098 #endif