|
Boost-Commit : |
From: mariano.consoni_at_[hidden]
Date: 2008-07-23 15:03:52
Author: mconsoni
Date: 2008-07-23 15:03:51 EDT (Wed, 23 Jul 2008)
New Revision: 47735
URL: http://svn.boost.org/trac/boost/changeset/47735
Log:
- Reordered public/private.
Text files modified:
sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree.hpp | 15 ++-
sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree_node.hpp | 155 ++++++++++++++++++++-------------------
2 files changed, 86 insertions(+), 84 deletions(-)
Modified: sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree.hpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree.hpp (original)
+++ sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree.hpp 2008-07-23 15:03:51 EDT (Wed, 23 Jul 2008)
@@ -25,13 +25,6 @@
template < typename Point, typename Value > class quadtree
{
- private:
- quadtree_node < Point, Value > root;
- unsigned int element_count;
-
- // number of points in each node
- unsigned int node_size_;
-
public:
quadtree(const geometry::box < Point > &r)
: root(r, 1), element_count(0), node_size_(1)
@@ -115,6 +108,14 @@
{
return element_count;
}
+
+ private:
+ quadtree_node < Point, Value > root;
+ unsigned int element_count;
+
+ // number of points in each node
+ unsigned int node_size_;
+
};
Modified: sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree_node.hpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree_node.hpp (original)
+++ sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree_node.hpp 2008-07-23 15:03:51 EDT (Wed, 23 Jul 2008)
@@ -27,83 +27,6 @@
template < typename Point, typename Value > class quadtree_node
{
- private:
- /// pointers to child nodes
- boost::shared_ptr < quadtree_node > nw_;
- boost::shared_ptr < quadtree_node > ne_;
- boost::shared_ptr < quadtree_node > sw_;
- boost::shared_ptr < quadtree_node > se_;
-
- /// this node's points
- std::map < Point, Value > m_;
-
- /// the bounding rectangle for the node
- geometry::box < Point > bounding_rectangle_;
-
- /// number of points in each node
- unsigned int node_size_;
-
- /// divide the node in four quadrants
- void divide_quadrants(geometry::box < Point > &ne_box,
- geometry::box < Point > &sw_box,
- geometry::box < Point > &se_box,
- geometry::box < Point > &nw_box) const
- {
-
- geometry::get < 0 > (ne_box.min()) =
- (geometry::get < 0 > (bounding_rectangle_.max()) - geometry::get < 0 >
- (bounding_rectangle_.min())) / 2.0 + geometry::get < 0 >
- (bounding_rectangle_.min());
- geometry::get < 1 > (ne_box.min()) =
- (geometry::get < 1 > (bounding_rectangle_.max()) - geometry::get < 1 >
- (bounding_rectangle_.min())) / 2.0 + geometry::get < 1 >
- (bounding_rectangle_.min());
- geometry::get < 0 > (ne_box.max()) =
- geometry::get < 0 > (bounding_rectangle_.max());
- geometry::get < 1 > (ne_box.max()) =
- geometry::get < 1 > (bounding_rectangle_.max());
-
- geometry::get < 0 > (sw_box.min()) =
- geometry::get < 0 > (bounding_rectangle_.min());
- geometry::get < 1 > (sw_box.min()) =
- geometry::get < 1 > (bounding_rectangle_.min());
- geometry::get < 0 > (sw_box.max()) =
- (geometry::get < 0 > (bounding_rectangle_.max()) - geometry::get < 0 >
- (bounding_rectangle_.min())) / 2.0 + geometry::get < 0 >
- (bounding_rectangle_.min());
- geometry::get < 1 > (sw_box.max()) =
- (geometry::get < 1 > (bounding_rectangle_.max()) - geometry::get < 1 >
- (bounding_rectangle_.min())) / 2.0 + geometry::get < 1 >
- (bounding_rectangle_.min());
-
- geometry::get < 0 > (se_box.min()) =
- (geometry::get < 0 > (bounding_rectangle_.max()) - geometry::get < 0 >
- (bounding_rectangle_.min())) / 2.0 + geometry::get < 0 >
- (bounding_rectangle_.min());
- geometry::get < 1 > (se_box.min()) =
- geometry::get < 1 > (bounding_rectangle_.min());
- geometry::get < 0 > (se_box.max()) =
- geometry::get < 0 > (bounding_rectangle_.max());
- geometry::get < 1 > (se_box.max()) =
- (geometry::get < 1 > (bounding_rectangle_.max()) - geometry::get < 1 >
- (bounding_rectangle_.min())) / 2.0 + geometry::get < 1 >
- (bounding_rectangle_.min());
-
- geometry::get < 0 > (nw_box.min()) =
- geometry::get < 0 > (bounding_rectangle_.min());
- geometry::get < 1 > (nw_box.min()) =
- (geometry::get < 1 > (bounding_rectangle_.max()) - geometry::get < 1 >
- (bounding_rectangle_.min())) / 2.0 + geometry::get < 1 >
- (bounding_rectangle_.min());
- geometry::get < 0 > (nw_box.max()) =
- (geometry::get < 0 > (bounding_rectangle_.max()) - geometry::get < 0 >
- (bounding_rectangle_.min())) / 2.0 + geometry::get < 0 >
- (bounding_rectangle_.min());
- geometry::get < 1 > (nw_box.max()) =
- geometry::get < 1 > (bounding_rectangle_.max());
- }
-
-
public:
quadtree_node(const geometry::box < Point > &r,
const unsigned int node_size)
@@ -368,6 +291,84 @@
std::cerr << "--------------------------------------" << std::endl;
}
+ private:
+ /// pointers to child nodes
+ boost::shared_ptr < quadtree_node > nw_;
+ boost::shared_ptr < quadtree_node > ne_;
+ boost::shared_ptr < quadtree_node > sw_;
+ boost::shared_ptr < quadtree_node > se_;
+
+ /// this node's points
+ std::map < Point, Value > m_;
+
+ /// the bounding rectangle for the node
+ geometry::box < Point > bounding_rectangle_;
+
+ /// number of points in each node
+ unsigned int node_size_;
+
+ /// divide the node in four quadrants
+ void divide_quadrants(geometry::box < Point > &ne_box,
+ geometry::box < Point > &sw_box,
+ geometry::box < Point > &se_box,
+ geometry::box < Point > &nw_box) const
+ {
+
+ geometry::get < 0 > (ne_box.min()) =
+ (geometry::get < 0 > (bounding_rectangle_.max()) - geometry::get < 0 >
+ (bounding_rectangle_.min())) / 2.0 + geometry::get < 0 >
+ (bounding_rectangle_.min());
+ geometry::get < 1 > (ne_box.min()) =
+ (geometry::get < 1 > (bounding_rectangle_.max()) - geometry::get < 1 >
+ (bounding_rectangle_.min())) / 2.0 + geometry::get < 1 >
+ (bounding_rectangle_.min());
+ geometry::get < 0 > (ne_box.max()) =
+ geometry::get < 0 > (bounding_rectangle_.max());
+ geometry::get < 1 > (ne_box.max()) =
+ geometry::get < 1 > (bounding_rectangle_.max());
+
+ geometry::get < 0 > (sw_box.min()) =
+ geometry::get < 0 > (bounding_rectangle_.min());
+ geometry::get < 1 > (sw_box.min()) =
+ geometry::get < 1 > (bounding_rectangle_.min());
+ geometry::get < 0 > (sw_box.max()) =
+ (geometry::get < 0 > (bounding_rectangle_.max()) - geometry::get < 0 >
+ (bounding_rectangle_.min())) / 2.0 + geometry::get < 0 >
+ (bounding_rectangle_.min());
+ geometry::get < 1 > (sw_box.max()) =
+ (geometry::get < 1 > (bounding_rectangle_.max()) - geometry::get < 1 >
+ (bounding_rectangle_.min())) / 2.0 + geometry::get < 1 >
+ (bounding_rectangle_.min());
+
+ geometry::get < 0 > (se_box.min()) =
+ (geometry::get < 0 > (bounding_rectangle_.max()) - geometry::get < 0 >
+ (bounding_rectangle_.min())) / 2.0 + geometry::get < 0 >
+ (bounding_rectangle_.min());
+ geometry::get < 1 > (se_box.min()) =
+ geometry::get < 1 > (bounding_rectangle_.min());
+ geometry::get < 0 > (se_box.max()) =
+ geometry::get < 0 > (bounding_rectangle_.max());
+ geometry::get < 1 > (se_box.max()) =
+ (geometry::get < 1 > (bounding_rectangle_.max()) - geometry::get < 1 >
+ (bounding_rectangle_.min())) / 2.0 + geometry::get < 1 >
+ (bounding_rectangle_.min());
+
+ geometry::get < 0 > (nw_box.min()) =
+ geometry::get < 0 > (bounding_rectangle_.min());
+ geometry::get < 1 > (nw_box.min()) =
+ (geometry::get < 1 > (bounding_rectangle_.max()) - geometry::get < 1 >
+ (bounding_rectangle_.min())) / 2.0 + geometry::get < 1 >
+ (bounding_rectangle_.min());
+ geometry::get < 0 > (nw_box.max()) =
+ (geometry::get < 0 > (bounding_rectangle_.max()) - geometry::get < 0 >
+ (bounding_rectangle_.min())) / 2.0 + geometry::get < 0 >
+ (bounding_rectangle_.min());
+ geometry::get < 1 > (nw_box.max()) =
+ geometry::get < 1 > (bounding_rectangle_.max());
+ }
+
+
+
};
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