Chris@102: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@102: Chris@102: // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@102: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@102: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@102: // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. Chris@102: Chris@102: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@102: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. Chris@102: Chris@102: // Use, modification and distribution is subject to the Boost Software License, Chris@102: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: #ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP Chris@102: #define BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP Chris@102: Chris@102: #include Chris@102: #include Chris@102: Chris@102: #include Chris@102: Chris@102: #include Chris@102: #include Chris@102: Chris@102: #ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST Chris@102: #include Chris@102: #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST Chris@102: #include Chris@102: #endif Chris@102: #endif Chris@102: Chris@102: namespace boost { namespace geometry Chris@102: { Chris@102: Chris@102: namespace model Chris@102: { Chris@102: Chris@102: Chris@102: /*! Chris@102: \brief multi_point, a collection of points Chris@102: \ingroup geometries Chris@102: \tparam Point \tparam_point Chris@102: \tparam Container \tparam_container Chris@102: \tparam Allocator \tparam_allocator Chris@102: \details Multipoint can be used to group points belonging to each other, Chris@102: e.g. a constellation, or the result set of an intersection Chris@102: \qbk{before.synopsis, Chris@102: [heading Model of] Chris@102: [link geometry.reference.concepts.concept_multi_point MultiPoint Concept] Chris@102: } Chris@102: */ Chris@102: template Chris@102: < Chris@102: typename Point, Chris@102: template class Container = std::vector, Chris@102: template class Allocator = std::allocator Chris@102: > Chris@102: class multi_point : public Container > Chris@102: { Chris@102: BOOST_CONCEPT_ASSERT( (concept::Point) ); Chris@102: Chris@102: typedef Container > base_type; Chris@102: Chris@102: public : Chris@102: /// \constructor_default{multi_point} Chris@102: inline multi_point() Chris@102: : base_type() Chris@102: {} Chris@102: Chris@102: /// \constructor_begin_end{multi_point} Chris@102: template Chris@102: inline multi_point(Iterator begin, Iterator end) Chris@102: : base_type(begin, end) Chris@102: {} Chris@102: Chris@102: #ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST Chris@102: #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST Chris@102: Chris@102: /// \constructor_initializer_list{multi_point} Chris@102: inline multi_point(std::initializer_list l) Chris@102: : base_type(l.begin(), l.end()) Chris@102: {} Chris@102: Chris@102: // Commented out for now in order to support Boost.Assign Chris@102: // Without this assignment operator first the object should be created Chris@102: // from initializer list, then it shoudl be moved. Chris@102: //// Without this workaround in MSVC the assignment operator is ambiguous Chris@102: //#ifndef BOOST_MSVC Chris@102: // /// \assignment_initializer_list{multi_point} Chris@102: // inline multi_point & operator=(std::initializer_list l) Chris@102: // { Chris@102: // base_type::assign(l.begin(), l.end()); Chris@102: // return *this; Chris@102: // } Chris@102: //#endif Chris@102: Chris@102: #endif Chris@102: #endif Chris@102: }; Chris@102: Chris@102: } // namespace model Chris@102: Chris@102: Chris@102: #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS Chris@102: namespace traits Chris@102: { Chris@102: Chris@102: template Chris@102: < Chris@102: typename Point, Chris@102: template class Container, Chris@102: template class Allocator Chris@102: > Chris@102: struct tag< model::multi_point > Chris@102: { Chris@102: typedef multi_point_tag type; Chris@102: }; Chris@102: Chris@102: } // namespace traits Chris@102: #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS Chris@102: Chris@102: }} // namespace boost::geometry Chris@102: Chris@102: #endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP