A class that represents a two dimensional K-d Tree (2-d Tree). More...
#include <Index.h>
Public Types | |
| typedef KdTreeNode::kdData | kdData | 
| Export data type.  More... | |
| typedef KdTreeNode::kdDataItem | kdDataItem | 
| Export data item type.  More... | |
| typedef KdTreeNode::kdDataTag | kdDataTag | 
| Export data type.  More... | |
| typedef KdTreeNode::kdKey | kdKey | 
| Export key type.  More... | |
Public Member Functions | |
| void | buildOptimized (std::vector< std::pair< kdKey, kdData > > &dataSet) | 
| It inserts the data in the tree and and keeps it balanced: the kdsort algorithm must be called before.  More... | |
| void | clear () | 
| It clears all tree nodes.  More... | |
| const te::gm::Envelope & | getMBR () const | 
| It gets the minimum bounding box of all elements in the tree.  More... | |
| Index (const te::gm::Envelope &mbr) | |
| Constructor.  More... | |
| void | insert (const kdKey &key, const kdData &item) | 
| It inserts the data with a given key in tree.  More... | |
| bool | isEmpty () const | 
| It returns true if the tree is empty and false otherwise.  More... | |
| void | search (const te::gm::Envelope &e, std::vector< KdTreeNode *> &report) const | 
| Range search query.  More... | |
| void | setMBR (const te::gm::Envelope &mbr) | 
| It sets the minimum bounding box of all elements in the tree.  More... | |
| const std::size_t & | size () const | 
| It returns the number of tree nodes.  More... | |
| ~Index () | |
| Destructor.  More... | |
Private Member Functions | |
| KdTreeNode * | buildOptimized (std::vector< std::pair< kdKey, kdData > > &dataSet, const std::size_t &first, const std::size_t &last) | 
| It builds the tree recursively.  More... | |
| void | erase (KdTreeNode *node) | 
| It Erases a node from the tree and all nodes below it.  More... | |
| Index (const Index &rhs) | |
| No copy constructor allowed.  More... | |
| void | insertData (KdTreeNode *&node, const kdData &data, const kd_node_m_datasingle_tag &) | 
| It inserts data for single nodes, i.e. nodes that stores only one element.  More... | |
| void | insertData (KdTreeNode *&node, const kdData &data, const kd_node_m_dataset_tag &) | 
| It inserts data for set nodes, i.e., nodes that may stores many element.  More... | |
| Index & | operator= (const Index &rhs) | 
| No assignment operator allowed.  More... | |
| void | search (const te::gm::Envelope &e, KdTreeNode *node, const char &level, std::vector< KdTreeNode *> &report) const | 
| Recursive range query.  More... | |
Private Attributes | |
| te::gm::Envelope | m_mbr | 
| Minimum bounding box of all nodes.  More... | |
| KdTreeNode * | m_root | 
| Pointer to the root node.  More... | |
| std::size_t | m_size | 
| The size of the K-d Tree (number of nodes).  More... | |
A class that represents a two dimensional K-d Tree (2-d Tree).
| typedef KdTreeNode::kdData te::sam::kdtree::Index< KdTreeNode >::kdData | 
| typedef KdTreeNode::kdDataItem te::sam::kdtree::Index< KdTreeNode >::kdDataItem | 
| typedef KdTreeNode::kdDataTag te::sam::kdtree::Index< KdTreeNode >::kdDataTag | 
| typedef KdTreeNode::kdKey te::sam::kdtree::Index< KdTreeNode >::kdKey | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  private | 
No copy constructor allowed.
| rhs | The other index. | 
      
  | 
  inline | 
It inserts the data in the tree and and keeps it balanced: the kdsort algorithm must be called before.
Definition at line 136 of file Index.h.
Referenced by te::sam::kdtree::Index< te::sam::kdtree::Node >::buildOptimized().
      
  | 
  inlineprivate | 
      
  | 
  inline | 
It clears all tree nodes.
Definition at line 98 of file Index.h.
Referenced by te::sam::kdtree::Index< te::sam::kdtree::Node >::~Index().
      
  | 
  inlineprivate | 
It Erases a node from the tree and all nodes below it.
Definition at line 152 of file Index.h.
Referenced by te::sam::kdtree::Index< te::sam::kdtree::Node >::clear(), and te::sam::kdtree::Index< te::sam::kdtree::Node >::erase().
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inlineprivate | 
      
  | 
  inlineprivate | 
      
  | 
  inline | 
      
  | 
  private | 
No assignment operator allowed.
| rhs | The other index. | 
      
  | 
  inline | 
Range search query.
Definition at line 143 of file Index.h.
Referenced by te::sam::kdtree::Index< te::sam::kdtree::Node >::search().
      
  | 
  inlineprivate | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  private | 
Minimum bounding box of all nodes.
Definition at line 218 of file Index.h.
Referenced by te::sam::kdtree::Index< te::sam::kdtree::Node >::getMBR(), and te::sam::kdtree::Index< te::sam::kdtree::Node >::setMBR().
      
  | 
  private | 
Pointer to the root node.
Definition at line 217 of file Index.h.
Referenced by te::sam::kdtree::Index< te::sam::kdtree::Node >::buildOptimized(), te::sam::kdtree::Index< te::sam::kdtree::Node >::clear(), te::sam::kdtree::Index< te::sam::kdtree::Node >::isEmpty(), and te::sam::kdtree::Index< te::sam::kdtree::Node >::search().
      
  | 
  private | 
The size of the K-d Tree (number of nodes).
Definition at line 219 of file Index.h.
Referenced by te::sam::kdtree::Index< te::sam::kdtree::Node >::buildOptimized(), te::sam::kdtree::Index< te::sam::kdtree::Node >::clear(), and te::sam::kdtree::Index< te::sam::kdtree::Node >::size().