Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81778 - in sandbox-branches/geometry/index: . boost/geometry/extensions/index boost/geometry/extensions/index/rtree doc/html doc/html/geometry_index/r_tree doc/rtree test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2012-12-07 17:52:56


Author: awulkiew
Date: 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
New Revision: 81778
URL: http://svn.boost.org/trac/boost/changeset/81778

Log:
Merged from index_dev

Fixed rtree::clear() mem leak.
Added test for clear() and boost::shared_ptr as Values.
Each linear algo test file divided into 2 files.
Added reference in docs->rtree introduction.
Added:
   sandbox-branches/geometry/index/test/rtree/rtree2d_linear_d_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree2d_linear_d_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree2d_linear_f_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree2d_linear_f_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree2d_linear_i_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree2d_linear_i_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree2d_linear_tt_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree2d_linear_tt_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_d_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree2d_quadratic_d_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_f_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree2d_quadratic_f_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_i_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree2d_quadratic_i_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_tt_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree2d_quadratic_tt_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree3d_linear_d_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree3d_linear_d_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree3d_linear_f_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree3d_linear_f_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree3d_linear_i_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree3d_linear_i_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree3d_linear_tt_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree3d_linear_tt_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_d_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree3d_quadratic_d_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_f_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree3d_quadratic_f_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_i_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree3d_quadratic_i_rt.cpp
   sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_tt_rt.cpp
      - copied unchanged from r81777, /sandbox-branches/geometry/index_dev/test/rtree/rtree3d_quadratic_tt_rt.cpp
Properties modified:
   sandbox-branches/geometry/index/ (props changed)
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/inserter.hpp | 6 +-
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp | 21 +++-------
   sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/introduction.html | 15 +++++--
   sandbox-branches/geometry/index/doc/html/index.html | 2
   sandbox-branches/geometry/index/doc/rtree/introduction.qbk | 5 +-
   sandbox-branches/geometry/index/test/rtree/Jamfile.v2 | 16 ++++++++
   sandbox-branches/geometry/index/test/rtree/rtree2d_linear_d.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree2d_linear_f.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree2d_linear_i.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree2d_linear_tt.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_d.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_f.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_i.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_tt.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree3d_linear_d.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree3d_linear_f.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree3d_linear_i.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree3d_linear_tt.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_d.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_f.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_i.cpp | 1
   sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_tt.cpp | 1
   sandbox-branches/geometry/index/test/rtree/test_rtree.hpp | 77 ++++++++++++++++++++++++++++++++++++++-
   23 files changed, 115 insertions(+), 43 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/inserter.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/inserter.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/inserter.hpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -23,12 +23,12 @@
     typedef Container container_type;
 
     inline explicit insert_iterator(Container & c)
- : container(c)
+ : container(&c)
     {}
     
     insert_iterator & operator=(typename Container::value_type const& value)
     {
- container.insert(value);
+ container->insert(value);
         return *this;
     }
 
@@ -48,7 +48,7 @@
     }
 
 private:
- Container & container;
+ Container * container;
 };
 
 template <typename Container>

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -146,7 +146,7 @@
         }
         catch(...)
         {
- this->raw_destroy(*this, true);
+ this->raw_destroy(*this);
             throw;
         }
     }
@@ -176,7 +176,7 @@
         }
         catch(...)
         {
- this->raw_destroy(*this, true);
+ this->raw_destroy(*this);
             throw;
         }
     }
@@ -188,7 +188,7 @@
     */
     inline ~rtree()
     {
- this->raw_destroy(*this, true);
+ this->raw_destroy(*this);
     }
 
     /*!
@@ -586,7 +586,7 @@
     */
     inline void clear()
     {
- this->raw_destroy(*this, false);
+ this->raw_destroy(*this);
     }
 
     /*!
@@ -775,19 +775,12 @@
 
     \param t The container which is going to be destroyed.
     */
- inline void raw_destroy(rtree & t, bool destroy_root = true)
+ inline void raw_destroy(rtree & t)
     {
         if ( t.m_root )
         {
- if ( destroy_root )
- {
- detail::rtree::visitors::destroy<value_type, options_type, translator_type, box_type, allocators_type> del_v(t.m_root, t.m_allocators);
- detail::rtree::apply_visitor(del_v, *t.m_root);
- }
- else
- {
- detail::rtree::clear_node<value_type, options_type, translator_type, box_type, allocators_type>::apply(*t.m_root, t.m_allocators);
- }
+ detail::rtree::visitors::destroy<value_type, options_type, translator_type, box_type, allocators_type> del_v(t.m_root, t.m_allocators);
+ detail::rtree::apply_visitor(del_v, *t.m_root);
 
             t.m_root = 0;
         }

Modified: sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/introduction.html
==============================================================================
--- sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/introduction.html (original)
+++ sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/introduction.html 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -31,7 +31,7 @@
         by Antonin Guttman in 1984 [1]</sup></a> as an expansion of B-tree for multi-dimensional data. It may
         be used to store points or volumetric data in order to perform a spatial
         query later. This query may return objects that are inside some area or are
- close to some point in space.
+ close to some point in space [2]</sup></a>.
       </p>
 <p>
         The R-tree structure is presented on the image below. Each R-tree's node
@@ -51,7 +51,7 @@
       </p>
 <p>
         The R-tree is a self-balanced data structure. The key part of balancing algorithm
- is node splitting algorithm [2]</sup></a> [3]</sup></a>. Each algorithm produces different splits so the internal structure
+ is node splitting algorithm [3]</sup></a> [4]</sup></a>. Each algorithm produces different splits so the internal structure
         of a tree may be different for each one of them. In general more complex
         algorithms analyses elements better and produces less overlapping nodes.
         In the searching process less nodes must be traversed in order to find desired
@@ -192,8 +192,9 @@
             capable to store arbitrary Value type,
           </li>
 <li class="listitem">
- sophisticated queries - e.g. search for 5 nearest values intersecting
- some region but not within the other one.
+ advanced queries - e.g. search for 5 nearest values further than some
+ minimal distance and intersecting some region but not within the other
+ one.
           </li>
 </ul></div>
 <div class="footnotes">
@@ -203,10 +204,14 @@
           Searching</em></span>
         </p></div>
 <div id="ftn.geometry_index.r_tree.introduction.f1" class="footnote"><p>[2]
+ Cheung, K.; Fu, A. (1998). <span class="emphasis"><em>Enhanced Nearest Neighbour Search
+ on the R-tree</em></span>
+ </p></div>
+<div id="ftn.geometry_index.r_tree.introduction.f2" class="footnote"><p>[3]
           Greene, D. (1989). <span class="emphasis"><em>An implementation and performance analysis
           of spatial data access methods</em></span>
         </p></div>
-<div id="ftn.geometry_index.r_tree.introduction.f2" class="footnote"><p>[3]
+<div id="ftn.geometry_index.r_tree.introduction.f3" class="footnote"><p>[4]
           Beckmann, N.; Kriegel, H. P.; Schneider, R.; Seeger, B. (1990). <span class="emphasis"><em>The
           R*-tree: an efficient and robust access method for points and rectangles</em></span>
         </p></div>

Modified: sandbox-branches/geometry/index/doc/html/index.html
==============================================================================
--- sandbox-branches/geometry/index/doc/html/index.html (original)
+++ sandbox-branches/geometry/index/doc/html/index.html 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -56,7 +56,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: November 26, 2012 at 22:11:47 GMT</small></p></td>
+<td align="left"><p><small>Last revised: November 27, 2012 at 12:09:04 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox-branches/geometry/index/doc/rtree/introduction.qbk
==============================================================================
--- sandbox-branches/geometry/index/doc/rtree/introduction.qbk (original)
+++ sandbox-branches/geometry/index/doc/rtree/introduction.qbk 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -13,7 +13,8 @@
 __rtree__ is a tree data structure used for spatial searching. It was proposed by
 Antonin Guttman in 1984 [footnote Guttman, A. (1984). /R-Trees: A Dynamic Index Structure for Spatial Searching/]
 as an expansion of B-tree for multi-dimensional data. It may be used to store points or volumetric data in order to
-perform a spatial query later. This query may return objects that are inside some area or are close to some point in space.
+perform a spatial query later. This query may return objects that are inside some area or are close to some point in space
+[footnote Cheung, K.; Fu, A. (1998). /Enhanced Nearest Neighbour Search on the R-tree/].
 
 The __rtree__ structure is presented on the image below. Each __rtree__'s node store a box descring the space occupied by
 its children nodes. At the bottom of the structure, there are leaf-nodes which contains values
@@ -46,7 +47,7 @@
 * three different creation algorithms - linear, quadratic or rstar,
 * parameters (including maximal and minimal number of elements) may be passed as compile- or run-time parameters - compile-time version is faster,
 * capable to store arbitrary __value__ type,
-* sophisticated queries - e.g. search for 5 nearest values intersecting some region but not within the other one.
+* advanced queries - e.g. search for 5 nearest values further than some minimal distance and intersecting some region but not within the other one.
 
 [endsect]
 

Modified: sandbox-branches/geometry/index/test/rtree/Jamfile.v2
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/Jamfile.v2 (original)
+++ sandbox-branches/geometry/index/test/rtree/Jamfile.v2 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -12,11 +12,19 @@
     [ run rtree2d_linear_f.cpp ]
     [ run rtree2d_linear_d.cpp ]
     [ run rtree2d_linear_tt.cpp ]
+ [ run rtree2d_linear_i_rt.cpp ]
+ [ run rtree2d_linear_f_rt.cpp ]
+ [ run rtree2d_linear_d_rt.cpp ]
+ [ run rtree2d_linear_tt_rt.cpp ]
 
     [ run rtree2d_quadratic_i.cpp ]
     [ run rtree2d_quadratic_f.cpp ]
     [ run rtree2d_quadratic_d.cpp ]
     [ run rtree2d_quadratic_tt.cpp ]
+ [ run rtree2d_quadratic_i_rt.cpp ]
+ [ run rtree2d_quadratic_f_rt.cpp ]
+ [ run rtree2d_quadratic_d_rt.cpp ]
+ [ run rtree2d_quadratic_tt_rt.cpp ]
 
     [ run rtree2d_rstar_i.cpp ]
     [ run rtree2d_rstar_f.cpp ]
@@ -31,11 +39,19 @@
     [ run rtree3d_linear_f.cpp ]
     [ run rtree3d_linear_d.cpp ]
     [ run rtree3d_linear_tt.cpp ]
+ [ run rtree3d_linear_i_rt.cpp ]
+ [ run rtree3d_linear_f_rt.cpp ]
+ [ run rtree3d_linear_d_rt.cpp ]
+ [ run rtree3d_linear_tt_rt.cpp ]
 
     [ run rtree3d_quadratic_i.cpp ]
     [ run rtree3d_quadratic_f.cpp ]
     [ run rtree3d_quadratic_d.cpp ]
     [ run rtree3d_quadratic_tt.cpp ]
+ [ run rtree3d_quadratic_i_rt.cpp ]
+ [ run rtree3d_quadratic_f_rt.cpp ]
+ [ run rtree3d_quadratic_d_rt.cpp ]
+ [ run rtree3d_quadratic_tt_rt.cpp ]
 
     [ run rtree3d_rstar_i.cpp ]
     [ run rtree3d_rstar_f.cpp ]

Modified: sandbox-branches/geometry/index/test/rtree/rtree2d_linear_d.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree2d_linear_d.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree2d_linear_d.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<double, 2, bg::cs::cartesian> P2dc;
 
     test_rtree<P2dc, bgi::linear<4, 2> >();
- test_rtree<P2dc>(bgi::runtime::linear(4, 2));
     
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree2d_linear_f.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree2d_linear_f.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree2d_linear_f.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<float, 2, bg::cs::cartesian> P2fc;
 
     test_rtree<P2fc, bgi::linear<4, 2> >();
- test_rtree<P2fc>(bgi::runtime::linear(4, 2));
 
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree2d_linear_i.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree2d_linear_i.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree2d_linear_i.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<int, 2, bg::cs::cartesian> P2ic;
 
     test_rtree<P2ic, bgi::linear<4, 2> >();
- test_rtree<P2ic>(bgi::runtime::linear(4, 2));
 
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree2d_linear_tt.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree2d_linear_tt.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree2d_linear_tt.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -20,7 +20,6 @@
     typedef bg::model::point<ttmath_big, 2, bg::cs::cartesian> P2ttmc;
 
     test_rtree<P2ttmc, bgi::linear<4, 2> >();
- test_rtree<P2ttmc>(bgi::runtime::linear(4, 2));
 
 #endif
 

Modified: sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_d.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_d.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_d.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<double, 2, bg::cs::cartesian> P2dc;
 
     test_rtree<P2dc, bgi::quadratic<4, 2> >();
- test_rtree<P2dc>(bgi::runtime::quadratic(4, 2));
     
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_f.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_f.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_f.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<float, 2, bg::cs::cartesian> P2fc;
     
     test_rtree<P2fc, bgi::quadratic<4, 2> >();
- test_rtree<P2fc>(bgi::runtime::quadratic(4, 2));
     
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_i.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_i.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_i.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<int, 2, bg::cs::cartesian> P2ic;
     
     test_rtree<P2ic, bgi::quadratic<4, 2> >();
- test_rtree<P2ic>(bgi::runtime::quadratic(4, 2));
     
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_tt.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_tt.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree2d_quadratic_tt.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -20,7 +20,6 @@
     typedef bg::model::point<ttmath_big, 2, bg::cs::cartesian> P2ttmc;
 
     test_rtree<P2ttmc, bgi::quadratic<4, 2> >();
- test_rtree<P2ttmc>(bgi::runtime::quadratic(4, 2));
 #endif
 
     return 0;

Modified: sandbox-branches/geometry/index/test/rtree/rtree3d_linear_d.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree3d_linear_d.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree3d_linear_d.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<double, 3, bg::cs::cartesian> P3dc;
 
     test_rtree<P3dc, bgi::linear<4, 2> >();
- test_rtree<P3dc>(bgi::runtime::linear(4, 2));
     
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree3d_linear_f.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree3d_linear_f.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree3d_linear_f.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<float, 3, bg::cs::cartesian> P3fc;
     
     test_rtree<P3fc, bgi::linear<4, 2> >();
- test_rtree<P3fc>(bgi::runtime::linear(4, 2));
     
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree3d_linear_i.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree3d_linear_i.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree3d_linear_i.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<int, 3, bg::cs::cartesian> P3ic;
     
     test_rtree<P3ic, bgi::linear<4, 2> >();
- test_rtree<P3ic>(bgi::runtime::linear(4, 2));
 
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree3d_linear_tt.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree3d_linear_tt.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree3d_linear_tt.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -20,7 +20,6 @@
     typedef bg::model::point<ttmath_big, 3, bg::cs::cartesian> P3ttmc;
 
     test_rtree<P3ttmc, bgi::linear<4, 2> >();
- test_rtree<P3ttmc>(bgi::runtime::linear(4, 2));
 #endif
 
     return 0;

Modified: sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_d.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_d.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_d.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<double, 3, bg::cs::cartesian> P3dc;
 
     test_rtree<P3dc, bgi::quadratic<4, 2> >();
- test_rtree<P3dc>(bgi::runtime::quadratic(4, 2));
 
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_f.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_f.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_f.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<float, 3, bg::cs::cartesian> P3fc;
     
     test_rtree<P3fc, bgi::quadratic<4, 2> >();
- test_rtree<P3fc>(bgi::runtime::quadratic(4, 2));
     
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_i.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_i.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_i.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -18,7 +18,6 @@
     typedef bg::model::point<int, 3, bg::cs::cartesian> P3ic;
     
     test_rtree<P3ic, bgi::quadratic<4, 2> >();
- test_rtree<P3ic>(bgi::runtime::quadratic(4, 2));
 
     return 0;
 }

Modified: sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_tt.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_tt.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/rtree3d_quadratic_tt.cpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -20,7 +20,6 @@
     typedef bg::model::point<ttmath_big, 3, bg::cs::cartesian> P3ttmc;
 
     test_rtree<P3ttmc, bgi::quadratic<4, 2> >();
- test_rtree<P3ttmc>(bgi::runtime::quadratic(4, 2));
 #endif
 
     return 0;

Modified: sandbox-branches/geometry/index/test/rtree/test_rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/test_rtree.hpp (original)
+++ sandbox-branches/geometry/index/test/rtree/test_rtree.hpp 2012-12-07 17:52:53 EST (Fri, 07 Dec 2012)
@@ -187,6 +187,62 @@
     }
 };
 
+// shared_ptr value
+
+template <typename Indexable>
+struct test_object
+{
+ test_object(Indexable const& indexable_) : indexable(indexable_) {}
+ Indexable indexable;
+};
+
+namespace boost { namespace geometry { namespace index { namespace translator {
+
+template <typename Indexable>
+struct def< boost::shared_ptr< test_object<Indexable> > >
+{
+ typedef boost::shared_ptr< test_object<Indexable> > value_type;
+ typedef Indexable const& result_type;
+
+ result_type operator()(value_type const& value) const
+ {
+ return value->indexable;
+ }
+
+ bool equals(value_type const& v1, value_type const& v2) const
+ {
+ return v1 == v2;
+ }
+};
+
+}}}}
+
+template <typename T, typename C>
+struct generate_value< boost::shared_ptr<test_object<bg::model::point<T, 2, C> > > >
+{
+ typedef bg::model::point<T, 2, C> P;
+ typedef test_object<P> O;
+
+ static boost::shared_ptr<O> apply(int x, int y)
+ {
+ return boost::shared_ptr<O>(new O(P(x, y)));
+ }
+};
+
+template <typename T, typename C>
+struct generate_value< boost::shared_ptr<test_object<bg::model::point<T, 3, C> > > >
+{
+ typedef bg::model::point<T, 3, C> P;
+ typedef test_object<P> O;
+
+ static boost::shared_ptr<O> apply(int x, int y, int z)
+ {
+ return boost::shared_ptr<O>(new O(P(x, y, z)));
+ }
+};
+
+// generate input
+
 template <size_t Dimension>
 struct generate_input
 {};
@@ -745,7 +801,7 @@
 // rtree removing
 
 template <typename Value, typename Algo, typename Box>
-void test_remove(bgi::rtree<Value, Algo> & tree, Box const& qbox)
+void test_remove_clear(bgi::rtree<Value, Algo> & tree, std::vector<Value> const& input, Box const& qbox)
 {
     typedef bgi::rtree<Value, Algo> T;
 
@@ -807,6 +863,21 @@
         BOOST_CHECK( output.size() == tree.size() - values_to_remove.size() );
         test_compare_outputs(t, output, expected_output);
     }
+
+ //clear
+ {
+ std::vector<Value> expected_output;
+ tree.spatial_query(bgi::intersects(qbox), std::back_inserter(expected_output));
+ size_t s = tree.size();
+ tree.clear();
+ BOOST_CHECK(tree.empty());
+ BOOST_CHECK(tree.size() == 0);
+ tree.insert(input);
+ BOOST_CHECK(tree.size() == s);
+ std::vector<Value> output;
+ tree.spatial_query(bgi::intersects(qbox), std::back_inserter(output));
+ test_exactly_the_same_outputs(tree, output, expected_output);
+ }
 }
 
 // run all tests for a single Algorithm and single rtree
@@ -844,7 +915,7 @@
     test_copy_assignment_swap_move(tree, qbox);
 
     test_create_insert(tree, input, qbox);
- test_remove(tree, qbox);
+ test_remove_clear(tree, input, qbox);
 
     // empty tree test
 
@@ -874,6 +945,7 @@
     typedef std::pair<Point, int> PairP;
     typedef boost::tuple<Point, int, int> TupleP;
     typedef boost::tuple<Box, int, int> TupleB;
+ typedef boost::shared_ptr< test_object<Point> > SharedPtrP;
 
     test_rtree_by_value<Point, Parameters>(parameters);
     test_rtree_by_value<Box, Parameters>(parameters);
@@ -881,6 +953,7 @@
     test_rtree_by_value<PairP, Parameters>(parameters);
     test_rtree_by_value<TupleP, Parameters>(parameters);
     test_rtree_by_value<TupleB, Parameters>(parameters);
+ test_rtree_by_value<SharedPtrP, Parameters>(parameters);
 }
 
 #endif


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