OpenVDB  9.0.1
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
InternalNode< ChildT, Log2Dim > Class Template Reference

Internal nodes of a VDB treedim(),. More...

#include <nanovdb/NanoVDB.h>

Inherits InternalData< ChildT, Log2Dim >.

Public Types

using DataType = InternalData< ChildT, Log2Dim >
 
using ValueType = typename DataType::ValueT
 
using FloatType = typename DataType::StatsT
 
using BuildType = typename DataType::BuildT
 
using LeafNodeType = typename ChildT::LeafNodeType
 
using ChildNodeType = ChildT
 
using CoordType = typename ChildT::CoordType
 
template<uint32_t LOG2>
using MaskType = typename ChildT::template MaskType< LOG2 >
 

Public Member Functions

 InternalNode ()=delete
 This class cannot be constructed or deleted. More...
 
 InternalNode (const InternalNode &)=delete
 
InternalNodeoperator= (const InternalNode &)=delete
 
 ~InternalNode ()=delete
 
DataTypedata ()
 
const DataTypedata () const
 
const MaskType< LOG2DIM > & valueMask () const
 Return a const reference to the bit mask of active voxels in this internal node. More...
 
const MaskType< LOG2DIM > & childMask () const
 Return a const reference to the bit mask of child nodes in this internal node. More...
 
CoordType origin () const
 Return the origin in index space of this leaf node. More...
 
const ValueTypeminimum () const
 Return a const reference to the minimum active value encoded in this internal node and any of its child nodes. More...
 
const ValueTypemaximum () const
 Return a const reference to the maximum active value encoded in this internal node and any of its child nodes. More...
 
const FloatTypeaverage () const
 Return a const reference to the average of all the active values encoded in this internal node and any of its child nodes. More...
 
FloatType variance () const
 Return the variance of all the active values encoded in this internal node and any of its child nodes. More...
 
const FloatTypestdDeviation () const
 Return a const reference to the standard deviation of all the active values encoded in this internal node and any of its child nodes. More...
 
const BBox< CoordType > & bbox () const
 Return a const reference to the bounding box in index space of active values in this internal node and any of its child nodes. More...
 
ValueType getValue (const CoordType &ijk) const
 Return the value of the given voxel. More...
 
bool isActive (const CoordType &ijk) const
 
bool probeValue (const CoordType &ijk, ValueType &v) const
 
const LeafNodeTypeprobeLeaf (const CoordType &ijk) const
 
void localToGlobalCoord (Coord &ijk) const
 modifies local coordinates to global coordinates of a tile or child node More...
 
Coord offsetToGlobalCoord (uint32_t n) const
 
bool isActive () const
 Retrun true if this node or any of its child nodes contain active values. More...
 

Static Public Member Functions

static uint32_t dim ()
 Return the dimension, in voxel units, of this internal node (typically 8*16 or 8*16*32) More...
 
static size_t memUsage ()
 Return memory usage in bytes for the class. More...
 
static uint32_t CoordToOffset (const CoordType &ijk)
 Return the linear offset corresponding to the given coordinate. More...
 
static Coord OffsetToLocalCoord (uint32_t n)
 

Static Public Attributes

static constexpr bool FIXED_SIZE = DataType::FIXED_SIZE
 
static constexpr uint32_t LOG2DIM = Log2Dim
 
static constexpr uint32_t TOTAL = LOG2DIM + ChildT::TOTAL
 
static constexpr uint32_t DIM = 1u << TOTAL
 
static constexpr uint32_t SIZE = 1u << (3 * LOG2DIM)
 
static constexpr uint32_t MASK = (1u << TOTAL) - 1u
 
static constexpr uint32_t LEVEL = 1 + ChildT::LEVEL
 
static constexpr uint64_t NUM_VALUES = uint64_t(1) << (3 * TOTAL)
 

Private Types

using ValueT = typename ChildT::ValueType
 
using BuildT = typename ChildT::BuildType
 
using StatsT = typename ChildT::FloatType
 
using CoordT = typename ChildT::CoordType
 
using MaskT = typename ChildT::template MaskType< LOG2DIM >
 

Private Member Functions

void setChild (uint32_t n, const void *ptr)
 
void setValue (uint32_t n, const ValueT &v)
 
ChildT * getChild (uint32_t n)
 Returns a pointer to the child node at the specifed linear offset. More...
 
const ChildT * getChild (uint32_t n) const
 
void setOrigin (const T &ijk)
 
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)
 

Private Attributes

BBox< CoordTmBBox
 
uint64_t mFlags
 
MaskT mValueMask
 
MaskT mChildMask
 
ValueT mMinimum
 
ValueT mMaximum
 
StatsT mAverage
 
StatsT mStdDevi
 
Tile mTable [1u<< (3 *LOG2DIM)]
 

Friends

template<typename , int , int , int >
class ReadAccessor
 
template<typename >
class RootNode
 
template<typename , uint32_t >
class InternalNode
 

Detailed Description

template<typename ChildT, uint32_t Log2Dim = ChildT::LOG2DIM + 1>
class nanovdb::InternalNode< ChildT, Log2Dim >

Internal nodes of a VDB treedim(),.

Member Typedef Documentation

using BuildType = typename DataType::BuildT
using ChildNodeType = ChildT
using CoordType = typename ChildT::CoordType
using DataType = InternalData<ChildT, Log2Dim>
using FloatType = typename DataType::StatsT
using LeafNodeType = typename ChildT::LeafNodeType
using MaskType = typename ChildT::template MaskType<LOG2>
using ValueType = typename DataType::ValueT

Constructor & Destructor Documentation

InternalNode ( )
delete

This class cannot be constructed or deleted.

InternalNode ( const InternalNode< ChildT, Log2Dim > &  )
delete
~InternalNode ( )
delete

Member Function Documentation

const FloatType& average ( ) const
inline

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

const BBox<CoordType>& bbox ( ) const
inline

Return a const reference to the bounding box in index space of active values in this internal node and any of its child nodes.

const MaskType<LOG2DIM>& childMask ( ) const
inline

Return a const reference to the bit mask of child nodes in this internal node.

static uint32_t CoordToOffset ( const CoordType ijk)
inlinestatic

Return the linear offset corresponding to the given coordinate.

DataType* data ( )
inline
const DataType* data ( ) const
inline
static uint32_t dim ( )
inlinestatic

Return the dimension, in voxel units, of this internal node (typically 8*16 or 8*16*32)

ValueType getValue ( const CoordType ijk) const
inline

Return the value of the given voxel.

bool isActive ( const CoordType ijk) const
inline
bool isActive ( ) const
inline

Retrun true if this node or any of its child nodes contain active values.

void localToGlobalCoord ( Coord ijk) const
inline

modifies local coordinates to global coordinates of a tile or child node

const ValueType& maximum ( ) const
inline

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

static size_t memUsage ( )
inlinestatic

Return memory usage in bytes for the class.

const ValueType& minimum ( ) const
inline

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

Coord offsetToGlobalCoord ( uint32_t  n) const
inline
static Coord OffsetToLocalCoord ( uint32_t  n)
inlinestatic
Returns
the local coordinate of the n'th tile or child node
InternalNode& operator= ( const InternalNode< ChildT, Log2Dim > &  )
delete
CoordType origin ( ) const
inline

Return the origin in index space of this leaf node.

const LeafNodeType* probeLeaf ( const CoordType ijk) const
inline
bool probeValue ( const CoordType ijk,
ValueType v 
) const
inline
const FloatType& stdDeviation ( ) const
inline

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

const MaskType<LOG2DIM>& valueMask ( ) const
inline

Return a const reference to the bit mask of active voxels in this internal node.

FloatType variance ( ) const
inline

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

Friends And Related Function Documentation

friend class InternalNode
friend
friend class ReadAccessor
friend
friend class RootNode
friend

Member Data Documentation

constexpr uint32_t DIM = 1u << TOTAL
static
constexpr bool FIXED_SIZE = DataType::FIXED_SIZE
static
constexpr uint32_t LEVEL = 1 + ChildT::LEVEL
static
constexpr uint32_t LOG2DIM = Log2Dim
static
constexpr uint32_t MASK = (1u << TOTAL) - 1u
static
constexpr uint64_t NUM_VALUES = uint64_t(1) << (3 * TOTAL)
static
constexpr uint32_t SIZE = 1u << (3 * LOG2DIM)
static
constexpr uint32_t TOTAL = LOG2DIM + ChildT::TOTAL
static