Spatial_Tree< tree_type, bb_type, container_type > Class Template Reference

#include <Spatial_Tree.h>

Inherits Tree< container_type *, tree_type >.

Inheritance diagram for Spatial_Tree< tree_type, bb_type, container_type >:

Inheritance graph
[legend]
Collaboration diagram for Spatial_Tree< tree_type, bb_type, container_type >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual bool checkReady () const
virtual void ensureReady ()
virtual ~Spatial_Tree ()
virtual tree_type * insert (container_type *container)=0
virtual tree_type * remove (container_type *container)=0
template<class InputIterator>
void insertPolytopes (InputIterator begin, InputIterator end)
virtual vector< int > neighboursOf (const container_type *item) const=0
virtual vector< int > neighboursOf (const vector< double > &point, const unsigned int k) const=0
virtual vector< int > containedIn (const bb_type &box) const=0
virtual vector< int > intersects (const Point &point) const=0
virtual vector< int > intersects (const vector< double > &begin, const vector< double > &end) const=0
virtual vector< int > intersects (const vector< double > &a, const double b) const=0

Detailed Description

template<typename tree_type, typename bb_type, typename container_type>
class Spatial_Tree< tree_type, bb_type, container_type >

Specializes a generic Tree to force support for Shells operations on stored data.

For the application on Shell's problem, we need a Tree which stores Polytopes. Also, the queries which Shell wants to execute on the data stored in this tree, are declared as purely virtual functions here. This forces any derived class to have to implement code to support those queries.

Definition at line 31 of file Spatial_Tree.h.


Constructor & Destructor Documentation

template<typename tree_type, typename bb_type, typename container_type>
virtual Spatial_Tree< tree_type, bb_type, container_type >::~Spatial_Tree (  )  [inline, virtual]

Base deconstructor

Definition at line 52 of file Spatial_Tree.h.


Member Function Documentation

template<typename tree_type, typename bb_type, typename container_type>
virtual bool Spatial_Tree< tree_type, bb_type, container_type >::checkReady (  )  const [inline, virtual]

Checks if the tree is ready for access.

Returns:
Whether or not the tree is ready for access.

Definition at line 41 of file Spatial_Tree.h.

template<typename tree_type, typename bb_type, typename container_type>
virtual void Spatial_Tree< tree_type, bb_type, container_type >::ensureReady (  )  [inline, virtual]

Checks if the tree is ready for queries. If not, it starts the procedures necessary to make it so.

Definition at line 47 of file Spatial_Tree.h.

template<typename tree_type, typename bb_type, typename container_type>
virtual tree_type* Spatial_Tree< tree_type, bb_type, container_type >::insert ( container_type *  container  )  [pure virtual]

Inserts a single element into the tree structure

Parameters:
container Pointer to the container to be added
Returns:
The tree root after the operation has finished

Implements Tree< container_type *, tree_type >.

Implemented in Basic_R_tree, and Hilbert_R_tree.

Referenced by Spatial_Tree< Basic_R_tree, BB_type, BB_container >::insertPolytopes().

template<typename tree_type, typename bb_type, typename container_type>
virtual tree_type* Spatial_Tree< tree_type, bb_type, container_type >::remove ( container_type *  container  )  [pure virtual]

Removes elements from the tree. This is also a tree-type specific operation and thus is virtual here.

Parameters:
container Pointer to the element to be removed
Returns:
The root of the tree after the operation is done

Implements Tree< container_type *, tree_type >.

Implemented in Basic_R_tree, and Hilbert_R_tree.

template<typename tree_type, typename bb_type, typename container_type>
template<class InputIterator>
void Spatial_Tree< tree_type, bb_type, container_type >::insertPolytopes ( InputIterator  begin,
InputIterator  end 
) [inline]

Inserts a range of polytopes into the tree structure.

Parameters:
begin An iterator at the first polytope to be added.
end An iterator at one location past the last iterator to be added.

Definition at line 100 of file Spatial_Tree.h.

template<typename tree_type, typename bb_type, typename container_type>
virtual vector<int> Spatial_Tree< tree_type, bb_type, container_type >::neighboursOf ( const container_type *  item  )  const [pure virtual]

Searches and returns which polytopes are considered to be neighbours of a given polytope pointed to.

Parameters:
item A pointer to the Polytope we wish to know the neighbours of.
Returns:
An index vector of the polytopes fitting the query.

Implemented in R_tree< r_tree_variation >, R_tree< Basic_R_tree >, and R_tree< Hilbert_R_tree >.

template<typename tree_type, typename bb_type, typename container_type>
virtual vector<int> Spatial_Tree< tree_type, bb_type, container_type >::neighboursOf ( const vector< double > &  point,
const unsigned int  k 
) const [pure virtual]

Searches and returns the polytopes that are the closest neighbours of a given point.

Parameters:
point The point we wish to know the neighbours of.
k The number of neighbours we are looking for.
Returns:
An index vector of the polytopes fitting the query.

Implemented in R_tree< r_tree_variation >, R_tree< Basic_R_tree >, and R_tree< Hilbert_R_tree >.

template<typename tree_type, typename bb_type, typename container_type>
virtual vector<int> Spatial_Tree< tree_type, bb_type, container_type >::containedIn ( const bb_type &  box  )  const [pure virtual]

Searches and returns all polytopes which are contained in a given bounding box.

Parameters:
box The given bounding box.
Returns:
An index vector of the polytopes fitting the query.

Implemented in R_tree< r_tree_variation >, R_tree< Basic_R_tree >, and R_tree< Hilbert_R_tree >.

template<typename tree_type, typename bb_type, typename container_type>
virtual vector<int> Spatial_Tree< tree_type, bb_type, container_type >::intersects ( const Point point  )  const [pure virtual]

Searches and returns all polytopes which intersect a given Point.

Parameters:
point The given point.
Returns:
An index vector of the polytopes fitting the query.

Implemented in R_tree< r_tree_variation >, R_tree< Basic_R_tree >, and R_tree< Hilbert_R_tree >.

template<typename tree_type, typename bb_type, typename container_type>
virtual vector<int> Spatial_Tree< tree_type, bb_type, container_type >::intersects ( const vector< double > &  begin,
const vector< double > &  end 
) const [pure virtual]

Searches and returns all polytopes which intersect a line defined by its given start- en ending points.

Parameters:
begin The starting point of the line
end The ending point of the line
Returns:
An index vector of the polytopes fitting the query

Implemented in R_tree< r_tree_variation >, R_tree< Basic_R_tree >, and R_tree< Hilbert_R_tree >.

template<typename tree_type, typename bb_type, typename container_type>
virtual vector<int> Spatial_Tree< tree_type, bb_type, container_type >::intersects ( const vector< double > &  a,
const double  b 
) const [pure virtual]

Searches and returns all polytopes which intersect an affine hyperplane. A hyperplane is defined as:

a_1 * x_1 + a_2 * x_2 + ... + a_{n-1} * x_{n-1} = b

where n is the dimension of the bounding boxes stored in this tree, a is a vector of length n-1, x are the coordinates in R^{(n-1)} which lie on the hyperplane, b is a scalar.

Parameters:
a The n-1 vector a.
b The scalar b.
Returns:
An index vector of the polytopes fitting the query.

Implemented in R_tree< r_tree_variation >, R_tree< Basic_R_tree >, and R_tree< Hilbert_R_tree >.


The documentation for this class was generated from the following file:
Generated on Sat Oct 13 17:34:43 2007 for R-Tree by  doxygen 1.5.2