1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2014-2017, Oracle and/or its affiliates.
5 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
6 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
8 // Licensed under the Boost Software License version 1.0.
9 // http://www.boost.org/users/license.html
11 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP
12 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP
14 #include <boost/geometry/core/tags.hpp>
16 #include <boost/geometry/algorithms/dispatch/is_simple.hpp>
19 namespace boost { namespace geometry
23 #ifndef DOXYGEN_NO_DETAIL
24 namespace detail { namespace is_simple
28 template <typename Geometry>
31 template <typename Strategy>
32 static inline bool apply(Geometry const&, Strategy const&)
39 }} // namespace detail::is_simple
40 #endif // DOXYGEN_NO_DETAIL
45 #ifndef DOXYGEN_NO_DISPATCH
50 // A point is always simple
51 template <typename Point>
52 struct is_simple<Point, point_tag>
53 : detail::is_simple::always_simple<Point>
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
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>
69 // A valid box is always simple
70 // A box is a Polygon, and it satisfies the conditions for Polygon validity.
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>
79 } // namespace dispatch
80 #endif // DOXYGEN_NO_DISPATCH
83 }} // namespace boost::geometry
85 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP