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_POINT_HPP
0016 #define BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_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/point_concept.hpp>
0025 
0026 #include <boost/config.hpp>
0027 
0028 #include <initializer_list>
0029 
0030 namespace boost { namespace geometry
0031 {
0032 
0033 namespace model
0034 {
0035 
0036 
0037 /*!
0038 \brief multi_point, a collection of points
0039 \ingroup geometries
0040 \tparam Point \tparam_point
0041 \tparam Container \tparam_container
0042 \tparam Allocator \tparam_allocator
0043 \details Multipoint can be used to group points belonging to each other,
0044         e.g. a constellation, or the result set of an intersection
0045 
0046 \qbk{[include reference/geometries/multi_point.qbk]}
0047 \qbk{before.synopsis,
0048 [heading Model of]
0049 [link geometry.reference.concepts.concept_multi_point MultiPoint Concept]
0050 }
0051 */
0052 template
0053 <
0054     typename Point,
0055     template<typename, typename> class Container = std::vector,
0056     template<typename> class Allocator = std::allocator
0057 >
0058 class multi_point : public Container<Point, Allocator<Point> >
0059 {
0060     BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
0061 
0062     typedef Container<Point, Allocator<Point> > base_type;
0063 
0064 public :
0065     /// \constructor_default{multi_point}
0066     inline multi_point()
0067         : base_type()
0068     {}
0069 
0070     /// \constructor_begin_end{multi_point}
0071     template <typename Iterator>
0072     inline multi_point(Iterator begin, Iterator end)
0073         : base_type(begin, end)
0074     {}
0075 
0076     /// \constructor_initializer_list{multi_point}
0077     inline multi_point(std::initializer_list<Point> l)
0078         : base_type(l.begin(), l.end())
0079     {}
0080 
0081 // Commented out for now in order to support Boost.Assign
0082 // Without this assignment operator first the object should be created
0083 //   from initializer list, then it shoudl be moved.
0084 //// Without this workaround in MSVC the assignment operator is ambiguous
0085 //#ifndef BOOST_MSVC
0086 //    /// \assignment_initializer_list{multi_point}
0087 //    inline multi_point & operator=(std::initializer_list<Point> l)
0088 //    {
0089 //        base_type::assign(l.begin(), l.end());
0090 //        return *this;
0091 //    }
0092 //#endif
0093 
0094 };
0095 
0096 } // namespace model
0097 
0098 
0099 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0100 namespace traits
0101 {
0102 
0103 template
0104 <
0105     typename Point,
0106     template<typename, typename> class Container,
0107     template<typename> class Allocator
0108 >
0109 struct tag< model::multi_point<Point, Container, Allocator> >
0110 {
0111     typedef multi_point_tag type;
0112 };
0113 
0114 } // namespace traits
0115 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0116 
0117 }} // namespace boost::geometry
0118 
0119 #endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP