1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // This file was modified by Oracle on 2020.
8 // Modifications copyright (c) 2020, Oracle and/or its affiliates.
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
14 // Use, modification and distribution is subject to the Boost Software License,
15 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
18 #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP
19 #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP
22 #include <type_traits>
25 #include <boost/concept_check.hpp>
26 #include <boost/core/ignore_unused.hpp>
28 #include <boost/geometry/geometries/point.hpp>
29 #include <boost/geometry/strategies/concepts/distance_concept.hpp>
32 namespace boost { namespace geometry { namespace concepts
37 \brief Checks strategy for simplify
40 template <typename Strategy, typename Point>
41 struct SimplifyStrategy
43 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
46 // 1) must define distance_strategy_type,
47 // defining point-segment distance strategy (to be checked)
48 typedef typename Strategy::distance_strategy_type ds_type;
53 template <typename ApplyMethod>
54 static void apply(ApplyMethod)
56 namespace ft = boost::function_types;
57 typedef typename ft::parameter_types
60 >::type parameter_types;
62 typedef std::conditional_t
64 ft::is_member_function_pointer<ApplyMethod>::value,
65 std::integral_constant<int, 1>,
66 std::integral_constant<int, 0>
71 (concepts::PointSegmentDistanceStrategy<ds_type, Point, Point>)
75 std::vector<Point> const* v1 = 0;
76 std::vector<Point> * v2 = 0;
78 // 2) must implement method apply with arguments
81 // - floating point value
82 str->apply(*v1, std::back_inserter(*v2), 1.0);
84 boost::ignore_unused<parameter_types, base_index>();
85 boost::ignore_unused(str);
90 BOOST_CONCEPT_USAGE(SimplifyStrategy)
92 checker::apply(&ds_type::template apply<Point, Point>);
99 }}} // namespace boost::geometry::concepts
101 #endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP