Fermat
Public Methods | Static Public Methods | Public Members | Static Public Members | List of all members
cugar::Kd_node Struct Reference

Detailed description

A k-d tree node. A node can either be a leaf and have no children, or be an internal split node. If a split node, its children will be consecutive in memory. Supports up to 7 dimensions.

#include <kd_node.h>

Public Methods

CUGAR_HOST_DEVICE Kd_node ()
 
CUGAR_HOST_DEVICE Kd_node (uint32 index)
 
CUGAR_HOST_DEVICE Kd_node (const uint32 split_dim, const float split_plane, uint32 index)
 
CUGAR_HOST_DEVICE Kd_node (const uint32 packed_info, const float split_plane)
 
CUGAR_HOST_DEVICE uint32 is_leaf () const
 
CUGAR_HOST_DEVICE uint32 get_child_offset () const
 
CUGAR_HOST_DEVICE uint32 get_leaf_index () const
 
CUGAR_HOST_DEVICE uint32 get_child (const uint32 i) const
 
CUGAR_HOST_DEVICE bool has_child (const uint32 i) const
 
CUGAR_HOST_DEVICE uint32 get_left () const
 
CUGAR_HOST_DEVICE uint32 get_right () const
 
CUGAR_HOST_DEVICE uint32 get_split_dim () const
 
CUGAR_HOST_DEVICE float get_split_plane () const
 

Static Public Methods

static CUGAR_HOST_DEVICE Kd_node load (const Kd_node *node)
 
static CUGAR_HOST_DEVICE Kd_node load_ldg (const Kd_node *node)
 

Public Members

uint32 m_packed_info
 
float m_split_plane
 

Static Public Members

static const uint32 kInvalid = uint32(-1)
 

Constructor & Destructor Documentation

◆ Kd_node() [1/4]

CUGAR_HOST_DEVICE cugar::Kd_node::Kd_node ( )
inline

empty constructor

◆ Kd_node() [2/4]

CUGAR_HOST_DEVICE cugar::Kd_node::Kd_node ( uint32  index)
inline

leaf constructor

Parameters
indexchild index

◆ Kd_node() [3/4]

CUGAR_HOST_DEVICE cugar::Kd_node::Kd_node ( const uint32  split_dim,
const float  split_plane,
uint32  index 
)
inline

split node constructor

Parameters
split_dimsplitting dimension
split_planesplitting plane
indexchild index

◆ Kd_node() [4/4]

CUGAR_HOST_DEVICE cugar::Kd_node::Kd_node ( const uint32  packed_info,
const float  split_plane 
)
inline

leaf constructor

Parameters
indexchild index

Member Function Documentation

◆ get_child()

CUGAR_HOST_DEVICE uint32 cugar::Kd_node::get_child ( const uint32  i) const
inline

get i-th child

Parameters
ichild index

◆ get_child_offset()

CUGAR_HOST_DEVICE uint32 cugar::Kd_node::get_child_offset ( ) const
inline

get offset of the first child

◆ get_leaf_index()

CUGAR_HOST_DEVICE uint32 cugar::Kd_node::get_leaf_index ( ) const
inline

get leaf index

◆ get_left()

CUGAR_HOST_DEVICE uint32 cugar::Kd_node::get_left ( ) const
inline

get left partition (or kInvalid if not active)

◆ get_right()

CUGAR_HOST_DEVICE uint32 cugar::Kd_node::get_right ( ) const
inline

get right partition (or kInvalid if not active)

◆ get_split_dim()

CUGAR_HOST_DEVICE uint32 cugar::Kd_node::get_split_dim ( ) const
inline

get splitting dimension

◆ get_split_plane()

CUGAR_HOST_DEVICE float cugar::Kd_node::get_split_plane ( ) const
inline

get splitting plane

◆ has_child()

CUGAR_HOST_DEVICE bool cugar::Kd_node::has_child ( const uint32  i) const
inline

is the i-th child active?

Parameters
ichild index

◆ is_leaf()

CUGAR_HOST_DEVICE uint32 cugar::Kd_node::is_leaf ( ) const
inline

is a leaf?


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