rkdTreeNode< T > Class Template Reference

#include <ray_kdtree.h>

Collaboration diagram for rkdTreeNode< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void createLeaf (u_int32 *primIdx, int np, const T **prims, MemoryArena &arena)
void createInterior (int axis, PFLOAT d)
PFLOAT SplitPos () const
int SplitAxis () const
int nPrimitives () const
bool IsLeaf () const
u_int32 getRightChild () const
void setRightChild (u_int32 i)

Public Attributes

union {
   PFLOAT   division
 interior: division plane position
   T **   primitives
 leaf: list of primitives
   T *   onePrimitive
 leaf: direct inxex of one primitive
}; 
u_int32 flags
 2bits: isLeaf, axis; 30bits: nprims (leaf) or index of right child

Detailed Description

template<class T>
class rkdTreeNode< T >

kd-tree nodes, kept as small as possible double precision float and/or 64 bit system: 12bytes else 8 bytes

Definition at line 27 of file ray_kdtree.h.


Member Function Documentation

template<class T>
void rkdTreeNode< T >::createInterior ( int  axis,
PFLOAT  d 
) [inline]

Definition at line 49 of file ray_kdtree.h.

template<class T>
void rkdTreeNode< T >::createLeaf ( u_int32 primIdx,
int  np,
const T **  prims,
MemoryArena arena 
) [inline]

Definition at line 30 of file ray_kdtree.h.

template<class T>
u_int32 rkdTreeNode< T >::getRightChild (  )  const [inline]

Definition at line 55 of file ray_kdtree.h.

template<class T>
bool rkdTreeNode< T >::IsLeaf (  )  const [inline]

Definition at line 54 of file ray_kdtree.h.

template<class T>
int rkdTreeNode< T >::nPrimitives (  )  const [inline]

Definition at line 53 of file ray_kdtree.h.

template<class T>
void rkdTreeNode< T >::setRightChild ( u_int32  i  )  [inline]

Definition at line 56 of file ray_kdtree.h.

template<class T>
int rkdTreeNode< T >::SplitAxis (  )  const [inline]

Definition at line 52 of file ray_kdtree.h.

template<class T>
PFLOAT rkdTreeNode< T >::SplitPos (  )  const [inline]

Definition at line 51 of file ray_kdtree.h.


Member Data Documentation

union { ... }
template<class T>
PFLOAT rkdTreeNode< T >::division

interior: division plane position

Definition at line 60 of file ray_kdtree.h.

template<class T>
u_int32 rkdTreeNode< T >::flags

2bits: isLeaf, axis; 30bits: nprims (leaf) or index of right child

Definition at line 64 of file ray_kdtree.h.

template<class T>
T* rkdTreeNode< T >::onePrimitive

leaf: direct inxex of one primitive

Definition at line 62 of file ray_kdtree.h.

template<class T>
T** rkdTreeNode< T >::primitives

leaf: list of primitives

Definition at line 61 of file ray_kdtree.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 18 Dec 2009 for YafaRay by  doxygen 1.6.1