Fermat
Modules | Classes | Functions
Binary Trees

Detailed Description

This module defines generic binary tree concepts and objects, such as node representations and visitor patterns.

Modules

 Radix Trees
 

Classes

struct  cugar::leaf_index_tag
 
struct  cugar::leaf_range_tag
 
struct  cugar::Bintree_node< leaf_type_tag >
 
struct  cugar::Bintree_node< leaf_index_tag >
 
struct  cugar::Bintree_visitor< node_type, leaf_type >
 
struct  cugar::Bintree_visitor< Node_type, leaf_index_tag >
 
struct  cugar::Bintree_visitor< Node_type, leaf_range_tag >
 
struct  cugar::Bintree_writer_context< node_type, node_tag >
 
struct  cugar::Bintree_writer_context< node_type, leaf_index_tag >
 
struct  cugar::Bintree_writer_context< node_type, leaf_range_tag >
 
struct  cugar::Bintree_writer< node_type, system_tag, node_vector, range_vector, index_vector >
 

Functions

template<>
struct cugar::CUGAR_ALIGN_BEGIN (8) Bintree_node< leaf_range_tag >
 
template<typename bvh_visitor_type >
void cugar::check_tree_rec (const uint32 node_id, const uint32 parent_id, const bvh_visitor_type &visitor, const uint32 n_prims, const uint32 max_leaf_size)
 
template<typename node_type , typename leaf_type >
void cugar::check_tree (const Bintree_visitor< node_type, leaf_type > &visitor, const uint32 n_prims, const uint32 max_leaf_size=uint32(-1))
 

Function Documentation

◆ check_tree()

template<typename node_type , typename leaf_type >
void cugar::check_tree ( const Bintree_visitor< node_type, leaf_type > &  visitor,
const uint32  n_prims,
const uint32  max_leaf_size = uint32(-1) 
)

A function to check a host binary tree

◆ CUGAR_ALIGN_BEGIN()

template<>
struct cugar::CUGAR_ALIGN_BEGIN ( )

A "fat" binary tree node, specifying a whole primitive range per leaf. A node can either be a leaf and have no children, or be an internal split node. If a split node, it can either have one or two children. The ability for an internal node to have one children is useful to represent singletons in a radix trie.

empty constructor

full constructor

Parameters
child0first child activation predicate
child1second child activation predicate
indexchild index

leaf constructor

Parameters
indexleaf range begin
indexleaf range end

is a leaf?

get offset of the first child

get leaf offset

get range size

get leaf range

get leaf size

get child count

get i-th child (among the active ones)

Parameters
ichild index

is the i-th child active?

Parameters
ichild index

get left partition (or kInvalid if not active)

get right partition (or kInvalid if not active)