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

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

Constructor & Destructor Documentation

InternalNode ( const Coord origin,
const ValueType value,
bool  state 
)
inline
InternalNode ( const InternalNode< ChildT > &  )
delete
InternalNode ( InternalNode< ChildT > &&  )
delete
~InternalNode ( )
inline

Member Function Documentation

void addChild ( ChildT *&  child)
inline
void addNode ( NodeT *&  node)
inline
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
ChildIterator beginChild ( )
inline
DenseIterator beginDense ( )
inline
ValueIterator beginValue ( )
inline
ValueOnIterator beginValueOn ( )
inline
DenseIterator cbeginChildAll ( ) const
inline
ChildIterator cbeginChildOn ( ) const
inline
ValueIterator cbeginValueAll ( ) const
inline
ValueOnIterator cbeginValueOn ( ) const
inline
const MaskT& childMask ( ) const
inline
static uint32_t CoordToOffset ( const Coord ijk)
inlinestatic
auto get ( const Coord ijk,
ArgsT &&...  args 
) const
inline
auto getAndCache ( const Coord ijk,
const AccT &  acc,
ArgsT &&...  args 
) const
inline
const MaskT& getChildMask ( ) const
inline
ValueType getFirstValue ( ) const
inline
ValueType getLastValue ( ) const
inline
void getNodes ( std::vector< NodeT * > &  array)
inline
ValueType getValue ( const Coord ijk) const
inline
ValueType getValueAndCache ( const Coord ijk,
AccT &  acc 
) const
inline
const MaskT& getValueMask ( ) const
inline
bool isActiveAndCache ( const Coord ijk,
AccT &  acc 
) const
inline
void localToGlobalCoord ( Coord ijk) const
inline
void merge ( InternalNode< ChildT > &  other)
inline
void nodeCount ( std::array< size_t, 3 > &  count) const
inline
uint32_t nodeCount ( ) const
inline
Coord offsetToGlobalCoord ( uint32_t  n) const
inline
static Coord OffsetToLocalCoord ( uint32_t  n)
inlinestatic
InternalNode& operator= ( const InternalNode< ChildT > &  )
delete
InternalNode& operator= ( InternalNode< ChildT > &&  )
delete
const Coord& origin ( ) const
inline
auto set ( const Coord ijk,
ArgsT &&...  args 
)
inline
auto setAndCache ( const Coord ijk,
const AccT &  acc,
ArgsT &&...  args 
)
inline
void setValue ( const Coord ijk,
const ValueType value 
)
inline
void setValueAndCache ( const Coord ijk,
const ValueType value,
AccT &  acc 
)
inline
void setValueOnAndCache ( const Coord ijk,
AccT &  acc 
)
inline
std::enable_if< std::is_floating_point< T >::value >::type signedFloodFill ( outside)
inline
void touchLeafAndCache ( const Coord ijk,
AccT &  acc 
)
inline
const MaskT& valueMask ( ) const
inline

Member Data Documentation

union { ... }
constexpr uint32_t DIM = 1u << TOTAL
static
constexpr uint32_t LEVEL = 1 + ChildT::LEVEL
static
constexpr uint32_t LOG2DIM = ChildT::LOG2DIM + 1
static
constexpr uint32_t MASK = DIM - 1
static
MaskT mChildMask
NanoNodeT* mDstNode
uint64_t mDstOffset
Coord mOrigin
Tile mTable[SIZE]
MaskT mValueMask
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