From 39e1fac54709efb087e1aaca1113034cccd07002 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Fri, 13 Jun 2014 12:46:13 +0300 Subject: [PATCH] [algorithms][is_simple] remove unused code and includes --- .../boost/geometry/algorithms/is_simple.hpp | 142 +----------------- 1 file changed, 2 insertions(+), 140 deletions(-) diff --git a/include/boost/geometry/algorithms/is_simple.hpp b/include/boost/geometry/algorithms/is_simple.hpp index 7bd9c17c6..e4e86c965 100644 --- a/include/boost/geometry/algorithms/is_simple.hpp +++ b/include/boost/geometry/algorithms/is_simple.hpp @@ -10,149 +10,24 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_IS_SIMPLE_HPP #define BOOST_GEOMETRY_ALGORITHMS_IS_SIMPLE_HPP -#include - -#include - #include -#include -#include - -#include #include - -#include - #include #include - - -// check includes below -#include -#include -#include -#include -#include -#include -#include -#include - - +#include namespace boost { namespace geometry { -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace is_simple -{ - - -template -< - typename Geometry, - bool AllowEmpty = true, - typename Tag = typename tag::type -> -struct is_below_minimal_size -{ - static inline bool apply(Geometry const&) - { - return false; - } -}; - - -template -struct is_below_minimal_size -{ - static inline bool apply(Linestring const& linestring) - { - return boost::size(linestring) == 1; - } -}; - - - - - -template -struct is_simple_polygon -{ - static inline bool apply(Polygon const& polygon) - { - typedef typename ring_type::type Ring; - - BOOST_AUTO_TPL(it, boost::begin(geometry::interior_rings(polygon))); - for (; it != boost::end(geometry::interior_rings(polygon)); ++it) - { - if ( !is_simple_range::apply(*it) ) - { - return false; - } - } - - return is_simple_range::apply(geometry::exterior_ring(polygon)); - } -}; - - - - - -template -struct is_simple_multigeometry -{ - static inline bool apply(MultiGeometry const& multigeometry) - { - typedef typename boost::range_value::type Geometry; - - BOOST_AUTO_TPL(it, boost::begin(multigeometry)); - for (; it != boost::end(multigeometry); ++it) - { - if ( !dispatch::is_simple::apply(*it) ) - { - return false; - } - } - - - if ( CheckIntersections ) - { - BOOST_AUTO_TPL(it1, boost::begin(multigeometry)); - it = it1; - for (; it != boost::end(multigeometry); ++it) - { - for (; it1 != boost::end(multigeometry); ++it1) - { - if ( geometry::intersects(*it, *it1) ) - { - return false; - } - } - } - } - return true; - } -}; - - - -}} // namespace detail::is_simple -#endif // DOXYGEN_NO_DETAIL - - - - #ifndef DOXYGEN_NO_DISPATCH namespace dispatch { - // A segment is always simple. // A segment is a curve. // A curve is simple if it does not pass through the same point twice, @@ -163,13 +38,7 @@ template struct is_simple : dispatch::is_valid {}; -#if 0 - static inline bool apply(Segment const& segment) - { - return dispatch::is_valid::apply(segment); - } -}; -#endif + // A box is always simple // A box is a Polygon, and it satisfies the conditions for Polygon validity. @@ -179,13 +48,6 @@ template struct is_simple : dispatch::is_valid {}; -#if 0 - static inline bool apply(Box const& box) - { - return dispatch::is_valid::apply(box); - } -}; -#endif // A Ring is a Polygon.