Simple 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 | |
| SimpleKDNode () | |
| Initialize a KD-tree node. More... | |
| SimpleKDNode (const DataRecord &data) | |
| Initialize a KD-tree node with the given data record. 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... | |
| 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... | |
| 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 |
| IndexType | right |
| DataRecord | data |
| uint8_t | flags |
Static Public Attributes | |
| static const bool | leftBalancedLayout = false |
Simple kd-tree node for use with PointKDTree.
This class is an example of how one might write a space-efficient kd-tree node that is compatible with the PointKDTree class. The implementation supports associating a custom data record with each node and works up to 16 dimensions.
| _PointType | Underlying point data type (e.g. TPoint3<float>) |
| _DataRecord | Custom storage that should be associated with each tree node |
| typedef _DataRecord mitsuba::SimpleKDNode< _PointType, _DataRecord >::DataRecord |
| typedef uint32_t mitsuba::SimpleKDNode< _PointType, _DataRecord >::IndexType |
| typedef _PointType mitsuba::SimpleKDNode< _PointType, _DataRecord >::PointType |
| typedef PointType::Scalar mitsuba::SimpleKDNode< _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::SimpleKDNode< _PointType, _DataRecord >::data |
| uint8_t mitsuba::SimpleKDNode< _PointType, _DataRecord >::flags |
|
static |
| PointType mitsuba::SimpleKDNode< _PointType, _DataRecord >::position |
| IndexType mitsuba::SimpleKDNode< _PointType, _DataRecord >::right |