OpenVDB  11.0.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
InternalNode< ChildT > Struct Template Reference

#include <nanovdb/util/GridBuilder.h>

Classes

class  ChildIterator
 Visits child nodes of this node only. More...
 
class  DenseIterator
 Visits all tile values and child nodes of this node. More...
 
struct  Tile
 
class  ValueIterator
 Visits all tile values in this node, i.e. both inactive and active tiles. More...
 
class  ValueOnIterator
 Visits active tile values of this node only. More...
 

Public Types

using ValueType = typename ChildT::ValueType
 
using BuildType = typename ChildT::BuildType
 
using ChildNodeType = ChildT
 
using LeafNodeType = typename ChildT::LeafNodeType
 
using MaskT = Mask< LOG2DIM >
 
template<bool On>
using MaskIterT = typename MaskT::template Iterator< On >
 
using NanoNodeT = typename NanoNode< BuildType, LEVEL >::Type
 

Public Member Functions

ChildIterator beginChild ()
 
ChildIterator cbeginChildOn () const
 
ValueIterator beginValue ()
 
ValueIterator cbeginValueAll () const
 
ValueOnIterator beginValueOn ()
 
ValueOnIterator cbeginValueOn () const
 
DenseIterator beginDense ()
 
DenseIterator cbeginChildAll () const
 
 InternalNode (const Coord &origin, const ValueType &value, bool state)
 
 InternalNode (const InternalNode &)=delete
 
 InternalNode (InternalNode &&)=delete
 
InternalNodeoperator= (const InternalNode &)=delete
 
InternalNodeoperator= (InternalNode &&)=delete
 
 ~InternalNode ()
 
const MaskTgetValueMask () const
 
const MaskTvalueMask () const
 
const MaskTgetChildMask () const
 
const MaskTchildMask () const
 
const Coordorigin () const
 
void nodeCount (std::array< size_t, 3 > &count) const
 
void localToGlobalCoord (Coord &ijk) const
 
Coord offsetToGlobalCoord (uint32_t n) const
 
ValueType getFirstValue () const
 
ValueType getLastValue () const
 
template<typename OpT , typename... ArgsT>
auto get (const Coord &ijk, ArgsT &&... args) const
 
template<typename OpT , typename... ArgsT>
auto set (const Coord &ijk, ArgsT &&... args)
 
template<typename OpT , typename AccT , typename... ArgsT>
auto getAndCache (const Coord &ijk, const AccT &acc, ArgsT &&... args) const
 
template<typename OpT , typename AccT , typename... ArgsT>
auto setAndCache (const Coord &ijk, const AccT &acc, ArgsT &&... args)
 
ValueType getValue (const Coord &ijk) const
 
void setValue (const Coord &ijk, const ValueType &value)
 
template<typename AccT >
ValueType getValueAndCache (const Coord &ijk, AccT &acc) const
 
template<typename AccT >
void setValueAndCache (const Coord &ijk, const ValueType &value, AccT &acc)
 
template<typename AccT >
void setValueOnAndCache (const Coord &ijk, AccT &acc)
 
template<typename AccT >
void touchLeafAndCache (const Coord &ijk, AccT &acc)
 
template<typename AccT >
bool isActiveAndCache (const Coord &ijk, AccT &acc) const
 
template<typename NodeT >
uint32_t nodeCount () const
 
template<typename NodeT >
void getNodes (std::vector< NodeT * > &array)
 
void addChild (ChildT *&child)
 
template<uint32_t level>
void addTile (const Coord &ijk, const ValueType &value, bool state)
 Add a tile containing voxel (i, j, k) at the specified tree level, creating a new branch if necessary. Delete any existing lower-level nodes that contain (x, y, z). More...
 
template<typename NodeT >
void addNode (NodeT *&node)
 
void merge (InternalNode &other)
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value >::type signedFloodFill (T outside)
 

Static Public Member Functions

static uint32_t CoordToOffset (const Coord &ijk)
 
static Coord OffsetToLocalCoord (uint32_t n)
 

Public Attributes

Coord mOrigin
 
MaskT mValueMask
 
MaskT mChildMask
 
Tile mTable [SIZE]
 
union {
   NanoNodeT *   mDstNode
 
   uint64_t   mDstOffset
 
}; 
 

Static Public Attributes

static constexpr uint32_t LOG2DIM = ChildT::LOG2DIM + 1
 
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 = DIM - 1
 
static constexpr uint32_t LEVEL = 1 + ChildT::LEVEL
 
static constexpr uint64_t NUM_VALUES = uint64_t(1) << (3 * TOTAL)
 

Member Typedef Documentation

◆ BuildType

using BuildType = typename ChildT::BuildType

◆ ChildNodeType

using ChildNodeType = ChildT

◆ LeafNodeType

using LeafNodeType = typename ChildT::LeafNodeType

◆ MaskIterT

using MaskIterT = typename MaskT::template Iterator<On>

◆ MaskT

using MaskT = Mask<LOG2DIM>

◆ NanoNodeT

using NanoNodeT = typename NanoNode<BuildType, LEVEL>::Type

◆ ValueType

using ValueType = typename ChildT::ValueType

Constructor & Destructor Documentation

◆ InternalNode() [1/3]

InternalNode ( const Coord origin,
const ValueType value,
bool  state 
)
inline

◆ InternalNode() [2/3]

InternalNode ( const InternalNode< ChildT > &  )
delete

◆ InternalNode() [3/3]

InternalNode ( InternalNode< ChildT > &&  )
delete

◆ ~InternalNode()

~InternalNode ( )
inline

Member Function Documentation

◆ addChild()

void addChild ( ChildT *&  child)
inline

◆ addNode()

void addNode ( NodeT *&  node)
inline

◆ addTile()

void addTile ( const Coord ijk,
const ValueType value,
bool  state 
)
inline

Add a tile containing voxel (i, j, k) at the specified tree level, creating a new branch if necessary. Delete any existing lower-level nodes that contain (x, y, z).

Template Parameters
leveltree level at which the tile is inserted. Must be 1 or 2.
Parameters
ijkIndex coordinate that map to the tile being inserted
valueValue of the tile
stateBinary state of the tile

◆ beginChild()

ChildIterator beginChild ( )
inline

◆ beginDense()

DenseIterator beginDense ( )
inline

◆ beginValue()

ValueIterator beginValue ( )
inline

◆ beginValueOn()

ValueOnIterator beginValueOn ( )
inline

◆ cbeginChildAll()

DenseIterator cbeginChildAll ( ) const
inline

◆ cbeginChildOn()

ChildIterator cbeginChildOn ( ) const
inline

◆ cbeginValueAll()

ValueIterator cbeginValueAll ( ) const
inline

◆ cbeginValueOn()

ValueOnIterator cbeginValueOn ( ) const
inline

◆ childMask()

const MaskT& childMask ( ) const
inline

◆ CoordToOffset()

static uint32_t CoordToOffset ( const Coord ijk)
inlinestatic

◆ get()

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

◆ getAndCache()

auto getAndCache ( const Coord ijk,
const AccT &  acc,
ArgsT &&...  args 
) const
inline

◆ getChildMask()

const MaskT& getChildMask ( ) const
inline

◆ getFirstValue()

ValueType getFirstValue ( ) const
inline

◆ getLastValue()

ValueType getLastValue ( ) const
inline

◆ getNodes()

void getNodes ( std::vector< NodeT * > &  array)
inline

◆ getValue()

ValueType getValue ( const Coord ijk) const
inline

◆ getValueAndCache()

ValueType getValueAndCache ( const Coord ijk,
AccT &  acc 
) const
inline

◆ getValueMask()

const MaskT& getValueMask ( ) const
inline

◆ isActiveAndCache()

bool isActiveAndCache ( const Coord ijk,
AccT &  acc 
) const
inline

◆ localToGlobalCoord()

void localToGlobalCoord ( Coord ijk) const
inline

◆ merge()

void merge ( InternalNode< ChildT > &  other)
inline

◆ nodeCount() [1/2]

uint32_t nodeCount ( ) const
inline

◆ nodeCount() [2/2]

void nodeCount ( std::array< size_t, 3 > &  count) const
inline

◆ offsetToGlobalCoord()

Coord offsetToGlobalCoord ( uint32_t  n) const
inline

◆ OffsetToLocalCoord()

static Coord OffsetToLocalCoord ( uint32_t  n)
inlinestatic

◆ operator=() [1/2]

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

◆ operator=() [2/2]

InternalNode& operator= ( InternalNode< ChildT > &&  )
delete

◆ origin()

const Coord& origin ( ) const
inline

◆ set()

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

◆ setAndCache()

auto setAndCache ( const Coord ijk,
const AccT &  acc,
ArgsT &&...  args 
)
inline

◆ setValue()

void setValue ( const Coord ijk,
const ValueType value 
)
inline

◆ setValueAndCache()

void setValueAndCache ( const Coord ijk,
const ValueType value,
AccT &  acc 
)
inline

◆ setValueOnAndCache()

void setValueOnAndCache ( const Coord ijk,
AccT &  acc 
)
inline

◆ signedFloodFill()

std::enable_if< std::is_floating_point< T >::value >::type signedFloodFill ( outside)
inline

◆ touchLeafAndCache()

void touchLeafAndCache ( const Coord ijk,
AccT &  acc 
)
inline

◆ valueMask()

const MaskT& valueMask ( ) const
inline

Member Data Documentation

◆ 

union { ... }

◆ DIM

constexpr uint32_t DIM = 1u << TOTAL
staticconstexpr

◆ LEVEL

constexpr uint32_t LEVEL = 1 + ChildT::LEVEL
staticconstexpr

◆ LOG2DIM

constexpr uint32_t LOG2DIM = ChildT::LOG2DIM + 1
staticconstexpr

◆ MASK

constexpr uint32_t MASK = DIM - 1
staticconstexpr

◆ mChildMask

MaskT mChildMask

◆ mDstNode

NanoNodeT* mDstNode

◆ mDstOffset

uint64_t mDstOffset

◆ mOrigin

Coord mOrigin

◆ mTable

Tile mTable[SIZE]

◆ mValueMask

MaskT mValueMask

◆ NUM_VALUES

constexpr uint64_t NUM_VALUES = uint64_t(1) << (3 * TOTAL)
staticconstexpr

◆ SIZE

constexpr uint32_t SIZE = 1u << (3 * LOG2DIM)
staticconstexpr

◆ TOTAL

constexpr uint32_t TOTAL = LOG2DIM + ChildT::TOTAL
staticconstexpr