Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
0007 
0008 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0009 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0010 
0011 // Use, modification and distribution is subject to the Boost Software License,
0012 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0013 // http://www.boost.org/LICENSE_1_0.txt)
0014 
0015 #ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP
0016 #define BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP
0017 
0018 #include <memory>
0019 #include <vector>
0020 
0021 #include <boost/concept/requires.hpp>
0022 
0023 #include <boost/geometry/core/tags.hpp>
0024 #include <boost/geometry/geometries/concepts/polygon_concept.hpp>
0025 
0026 #include <boost/config.hpp>
0027 
0028 #include <initializer_list>
0029 
0030 
0031 namespace boost { namespace geometry
0032 {
0033 
0034 namespace model
0035 {
0036 
0037 /*!
0038 \brief multi_polygon, a collection of polygons
0039 \details Multi-polygon can be used to group polygons belonging to each other,
0040         e.g. Hawaii
0041 \ingroup geometries
0042 
0043 \qbk{[include reference/geometries/multi_polygon.qbk]}
0044 \qbk{before.synopsis,
0045 [heading Model of]
0046 [link geometry.reference.concepts.concept_multi_polygon MultiPolygon Concept]
0047 }
0048 */
0049 template
0050 <
0051     typename Polygon,
0052     template<typename, typename> class Container = std::vector,
0053     template<typename> class Allocator = std::allocator
0054 >
0055 class multi_polygon : public Container<Polygon, Allocator<Polygon> >
0056 {
0057     BOOST_CONCEPT_ASSERT( (concepts::Polygon<Polygon>) );
0058 
0059     // default constructor and base_type definitions are required only
0060     // if the constructor taking std::initializer_list is defined
0061 
0062     typedef Container<Polygon, Allocator<Polygon> > base_type;
0063 
0064 public:
0065     /// \constructor_default{multi_polygon}
0066     multi_polygon()
0067         : base_type()
0068     {}
0069 
0070     /// \constructor_initializer_list{multi_polygon}
0071     inline multi_polygon(std::initializer_list<Polygon> l)
0072         : base_type(l.begin(), l.end())
0073     {}
0074 
0075 // Commented out for now in order to support Boost.Assign
0076 // Without this assignment operator first the object should be created
0077 //   from initializer list, then it shoudl be moved.
0078 //// Without this workaround in MSVC the assignment operator is ambiguous
0079 //#ifndef BOOST_MSVC
0080 //    /// \assignment_initializer_list{multi_polygon}
0081 //    inline multi_polygon & operator=(std::initializer_list<Polygon> l)
0082 //    {
0083 //        base_type::assign(l.begin(), l.end());
0084 //        return *this;
0085 //    }
0086 //#endif
0087 };
0088 
0089 
0090 } // namespace model
0091 
0092 
0093 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0094 namespace traits
0095 {
0096 
0097 template
0098 <
0099     typename Polygon,
0100     template<typename, typename> class Container,
0101     template<typename> class Allocator
0102 >
0103 struct tag< model::multi_polygon<Polygon, Container, Allocator> >
0104 {
0105     typedef multi_polygon_tag type;
0106 };
0107 
0108 } // namespace traits
0109 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0110 
0111 }} // namespace boost::geometry
0112 
0113 #endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP