File indexing completed on 2025-01-18 09:35:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
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
0063
0064
0065
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
0075
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 }}}
0102
0103
0104 #endif