From b2dfd7f0c8c75f2edb45ee6d4bd61a10c48caedd Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Thu, 2 Oct 2014 19:57:20 +0200 Subject: [PATCH] [index] Use default Dimension templ. params in content() and margin() algorithms. Replace traits::dimension<> with geometry::dimension<>. --- .../index/detail/algorithms/content.hpp | 16 ++++++----- .../index/detail/algorithms/margin.hpp | 28 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/include/boost/geometry/index/detail/algorithms/content.hpp b/include/boost/geometry/index/detail/algorithms/content.hpp index 1c4739d8e..028113e0e 100644 --- a/include/boost/geometry/index/detail/algorithms/content.hpp +++ b/include/boost/geometry/index/detail/algorithms/content.hpp @@ -2,7 +2,7 @@ // // n-dimensional content (hypervolume) - 2d area, 3d volume, ... // -// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland. // // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -24,11 +24,11 @@ struct default_content_result namespace dispatch { -template +template ::value> struct content_box { BOOST_STATIC_ASSERT(0 < CurrentDimension); - //BOOST_STATIC_ASSERT(CurrentDimension <= traits::dimension::value); static inline typename detail::default_content_result::type apply(Box const& b) { @@ -66,7 +66,7 @@ struct content { static typename default_content_result::type apply(Indexable const& b) { - return dispatch::content_box::value>::apply(b); + return dispatch::content_box::apply(b); } }; @@ -75,9 +75,11 @@ struct content template typename default_content_result::type content(Indexable const& b) { - return dispatch::content::type - >::apply(b); + return dispatch::content + < + Indexable, + typename tag::type + >::apply(b); } }}}} // namespace boost::geometry::index::detail diff --git a/include/boost/geometry/index/detail/algorithms/margin.hpp b/include/boost/geometry/index/detail/algorithms/margin.hpp index 8e2685ab3..d4876600a 100644 --- a/include/boost/geometry/index/detail/algorithms/margin.hpp +++ b/include/boost/geometry/index/detail/algorithms/margin.hpp @@ -2,7 +2,7 @@ // // n-dimensional box's margin value (hypersurface), 2d perimeter, 3d surface, etc... // -// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland. // // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -25,7 +25,9 @@ struct default_margin_result >::type type; }; -//template +//template ::value> //struct margin_for_each_edge //{ // BOOST_STATIC_ASSERT(0 < CurrentDimension); @@ -38,7 +40,7 @@ struct default_margin_result // } //}; // -//template +//template //struct margin_for_each_edge //{ // BOOST_STATIC_ASSERT(0 < CurrentDimension); @@ -49,7 +51,7 @@ struct default_margin_result // } //}; // -//template +//template //struct margin_for_each_edge //{ // BOOST_STATIC_ASSERT(0 < CurrentDimension); @@ -69,16 +71,16 @@ struct default_margin_result // } //}; // -//template +//template ::value> //struct margin_for_each_dimension //{ // BOOST_STATIC_ASSERT(0 < CurrentDimension); -// BOOST_STATIC_ASSERT(CurrentDimension <= detail::traits::dimension::value); // // static inline typename default_margin_result::type apply(Box const& b) // { // return margin_for_each_dimension::apply(b) + -// margin_for_each_edge::value>::apply(b); +// margin_for_each_edge::apply(b); // } //}; // @@ -87,7 +89,7 @@ struct default_margin_result //{ // static inline typename default_margin_result::type apply(Box const& b) // { -// return margin_for_each_edge::value>::apply(b); +// return margin_for_each_edge::apply(b); // } //}; @@ -95,11 +97,11 @@ struct default_margin_result // Now it's sum of edges lengths // maybe margin_for_each_dimension should be used to get more or less hypersurface? -template +template ::value> struct simple_margin_for_each_dimension { BOOST_STATIC_ASSERT(0 < CurrentDimension); - //BOOST_STATIC_ASSERT(CurrentDimension <= dimension::value); static inline typename default_margin_result::type apply(Box const& b) { @@ -140,8 +142,8 @@ struct comparable_margin static inline result_type apply(Box const& g) { - //return detail::margin_for_each_dimension::value>::apply(g); - return detail::simple_margin_for_each_dimension::value>::apply(g); + //return detail::margin_for_each_dimension::apply(g); + return detail::simple_margin_for_each_dimension::apply(g); } }; @@ -159,7 +161,7 @@ typename default_margin_result::type comparable_margin(Geometry const& //template //typename default_margin_result::type margin(Box const& b) //{ -// return 2 * detail::margin_for_each_dimension::value>::apply(b); +// return 2 * detail::margin_for_each_dimension::apply(b); //} }}}} // namespace boost::geometry::index::detail