Left-balanced kd-tree node for use with PointKDTree. More...
#include <mitsuba/core/kdtree.h>
Public Types | |
enum | { ELeafFlag = 0x10, EAxisMask = 0x0F } |
typedef _PointType | PointType |
typedef _DataRecord | DataRecord |
typedef uint32_t | IndexType |
typedef PointType::Scalar | Scalar |
Public Member Functions | |
LeftBalancedKDNode () | |
Initialize a KD-tree node. More... | |
LeftBalancedKDNode (const DataRecord &data) | |
Initialize a KD-tree node with the given data record. More... | |
IndexType | getLeftIndex (IndexType self) const |
Given the current node's index, return the index of the left child. More... | |
void | setLeftIndex (IndexType self, IndexType value) |
Given the current node's index, set the left child index. More... | |
IndexType | getRightIndex (IndexType self) const |
Given the current node's index, return the index of the right child. More... | |
void | setRightIndex (IndexType self, IndexType value) |
Given the current node's index, set the right child index. More... | |
bool | isLeaf () const |
Check whether this is a leaf node. More... | |
void | setLeaf (bool value) |
Specify whether this is a leaf node. More... | |
uint16_t | getAxis () const |
Return the split axis associated with this node. More... | |
void | setAxis (uint8_t axis) |
Set the split flags associated with this node. More... | |
const PointType & | getPosition () const |
Return the position associated with this node. More... | |
void | setPosition (const PointType &value) |
Set the position associated with this node. More... | |
DataRecord & | getData () |
Return the data record associated with this node. More... | |
const DataRecord & | getData () const |
Return the data record associated with this node (const version) More... | |
void | setData (const DataRecord &val) |
Set the data record associated with this node. More... | |
Public Attributes | |
PointType | position |
DataRecord | data |
uint8_t | flags |
Static Public Attributes | |
static const bool | leftBalancedLayout = true |
Left-balanced kd-tree node for use with PointKDTree.
This class provides a basic kd-tree node layout that can be used with the PointKDTree class and the PointKDTree::ELeftBalanced tree construction heuristic. The advantage of a left-balanced tree is that there is no need to store node pointers within nodes.
_PointType | Underlying point data type (e.g. TPoint3<float>) |
_DataRecord | Custom storage that should be associated with each tree node |
typedef _DataRecord mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::DataRecord |
typedef uint32_t mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::IndexType |
typedef _PointType mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::PointType |
typedef PointType::Scalar mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::Scalar |
|
inline |
Initialize a KD-tree node.
|
inline |
Initialize a KD-tree node with the given data record.
|
inline |
Return the split axis associated with this node.
|
inline |
Return the data record associated with this node.
|
inline |
Return the data record associated with this node (const version)
|
inline |
Given the current node's index, return the index of the left child.
|
inline |
Return the position associated with this node.
|
inline |
Given the current node's index, return the index of the right child.
|
inline |
Check whether this is a leaf node.
|
inline |
Set the split flags associated with this node.
|
inline |
Set the data record associated with this node.
|
inline |
Specify whether this is a leaf node.
|
inline |
Given the current node's index, set the left child index.
|
inline |
Set the position associated with this node.
|
inline |
Given the current node's index, set the right child index.
DataRecord mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::data |
uint8_t mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::flags |
|
static |
PointType mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::position |