Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:50:15

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 // Copyright (c) 2020, 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 #ifndef BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP
0019 #define BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP
0020 
0021 #include <memory>
0022 #include <vector>
0023 
0024 #include <boost/concept/assert.hpp>
0025 #include <boost/config.hpp>
0026 
0027 #include <boost/geometry/core/tag.hpp>
0028 #include <boost/geometry/core/tags.hpp>
0029 
0030 #include <boost/geometry/geometries/concepts/point_concept.hpp>
0031 
0032 #include <initializer_list>
0033 
0034 namespace boost { namespace geometry
0035 {
0036 
0037 namespace model
0038 {
0039 
0040 /*!
0041 \brief A linestring (named so by OGC) is a collection (default a vector) of points.
0042 \ingroup geometries
0043 \tparam Point \tparam_point
0044 \tparam Container \tparam_container
0045 \tparam Allocator \tparam_allocator
0046 
0047 \qbk{[include reference/geometries/linestring.qbk]}
0048 \qbk{before.synopsis,
0049 [heading Model of]
0050 [link geometry.reference.concepts.concept_linestring Linestring Concept]
0051 }
0052 
0053 */
0054 template
0055 <
0056     typename Point,
0057     template<typename,typename> class Container = std::vector,
0058     template<typename> class Allocator = std::allocator
0059 >
0060 class linestring : public Container<Point, Allocator<Point> >
0061 {
0062     BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
0063 
0064     typedef Container<Point, Allocator<Point> > base_type;
0065 
0066 public :
0067     /// \constructor_default{linestring}
0068     inline linestring()
0069         : base_type()
0070     {}
0071 
0072     /// \constructor_begin_end{linestring}
0073     template <typename Iterator>
0074     inline linestring(Iterator begin, Iterator end)
0075         : base_type(begin, end)
0076     {}
0077 
0078     /// \constructor_initializer_list{linestring}
0079     inline linestring(std::initializer_list<Point> l)
0080         : base_type(l.begin(), l.end())
0081     {}
0082 
0083 // Commented out for now in order to support Boost.Assign
0084 // Without this assignment operator first the object should be created
0085 //   from initializer list, then it should be moved.
0086 //// Without this workaround in MSVC the assignment operator is ambiguous
0087 //#ifndef BOOST_MSVC
0088 //    /// \assignment_initializer_list{linestring}
0089 //    inline linestring & operator=(std::initializer_list<Point> l)
0090 //    {
0091 //        base_type::assign(l.begin(), l.end());
0092 //        return *this;
0093 //    }
0094 //#endif
0095 };
0096 
0097 } // namespace model
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::linestring<Point, Container, Allocator> >
0110 {
0111     using type = linestring_tag;
0112 };
0113 } // namespace traits
0114 
0115 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0116 
0117 }} // namespace boost::geometry
0118 
0119 #endif // BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP