OpenVDB  9.0.1
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Tree< RootT > Class Template Reference

VDB Tree, which is a thin wrapper around a RootNode. More...

#include <nanovdb/NanoVDB.h>

Inherits TreeData< RootT::LEVEL >.

Public Types

using DataType = TreeData< RootT::LEVEL >
 
using RootType = RootT
 
using LeafNodeType = typename RootT::LeafNodeType
 
using ValueType = typename RootT::ValueType
 
using BuildType = typename RootT::BuildType
 
using CoordType = typename RootT::CoordType
 
using AccessorType = DefaultReadAccessor< BuildType >
 
using Node3 = RootT
 
using Node2 = typename RootT::ChildNodeType
 
using Node1 = typename Node2::ChildNodeType
 
using Node0 = LeafNodeType
 

Public Member Functions

 Tree ()=delete
 This class cannot be constructed or deleted. More...
 
 Tree (const Tree &)=delete
 
Treeoperator= (const Tree &)=delete
 
 ~Tree ()=delete
 
DataTypedata ()
 
const DataTypedata () const
 
RootT & root ()
 
const RootT & root () const
 
AccessorType getAccessor () const
 
ValueType getValue (const CoordType &ijk) const
 Return the value of the given voxel (regardless of state or location in the tree.) More...
 
bool isActive (const CoordType &ijk) const
 Return the active state of the given voxel (regardless of state or location in the tree.) More...
 
bool isEmpty () const
 Return true if this tree is empty, i.e. contains no values or nodes. More...
 
bool probeValue (const CoordType &ijk, ValueType &v) const
 Combines the previous two methods in a single call. More...
 
const ValueTypebackground () const
 Return a const reference to the background value. More...
 
void extrema (ValueType &min, ValueType &max) const
 Sets the extrema values of all the active values in this tree, i.e. in all nodes of the tree. More...
 
const BBox< CoordType > & bbox () const
 Return a const reference to the index bounding box of all the active values in this tree, i.e. in all nodes of the tree. More...
 
uint64_t activeVoxelCount () const
 Return the total number of active voxels in this tree. More...
 
const uint32_t & activeTileCount (uint32_t n) const
 Return the total number of active tiles at the specified level of the tree. More...
 
template<typename NodeT >
uint32_t nodeCount () const
 
uint32_t nodeCount (int level) const
 
template<typename NodeT >
NodeT * getFirstNode ()
 return a pointer to the first node of the specified type More...
 
template<typename NodeT >
const NodeT * getFirstNode () const
 return a const pointer to the first node of the specified type More...
 
template<int LEVEL>
NodeTrait< RootT, LEVEL >::type * getFirstNode ()
 return a pointer to the first node at the specified level More...
 
template<int LEVEL>
const NodeTrait< RootT, LEVEL >::type * getFirstNode () const
 return a const pointer to the first node of the specified level More...
 

Static Public Member Functions

static uint64_t memUsage ()
 return memory usage in bytes for the class More...
 

Private Member Functions

void setRoot (const RootT *root)
 
RootT * getRoot ()
 
const RootT * getRoot () const
 
void setFirstNode (const NodeT *node)
 

Private Attributes

uint64_t mNodeOffset [4]
 
uint32_t mNodeCount [3]
 
uint32_t mTileCount [3]
 
uint64_t mVoxelCount
 

Detailed Description

template<typename RootT>
class nanovdb::Tree< RootT >

VDB Tree, which is a thin wrapper around a RootNode.

Member Typedef Documentation

using BuildType = typename RootT::BuildType
using CoordType = typename RootT::CoordType
using DataType = TreeData<RootT::LEVEL>
using LeafNodeType = typename RootT::LeafNodeType
using Node1 = typename Node2::ChildNodeType
using Node2 = typename RootT::ChildNodeType
using Node3 = RootT
using RootType = RootT
using ValueType = typename RootT::ValueType

Constructor & Destructor Documentation

Tree ( )
delete

This class cannot be constructed or deleted.

Tree ( const Tree< RootT > &  )
delete
~Tree ( )
delete

Member Function Documentation

const uint32_t& activeTileCount ( uint32_t  n) const
inline

Return the total number of active tiles at the specified level of the tree.

n = 0 corresponds to leaf level tiles.

uint64_t activeVoxelCount ( ) const
inline

Return the total number of active voxels in this tree.

const ValueType& background ( ) const
inline

Return a const reference to the background value.

const BBox<CoordType>& bbox ( ) const
inline

Return a const reference to the index bounding box of all the active values in this tree, i.e. in all nodes of the tree.

DataType* data ( )
inline
const DataType* data ( ) const
inline
void extrema ( ValueType min,
ValueType max 
) const

Sets the extrema values of all the active values in this tree, i.e. in all nodes of the tree.

AccessorType getAccessor ( ) const
inline
NodeT* getFirstNode ( )
inline

return a pointer to the first node of the specified type

Warning
Note it may return NULL if no nodes exist
const NodeT* getFirstNode ( ) const
inline

return a const pointer to the first node of the specified type

Warning
Note it may return NULL if no nodes exist
NodeTrait<RootT, LEVEL>::type* getFirstNode ( )
inline

return a pointer to the first node at the specified level

Warning
Note it may return NULL if no nodes exist
const NodeTrait<RootT, LEVEL>::type* getFirstNode ( ) const
inline

return a const pointer to the first node of the specified level

Warning
Note it may return NULL if no nodes exist
ValueType getValue ( const CoordType ijk) const
inline

Return the value of the given voxel (regardless of state or location in the tree.)

bool isActive ( const CoordType ijk) const
inline

Return the active state of the given voxel (regardless of state or location in the tree.)

bool isEmpty ( ) const
inline

Return true if this tree is empty, i.e. contains no values or nodes.

static uint64_t memUsage ( )
inlinestatic

return memory usage in bytes for the class

uint32_t nodeCount ( ) const
inline
uint32_t nodeCount ( int  level) const
inline
Tree& operator= ( const Tree< RootT > &  )
delete
bool probeValue ( const CoordType ijk,
ValueType v 
) const
inline

Combines the previous two methods in a single call.

RootT& root ( )
inline
const RootT& root ( ) const
inline