KD-tree node in 8 bytes.
More...
#include <gkdtree.h>
List of all members.
Public Types |
enum | EMask {
ETypeMask = 1 << 31,
EIndirectionMask = 1 << 30,
ELeafOffsetMask = ~ETypeMask,
EInnerAxisMask = 0x3,
EInnerOffsetMask = ~(EInnerAxisMask + EIndirectionMask),
ERelOffsetLimit = (1<<28) - 1
} |
Public Member Functions |
void | initLeafNode (unsigned int offset, unsigned int numPrims) |
| Initialize a leaf kd-Tree node.
|
bool | initInnerNode (int axis, float split, ptrdiff_t relOffset) |
void | initIndirectionNode (int axis, float split, uint32_t indirectionEntry) |
| Initialize an interior indirection node.
|
bool | isLeaf () const |
| Is this a leaf node?
|
bool | isIndirection () const |
| Is this an indirection node?
|
IndexType | getPrimStart () const |
| Assuming this is a leaf node, return the first primitive index.
|
IndexType | getPrimEnd () const |
| Assuming this is a leaf node, return the last primitive index.
|
IndexType | getIndirectionIndex () const |
| Return the index of an indirection node.
|
const KDNode * | getLeft () const |
| Return the left child (assuming that this is an interior node)
|
const KDNode * | getSibling () const |
| Return the sibling of the current node.
|
KDNode * | getLeft () |
| Return the left child (assuming that this is an interior node)
|
const KDNode * | getRight () const |
| Return the left child (assuming that this is an interior node)
|
float | getSplit () const |
| Return the split plane location (assuming that this is an interior node)
|
int | getAxis () const |
| Return the split axis (assuming that this is an interior node)
|
Public Attributes |
union { |
struct { |
uint32_t combined |
float split |
| Split plane coordinate.
|
} inner |
struct { |
uint32_t combined |
uint32_t end |
| End offset of the primitive list.
|
} leaf |
}; | |
Detailed Description
template<typename BoundingBoxType>
struct KDTreeBase< BoundingBoxType >::KDNode
KD-tree node in 8 bytes.
Definition at line 405 of file gkdtree.h.
Member Enumeration Documentation
template<typename BoundingBoxType>
- Enumerator:
ETypeMask |
|
EIndirectionMask |
|
ELeafOffsetMask |
|
EInnerAxisMask |
|
EInnerOffsetMask |
|
ERelOffsetLimit |
|
Definition at line 435 of file gkdtree.h.
Member Function Documentation
template<typename BoundingBoxType>
int KDTreeBase< BoundingBoxType >::KDNode::getAxis |
( |
| ) |
const [inline] |
Return the split axis (assuming that this is an interior node)
Definition at line 534 of file gkdtree.h.
template<typename BoundingBoxType>
Return the index of an indirection node.
Definition at line 499 of file gkdtree.h.
template<typename BoundingBoxType>
Return the left child (assuming that this is an interior node)
Definition at line 504 of file gkdtree.h.
template<typename BoundingBoxType>
Return the left child (assuming that this is an interior node)
Definition at line 515 of file gkdtree.h.
template<typename BoundingBoxType>
Assuming this is a leaf node, return the last primitive index.
Definition at line 494 of file gkdtree.h.
template<typename BoundingBoxType>
Assuming this is a leaf node, return the first primitive index.
Definition at line 489 of file gkdtree.h.
template<typename BoundingBoxType>
const KDNode* KDTreeBase< BoundingBoxType >::KDNode::getRight |
( |
| ) |
const [inline] |
Return the left child (assuming that this is an interior node)
Definition at line 521 of file gkdtree.h.
template<typename BoundingBoxType>
const KDNode* KDTreeBase< BoundingBoxType >::KDNode::getSibling |
( |
| ) |
const [inline] |
Return the sibling of the current node.
Definition at line 510 of file gkdtree.h.
template<typename BoundingBoxType>
float KDTreeBase< BoundingBoxType >::KDNode::getSplit |
( |
| ) |
const [inline] |
Return the split plane location (assuming that this is an interior node)
Definition at line 529 of file gkdtree.h.
template<typename BoundingBoxType>
void KDTreeBase< BoundingBoxType >::KDNode::initIndirectionNode |
( |
int |
axis, |
|
|
float |
split, |
|
|
uint32_t |
indirectionEntry |
|
) |
| [inline] |
Initialize an interior indirection node.
Indirections are necessary whenever the children cannot be referenced using a relative pointer, which can happen when they lie in different memory chunks. In this case, the node stores an index into a globally shared pointer list.
Definition at line 470 of file gkdtree.h.
template<typename BoundingBoxType>
bool KDTreeBase< BoundingBoxType >::KDNode::initInnerNode |
( |
int |
axis, |
|
|
float |
split, |
|
|
ptrdiff_t |
relOffset |
|
) |
| [inline] |
Initialize an interior kd-Tree node. Reports a failure if the relative offset to the left child node is too large.
Definition at line 454 of file gkdtree.h.
template<typename BoundingBoxType>
void KDTreeBase< BoundingBoxType >::KDNode::initLeafNode |
( |
unsigned int |
offset, |
|
|
unsigned int |
numPrims |
|
) |
| [inline] |
Initialize a leaf kd-Tree node.
Definition at line 445 of file gkdtree.h.
template<typename BoundingBoxType>
bool KDTreeBase< BoundingBoxType >::KDNode::isIndirection |
( |
| ) |
const [inline] |
Is this an indirection node?
Definition at line 484 of file gkdtree.h.
template<typename BoundingBoxType>
bool KDTreeBase< BoundingBoxType >::KDNode::isLeaf |
( |
| ) |
const [inline] |
Is this a leaf node?
Definition at line 479 of file gkdtree.h.
Member Data Documentation
template<typename BoundingBoxType>
template<typename BoundingBoxType>
End offset of the primitive list.
Definition at line 431 of file gkdtree.h.
template<typename BoundingBoxType>
Split plane coordinate.
Definition at line 419 of file gkdtree.h.
The documentation for this struct was generated from the following file: