| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Attributes
TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag > Class Template Reference

Class that represents a node of a TeKdTree. More...

`#include <TeKdTree.h>`

List of all members.

## Public Types

typedef NodeKey | kdKey
| Export key type.
typedef NodeData | kdData
| Export data type.
typedef NodeDataItem | kdDataItem
| Export data item type.
typedef NodeDataTag | kdDataTag
| Export data type.

## Public Member Functions

| TeKdTreeNode (const NodeKey &k)
| Constructor.
void | setKey (const NodeKey &k)
| Sets the key to the node.
const NodeKey & | getKey (void) const
| Returns a reference to node key.
void | setData (const NodeData &data)
| Sets the data in the node.
NodeData & | getData (void)
| Returns a reference to data node.
void | setLeft (TeKdTreeNode *node)
| Sets the left child pointer.
void | setRight (TeKdTreeNode *node)
| Sets the right child pointer.
TeKdTreeNode * | getLeft (void) const
| Accessor for left child.
TeKdTreeNode * | getRight (void) const
| Accessor for right child.
bool | hasLeft (void) const
| Method to check if this has a left child.
bool | hasRight (void) const
| Method to check if a this has a right child.
bool | isLeaf (void) const
| Method to check if this has no children.
unsigned int | descendants (void) const
| Method to count the number of nodes below this.

## Protected Attributes

NodeKey | key_
| The key used to access this record.
NodeData | data_
| The data stored in this record.
TeKdTreeNode * | left_
| Pointer to the left sub-tree.
TeKdTreeNode * | right_
| Pointer to the right sub-tree.

## Detailed Description

### template<class NodeKey, class NodeData, class NodeDataItem, class NodeDataTag = kd_node_data_single_tag>
class TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >

Class that represents a node of a TeKdTree.

Each node contains a pointer to its left and right subtree (NULL if it is not set), one key used for insertion of the data into the tree.

WARNING:

1. The key must have methods called x() and y().

2. These kind of node stores the data in each node.

3. The nodes may contains one single element (kd_node_data_single_tag) or a set of values (kd_node_data_set_tag).

4. If the node type is kd_node_data_single_tag than NodeData and NodeDataItem are the same types. And if one entry with the same key already exist, so they will be overwrite.

5. If the node type is kd_node_data_set_tag than NodeData mus have a method called push_back(NodeDataItem) that permits to store elements with the same key in the node.

## Member Typedef Documentation

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

typedef NodeData TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::kdData

Export data type.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

typedef NodeDataItem TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::kdDataItem

Export data item type.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

typedef NodeDataTag TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::kdDataTag

Export data type.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

typedef NodeKey TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::kdKey

Export key type.

## Constructor & Destructor Documentation

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::TeKdTreeNode | ( | const NodeKey & | k | ) | `[inline]`

Constructor.

## Member Function Documentation

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

unsigned int TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::descendants | ( | void |  | ) | const`[inline]`

Method to count the number of nodes below this.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

NodeData& TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::getData | ( | void |  | ) | `[inline]`

Returns a reference to data node.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

const NodeKey& TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::getKey | ( | void |  | ) | const`[inline]`

Returns a reference to node key.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

TeKdTreeNode* TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::getLeft | ( | void |  | ) | const`[inline]`

Accessor for left child.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

TeKdTreeNode* TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::getRight | ( | void |  | ) | const`[inline]`

Accessor for right child.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

bool TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::hasLeft | ( | void |  | ) | const`[inline]`

Method to check if this has a left child.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

bool TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::hasRight | ( | void |  | ) | const`[inline]`

Method to check if a this has a right child.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

bool TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::isLeaf | ( | void |  | ) | const`[inline]`

Method to check if this has no children.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

void TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::setData | ( | const NodeData & | data | ) | `[inline]`

Sets the data in the node.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

void TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::setKey | ( | const NodeKey & | k | ) | `[inline]`

Sets the key to the node.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

void TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::setLeft | ( | TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag > * | node | ) | `[inline]`

Sets the left child pointer.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

void TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::setRight | ( | TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag > * | node | ) | `[inline]`

Sets the right child pointer.

## Member Data Documentation

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

NodeData TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::data_`[protected]`

The data stored in this record.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

NodeKey TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::key_`[protected]`

The key used to access this record.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

TeKdTreeNode* TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::left_`[protected]`

Pointer to the left sub-tree.

template<class NodeKey , class NodeData , class NodeDataItem , class NodeDataTag = kd_node_data_single_tag>

TeKdTreeNode* TeSAM::TeKdTreeNode< NodeKey, NodeData, NodeDataItem, NodeDataTag >::right_`[protected]`

Pointer to the right sub-tree.

The documentation for this class was generated from the following file:

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeKdTree.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines