OpenVDB 11.0.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
RootNode< ChildT > Class Template Reference

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

#include <nanovdb/NanoVDB.h>

Inheritance diagram for RootNode< ChildT >:
RootData< 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 = 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.
 

Public Member Functions

ChildIterator beginChild ()
 
ConstChildIterator cbeginChild () const
 
ValueIterator beginValue ()
 
ConstValueIterator cbeginValueAll () const
 
ValueOnIterator beginValueOn ()
 
ConstValueOnIterator cbeginValueOn () const
 
DenseIterator beginDense ()
 
ConstDenseIterator cbeginDense () const
 
ConstDenseIterator cbeginChildAll () const
 
 RootNode ()=delete
 This class cannot be constructed or deleted.
 
 RootNode (const RootNode &)=delete
 
RootNodeoperator= (const RootNode &)=delete
 
 ~RootNode ()=delete
 
AccessorType getAccessor () const
 
DataTypedata ()
 
const DataTypedata () const
 
const BBoxTypebbox () 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.
 
const ValueTypebackground () const
 Return the total number of active voxels in the root and all its child nodes.
 
const uint32_t & tileCount () const
 Return the number of tiles encoded in this root node.
 
const uint32_t & getTableSize () const
 
const ValueTypeminimum () const
 Return a const reference to the minimum active value encoded in this root node and any of its child nodes.
 
const ValueTypemaximum () const
 Return a const reference to the maximum active value encoded in this root node and any of its child nodes.
 
const FloatTypeaverage () const
 Return a const reference to the average of all the active values encoded in this root node and any of its child nodes.
 
FloatType variance () const
 Return the variance of all the active values encoded in this root node and any of its child nodes.
 
const FloatTypestdDeviation () 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.
 
uint64_t memUsage () const
 Return the actual memory footprint of this root node.
 
bool isEmpty () const
 Return true if this RootNode is empty, i.e. contains no values or nodes.
 
ValueType getValue (const CoordType &ijk) const
 Return the value of the given voxel.
 
ValueType getValue (int i, int j, int k) const
 
bool isActive (const CoordType &ijk) const
 
bool probeValue (const CoordType &ijk, ValueType &v) const
 return the state and updates the value of the specified voxel
 
const LeafNodeTypeprobeLeaf (const CoordType &ijk) const
 
const ChildNodeTypeprobeChild (const CoordType &ijk) const
 
ChildNodeTypeprobeChild (const CoordType &ijk)
 
template<typename OpT , typename... ArgsT>
auto get (const CoordType &ijk, ArgsT &&... args) const
 
const Tiletile (uint32_t n) const
 Returns a non-const reference to the tile at the specified linear offset.
 
Tiletile (uint32_t n)
 
TileprobeTile (const CoordT &ijk)
 
const TileprobeTile (const CoordT &ijk) const
 
ChildT * getChild (const Tile *tile)
 Returns a const reference to the child node in the specified tile.
 
const ChildT * getChild (const Tile *tile) const
 
const ValueTgetMin () const
 
const ValueTgetMax () const
 
void setMin (const ValueT &v)
 
void setMax (const ValueT &v)
 
void setAvg (const StatsT &v)
 
void setDev (const StatsT &v)
 

Static Public Member Functions

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

Public Attributes

template<typename OpT , typename... ArgsT>
decltype(OpT::set(std::declval< Tile & >(), std::declval< ArgsT >()...)) set (const CoordType &ijk, ArgsT &&... args)
 
BBox< CoordTmBBox
 
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

◆ BBoxType

◆ BuildT

using BuildT = typename ChildT::BuildType
inherited

◆ BuildType

using BuildType = typename DataType::BuildT

◆ ChildIterator

◆ ChildNodeType

using ChildNodeType = ChildT

◆ ConstChildIterator

◆ ConstDenseIterator

◆ ConstValueIterator

◆ ConstValueOnIterator

◆ CoordT

using CoordT = typename ChildT::CoordType
inherited

◆ CoordType

using CoordType = typename ChildT::CoordType

◆ DataType

using DataType = RootData<ChildT>

◆ DenseIterator

◆ FloatType

using FloatType = typename DataType::StatsT

◆ KeyT

using KeyT = uint64_t
inherited

Return a key based on the coordinates of a voxel.

◆ LeafNodeType

using LeafNodeType = typename ChildT::LeafNodeType

◆ LowerNodeType

using LowerNodeType = typename UpperNodeType::ChildNodeType

◆ RootNodeType

◆ RootType

using RootType = RootNode<ChildT>

◆ StatsT

using StatsT = typename ChildT::FloatType
inherited

◆ Tile

using Tile = typename DataType::Tile

◆ UpperNodeType

using UpperNodeType = ChildT

◆ ValueIterator

◆ ValueOnIterator

◆ ValueT

using ValueT = typename ChildT::ValueType
inherited

◆ ValueType

using ValueType = typename DataType::ValueT

Constructor & Destructor Documentation

◆ RootNode() [1/2]

RootNode ( )
delete

This class cannot be constructed or deleted.

◆ RootNode() [2/2]

RootNode ( const RootNode< ChildT > &  )
delete

◆ ~RootNode()

~RootNode ( )
delete

Member Function Documentation

◆ average()

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

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

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

ChildIterator beginChild ( )
inline

◆ beginDense()

DenseIterator beginDense ( )
inline

◆ beginValue()

ValueIterator beginValue ( )
inline

◆ beginValueOn()

ValueOnIterator beginValueOn ( )
inline

◆ cbeginChild()

ConstChildIterator cbeginChild ( ) const
inline

◆ cbeginChildAll()

ConstDenseIterator cbeginChildAll ( ) const
inline

◆ cbeginDense()

ConstDenseIterator cbeginDense ( ) const
inline

◆ cbeginValueAll()

ConstValueIterator cbeginValueAll ( ) const
inline

◆ cbeginValueOn()

ConstValueOnIterator cbeginValueOn ( ) const
inline

◆ CoordToKey()

static KeyT CoordToKey ( const CoordType &  ijk)
inlinestaticinherited

◆ data() [1/2]

DataType * data ( )
inline

◆ data() [2/2]

const DataType * data ( ) const
inline

◆ get()

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

◆ getAccessor()

AccessorType getAccessor ( ) const
inline

◆ getChild() [1/2]

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]

const ChildT * getChild ( const Tile tile) const
inlineinherited

◆ getMax()

const ValueT & getMax ( ) const
inlineinherited

◆ getMin()

const ValueT & getMin ( ) const
inlineinherited

◆ getTableSize()

const uint32_t & getTableSize ( ) const
inline

◆ getValue() [1/2]

ValueType getValue ( const CoordType ijk) const
inline

Return the value of the given voxel.

◆ getValue() [2/2]

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

◆ isActive()

bool isActive ( const CoordType ijk) const
inline

◆ isEmpty()

bool isEmpty ( ) const
inline

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

◆ KeyToCoord()

static CoordT KeyToCoord ( const KeyT key)
inlinestaticinherited

◆ maximum()

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]

uint64_t memUsage ( ) const
inline

Return the actual memory footprint of this root node.

◆ memUsage() [2/2]

static uint64_t memUsage ( uint32_t  tableSize)
inlinestatic

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

◆ minimum()

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

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

◆ padding()

static 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.

◆ probeChild() [1/2]

ChildNodeType * probeChild ( const CoordType ijk)
inline

◆ probeChild() [2/2]

const ChildNodeType * probeChild ( const CoordType ijk) const
inline

◆ probeLeaf()

const LeafNodeType * probeLeaf ( const CoordType ijk) const
inline

◆ probeTile() [1/2]

Tile * probeTile ( const CoordT ijk)
inlineinherited

◆ probeTile() [2/2]

const Tile * probeTile ( const CoordT ijk) const
inlineinherited

◆ probeValue()

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

return the state and updates the value of the specified voxel

◆ setAvg()

void setAvg ( const StatsT v)
inlineinherited

◆ setDev()

void setDev ( const StatsT v)
inlineinherited

◆ setMax()

void setMax ( const ValueT v)
inlineinherited

◆ setMin()

void setMin ( const ValueT v)
inlineinherited

◆ stdDeviation()

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]

Tile * tile ( uint32_t  n)
inlineinherited

◆ tile() [2/2]

const Tile * tile ( uint32_t  n) const
inlineinherited

Returns a non-const reference to the tile at the specified linear offset.

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

◆ tileCount()

const uint32_t & tileCount ( ) const
inline

Return the number of tiles encoded in this root node.

◆ variance()

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 Function Documentation

◆ ReadAccessor

friend class ReadAccessor
friend

◆ Tree

friend class Tree
friend

Member Data Documentation

◆ FIXED_SIZE

constexpr bool FIXED_SIZE = DataType::FIXED_SIZE
staticconstexpr

◆ LEVEL

constexpr uint32_t LEVEL = 1 + ChildT::LEVEL
staticconstexpr

◆ mAverage

StatsT mAverage
inherited

◆ mBackground

ValueT mBackground
inherited

◆ mBBox

BBox<CoordT> mBBox
inherited

◆ mMaximum

ValueT mMaximum
inherited

◆ mMinimum

ValueT mMinimum
inherited

◆ mStdDevi

StatsT mStdDevi
inherited

◆ mTableSize

uint32_t mTableSize
inherited

◆ set

decltype(OpT::set(std::declval< Tile & >(), std::declval< ArgsT >()...)) set(const CoordType &ijk, ArgsT &&... args)
inline