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) 2008-2012 Bruno Lalande, Paris, France.
0004 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
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_LINESTRING_CONCEPT_HPP
0020 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_LINESTRING_CONCEPT_HPP
0021 
0022 
0023 #include <boost/concept_check.hpp>
0024 #include <boost/range/concepts.hpp>
0025 
0026 #include <boost/geometry/core/access.hpp>
0027 #include <boost/geometry/core/mutable_range.hpp>
0028 #include <boost/geometry/core/point_type.hpp>
0029 
0030 #include <boost/geometry/geometries/concepts/concept_type.hpp>
0031 #include <boost/geometry/geometries/concepts/point_concept.hpp>
0032 
0033 
0034 
0035 namespace boost { namespace geometry { namespace concepts
0036 {
0037 
0038 template <typename Geometry>
0039 class Linestring
0040 {
0041 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0042     typedef typename point_type<Geometry>::type point_type;
0043 
0044     BOOST_CONCEPT_ASSERT( (concepts::Point<point_type>) );
0045     BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
0046 
0047 public :
0048 
0049     BOOST_CONCEPT_USAGE(Linestring)
0050     {
0051         Geometry* ls = 0;
0052         traits::clear<Geometry>::apply(*ls);
0053         traits::resize<Geometry>::apply(*ls, 0);
0054         point_type* point = 0;
0055         traits::push_back<Geometry>::apply(*ls, *point);
0056     }
0057 #endif
0058 };
0059 
0060 
0061 /*!
0062 \brief Linestring concept (const version)
0063 \ingroup const_concepts
0064 \details The ConstLinestring concept check the same as the Linestring concept,
0065 but does not check write access.
0066 */
0067 template <typename Geometry>
0068 class ConstLinestring
0069 {
0070 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0071     typedef typename point_type<Geometry>::type point_type;
0072 
0073     BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point_type>) );
0074     //BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
0075     // Relaxed the concept.
0076     BOOST_CONCEPT_ASSERT( (boost::ForwardRangeConcept<Geometry>) );
0077 
0078 
0079 public :
0080 
0081     BOOST_CONCEPT_USAGE(ConstLinestring)
0082     {
0083     }
0084 #endif
0085 };
0086 
0087 
0088 template <typename Geometry>
0089 struct concept_type<Geometry, linestring_tag>
0090 {
0091     using type = Linestring<Geometry>;
0092 };
0093 
0094 template <typename Geometry>
0095 struct concept_type<Geometry const, linestring_tag>
0096 {
0097     using type = ConstLinestring<Geometry>;
0098 };
0099 
0100 
0101 }}} // namespace boost::geometry::concepts
0102 
0103 
0104 #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_LINESTRING_CONCEPT_HPP