OpenVDB 12.0.0
 
Loading...
Searching...
No Matches
TreeValueIteratorBase< _TreeT, _ValueIterT > Class Template Reference

Base class for tree-traversal iterators over tile and voxel values. More...

#include <openvdb/tree/TreeIterator.h>

Public Types

using TreeT = _TreeT
 
using ValueIterT = _ValueIterT
 
using NodeT = typename ValueIterT::NodeType
 
using ValueT = typename ValueIterT::NonConstValueType
 
using ChildOnIterT = typename NodeT::ChildOnCIter
 

Public Member Functions

 TreeValueIteratorBase (TreeT &)
 
 TreeValueIteratorBase (const TreeValueIteratorBase &other)
 
TreeValueIteratorBaseoperator= (const TreeValueIteratorBase &other)
 
void setMinDepth (Index minDepth)
 Specify the depth of the highest level of the tree to which to ascend (depth 0 = root).
 
Index getMinDepth () const
 Return the depth of the highest level of the tree to which this iterator ascends.
 
void setMaxDepth (Index maxDepth)
 Specify the depth of the lowest level of the tree to which to descend (depth 0 = root).
 
Index getMaxDepth () const
 Return the depth of the lowest level of the tree to which this iterator ascends.
 
bool test () const
 Return true if this iterator is not yet exhausted.
 
 operator bool () const
 
bool next ()
 Advance to the next tile or voxel value. Return true if this iterator is not yet exhausted.
 
TreeValueIteratorBaseoperator++ ()
 Advance to the next tile or voxel value.
 
Index getLevel () const
 Return the level in the tree (0 = leaf) of the node to which this iterator is currently pointing.
 
Index getDepth () const
 Return the depth in the tree (0 = root) of the node to which this iterator is currently pointing.
 
template<typename NodeType>
void getNode (NodeType *&node) const
 Return in node a pointer to the node over which this iterator is currently iterating or one of that node's parents, as determined by NodeType. Sets node to null pointer if NodeType specifies a node at a lower level of the tree than that given by getLevel().
 
Coord getCoord () const
 Return the global coordinates of the voxel or tile to which this iterator is currently pointing.
 
bool getBoundingBox (CoordBBox &) const
 Return in bbox the axis-aligned bounding box of the voxel or tile to which this iterator is currently pointing.
 
CoordBBox getBoundingBox () const
 Return the axis-aligned bounding box of the voxel or tile to which this iterator is currently pointing.
 
Index64 getVoxelCount () const
 Return the number of (virtual) voxels corresponding to the value.
 
bool isTileValue () const
 Return true if this iterator is currently pointing to a (non-leaf) tile value.
 
bool isVoxelValue () const
 Return true if this iterator is currently pointing to a (leaf) voxel value.
 
bool isValueOn () const
 Return true if the value to which this iterator is currently pointing is active.
 
const ValueTgetValue () const
 Return the tile or voxel value to which this iterator is currently pointing.
 
const ValueToperator* () const
 
const ValueToperator-> () const
 
void setValue (const ValueT &val) const
 Change the tile or voxel value to which this iterator is currently pointing and mark it as active.
 
void setActiveState (bool on) const
 Change the active/inactive state of the tile or voxel value to which this iterator is currently pointing.
 
void setValueOff () const
 Mark the tile or voxel value to which this iterator is currently pointing as inactive.
 
template<typename ModifyOp>
void modifyValue (const ModifyOp &op) const
 Apply a functor to the item to which this iterator is pointing. (Not valid for const iterators.)
 
TreeTgetTree () const
 Return a pointer to the tree over which this iterator is iterating.
 
std::string summary () const
 Return a string (for debugging, mainly) describing this iterator's current state.
 

Static Public Member Functions

static Index getLeafDepth ()
 

Static Public Attributes

static const Index ROOT_LEVEL = NodeT::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 _ValueIterT>
class openvdb::v12_0::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >

Base class for tree-traversal iterators over tile and voxel values.

Member Typedef Documentation

◆ ChildOnIterT

template<typename _TreeT, typename _ValueIterT>
using ChildOnIterT = typename NodeT::ChildOnCIter

◆ NodeT

template<typename _TreeT, typename _ValueIterT>
using NodeT = typename ValueIterT::NodeType

◆ TreeT

template<typename _TreeT, typename _ValueIterT>
using TreeT = _TreeT

◆ ValueIterT

template<typename _TreeT, typename _ValueIterT>
using ValueIterT = _ValueIterT

◆ ValueT

template<typename _TreeT, typename _ValueIterT>
using ValueT = typename ValueIterT::NonConstValueType

Constructor & Destructor Documentation

◆ TreeValueIteratorBase() [1/2]

template<typename TreeT, typename ValueIterT>
TreeValueIteratorBase ( TreeT & tree)
inline

◆ TreeValueIteratorBase() [2/2]

template<typename TreeT, typename ValueIterT>
TreeValueIteratorBase ( const TreeValueIteratorBase< _TreeT, _ValueIterT > & other)
inline

Member Function Documentation

◆ getBoundingBox() [1/2]

template<typename _TreeT, typename _ValueIterT>
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]

template<typename TreeT, typename ValueIterT>
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()

template<typename _TreeT, typename _ValueIterT>
Coord getCoord ( ) const
inline

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

◆ getDepth()

template<typename _TreeT, typename _ValueIterT>
Index getDepth ( ) const
inline

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

◆ getLeafDepth()

template<typename _TreeT, typename _ValueIterT>
static Index getLeafDepth ( )
inlinestatic

◆ getLevel()

template<typename _TreeT, typename _ValueIterT>
Index getLevel ( ) const
inline

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

◆ getMaxDepth()

template<typename _TreeT, typename _ValueIterT>
Index getMaxDepth ( ) const
inline

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

◆ getMinDepth()

template<typename _TreeT, typename _ValueIterT>
Index getMinDepth ( ) const
inline

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

◆ getNode()

template<typename _TreeT, typename _ValueIterT>
template<typename NodeType>
void getNode ( NodeType *& node) const
inline

Return in node a pointer to the node over which this iterator is currently iterating or one of that node's parents, as determined by NodeType. Sets node to null pointer if NodeType specifies a node at a lower level of the tree than that given by getLevel().

◆ getTree()

template<typename _TreeT, typename _ValueIterT>
TreeT * getTree ( ) const
inline

Return a pointer to the tree over which this iterator is iterating.

◆ getValue()

template<typename _TreeT, typename _ValueIterT>
const ValueT & getValue ( ) const
inline

Return the tile or voxel value to which this iterator is currently pointing.

◆ getVoxelCount()

template<typename _TreeT, typename _ValueIterT>
Index64 getVoxelCount ( ) const
inline

Return the number of (virtual) voxels corresponding to the value.

◆ isTileValue()

template<typename _TreeT, typename _ValueIterT>
bool isTileValue ( ) const
inline

Return true if this iterator is currently pointing to a (non-leaf) tile value.

◆ isValueOn()

template<typename _TreeT, typename _ValueIterT>
bool isValueOn ( ) const
inline

Return true if the value to which this iterator is currently pointing is active.

◆ isVoxelValue()

template<typename _TreeT, typename _ValueIterT>
bool isVoxelValue ( ) const
inline

Return true if this iterator is currently pointing to a (leaf) voxel value.

◆ modifyValue()

template<typename _TreeT, typename _ValueIterT>
template<typename ModifyOp>
void modifyValue ( const ModifyOp & op) const
inline

Apply a functor to the item to which this iterator is pointing. (Not valid for const iterators.)

Parameters
opa functor of the form void op(ValueType&) const that modifies its argument in place
See also
Tree::modifyValue()

◆ next()

template<typename TreeT, typename ValueIterT>
bool next ( )
inline

Advance to the next tile or voxel value. Return true if this iterator is not yet exhausted.

◆ operator bool()

template<typename _TreeT, typename _ValueIterT>
operator bool ( ) const
inline

◆ operator*()

template<typename _TreeT, typename _ValueIterT>
const ValueT & operator* ( ) const
inline

◆ operator++()

template<typename _TreeT, typename _ValueIterT>
TreeValueIteratorBase & operator++ ( )
inline

Advance to the next tile or voxel value.

◆ operator->()

template<typename _TreeT, typename _ValueIterT>
const ValueT * operator-> ( ) const
inline

◆ operator=()

template<typename TreeT, typename ValueIterT>
TreeValueIteratorBase< TreeT, ValueIterT > & operator= ( const TreeValueIteratorBase< _TreeT, _ValueIterT > & other)
inline

◆ setActiveState()

template<typename _TreeT, typename _ValueIterT>
void setActiveState ( bool on) const
inline

Change the active/inactive state of the tile or voxel value to which this iterator is currently pointing.

◆ setMaxDepth()

template<typename TreeT, typename ValueIterT>
void setMaxDepth ( Index maxDepth)
inline

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

◆ setMinDepth()

template<typename TreeT, typename ValueIterT>
void setMinDepth ( Index minDepth)
inline

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

◆ setValue()

template<typename _TreeT, typename _ValueIterT>
void setValue ( const ValueT & val) const
inline

Change the tile or voxel value to which this iterator is currently pointing and mark it as active.

◆ setValueOff()

template<typename _TreeT, typename _ValueIterT>
void setValueOff ( ) const
inline

Mark the tile or voxel value to which this iterator is currently pointing as inactive.

◆ summary()

template<typename TreeT, typename ValueIterT>
std::string summary ( ) const
inline

Return a string (for debugging, mainly) describing this iterator's current state.

◆ test()

template<typename _TreeT, typename _ValueIterT>
bool test ( ) const
inline

Return true if this iterator is not yet exhausted.

Member Data Documentation

◆ LEAF_DEPTH

template<typename _TreeT, typename _ValueIterT>
const Index LEAF_DEPTH = ROOT_LEVEL
static

◆ LEAF_LEVEL

template<typename _TreeT, typename _ValueIterT>
const Index LEAF_LEVEL = 0
static

◆ ROOT_DEPTH

template<typename _TreeT, typename _ValueIterT>
const Index ROOT_DEPTH = 0
static

◆ ROOT_LEVEL

template<typename _TreeT, typename _ValueIterT>
const Index ROOT_LEVEL = NodeT::LEVEL
static