]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/algorithms/detail/is_simple/always_simple.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / detail / is_simple / always_simple.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2014-2017, Oracle and/or its affiliates.
4
5 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
6 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7
8 // Licensed under the Boost Software License version 1.0.
9 // http://www.boost.org/users/license.html
10
11 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP
12 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP
13
14 #include <boost/geometry/core/tags.hpp>
15
16 #include <boost/geometry/algorithms/dispatch/is_simple.hpp>
17
18
19 namespace boost { namespace geometry
20 {
21
22
23 #ifndef DOXYGEN_NO_DETAIL
24 namespace detail { namespace is_simple
25 {
26
27
28 template <typename Geometry>
29 struct always_simple
30 {
31 template <typename Strategy>
32 static inline bool apply(Geometry const&, Strategy const&)
33 {
34 return true;
35 }
36 };
37
38
39 }} // namespace detail::is_simple
40 #endif // DOXYGEN_NO_DETAIL
41
42
43
44
45 #ifndef DOXYGEN_NO_DISPATCH
46 namespace dispatch
47 {
48
49
50 // A point is always simple
51 template <typename Point>
52 struct is_simple<Point, point_tag>
53 : detail::is_simple::always_simple<Point>
54 {};
55
56
57 // A valid segment is always simple.
58 // A segment is a curve.
59 // A curve is simple if it does not pass through the same point twice,
60 // with the possible exception of its two endpoints
61 //
62 // Reference: OGC 06-103r4 (6.1.6.1)
63 template <typename Segment>
64 struct is_simple<Segment, segment_tag>
65 : detail::is_simple::always_simple<Segment>
66 {};
67
68
69 // A valid box is always simple
70 // A box is a Polygon, and it satisfies the conditions for Polygon validity.
71 //
72 // Reference (for polygon validity): OGC 06-103r4 (6.1.11.1)
73 template <typename Box>
74 struct is_simple<Box, box_tag>
75 : detail::is_simple::always_simple<Box>
76 {};
77
78
79 } // namespace dispatch
80 #endif // DOXYGEN_NO_DISPATCH
81
82
83 }} // namespace boost::geometry
84
85 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP