HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT > Class Template Reference

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

#include <TreeIterator.h>

Public Types

typedef _TreeT TreeT
 
typedef _ValueIterT ValueIterT
 
typedef ValueIterT::NodeType NodeT
 
typedef
ValueIterT::NonConstValueType 
ValueT
 
typedef NodeT::ChildOnCIter ChildOnIterT
 

Public Member Functions

 HBOOST_STATIC_ASSERT (ValueIterT::NodeType::LEVEL==ROOT_LEVEL)
 
 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). 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 next ()
 Advance to the next tile or voxel value. Return true if this iterator is not yet exhausted. More...
 
TreeValueIteratorBaseoperator++ ()
 Advance to the next tile or voxel value. 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...
 
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. More...
 
Coord getCoord () const
 Return the global coordinates of the voxel or tile to which this iterator is currently pointing. More...
 
bool getBoundingBox (CoordBBox &) 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...
 
Index64 getVoxelCount () const
 Return the number of (virtual) voxels corresponding to the value. More...
 
bool isTileValue () const
 Return true if this iterator is currently pointing to a (non-leaf) tile value. More...
 
bool isVoxelValue () const
 Return true if this iterator is currently pointing to a (leaf) voxel value. More...
 
bool isValueOn () const
 Return true if the value to which this iterator is currently pointing is active. More...
 
void setValue (const ValueT &val) const
 Change the tile or voxel value to which this iterator is currently pointing and mark it as active. More...
 
void setActiveState (bool on) const
 Change the active/inactive state of the tile or voxel value to which this iterator is currently pointing. More...
 
void setValueOff () const
 Mark the tile or voxel value to which this iterator is currently pointing as inactive. More...
 
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.) More...
 
TreeTgetTree () const
 Return a pointer to the tree over which this iterator is iterating. More...
 
std::string summary () const
 Return a string (for debugging, mainly) describing this iterator's current state. More...
 
bool test () const
 Return true if this iterator is not yet exhausted. More...
 
 operator bool () const
 Return true if this iterator is not yet exhausted. More...
 
const ValueTgetValue () const
 Return the tile or voxel value to which this iterator is currently pointing. More...
 
const ValueToperator* () const
 Return the tile or voxel value to which this iterator is currently pointing. More...
 
const ValueToperator-> () const
 Return the tile or voxel value to which this iterator is currently pointing. More...
 

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::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >

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

Definition at line 658 of file TreeIterator.h.

Member Typedef Documentation

template<typename _TreeT, typename _ValueIterT>
typedef NodeT::ChildOnCIter openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::ChildOnIterT

Definition at line 665 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
typedef ValueIterT::NodeType openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::NodeT

Definition at line 663 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
typedef _TreeT openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::TreeT

Definition at line 661 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
typedef _ValueIterT openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::ValueIterT

Definition at line 662 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
typedef ValueIterT::NonConstValueType openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::ValueT

Definition at line 664 of file TreeIterator.h.

Constructor & Destructor Documentation

template<typename TreeT , typename ValueIterT >
openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< TreeT, ValueIterT >::TreeValueIteratorBase ( TreeT tree)
inline

Definition at line 779 of file TreeIterator.h.

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

Definition at line 795 of file TreeIterator.h.

Member Function Documentation

template<typename TreeT , typename ValueIterT >
bool openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< TreeT, ValueIterT >::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.

Definition at line 936 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
CoordBBox openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getBoundingBox ( ) const
inline

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

Definition at line 720 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
Coord openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getCoord ( ) const
inline

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

Definition at line 713 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getDepth ( ) const
inline

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

Definition at line 701 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
static Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getLeafDepth ( )
inlinestatic

Definition at line 702 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getLevel ( ) const
inline

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

Definition at line 698 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getMaxDepth ( ) const
inline

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

Definition at line 682 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getMinDepth ( ) const
inline

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

Definition at line 678 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
template<typename NodeType >
void openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::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.

Returns
a null pointer if NodeType specifies a node at a lower level of the tree than that given by getLevel().

Definition at line 709 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
TreeT* openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getTree ( ) const
inline

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

Definition at line 757 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
const ValueT& openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getValue ( ) const
inline

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

Definition at line 734 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
Index64 openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::getVoxelCount ( ) const
inline

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

Definition at line 723 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::HBOOST_STATIC_ASSERT ( ValueIterT::NodeType::LEVEL  = =ROOT_LEVEL)
template<typename _TreeT, typename _ValueIterT>
bool openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::isTileValue ( ) const
inline

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

Definition at line 726 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
bool openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::isValueOn ( ) const
inline

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

Definition at line 730 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
bool openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::isVoxelValue ( ) const
inline

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

Definition at line 728 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
template<typename ModifyOp >
void openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::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()

Definition at line 754 of file TreeIterator.h.

template<typename TreeT , typename ValueIterT >
bool openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< TreeT, ValueIterT >::next ( )
inline

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

Definition at line 847 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::operator bool ( ) const
inline

Return true if this iterator is not yet exhausted.

Definition at line 687 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
const ValueT& openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::operator* ( void  ) const
inline

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

Definition at line 735 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
TreeValueIteratorBase& openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::operator++ ( )
inline

Advance to the next tile or voxel value.

Definition at line 694 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
const ValueT* openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::operator-> ( void  ) const
inline

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

Definition at line 736 of file TreeIterator.h.

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

Definition at line 810 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
void openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::setActiveState ( bool  on) const
inline

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

Definition at line 744 of file TreeIterator.h.

template<typename TreeT , typename ValueIterT >
void openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< TreeT, ValueIterT >::setMaxDepth ( Index  maxDepth)
inline

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

Definition at line 837 of file TreeIterator.h.

template<typename TreeT , typename ValueIterT >
void openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< TreeT, ValueIterT >::setMinDepth ( Index  minDepth)
inline

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

Definition at line 828 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
void openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::setValue ( const ValueT val) const
inline

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

Definition at line 741 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
void openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::setValueOff ( ) const
inline

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

Definition at line 746 of file TreeIterator.h.

template<typename TreeT , typename ValueIterT >
std::string openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< TreeT, ValueIterT >::summary ( ) const
inline

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

Definition at line 950 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
bool openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::test ( ) const
inline

Return true if this iterator is not yet exhausted.

Definition at line 686 of file TreeIterator.h.

Member Data Documentation

template<typename _TreeT, typename _ValueIterT>
const Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::LEAF_DEPTH = ROOT_LEVEL
static

Definition at line 668 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
const Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::LEAF_LEVEL = 0
static

Definition at line 668 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
const Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::ROOT_DEPTH = 0
static

Definition at line 668 of file TreeIterator.h.

template<typename _TreeT, typename _ValueIterT>
const Index openvdb::OPENVDB_VERSION_NAME::tree::TreeValueIteratorBase< _TreeT, _ValueIterT >::ROOT_LEVEL = NodeT::LEVEL
static

Definition at line 666 of file TreeIterator.h.


The documentation for this class was generated from the following file: