1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2014, Oracle and/or its affiliates.
5 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
10 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP
11 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP
13 #include <boost/geometry/core/tags.hpp>
15 #include <boost/geometry/algorithms/dispatch/is_simple.hpp>
18 namespace boost { namespace geometry
22 #ifndef DOXYGEN_NO_DETAIL
23 namespace detail { namespace is_simple
27 template <typename Geometry>
30 static inline bool apply(Geometry const&)
37 }} // namespace detail::is_simple
38 #endif // DOXYGEN_NO_DETAIL
43 #ifndef DOXYGEN_NO_DISPATCH
48 // A point is always simple
49 template <typename Point>
50 struct is_simple<Point, point_tag>
51 : detail::is_simple::always_simple<Point>
55 // A valid segment is always simple.
56 // A segment is a curve.
57 // A curve is simple if it does not pass through the same point twice,
58 // with the possible exception of its two endpoints
60 // Reference: OGC 06-103r4 (6.1.6.1)
61 template <typename Segment>
62 struct is_simple<Segment, segment_tag>
63 : detail::is_simple::always_simple<Segment>
67 // A valid box is always simple
68 // A box is a Polygon, and it satisfies the conditions for Polygon validity.
70 // Reference (for polygon validity): OGC 06-103r4 (6.1.11.1)
71 template <typename Box>
72 struct is_simple<Box, box_tag>
73 : detail::is_simple::always_simple<Box>
77 } // namespace dispatch
78 #endif // DOXYGEN_NO_DISPATCH
81 }} // namespace boost::geometry
83 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_ALWAYS_SIMPLE_HPP