OpenVDB 9.0.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
NodeIteratorBase< _TreeT, RootChildOnIterT > Class Template Reference

Base class for tree-traversal iterators over all nodes. More...

#include <openvdb/tree/TreeIterator.h>

Public Types

using TreeT = _TreeT
 
using RootIterT = RootChildOnIterT
 
using RootNodeT = typename RootIterT::NodeType
 
using NCRootNodeT = typename RootIterT::NonConstNodeType
 
using InvTreeT = typename iter::InvertedTree< NCRootNodeT, ROOT_LEVEL >::Type
 
using RootIterTraits = IterTraits< NCRootNodeT, RootIterT >
 

Public Member Functions

 NodeIteratorBase ()
 
 NodeIteratorBase (TreeT &)
 
 NodeIteratorBase (const NodeIteratorBase &other)
 
NodeIteratorBaseoperator= (const NodeIteratorBase &other)
 
void setMinDepth (Index minDepth)
 Specify the depth of the highest level of the tree to which to ascend (depth 0 = root). More...
 
Index getMinDepth () const
 Return the depth of the highest level of the tree to which this iterator ascends. More...
 
void setMaxDepth (Index maxDepth)
 Specify the depth of the lowest level of the tree to which to descend (depth 0 = root). More...
 
Index getMaxDepth () const
 Return the depth of the lowest level of the tree to which this iterator ascends. More...
 
bool test () const
 Return true if this iterator is not yet exhausted. More...
 
 operator bool () const
 
bool next ()
 Advance to the next tile or voxel value. More...
 
void increment ()
 Advance the iterator to the next leaf node. More...
 
NodeIteratorBaseoperator++ ()
 
void increment (Index n)
 Increment the iterator n times. More...
 
Index getLevel () const
 Return the level in the tree (0 = leaf) of the node to which this iterator is currently pointing. More...
 
Index getDepth () const
 Return the depth in the tree (0 = root) of the node to which this iterator is currently pointing. More...
 
Coord getCoord () const
 Return the global coordinates of the voxel or tile to which this iterator is currently pointing. More...
 
bool getBoundingBox (CoordBBox &bbox) const
 Return in bbox the axis-aligned bounding box of the voxel or tile to which this iterator is currently pointing. More...
 
CoordBBox getBoundingBox () const
 Return the axis-aligned bounding box of the voxel or tile to which this iterator is currently pointing. More...
 
template<typename NodeT >
void getNode (NodeT *&node) const
 Return the node to which the iterator is pointing. More...
 
template<typename NodeT >
void getNode (const NodeT *&node) const
 
TreeTgetTree () const
 
std::string summary () const
 

Static Public Member Functions

static Index getLeafDepth ()
 

Static Public Attributes

static const Index ROOT_LEVEL = RootNodeT::LEVEL
 
static const Index LEAF_LEVEL = 0
 
static const Index ROOT_DEPTH = 0
 
static const Index LEAF_DEPTH = ROOT_LEVEL
 

Detailed Description

template<typename _TreeT, typename RootChildOnIterT>
class openvdb::v9_0::tree::NodeIteratorBase< _TreeT, RootChildOnIterT >

Base class for tree-traversal iterators over all nodes.

Member Typedef Documentation

◆ InvTreeT

◆ NCRootNodeT

using NCRootNodeT = typename RootIterT::NonConstNodeType

◆ RootIterT

using RootIterT = RootChildOnIterT

◆ RootIterTraits

◆ RootNodeT

using RootNodeT = typename RootIterT::NodeType

◆ TreeT

using TreeT = _TreeT

Constructor & Destructor Documentation

◆ NodeIteratorBase() [1/3]

◆ NodeIteratorBase() [2/3]

NodeIteratorBase ( TreeT tree)
inline

◆ NodeIteratorBase() [3/3]

NodeIteratorBase ( const NodeIteratorBase< _TreeT, RootChildOnIterT > &  other)
inline

Member Function Documentation

◆ getBoundingBox() [1/2]

CoordBBox getBoundingBox ( ) const
inline

Return the axis-aligned bounding box of the voxel or tile to which this iterator is currently pointing.

◆ getBoundingBox() [2/2]

bool getBoundingBox ( CoordBBox bbox) const
inline

Return in bbox the axis-aligned bounding box of the voxel or tile to which this iterator is currently pointing.

Returns
false if the bounding box is empty.

◆ getCoord()

Coord getCoord
inline

Return the global coordinates of the voxel or tile to which this iterator is currently pointing.

◆ getDepth()

Index getDepth ( ) const
inline

Return the depth in the tree (0 = root) of the node to which this iterator is currently pointing.

◆ getLeafDepth()

static Index getLeafDepth ( )
inlinestatic

◆ getLevel()

Index getLevel ( ) const
inline

Return the level in the tree (0 = leaf) of the node to which this iterator is currently pointing.

◆ getMaxDepth()

Index getMaxDepth ( ) const
inline

Return the depth of the lowest level of the tree to which this iterator ascends.

◆ getMinDepth()

Index getMinDepth ( ) const
inline

Return the depth of the highest level of the tree to which this iterator ascends.

◆ getNode() [1/2]

void getNode ( const NodeT *&  node) const
inline

◆ getNode() [2/2]

void getNode ( NodeT *&  node) const
inline

Return the node to which the iterator is pointing.

Note
This iterator doesn't have the usual dereference operators (* and ->), because they would have to be overloaded by the returned node type.

◆ getTree()

TreeT * getTree ( ) const
inline

◆ increment() [1/2]

void increment ( )
inline

Advance the iterator to the next leaf node.

◆ increment() [2/2]

void increment ( Index  n)
inline

Increment the iterator n times.

◆ next()

bool next
inline

Advance to the next tile or voxel value.

Returns
true if this iterator is not yet exhausted.

◆ operator bool()

operator bool ( ) const
inline

◆ operator++()

NodeIteratorBase & operator++ ( )
inline

◆ operator=()

NodeIteratorBase< TreeT, RootChildOnIterT > & operator= ( const NodeIteratorBase< _TreeT, RootChildOnIterT > &  other)
inline

◆ setMaxDepth()

void setMaxDepth ( Index  maxDepth)
inline

Specify the depth of the lowest level of the tree to which to descend (depth 0 = root).

◆ setMinDepth()

void setMinDepth ( Index  minDepth)
inline

Specify the depth of the highest level of the tree to which to ascend (depth 0 = root).

◆ summary()

std::string summary
inline

◆ test()

bool test ( ) const
inline

Return true if this iterator is not yet exhausted.

Member Data Documentation

◆ LEAF_DEPTH

const Index LEAF_DEPTH = ROOT_LEVEL
static

◆ LEAF_LEVEL

const Index LEAF_LEVEL = 0
static

◆ ROOT_DEPTH

const Index ROOT_DEPTH = 0
static

◆ ROOT_LEVEL

const Index ROOT_LEVEL = RootNodeT::LEVEL
static