|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72556 - in sandbox-branches/geometry/index_080_new: boost/geometry/extensions/index boost/geometry/extensions/index/rtree tests
From: adam.wulkiewicz_at_[hidden]
Date: 2011-06-12 14:51:13
Author: awulkiew
Date: 2011-06-12 14:51:12 EDT (Sun, 12 Jun 2011)
New Revision: 72556
URL: http://svn.boost.org/trac/boost/changeset/72556
Log:
rtree template parameters sequence changed
Removed:
sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/default_parameter.hpp
Text files modified:
sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/indexable.hpp | 12 ++++++++++++
sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp | 14 +++++++++-----
sandbox-branches/geometry/index_080_new/tests/additional_glut_vis.cpp | 1 -
sandbox-branches/geometry/index_080_new/tests/additional_sizes_and_times.cpp | 6 +++---
sandbox-branches/geometry/index_080_new/tests/rtree_native.hpp | 16 ++++++++--------
5 files changed, 32 insertions(+), 17 deletions(-)
Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/default_parameter.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/default_parameter.hpp 2011-06-12 14:51:12 EDT (Sun, 12 Jun 2011)
+++ (empty file)
@@ -1,62 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.SpatialIndex - default indexes parameters
-//
-// Copyright 2011 Adam Wulkiewicz.
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_DEFAULT_PARAMETER_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_DEFAULT_PARAMETER_HPP
-
-#include <boost/geometry/geometries/point.hpp>
-#include <boost/geometry/geometries/box.hpp>
-#include <boost/geometry/extensions/index/translator/def.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-// TODO: awulkiew - move this elsewhere
-struct default_parameter {};
-
-namespace detail {
-
-template <typename Indexable>
-struct geometry_box_type
-{
- typedef geometry::model::box<
- geometry::model::point<
- typename index::traits::coordinate_type<Indexable>::type,
- index::traits::dimension<Indexable>::value,
- typename index::traits::coordinate_system<Indexable>::type
- >
- > type;
-};
-
-template <typename Value, typename Translator>
-struct default_translator_type
-{
- typedef Translator type;
-};
-template <typename Value>
-struct default_translator_type<Value, default_parameter>
-{
- typedef translator::def<Value> type;
-};
-
-template <typename Indexable, typename Box>
-struct default_box_type
-{
- typedef Box type;
-};
-template <typename Indexable>
-struct default_box_type<Indexable, default_parameter>
-{
- typedef typename detail::geometry_box_type<Indexable>::type type;
-};
-
-} // namespace detail
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_DEFAULT_PARAMETER_HPP
Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/indexable.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/indexable.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/indexable.hpp 2011-06-12 14:51:12 EDT (Sun, 12 Jun 2011)
@@ -159,6 +159,18 @@
>::get(i);
}
+template <typename Indexable>
+struct default_box_type
+{
+ typedef geometry::model::box<
+ geometry::model::point<
+ typename traits::coordinate_type<Indexable>::type,
+ traits::dimension<Indexable>::value,
+ typename traits::coordinate_system<Indexable>::type
+ >
+ > type;
+};
+
}}} // namespace boost::geometry::index
#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_INDEXABLE_HPP
Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp 2011-06-12 14:51:12 EDT (Sun, 12 Jun 2011)
@@ -11,7 +11,10 @@
#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_HPP
#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_HPP
-#include <boost/geometry/extensions/index/default_parameter.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/box.hpp>
+
+#include <boost/geometry/extensions/index/translator/def.hpp>
#include <boost/geometry/extensions/index/rtree/filters.hpp>
@@ -30,15 +33,16 @@
template <
typename Value,
- typename Translator = default_parameter,
- typename Tag = linear_tag
+ typename Tag = linear_tag,
+ typename Translator = translator::def<Value>
>
class rtree
{
public:
typedef Value value_type;
- typedef typename detail::default_translator_type<value_type, Translator>::type translator_type;
- typedef typename detail::geometry_box_type<typename translator_type::indexable_type>::type box_type;
+ typedef Translator translator_type;
+ typedef typename translator_type::indexable_type indexable_type;
+ typedef typename index::default_box_type<indexable_type>::type box_type;
typedef Tag tag_type;
typedef typename detail::rtree::node<value_type, box_type, tag_type>::type node;
Modified: sandbox-branches/geometry/index_080_new/tests/additional_glut_vis.cpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/tests/additional_glut_vis.cpp (original)
+++ sandbox-branches/geometry/index_080_new/tests/additional_glut_vis.cpp 2011-06-12 14:51:12 EDT (Sun, 12 Jun 2011)
@@ -22,7 +22,6 @@
//boost::geometry::index::rtree<B> t(2, 1);
boost::geometry::index::rtree<
B,
- boost::geometry::index::default_parameter,
boost::geometry::index::rstar_tag> t(4, 2);
std::vector<B> vect;
Modified: sandbox-branches/geometry/index_080_new/tests/additional_sizes_and_times.cpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/tests/additional_sizes_and_times.cpp (original)
+++ sandbox-branches/geometry/index_080_new/tests/additional_sizes_and_times.cpp 2011-06-12 14:51:12 EDT (Sun, 12 Jun 2011)
@@ -29,9 +29,9 @@
typedef bg::model::point<float, 2, bg::cs::cartesian> P;
typedef bg::model::box<P> B;
- //typedef bgi::rtree<std::pair<B, size_t>, bgi::default_parameter, bgi::linear_tag> RT;
- //typedef bgi::rtree<std::pair<B, size_t>, bgi::default_parameter, bgi::quadratic_tag> RT;
- typedef bgi::rtree<std::pair<B, size_t>, bgi::default_parameter, bgi::rstar_tag> RT;
+ //typedef bgi::rtree<std::pair<B, size_t>, bgi::linear_tag> RT;
+ //typedef bgi::rtree<std::pair<B, size_t>, bgi::quadratic_tag> RT;
+ typedef bgi::rtree<std::pair<B, size_t>, bgi::rstar_tag> RT;
// load config file
std::ifstream file_cfg("config.txt");
Modified: sandbox-branches/geometry/index_080_new/tests/rtree_native.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/tests/rtree_native.hpp (original)
+++ sandbox-branches/geometry/index_080_new/tests/rtree_native.hpp 2011-06-12 14:51:12 EDT (Sun, 12 Jun 2011)
@@ -23,7 +23,7 @@
typedef boost::geometry::model::point<float, 3, boost::geometry::cs::cartesian> P;
typedef boost::geometry::model::box<P> B;
- boost::geometry::index::rtree<B, boost::geometry::index::default_parameter, Tag> t(4, 2);
+ boost::geometry::index::rtree<B, Tag> t(4, 2);
boost::geometry::index::insert(t, B(P(0, 0, 0), P(1, 1, 1)));
boost::geometry::index::insert(t, B(P(2, 2, 2), P(3, 3, 3)));
boost::geometry::index::insert(t, B(P(4, 4, 4), P(5, 5, 5)));
@@ -40,7 +40,7 @@
typedef boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> P;
typedef boost::geometry::model::box<P> B;
- boost::geometry::index::rtree<B, boost::geometry::index::default_parameter, Tag> t(4, 2);
+ boost::geometry::index::rtree<B, Tag> t(4, 2);
boost::geometry::index::insert(t, B(P(0, 0), P(1, 1)));
boost::geometry::index::insert(t, B(P(2, 2), P(3, 3)));
boost::geometry::index::insert(t, B(P(4, 4), P(5, 5)));
@@ -57,7 +57,7 @@
typedef boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> P;
typedef boost::geometry::model::box<P> B;
- boost::geometry::index::rtree<P, boost::geometry::index::default_parameter, Tag> t(4, 2);
+ boost::geometry::index::rtree<P, Tag> t(4, 2);
boost::geometry::index::insert(t, P(0, 0));
boost::geometry::index::insert(t, P(2, 2));
boost::geometry::index::insert(t, P(4, 4));
@@ -75,7 +75,7 @@
typedef boost::geometry::model::box<P> B;
typedef std::pair<B, int> V;
- boost::geometry::index::rtree<V, boost::geometry::index::default_parameter, Tag> t(4, 2);
+ boost::geometry::index::rtree<V, Tag> t(4, 2);
boost::geometry::index::insert(t, V(B(P(0, 0), P(1, 1)), 0));
boost::geometry::index::insert(t, V(B(P(2, 2), P(3, 3)), 1));
boost::geometry::index::insert(t, V(B(P(4, 4), P(5, 5)), 2));
@@ -100,7 +100,7 @@
V v4( new std::pair<B, int>(B(P(6, 6), P(7, 7)), 3) );
V v5( new std::pair<B, int>(B(P(8, 8), P(9, 9)), 4) );
- boost::geometry::index::rtree<V, boost::geometry::index::default_parameter, Tag> t(4, 2);
+ boost::geometry::index::rtree<V, Tag> t(4, 2);
boost::geometry::index::insert(t, v1);
boost::geometry::index::insert(t, v2);
boost::geometry::index::insert(t, v3);
@@ -126,7 +126,7 @@
m.insert(std::pair<int, B>(3, B(P(6, 6), P(7, 7))));
m.insert(std::pair<int, B>(4, B(P(8, 8), P(9, 9))));
- boost::geometry::index::rtree<V, boost::geometry::index::default_parameter, Tag> t(4, 2);
+ boost::geometry::index::rtree<V, Tag> t(4, 2);
V vit = m.begin();
boost::geometry::index::insert(t, vit++);
boost::geometry::index::insert(t, vit++);
@@ -145,7 +145,7 @@
typedef boost::geometry::model::box<P> B;
typedef size_t V;
- typedef boost::geometry::index::translator::index<std::vector<B> > T;
+ typedef boost::geometry::index::translator::index<std::vector<B> > Tr;
std::vector<B> v;
v.push_back(B(P(0, 0), P(1, 1)));
@@ -154,7 +154,7 @@
v.push_back(B(P(6, 6), P(7, 7)));
v.push_back(B(P(8, 8), P(9, 9)));
- boost::geometry::index::rtree<V, T, Tag> t(4, 2, T(v));
+ boost::geometry::index::rtree<V, Tag, Tr> t(4, 2, Tr(v));
boost::geometry::index::insert(t, 0u);
boost::geometry::index::insert(t, 1u);
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk