OpenVDB  11.0.0
Public Types | Public Member Functions | Static Public Member Functions | Public 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.

Public Types

using DataType = TreeData
 
using RootType = RootT
 
using RootNodeType = RootT
 
using UpperNodeType = typename RootNodeType::ChildNodeType
 
using LowerNodeType = typename UpperNodeType::ChildNodeType
 
using LeafNodeType = typename RootType::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...
 
ValueType getValue (int i, int j, int k) const
 
bool isActive (const CoordType &ijk) const
 Return the active state of the given voxel (regardless of state or location in the tree.) More...
 
bool probeValue (const CoordType &ijk, ValueType &v) const
 Return true if this tree is empty, i.e. contains no values or nodes. 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...
 
uint64_t activeVoxelCount () 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...
 
const uint32_t & activeTileCount (uint32_t level) 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
 
uint32_t totalNodeCount () 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...
 
LeafNodeTypegetFirstLeaf ()
 Template specializations of getFirstNode. More...
 
const LeafNodeTypegetFirstLeaf () const
 
NodeTrait< RootT, 1 >::type * getFirstLower ()
 
const NodeTrait< RootT, 1 >::type * getFirstLower () const
 
NodeTrait< RootT, 2 >::type * getFirstUpper ()
 
const NodeTrait< RootT, 2 >::type * getFirstUpper () const
 
template<typename OpT , typename... ArgsT>
auto get (const CoordType &ijk, ArgsT &&... args) const
 
template<typename OpT , typename... ArgsT>
auto set (const CoordType &ijk, ArgsT &&... args)
 
void setRoot (const void *root)
 
uint8_t * getRoot ()
 
const uint8_t * getRoot () const
 
template<typename NodeT >
void setFirstNode (const NodeT *node)
 
bool isEmpty () const
 
CoordBBox bbox () const
 Return the index bounding box of all the active values in this tree, i.e. in all nodes of the tree. More...
 
bool isRootNext () const
 return true if RootData is layout out immediately after TreeData in memory More...
 

Static Public Member Functions

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

Public Attributes

int64_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

◆ AccessorType

◆ BuildType

using BuildType = typename RootT::BuildType

◆ CoordType

using CoordType = typename RootT::CoordType

◆ DataType

using DataType = TreeData

◆ LeafNodeType

using LeafNodeType = typename RootType::LeafNodeType

◆ LowerNodeType

using LowerNodeType = typename UpperNodeType::ChildNodeType

◆ Node0

◆ Node1

using Node1 = typename Node2::ChildNodeType

◆ Node2

using Node2 = typename RootT::ChildNodeType

◆ Node3

using Node3 = RootT

◆ RootNodeType

using RootNodeType = RootT

◆ RootType

using RootType = RootT

◆ UpperNodeType

using UpperNodeType = typename RootNodeType::ChildNodeType

◆ ValueType

using ValueType = typename RootT::ValueType

Constructor & Destructor Documentation

◆ Tree() [1/2]

Tree ( )
delete

This class cannot be constructed or deleted.

◆ Tree() [2/2]

Tree ( const Tree< RootT > &  )
delete

◆ ~Tree()

~Tree ( )
delete

Member Function Documentation

◆ activeTileCount()

const uint32_t& activeTileCount ( uint32_t  level) const
inline

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

level = 1,2,3 corresponds to active tile count in lower internal nodes, upper internal nodes, and the root level. Note active values at the leaf level are referred to as active voxels (see activeVoxelCount defined above).

◆ activeVoxelCount()

uint64_t activeVoxelCount ( ) 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.

Return the total number of active voxels in this tree.

◆ background()

const ValueType& background ( ) const
inline

Return a const reference to the background value.

◆ bbox()

CoordBBox bbox ( ) const
inlineinherited

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

◆ data() [1/2]

DataType* data ( )
inline

◆ data() [2/2]

const DataType* data ( ) const
inline

◆ extrema()

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.

◆ get()

auto get ( const CoordType ijk,
ArgsT &&...  args 
) const
inline

◆ getAccessor()

AccessorType getAccessor ( ) const
inline

◆ getFirstLeaf() [1/2]

LeafNodeType* getFirstLeaf ( )
inline

Template specializations of getFirstNode.

◆ getFirstLeaf() [2/2]

const LeafNodeType* getFirstLeaf ( ) const
inline

◆ getFirstLower() [1/2]

NodeTrait<RootT, 1>::type* getFirstLower ( )
inline

◆ getFirstLower() [2/2]

const NodeTrait<RootT, 1>::type* getFirstLower ( ) const
inline

◆ getFirstNode() [1/4]

NodeT* getFirstNode ( )
inline

return a pointer to the first node of the specified type

Warning
Note it may return NULL if no nodes exist

◆ getFirstNode() [2/4]

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

◆ getFirstNode() [3/4]

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

◆ getFirstNode() [4/4]

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

◆ getFirstUpper() [1/2]

NodeTrait<RootT, 2>::type* getFirstUpper ( )
inline

◆ getFirstUpper() [2/2]

const NodeTrait<RootT, 2>::type* getFirstUpper ( ) const
inline

◆ getRoot() [1/2]

uint8_t* getRoot ( )
inlineinherited

◆ getRoot() [2/2]

const uint8_t* getRoot ( ) const
inlineinherited

◆ getValue() [1/2]

ValueType getValue ( const CoordType ijk) const
inline

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

◆ getValue() [2/2]

ValueType getValue ( int  i,
int  j,
int  k 
) const
inline

◆ isActive()

bool isActive ( const CoordType ijk) const
inline

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

◆ isEmpty()

bool isEmpty ( ) const
inlineinherited

◆ isRootNext()

bool isRootNext ( ) const
inlineinherited

return true if RootData is layout out immediately after TreeData in memory

◆ memUsage()

static uint64_t memUsage ( )
inlinestatic

return memory usage in bytes for the class

◆ nodeCount() [1/2]

uint32_t nodeCount ( ) const
inline

◆ nodeCount() [2/2]

uint32_t nodeCount ( int  level) const
inline

◆ operator=()

Tree& operator= ( const Tree< RootT > &  )
delete

◆ probeValue()

bool probeValue ( const CoordType ijk,
ValueType v 
) const
inline

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

Combines the previous two methods in a single call

◆ root() [1/2]

RootT& root ( )
inline

◆ root() [2/2]

const RootT& root ( ) const
inline

◆ set()

auto set ( const CoordType ijk,
ArgsT &&...  args 
)
inline

◆ setFirstNode()

void setFirstNode ( const NodeT *  node)
inlineinherited

◆ setRoot()

void setRoot ( const void *  root)
inlineinherited

◆ totalNodeCount()

uint32_t totalNodeCount ( ) const
inline

Member Data Documentation

◆ mNodeCount

uint32_t mNodeCount[3]
inherited

◆ mNodeOffset

int64_t mNodeOffset[4]
inherited

◆ mTileCount

uint32_t mTileCount[3]
inherited

◆ mVoxelCount

uint64_t mVoxelCount
inherited