OpenVDB 12.1.0

Loading...
Searching...
No Matches
Tree< RootT > Class Template Reference

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

`#include <nanovdb/NanoVDB.h>`

Inheritance diagram for Tree< RootT >:

## 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.
| Tree (const Tree &)=delete
Tree & | operator= (const Tree &)=delete
| ~Tree ()=delete
__hostdev__ DataType * | data ()
__hostdev__ const DataType * | data () const
__hostdev__ RootT & | root ()
__hostdev__ const RootT & | root () const
__hostdev__ AccessorType | getAccessor () const
__hostdev__ ValueType | getValue (const CoordType &ijk) const
| Return the value of the given voxel (regardless of state or location in the tree.)
__hostdev__ ValueType | getValue (int i, int j, int k) const
__hostdev__ bool | isActive (const CoordType &ijk) const
| Return the active state of the given voxel (regardless of state or location in the tree.)
__hostdev__ bool | probeValue (const CoordType &ijk, ValueType &v) const
| Return true if this tree is empty, i.e. contains no values or nodes.
__hostdev__ const ValueType & | background () const
| Return a const reference to the background value.
__hostdev__ 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.
__hostdev__ 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.
__hostdev__ const uint32_t & | activeTileCount (uint32_t level) const
| Return the total number of active tiles at the specified level of the tree.
template<typename NodeT>
__hostdev__ uint32_t | nodeCount () const
__hostdev__ uint32_t | nodeCount (int level) const
__hostdev__ uint32_t | totalNodeCount () const
template<typename NodeT>
__hostdev__ NodeT * | getFirstNode ()
| return a pointer to the first node of the specified type
template<typename NodeT>
__hostdev__ const NodeT * | getFirstNode () const
| return a const pointer to the first node of the specified type
template<int LEVEL>
__hostdev__ NodeTrait< RootT, LEVEL >::type * | getFirstNode ()
| return a pointer to the first node at the specified level
template<int LEVEL>
__hostdev__ const NodeTrait< RootT, LEVEL >::type * | getFirstNode () const
| return a const pointer to the first node of the specified level
__hostdev__ LeafNodeType * | getFirstLeaf ()
| Template specializations of getFirstNode.
__hostdev__ const LeafNodeType * | getFirstLeaf () const
__hostdev__ NodeTrait< RootT, 1 >::type * | getFirstLower ()
__hostdev__ const NodeTrait< RootT, 1 >::type * | getFirstLower () const
__hostdev__ NodeTrait< RootT, 2 >::type * | getFirstUpper ()
__hostdev__ const NodeTrait< RootT, 2 >::type * | getFirstUpper () const
template<typename OpT, typename... ArgsT>
__hostdev__ auto | get (const CoordType &ijk, ArgsT &&... args) const
template<typename OpT, typename... ArgsT>
__hostdev__ auto | set (const CoordType &ijk, ArgsT &&... args)
__hostdev__ void | setRoot (const void *root)
__hostdev__ void * | getRoot ()
| Get a non-const void pointer to the root node (never NULL)
__hostdev__ const void * | getRoot () const
| Get a const void pointer to the root node (never NULL)
template<typename NodeT>
__hostdev__ void | setFirstNode (const NodeT *node)
__hostdev__ bool | isEmpty () const
| Return true if the root is empty, i.e. has not child nodes or constant tiles.
__hostdev__ CoordBBox | bbox () const
| Return the index bounding box of all the active values in this tree, i.e. in all nodes of the tree.
__hostdev__ bool | isRootNext () const
| return true if RootData is layout out immediately after TreeData in memory

## Static Public Member Functions
static __hostdev__ uint64_t | memUsage ()
| return memory usage in bytes for the class

## 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

template<typename RootT>

using AccessorType = DefaultReadAccessor<BuildType>

## ◆ BuildType

template<typename RootT>

using BuildType = typename RootT::BuildType

## ◆ CoordType

template<typename RootT>

using CoordType = typename RootT::CoordType

## ◆ DataType

template<typename RootT>

using DataType = TreeData

## ◆ LeafNodeType

template<typename RootT>

using LeafNodeType = typename RootType::LeafNodeType

## ◆ LowerNodeType

template<typename RootT>

using LowerNodeType = typename UpperNodeType::ChildNodeType

## ◆ Node0

template<typename RootT>

using Node0 = LeafNodeType

## ◆ Node1

template<typename RootT>

using Node1 = typename Node2::ChildNodeType

## ◆ Node2

template<typename RootT>

using Node2 = typename RootT::ChildNodeType

## ◆ Node3

template<typename RootT>

using Node3 = RootT

## ◆ RootNodeType

template<typename RootT>

using RootNodeType = RootT

## ◆ RootType

template<typename RootT>

using RootType = RootT

## ◆ UpperNodeType

template<typename RootT>

using UpperNodeType = typename RootNodeType::ChildNodeType

## ◆ ValueType

template<typename RootT>

using ValueType = typename RootT::ValueType

## Constructor & Destructor Documentation

## ◆ Tree() [1/2]

template<typename RootT>

Tree | ( |  | ) |
| delete

This class cannot be constructed or deleted.

## ◆ Tree() [2/2]

template<typename RootT>

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

## ◆ ~Tree()

template<typename RootT>

~Tree | ( |  | ) |
| delete

## Member Function Documentation

## ◆ activeTileCount()

template<typename RootT>

__hostdev__ 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()

template<typename RootT>

__hostdev__ 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()

template<typename RootT>

__hostdev__ const ValueType & background | ( |  | ) | const
| inline

Return a const reference to the background value.

## ◆ bbox()

__hostdev__ CoordBBox bbox | ( |  | ) | const
| inline inherited

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

## ◆ data() [1/2]

template<typename RootT>

__hostdev__ DataType * data | ( |  | ) |
| inline

## ◆ data() [2/2]

template<typename RootT>

__hostdev__ const DataType * data | ( |  | ) | const
| inline

## ◆ extrema()

template<typename RootT>

__hostdev__ 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()

template<typename RootT>
template<typename OpT, typename... ArgsT>

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

## ◆ getAccessor()

template<typename RootT>

__hostdev__ AccessorType getAccessor | ( |  | ) | const
| inline

## ◆ getFirstLeaf() [1/2]

template<typename RootT>

__hostdev__ LeafNodeType * getFirstLeaf | ( |  | ) |
| inline

Template specializations of getFirstNode.

## ◆ getFirstLeaf() [2/2]

template<typename RootT>

__hostdev__ const LeafNodeType * getFirstLeaf | ( |  | ) | const
| inline

## ◆ getFirstLower() [1/2]

template<typename RootT>

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

## ◆ getFirstLower() [2/2]

template<typename RootT>

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

## ◆ getFirstNode() [1/4]

template<typename RootT>
template<typename NodeT>

__hostdev__ 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]

template<typename RootT>
template<int LEVEL>

__hostdev__ 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]

template<typename RootT>
template<typename NodeT>

__hostdev__ 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]

template<typename RootT>
template<int LEVEL>

__hostdev__ 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]

template<typename RootT>

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

## ◆ getFirstUpper() [2/2]

template<typename RootT>

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

## ◆ getRoot() [1/2]

__hostdev__ void * getRoot | ( |  | ) |
| inline inherited

Get a non-const void pointer to the root node (never NULL)

## ◆ getRoot() [2/2]

__hostdev__ const void * getRoot | ( |  | ) | const
| inline inherited

Get a const void pointer to the root node (never NULL)

## ◆ getValue() [1/2]

template<typename RootT>

__hostdev__ 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]

template<typename RootT>

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

## ◆ isActive()

template<typename RootT>

__hostdev__ bool isActive | ( | const CoordType & | ijk | ) | const
| inline

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

## ◆ isEmpty()

__hostdev__ bool isEmpty | ( |  | ) | const
| inline inherited

Return true if the root is empty, i.e. has not child nodes or constant tiles.

## ◆ isRootNext()

__hostdev__ bool isRootNext | ( |  | ) | const
| inline inherited

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

## ◆ memUsage()

template<typename RootT>

__hostdev__ uint64_t memUsage | ( |  | ) |
| inline static

return memory usage in bytes for the class

## ◆ nodeCount() [1/2]

template<typename RootT>
template<typename NodeT>

__hostdev__ uint32_t nodeCount | ( |  | ) | const
| inline

## ◆ nodeCount() [2/2]

template<typename RootT>

__hostdev__ uint32_t nodeCount | ( | int | level | ) | const
| inline

## ◆ operator=()

template<typename RootT>

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

## ◆ probeValue()

template<typename RootT>

__hostdev__ 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]

template<typename RootT>

__hostdev__ RootT & root | ( |  | ) |
| inline

## ◆ root() [2/2]

template<typename RootT>

__hostdev__ const RootT & root | ( |  | ) | const
| inline

## ◆ set()

template<typename RootT>
template<typename OpT, typename... ArgsT>

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

## ◆ setFirstNode()

template<typename NodeT>

__hostdev__ void setFirstNode | ( | const NodeT * | node | ) |
| inline inherited

## ◆ setRoot()

__hostdev__ void setRoot | ( | const void * | root | ) |
| inline inherited

## ◆ totalNodeCount()

template<typename RootT>

__hostdev__ 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