OpenVDB: RootNode< ChildT > Class Template Reference

OpenVDB 12.1.0

Loading...
Searching...
No Matches
RootNode< ChildT > Class Template Reference

Top-most node of the VDB tree structure. More...

`#include <nanovdb/NanoVDB.h>`

Inheritance diagram for RootNode< ChildT >:

## Classes
class | BaseIter
class | ChildIter
class | DenseIter
class | ValueIter
class | ValueOnIter

## Public Types
using | DataType = RootData<ChildT>
using | ChildNodeType = ChildT
using | RootType = RootNode<ChildT>
using | RootNodeType = RootType
using | UpperNodeType = ChildT
using | LowerNodeType = typename UpperNodeType::ChildNodeType
using | LeafNodeType = typename ChildT::LeafNodeType
using | ValueType = typename DataType::ValueT
using | FloatType = typename DataType::StatsT
using | BuildType = typename DataType::BuildT
using | CoordType = typename ChildT::CoordType
using | BBoxType = math::BBox<CoordType>
using | AccessorType = DefaultReadAccessor<BuildType>
using | Tile = typename DataType::Tile
using | ChildIterator = ChildIter<RootNode>
using | ConstChildIterator = ChildIter<const RootNode>
using | ValueIterator = ValueIter<RootNode>
using | ConstValueIterator = ValueIter<const RootNode>
using | ValueOnIterator = ValueOnIter<RootNode>
using | ConstValueOnIterator = ValueOnIter<const RootNode>
using | DenseIterator = DenseIter<RootNode>
using | ConstDenseIterator = DenseIter<const RootNode>
using | ValueT = typename ChildT::ValueType
using | BuildT = typename ChildT::BuildType
using | CoordT = typename ChildT::CoordType
using | StatsT = typename ChildT::FloatType
using | KeyT = uint64_t
| Return a key based on the coordinates of a voxel.
using | TileIterator = TileIter<RootData>
using | ConstTileIterator = TileIter<const RootData>

## Public Member Functions
__hostdev__ ChildIterator | beginChild ()
__hostdev__ ConstChildIterator | cbeginChild () const
__hostdev__ ValueIterator | beginValue ()
__hostdev__ ConstValueIterator | cbeginValueAll () const
__hostdev__ ValueOnIterator | beginValueOn ()
__hostdev__ ConstValueOnIterator | cbeginValueOn () const
__hostdev__ DenseIterator | beginDense ()
__hostdev__ ConstDenseIterator | cbeginDense () const
__hostdev__ ConstDenseIterator | cbeginChildAll () const
| RootNode ()=delete
| This class cannot be constructed or deleted.
| RootNode (const RootNode &)=delete
RootNode & | operator= (const RootNode &)=delete
| ~RootNode ()=delete
__hostdev__ AccessorType | getAccessor () const
__hostdev__ DataType * | data ()
__hostdev__ const DataType * | data () const
__hostdev__ const BBoxType & | 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.
__hostdev__ const ValueType & | background () const
| Return the total number of active voxels in the root and all its child nodes.
__hostdev__ const uint32_t & | tileCount () const
| Return the number of tiles encoded in this root node.
__hostdev__ const uint32_t & | getTableSize () const
__hostdev__ const ValueType & | minimum () const
| Return a const reference to the minimum active value encoded in this root node and any of its child nodes.
__hostdev__ const ValueType & | maximum () const
| Return a const reference to the maximum active value encoded in this root node and any of its child nodes.
__hostdev__ const FloatType & | average () const
| Return a const reference to the average of all the active values encoded in this root node and any of its child nodes.
__hostdev__ FloatType | variance () const
| Return the variance of all the active values encoded in this root node and any of its child nodes.
__hostdev__ const FloatType & | stdDeviation () const
| Return a const reference to the standard deviation of all the active values encoded in this root node and any of its child nodes.
__hostdev__ uint64_t | memUsage () const
| Return the actual memory footprint of this root node.
__hostdev__ bool | isEmpty () const
| Return true if this RootNode is empty, i.e. contains no values or nodes.
__hostdev__ ValueType | getValue (const CoordType &ijk) const
| Return the value of the given voxel.
__hostdev__ ValueType | getValue (int i, int j, int k) const
__hostdev__ bool | isActive (const CoordType &ijk) const
__hostdev__ bool | probeValue (const CoordType &ijk, ValueType &v) const
| return the state and updates the value of the specified voxel
__hostdev__ const LeafNodeType * | probeLeaf (const CoordType &ijk) const
template<typename OpT, typename... ArgsT>
__hostdev__ OpT::Type | get (const CoordType &ijk, ArgsT &&... args) const
template<typename OpT, typename... ArgsT>
__hostdev__ void | set (const CoordType &ijk, ArgsT &&... args)
__hostdev__ const Tile * | tile (uint32_t n) const
| Returns a pointer to the tile at the specified linear offset.
__hostdev__ Tile * | tile (uint32_t n)
__hostdev__ TileIterator | beginTile ()
__hostdev__ ConstTileIterator | cbeginTile () const
__hostdev__ TileIterator | probe (const CoordT &ijk)
__hostdev__ ConstTileIterator | probe (const CoordT &ijk) const
__hostdev__ Tile * | probeTile (const CoordT &ijk)
__hostdev__ const Tile * | probeTile (const CoordT &ijk) const
__hostdev__ ChildT * | probeChild (const CoordT &ijk)
__hostdev__ const ChildT * | probeChild (const CoordT &ijk) const
__hostdev__ ChildT * | getChild (const Tile *tile)
| Returns a const reference to the child node in the specified tile.
__hostdev__ const ChildT * | getChild (const Tile *tile) const
__hostdev__ const ValueT & | getMin () const
__hostdev__ const ValueT & | getMax () const
__hostdev__ void | setMin (const ValueT &v)
__hostdev__ void | setMax (const ValueT &v)
__hostdev__ void | setAvg (const StatsT &v)
__hostdev__ void | setDev (const StatsT &v)

## Static Public Member Functions
static __hostdev__ uint64_t | memUsage (uint32_t tableSize)
| Return the expected memory footprint in bytes with the specified number of tiles.
template<typename CoordType>
static __hostdev__ KeyT | CoordToKey (const CoordType &ijk)
static __hostdev__ CoordT | KeyToCoord (const KeyT &key)
static __hostdev__ constexpr uint32_t | padding ()
| Return padding of this class in bytes, due to aliasing and 32B alignment.

## Public Attributes
math::BBox< CoordT > | mBBox
uint32_t | mTableSize
ValueT | mBackground
ValueT | mMinimum
ValueT | mMaximum
StatsT | mAverage
StatsT | mStdDevi

## Static Public Attributes
static constexpr bool | FIXED_SIZE = DataType::FIXED_SIZE
static constexpr uint32_t | LEVEL = 1 + ChildT::LEVEL

## Friends
template<typename, int, int, int>
class | ReadAccessor
template<typename>
class | Tree

## Detailed Description

template<typename ChildT>
class nanovdb::RootNode< ChildT >

Top-most node of the VDB tree structure.

## Member Typedef Documentation

## ◆ AccessorType

template<typename ChildT>

using AccessorType = DefaultReadAccessor<BuildType>

## ◆ BBoxType

template<typename ChildT>

using BBoxType = math::BBox<CoordType>

## ◆ BuildT

template<typename ChildT>

using BuildT = typename ChildT::BuildType
| inherited

## ◆ BuildType

template<typename ChildT>

using BuildType = typename DataType::BuildT

## ◆ ChildIterator

template<typename ChildT>

using ChildIterator = ChildIter<RootNode>

## ◆ ChildNodeType

template<typename ChildT>

using ChildNodeType = ChildT

## ◆ ConstChildIterator

template<typename ChildT>

using ConstChildIterator = ChildIter<const RootNode>

## ◆ ConstDenseIterator

template<typename ChildT>

using ConstDenseIterator = DenseIter<const RootNode>

## ◆ ConstTileIterator

template<typename ChildT>

using ConstTileIterator = TileIter<const RootData>
| inherited

## ◆ ConstValueIterator

template<typename ChildT>

using ConstValueIterator = ValueIter<const RootNode>

## ◆ ConstValueOnIterator

template<typename ChildT>

using ConstValueOnIterator = ValueOnIter<const RootNode>

## ◆ CoordT

template<typename ChildT>

using CoordT = typename ChildT::CoordType
| inherited

## ◆ CoordType

template<typename ChildT>

using CoordType = typename ChildT::CoordType

## ◆ DataType

template<typename ChildT>

using DataType = RootData<ChildT>

## ◆ DenseIterator

template<typename ChildT>

using DenseIterator = DenseIter<RootNode>

## ◆ FloatType

template<typename ChildT>

using FloatType = typename DataType::StatsT

## ◆ KeyT

template<typename ChildT>

using KeyT = uint64_t
| inherited

Return a key based on the coordinates of a voxel.

## ◆ LeafNodeType

template<typename ChildT>

using LeafNodeType = typename ChildT::LeafNodeType

## ◆ LowerNodeType

template<typename ChildT>

using LowerNodeType = typename UpperNodeType::ChildNodeType

## ◆ RootNodeType

template<typename ChildT>

using RootNodeType = RootType

## ◆ RootType

template<typename ChildT>

using RootType = RootNode<ChildT>

## ◆ StatsT

template<typename ChildT>

using StatsT = typename ChildT::FloatType
| inherited

## ◆ Tile

template<typename ChildT>

using Tile = typename DataType::Tile

## ◆ TileIterator

template<typename ChildT>

using TileIterator = TileIter<RootData>
| inherited

## ◆ UpperNodeType

template<typename ChildT>

using UpperNodeType = ChildT

## ◆ ValueIterator

template<typename ChildT>

using ValueIterator = ValueIter<RootNode>

## ◆ ValueOnIterator

template<typename ChildT>

using ValueOnIterator = ValueOnIter<RootNode>

## ◆ ValueT

template<typename ChildT>

using ValueT = typename ChildT::ValueType
| inherited

## ◆ ValueType

template<typename ChildT>

using ValueType = typename DataType::ValueT

## Constructor & Destructor Documentation

## ◆ RootNode() [1/2]

template<typename ChildT>

RootNode | ( |  | ) |
| delete

This class cannot be constructed or deleted.

## ◆ RootNode() [2/2]

template<typename ChildT>

RootNode | ( | const RootNode< ChildT > & |  | ) |
| delete

## ◆ ~RootNode()

template<typename ChildT>

~RootNode | ( |  | ) |
| delete

## Member Function Documentation

## ◆ average()

template<typename ChildT>

__hostdev__ const FloatType & average | ( |  | ) | const
| inline

Return a const reference to the average of all the active values encoded in this root node and any of its child nodes.

## ◆ background()

template<typename ChildT>

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

Return the total number of active voxels in the root and all its child nodes.

Return a const reference to the background value, i.e. the value associated with any coordinate location that has not been set explicitly.

## ◆ bbox()

template<typename ChildT>

__hostdev__ const BBoxType & 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.

## ◆ beginChild()

template<typename ChildT>

__hostdev__ ChildIterator beginChild | ( |  | ) |
| inline

## ◆ beginDense()

template<typename ChildT>

__hostdev__ DenseIterator beginDense | ( |  | ) |
| inline

## ◆ beginTile()

template<typename ChildT>

__hostdev__ TileIterator beginTile | ( |  | ) |
| inlineinherited

## ◆ beginValue()

template<typename ChildT>

__hostdev__ ValueIterator beginValue | ( |  | ) |
| inline

## ◆ beginValueOn()

template<typename ChildT>

__hostdev__ ValueOnIterator beginValueOn | ( |  | ) |
| inline

## ◆ cbeginChild()

template<typename ChildT>

__hostdev__ ConstChildIterator cbeginChild | ( |  | ) | const
| inline

## ◆ cbeginChildAll()

template<typename ChildT>

__hostdev__ ConstDenseIterator cbeginChildAll | ( |  | ) | const
| inline

## ◆ cbeginDense()

template<typename ChildT>

__hostdev__ ConstDenseIterator cbeginDense | ( |  | ) | const
| inline

## ◆ cbeginTile()

template<typename ChildT>

__hostdev__ ConstTileIterator cbeginTile | ( |  | ) | const
| inlineinherited

## ◆ cbeginValueAll()

template<typename ChildT>

__hostdev__ ConstValueIterator cbeginValueAll | ( |  | ) | const
| inline

## ◆ cbeginValueOn()

template<typename ChildT>

__hostdev__ ConstValueOnIterator cbeginValueOn | ( |  | ) | const
| inline

## ◆ CoordToKey()

template<typename ChildT>
template<typename CoordType>

__hostdev__ KeyT CoordToKey | ( | const CoordType & | ijk | ) |
| inlinestaticinherited

## ◆ data() [1/2]

template<typename ChildT>

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

## ◆ data() [2/2]

template<typename ChildT>

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

## ◆ get()

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

__hostdev__ OpT::Type get | ( | const CoordType & | ijk,
|  | ArgsT &&... | args ) const
| inline

## ◆ getAccessor()

template<typename ChildT>

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

## ◆ getChild() [1/2]

template<typename ChildT>

__hostdev__ ChildT * getChild | ( | const Tile * | tile | ) |
| inlineinherited

Returns a const reference to the child node in the specified tile.

Warning
  A child node is assumed to exist in the specified tile

## ◆ getChild() [2/2]

template<typename ChildT>

__hostdev__ const ChildT * getChild | ( | const Tile * | tile | ) | const
| inlineinherited

## ◆ getMax()

template<typename ChildT>

__hostdev__ const ValueT & getMax | ( |  | ) | const
| inlineinherited

## ◆ getMin()

template<typename ChildT>

__hostdev__ const ValueT & getMin | ( |  | ) | const
| inlineinherited

## ◆ getTableSize()

template<typename ChildT>

__hostdev__ const uint32_t & getTableSize | ( |  | ) | const
| inline

## ◆ getValue() [1/2]

template<typename ChildT>

__hostdev__ ValueType getValue | ( | const CoordType & | ijk | ) | const
| inline

Return the value of the given voxel.

## ◆ getValue() [2/2]

template<typename ChildT>

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

## ◆ isActive()

template<typename ChildT>

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

## ◆ isEmpty()

template<typename ChildT>

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

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

## ◆ KeyToCoord()

template<typename ChildT>

__hostdev__ CoordT KeyToCoord | ( | const KeyT & | key | ) |
| inlinestaticinherited

## ◆ maximum()

template<typename ChildT>

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

Return a const reference to the maximum active value encoded in this root node and any of its child nodes.

## ◆ memUsage() [1/2]

template<typename ChildT>

__hostdev__ uint64_t memUsage | ( |  | ) | const
| inline

Return the actual memory footprint of this root node.

## ◆ memUsage() [2/2]

template<typename ChildT>

__hostdev__ uint64_t memUsage | ( | uint32_t | tableSize | ) |
| inlinestatic

Return the expected memory footprint in bytes with the specified number of tiles.

## ◆ minimum()

template<typename ChildT>

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

Return a const reference to the minimum active value encoded in this root node and any of its child nodes.

## ◆ operator=()

template<typename ChildT>

RootNode & operator= | ( | const RootNode< ChildT > & |  | ) |
| delete

## ◆ padding()

template<typename ChildT>

__hostdev__ constexpr uint32_t padding | ( |  | ) |
| inlinestaticconstexprinherited

Return padding of this class in bytes, due to aliasing and 32B alignment.

Note
  The extra bytes are not necessarily at the end, but can come from aliasing of individual data members.

## ◆ probe() [1/2]

template<typename ChildT>

__hostdev__ TileIterator probe | ( | const CoordT & | ijk | ) |
| inlineinherited

## ◆ probe() [2/2]

template<typename ChildT>

__hostdev__ ConstTileIterator probe | ( | const CoordT & | ijk | ) | const
| inlineinherited

## ◆ probeChild() [1/2]

template<typename ChildT>

__hostdev__ ChildT * probeChild | ( | const CoordT & | ijk | ) |
| inlineinherited

## ◆ probeChild() [2/2]

template<typename ChildT>

__hostdev__ const ChildT * probeChild | ( | const CoordT & | ijk | ) | const
| inlineinherited

## ◆ probeLeaf()

template<typename ChildT>

__hostdev__ const LeafNodeType * probeLeaf | ( | const CoordType & | ijk | ) | const
| inline

## ◆ probeTile() [1/2]

template<typename ChildT>

__hostdev__ Tile * probeTile | ( | const CoordT & | ijk | ) |
| inlineinherited

## ◆ probeTile() [2/2]

template<typename ChildT>

__hostdev__ const Tile * probeTile | ( | const CoordT & | ijk | ) | const
| inlineinherited

## ◆ probeValue()

template<typename ChildT>

__hostdev__ bool probeValue | ( | const CoordType & | ijk,
|  | ValueType & | v ) const
| inline

return the state and updates the value of the specified voxel

## ◆ set()

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

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

## ◆ setAvg()

template<typename ChildT>

__hostdev__ void setAvg | ( | const StatsT & | v | ) |
| inlineinherited

## ◆ setDev()

template<typename ChildT>

__hostdev__ void setDev | ( | const StatsT & | v | ) |
| inlineinherited

## ◆ setMax()

template<typename ChildT>

__hostdev__ void setMax | ( | const ValueT & | v | ) |
| inlineinherited

## ◆ setMin()

template<typename ChildT>

__hostdev__ void setMin | ( | const ValueT & | v | ) |
| inlineinherited

## ◆ stdDeviation()

template<typename ChildT>

__hostdev__ const FloatType & stdDeviation | ( |  | ) | const
| inline

Return a const reference to the standard deviation of all the active values encoded in this root node and any of its child nodes.

## ◆ tile() [1/2]

template<typename ChildT>

__hostdev__ Tile * tile | ( | uint32_t | n | ) |
| inlineinherited

## ◆ tile() [2/2]

template<typename ChildT>

__hostdev__ const Tile * tile | ( | uint32_t | n | ) | const
| inlineinherited

Returns a pointer to the tile at the specified linear offset.

Warning
  The linear offset is assumed to be in the valid range

## ◆ tileCount()

template<typename ChildT>

__hostdev__ const uint32_t & tileCount | ( |  | ) | const
| inline

Return the number of tiles encoded in this root node.

## ◆ variance()

template<typename ChildT>

__hostdev__ FloatType variance | ( |  | ) | const
| inline

Return the variance of all the active values encoded in this root node and any of its child nodes.

## Friends And Related Symbol Documentation

## ◆ ReadAccessor

template<typename ChildT>
template<typename, int, int, int>

friend class ReadAccessor
| friend

## ◆ Tree

template<typename ChildT>
template<typename>

friend class Tree
| friend

## Member Data Documentation

## ◆ FIXED_SIZE

template<typename ChildT>

bool FIXED_SIZE = DataType::FIXED_SIZE
| staticconstexpr

## ◆ LEVEL

template<typename ChildT>

uint32_t LEVEL = 1 + ChildT::LEVEL
| staticconstexpr

## ◆ mAverage

template<typename ChildT>

StatsT mAverage
| inherited

## ◆ mBackground

template<typename ChildT>

ValueT mBackground
| inherited

## ◆ mBBox

template<typename ChildT>

math::BBox<CoordT> mBBox
| inherited

## ◆ mMaximum

template<typename ChildT>

ValueT mMaximum
| inherited

## ◆ mMinimum

template<typename ChildT>

ValueT mMinimum
| inherited

## ◆ mStdDevi

template<typename ChildT>

StatsT mStdDevi
| inherited

## ◆ mTableSize

template<typename ChildT>

uint32_t mTableSize
| inherited