File indexing completed on 2025-01-18 09:36:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP
0019 #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP
0020
0021 #include <iterator>
0022 #include <type_traits>
0023 #include <vector>
0024
0025 #include <boost/concept_check.hpp>
0026 #include <boost/core/ignore_unused.hpp>
0027
0028 #include <boost/geometry/geometries/point.hpp>
0029 #include <boost/geometry/strategies/concepts/distance_concept.hpp>
0030
0031
0032 namespace boost { namespace geometry { namespace concepts
0033 {
0034
0035
0036
0037
0038
0039
0040 template <typename Strategy, typename Point>
0041 struct SimplifyStrategy
0042 {
0043 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0044 private :
0045
0046
0047
0048 typedef typename Strategy::distance_strategy_type ds_type;
0049
0050
0051 struct checker
0052 {
0053 template <typename ApplyMethod>
0054 static void apply(ApplyMethod)
0055 {
0056 namespace ft = boost::function_types;
0057 typedef typename ft::parameter_types
0058 <
0059 ApplyMethod
0060 >::type parameter_types;
0061
0062 typedef std::conditional_t
0063 <
0064 ft::is_member_function_pointer<ApplyMethod>::value,
0065 std::integral_constant<int, 1>,
0066 std::integral_constant<int, 0>
0067 > base_index;
0068
0069 BOOST_CONCEPT_ASSERT
0070 (
0071 (concepts::PointSegmentDistanceStrategy<ds_type, Point, Point>)
0072 );
0073
0074 Strategy *str = 0;
0075 std::vector<Point> const* v1 = 0;
0076 std::vector<Point> * v2 = 0;
0077
0078
0079
0080
0081
0082 str->apply(*v1, std::back_inserter(*v2), 1.0);
0083
0084 boost::ignore_unused<parameter_types, base_index>();
0085 boost::ignore_unused(str);
0086 }
0087 };
0088
0089 public :
0090 BOOST_CONCEPT_USAGE(SimplifyStrategy)
0091 {
0092 checker::apply(&ds_type::template apply<Point, Point>);
0093 }
0094 #endif
0095 };
0096
0097
0098
0099 }}}
0100
0101 #endif