Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::LeftBalancedKDNode< _PointType, _DataRecord > Struct Template Reference

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 PointTypegetPosition () const
 Return the position associated with this node. More...
 
void setPosition (const PointType &value)
 Set the position associated with this node. More...
 
DataRecordgetData ()
 Return the data record associated with this node. More...
 
const DataRecordgetData () 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
 

Detailed Description

template<typename _PointType, typename _DataRecord>
struct mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >

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.

Template Parameters
_PointTypeUnderlying point data type (e.g. TPoint3<float>)
_DataRecordCustom storage that should be associated with each tree node
See Also
PointKDTree
SimpleKDNode

Member Typedef Documentation

template<typename _PointType , typename _DataRecord >
typedef _DataRecord mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::DataRecord
template<typename _PointType , typename _DataRecord >
typedef uint32_t mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::IndexType
template<typename _PointType , typename _DataRecord >
typedef _PointType mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::PointType
template<typename _PointType , typename _DataRecord >
typedef PointType::Scalar mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::Scalar

Member Enumeration Documentation

template<typename _PointType , typename _DataRecord >
anonymous enum
Enumerator
ELeafFlag 
EAxisMask 

Constructor & Destructor Documentation

template<typename _PointType , typename _DataRecord >
mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::LeftBalancedKDNode ( )
inline

Initialize a KD-tree node.

template<typename _PointType , typename _DataRecord >
mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::LeftBalancedKDNode ( const DataRecord data)
inline

Initialize a KD-tree node with the given data record.

Member Function Documentation

template<typename _PointType , typename _DataRecord >
uint16_t mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::getAxis ( ) const
inline

Return the split axis associated with this node.

template<typename _PointType , typename _DataRecord >
DataRecord& mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::getData ( )
inline

Return the data record associated with this node.

template<typename _PointType , typename _DataRecord >
const DataRecord& mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::getData ( ) const
inline

Return the data record associated with this node (const version)

template<typename _PointType , typename _DataRecord >
IndexType mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::getLeftIndex ( IndexType  self) const
inline

Given the current node's index, return the index of the left child.

template<typename _PointType , typename _DataRecord >
const PointType& mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::getPosition ( ) const
inline

Return the position associated with this node.

template<typename _PointType , typename _DataRecord >
IndexType mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::getRightIndex ( IndexType  self) const
inline

Given the current node's index, return the index of the right child.

template<typename _PointType , typename _DataRecord >
bool mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::isLeaf ( ) const
inline

Check whether this is a leaf node.

template<typename _PointType , typename _DataRecord >
void mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::setAxis ( uint8_t  axis)
inline

Set the split flags associated with this node.

template<typename _PointType , typename _DataRecord >
void mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::setData ( const DataRecord val)
inline

Set the data record associated with this node.

template<typename _PointType , typename _DataRecord >
void mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::setLeaf ( bool  value)
inline

Specify whether this is a leaf node.

template<typename _PointType , typename _DataRecord >
void mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::setLeftIndex ( IndexType  self,
IndexType  value 
)
inline

Given the current node's index, set the left child index.

template<typename _PointType , typename _DataRecord >
void mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::setPosition ( const PointType value)
inline

Set the position associated with this node.

template<typename _PointType , typename _DataRecord >
void mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::setRightIndex ( IndexType  self,
IndexType  value 
)
inline

Given the current node's index, set the right child index.

Member Data Documentation

template<typename _PointType , typename _DataRecord >
DataRecord mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::data
template<typename _PointType , typename _DataRecord >
uint8_t mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::flags
template<typename _PointType , typename _DataRecord >
const bool mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::leftBalancedLayout = true
static
template<typename _PointType , typename _DataRecord >
PointType mitsuba::LeftBalancedKDNode< _PointType, _DataRecord >::position

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