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_RING_CONCEPT_HPP
0020 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_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 namespace boost { namespace geometry { namespace concepts
0035 {
0036
0037 template <typename Geometry>
0038 class Ring
0039 {
0040 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0041 typedef typename point_type<Geometry>::type point_type;
0042
0043 BOOST_CONCEPT_ASSERT( (concepts::Point<point_type>) );
0044 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
0045
0046 public :
0047
0048 BOOST_CONCEPT_USAGE(Ring)
0049 {
0050 Geometry* ring = 0;
0051 traits::clear<Geometry>::apply(*ring);
0052 traits::resize<Geometry>::apply(*ring, 0);
0053 point_type* point = 0;
0054 traits::push_back<Geometry>::apply(*ring, *point);
0055 }
0056 #endif
0057 };
0058
0059
0060
0061
0062
0063
0064
0065
0066 template <typename Geometry>
0067 class ConstRing
0068 {
0069 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0070 typedef typename point_type<Geometry>::type point_type;
0071
0072 BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point_type>) );
0073 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
0074
0075
0076 public :
0077
0078 BOOST_CONCEPT_USAGE(ConstRing)
0079 {
0080 }
0081 #endif
0082 };
0083
0084
0085 template <typename Geometry>
0086 struct concept_type<Geometry, ring_tag>
0087 {
0088 using type = Ring<Geometry>;
0089 };
0090
0091 template <typename Geometry>
0092 struct concept_type<Geometry const, ring_tag>
0093 {
0094 using type = ConstRing<Geometry>;
0095 };
0096
0097
0098 }}}
0099
0100
0101 #endif