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

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

#include <nanovdb/util/NodeManager.h>

Inherits NodeManagerData.

Public Member Functions

 NodeManager (const NodeManager &)=delete
 
 NodeManager (NodeManager &&)=delete
 
NodeManageroperator= (const NodeManager &)=delete
 
NodeManageroperator= (NodeManager &&)=delete
 
 ~NodeManager ()=delete
 
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...
 
uint64_t memUsage () const
 Return the memory footprint in bytes of this instance. More...
 
GridTgrid ()
 Return a reference to the grid. More...
 
const GridTgrid () const
 
TreeT & tree ()
 Return a reference to the tree. More...
 
const TreeT & tree () const
 
RootT & root ()
 Return a reference to the root. More...
 
const RootT & root () const
 
uint64_t nodeCount (int level) const
 Return the number of tree nodes at the specified level. More...
 
template<int LEVEL>
const NodeT< LEVEL > & node (uint32_t i) const
 Return the i'th leaf node with respect to breadth-first ordering. More...
 
template<int LEVEL>
NodeT< LEVEL > & node (uint32_t i)
 Return the i'th node with respect to breadth-first ordering. More...
 
const Node0 & leaf (uint32_t i) const
 Return the i'th leaf node with respect to breadth-first ordering. More...
 
Node0 & leaf (uint32_t i)
 
const Node1 & lower (uint32_t i) const
 Return the i'th lower internal node with respect to breadth-first ordering. More...
 
Node1 & lower (uint32_t i)
 
const Node2 & upper (uint32_t i) const
 Return the i'th upper internal node with respect to breadth-first ordering. More...
 
Node2 & upper (uint32_t i)
 

Static Public Member Functions

static 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 uint64_t memUsage (const GridT &grid)
 Return the memory footprint in bytes of the NodeManager derived from the specified grid. More...
 

Private Attributes

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

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

GridT& grid ( )
inline

Return a reference to the grid.

const GridT& grid ( ) const
inline
static 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.

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.

const Node0& leaf ( uint32_t  i) const
inline

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

Node0& leaf ( uint32_t  i)
inline
const Node1& lower ( uint32_t  i) const
inline

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

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

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

uint64_t memUsage ( ) const
inline

Return the memory footprint in bytes of this instance.

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

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

NodeT<LEVEL>& node ( uint32_t  i)
inline

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

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
RootT& root ( )
inline

Return a reference to the root.

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

Return a reference to the tree.

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

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

Node2& upper ( uint32_t  i)
inline