Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:27

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2020-2021.
0008 // Modifications copyright (c) 2020-2021 Oracle and/or its affiliates.
0009 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0010 
0011 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0012 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0013 
0014 // Use, modification and distribution is subject to the Boost Software License,
0015 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0016 // http://www.boost.org/LICENSE_1_0.txt)
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         // The concept should support the second version of push_back, using &&
0052         polygon_type* poly = 0;
0053         traits::push_back<Geometry>::apply(*mp, std::move(*poly));
0054     }
0055 #endif
0056 };
0057 
0058 
0059 /*!
0060 \brief concept for multi-polygon (const version)
0061 \ingroup const_concepts
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 }}} // namespace boost::geometry::concepts
0096 
0097 
0098 #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP