File indexing completed on 2025-01-18 09:35:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_DYNAMIC_GEOMETRY_CONCEPT_HPP
0011 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_DYNAMIC_GEOMETRY_CONCEPT_HPP
0012
0013
0014 #include <utility>
0015
0016 #include <boost/concept_check.hpp>
0017
0018 #include <boost/geometry/core/geometry_types.hpp>
0019 #include <boost/geometry/core/tags.hpp>
0020 #include <boost/geometry/core/visit.hpp>
0021
0022 #include <boost/geometry/geometries/concepts/box_concept.hpp>
0023 #include <boost/geometry/geometries/concepts/concept_type.hpp>
0024 #include <boost/geometry/geometries/concepts/geometry_collection_concept.hpp>
0025 #include <boost/geometry/geometries/concepts/linestring_concept.hpp>
0026 #include <boost/geometry/geometries/concepts/multi_point_concept.hpp>
0027 #include <boost/geometry/geometries/concepts/multi_linestring_concept.hpp>
0028 #include <boost/geometry/geometries/concepts/multi_polygon_concept.hpp>
0029 #include <boost/geometry/geometries/concepts/point_concept.hpp>
0030 #include <boost/geometry/geometries/concepts/polygon_concept.hpp>
0031 #include <boost/geometry/geometries/concepts/ring_concept.hpp>
0032 #include <boost/geometry/geometries/concepts/segment_concept.hpp>
0033
0034
0035 namespace boost { namespace geometry { namespace concepts
0036 {
0037
0038 namespace detail
0039 {
0040
0041 template <typename Geometry, typename SubGeometry>
0042 struct GeometryType<Geometry, SubGeometry, dynamic_geometry_tag, false>
0043 : concepts::concept_type<SubGeometry>::type
0044 {
0045 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0046 BOOST_CONCEPT_USAGE(GeometryType)
0047 {
0048 Geometry* dg = nullptr;
0049 SubGeometry* sg = nullptr;
0050 *dg = std::move(*sg);
0051 }
0052 #endif
0053 };
0054
0055 template <typename Geometry, typename SubGeometry>
0056 struct GeometryType<Geometry const, SubGeometry, dynamic_geometry_tag, false>
0057 : concepts::concept_type<SubGeometry const>::type
0058 {};
0059
0060
0061 }
0062
0063
0064 template <typename Geometry>
0065 struct DynamicGeometry
0066 {
0067 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0068 using sequence_t = typename traits::geometry_types<Geometry>::type;
0069 BOOST_CONCEPT_ASSERT((detail::GeometryTypes<Geometry, sequence_t>));
0070
0071 BOOST_CONCEPT_USAGE(DynamicGeometry)
0072 {
0073 Geometry* dg = nullptr;
0074 traits::visit<Geometry>::apply([](auto &&) {}, *dg);
0075 }
0076 #endif
0077 };
0078
0079
0080 template <typename Geometry>
0081 struct ConstDynamicGeometry
0082 {
0083 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0084 using sequence_t = typename traits::geometry_types<Geometry>::type;
0085 BOOST_CONCEPT_ASSERT((detail::GeometryTypes<Geometry const, sequence_t>));
0086
0087 BOOST_CONCEPT_USAGE(ConstDynamicGeometry)
0088 {
0089 Geometry const* dg = nullptr;
0090 traits::visit<Geometry>::apply([](auto &&) {}, *dg);
0091 }
0092 #endif
0093 };
0094
0095
0096 template <typename Geometry>
0097 struct concept_type<Geometry, dynamic_geometry_tag>
0098 {
0099 using type = DynamicGeometry<Geometry>;
0100 };
0101
0102 template <typename Geometry>
0103 struct concept_type<Geometry const, dynamic_geometry_tag>
0104 {
0105 using type = ConstDynamicGeometry<Geometry>;
0106 };
0107
0108
0109 }}}
0110
0111
0112 #endif