OpenVDB  12.0.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
NodeManager< BuildT > Class Template Reference

NodeManager allows for sequential access to nodes. More...

#include <nanovdb/NodeManager.h>

Inherits NodeManagerData.

Public Member Functions

 NodeManager (const NodeManager &)=delete
 
 NodeManager (NodeManager &&)=delete
 
NodeManageroperator= (const NodeManager &)=delete
 
NodeManageroperator= (NodeManager &&)=delete
 
 ~NodeManager ()=delete
 
__hostdev__ bool isLinear () const
 return true if the nodes have both fixed size and are arranged breadth-first in memory. This allows for direct and memory-efficient linear access to nodes. More...
 
__hostdev__ uint64_t memUsage () const
 Return the memory footprint in bytes of this instance. More...
 
__hostdev__ GridTgrid ()
 Return a reference to the grid. More...
 
__hostdev__ const GridTgrid () const
 
__hostdev__ TreeT & tree ()
 Return a reference to the tree. More...
 
__hostdev__ const TreeT & tree () const
 
__hostdev__ RootT & root ()
 Return a reference to the root. More...
 
__hostdev__ const RootT & root () const
 
__hostdev__ uint64_t nodeCount (int level) const
 Return the number of tree nodes at the specified level. More...
 
__hostdev__ uint64_t leafCount () const
 
__hostdev__ uint64_t lowerCount () const
 
__hostdev__ uint64_t upperCount () const
 
template<int LEVEL>
__hostdev__ const NodeT< LEVEL > & node (uint32_t i) const
 Return the i'th leaf node with respect to breadth-first ordering. More...
 
template<int LEVEL>
__hostdev__ NodeT< LEVEL > & node (uint32_t i)
 Return the i'th node with respect to breadth-first ordering. More...
 
__hostdev__ const Node0 & leaf (uint32_t i) const
 Return the i'th leaf node with respect to breadth-first ordering. More...
 
__hostdev__ Node0 & leaf (uint32_t i)
 
__hostdev__ const Node1 & lower (uint32_t i) const
 Return the i'th lower internal node with respect to breadth-first ordering. More...
 
__hostdev__ Node1 & lower (uint32_t i)
 
__hostdev__ const Node2 & upper (uint32_t i) const
 Return the i'th upper internal node with respect to breadth-first ordering. More...
 
__hostdev__ Node2 & upper (uint32_t i)
 

Static Public Member Functions

static __hostdev__ bool isLinear (const GridT &grid)
 return true if the nodes have both fixed size and are arranged breadth-first in memory. This allows for direct and memory-efficient linear access to nodes. More...
 
static __hostdev__ uint64_t memUsage (const GridT &grid)
 Return the memory footprint in bytes of the NodeManager derived from the specified grid. More...
 

Static Public Attributes

static constexpr bool FIXED_SIZE = Node0::FIXED_SIZE && Node1::FIXED_SIZE && Node2::FIXED_SIZE
 

Private Attributes

uint64_t mMagic
 
union {
   int64_t   mPadding
 
   uint8_t   mLinear
 
}; 
 
void * mGrid
 
union {
   int64_t *   mPtr [3]
 
   int64_t   mOff [3]
 
}; 
 

Detailed Description

template<typename BuildT>
class nanovdb::NodeManager< BuildT >

NodeManager allows for sequential access to nodes.

This class allows for sequential access to nodes in a NanoVDB tree.

Nodes are always arranged breadth first during sequential access of nodes at a particular level.

Constructor & Destructor Documentation

NodeManager ( const NodeManager< BuildT > &  )
delete
NodeManager ( NodeManager< BuildT > &&  )
delete
~NodeManager ( )
delete

Member Function Documentation

__hostdev__ GridT& grid ( )
inline

Return a reference to the grid.

__hostdev__ const GridT& grid ( ) const
inline
static __hostdev__ bool isLinear ( const GridT grid)
inlinestatic

return true if the nodes have both fixed size and are arranged breadth-first in memory. This allows for direct and memory-efficient linear access to nodes.

__hostdev__ bool isLinear ( ) const
inline

return true if the nodes have both fixed size and are arranged breadth-first in memory. This allows for direct and memory-efficient linear access to nodes.

__hostdev__ const Node0& leaf ( uint32_t  i) const
inline

Return the i'th leaf node with respect to breadth-first ordering.

__hostdev__ Node0& leaf ( uint32_t  i)
inline
__hostdev__ uint64_t leafCount ( ) const
inline
__hostdev__ const Node1& lower ( uint32_t  i) const
inline

Return the i'th lower internal node with respect to breadth-first ordering.

__hostdev__ Node1& lower ( uint32_t  i)
inline
__hostdev__ uint64_t lowerCount ( ) const
inline
static __hostdev__ uint64_t memUsage ( const GridT grid)
inlinestatic

Return the memory footprint in bytes of the NodeManager derived from the specified grid.

__hostdev__ uint64_t memUsage ( ) const
inline

Return the memory footprint in bytes of this instance.

__hostdev__ const NodeT<LEVEL>& node ( uint32_t  i) const
inline

Return the i'th leaf node with respect to breadth-first ordering.

__hostdev__ NodeT<LEVEL>& node ( uint32_t  i)
inline

Return the i'th node with respect to breadth-first ordering.

__hostdev__ uint64_t nodeCount ( int  level) const
inline

Return the number of tree nodes at the specified level.

0 is leaf, 1 is lower internal, and 2 is upper internal level

NodeManager& operator= ( const NodeManager< BuildT > &  )
delete
NodeManager& operator= ( NodeManager< BuildT > &&  )
delete
__hostdev__ RootT& root ( )
inline

Return a reference to the root.

__hostdev__ const RootT& root ( ) const
inline
__hostdev__ TreeT& tree ( )
inline

Return a reference to the tree.

__hostdev__ const TreeT& tree ( ) const
inline
__hostdev__ const Node2& upper ( uint32_t  i) const
inline

Return the i'th upper internal node with respect to breadth-first ordering.

__hostdev__ Node2& upper ( uint32_t  i)
inline
__hostdev__ uint64_t upperCount ( ) const
inline

Member Data Documentation

constexpr bool FIXED_SIZE = Node0::FIXED_SIZE && Node1::FIXED_SIZE && Node2::FIXED_SIZE
static