OpenVDB  9.0.1
Public Types | Public Member Functions | Static Public Attributes | List of all members
DenseIteratorBase< MaskIterT, IterT, NodeT, SetItemT, UnsetItemT > Struct Template Reference

Base class for dense iterators over internal and leaf nodes. More...

#include <openvdb/tree/Iterator.h>

Inherits IteratorBase< MaskIterT, NodeT >.

Public Types

using NodeType = NodeT
 
using ValueType = UnsetItemT
 
using ChildNodeType = SetItemT
 
using NonConstNodeType = typename std::remove_const< NodeT >::type
 
using NonConstValueType = typename std::remove_const< UnsetItemT >::type
 
using NonConstChildNodeType = typename std::remove_const< SetItemT >::type
 

Public Member Functions

 DenseIteratorBase ()
 
 DenseIteratorBase (const MaskIterT &iter, NodeT *parent)
 
bool getItem (Index, SetItemT *&child, NonConstValueType &value) const
 Return true if the item at the given index in the parent node's table is a set value and return either the set value in child or the unset value in value. More...
 
void setItem (Index, SetItemT *) const
 Set the value of the item at the given index in the parent node's table. More...
 
void unsetItem (Index, const UnsetItemT &) const
 "Unset" the value of the item at the given index in the parent node's table. More...
 
bool isChildNode () const
 Return true if this iterator is pointing to a child node. More...
 
SetItemT * probeChild (NonConstValueType &value) const
 If this iterator is pointing to a child node, return a pointer to the node. Otherwise, return nullptr and, in value, the value to which this iterator is pointing. More...
 
bool probeChild (SetItemT *&child, NonConstValueType &value) const
 If this iterator is pointing to a child node, return true and return a pointer to the child node in child. Otherwise, return false and return the value to which this iterator is pointing in value. More...
 
bool probeValue (NonConstValueType &value) const
 Return true if this iterator is pointing to a value and return the value in value. Otherwise, return false. More...
 
void setChild (SetItemT *child) const
 Replace with the given child node the item in the parent node's table to which this iterator is pointing. More...
 
void setValue (const UnsetItemT &value) const
 Replace with the given value the item in the parent node's table to which this iterator is pointing. More...
 
bool operator== (const IteratorBase &other) const
 
bool operator!= (const IteratorBase &other) const
 
NodeT * getParentNode () const
 Return a pointer to the node (if any) over which this iterator is iterating. More...
 
NodeT & parent () const
 Return a reference to the node over which this iterator is iterating. More...
 
Index offset () const
 Return this iterator's position as an index into the parent node's table. More...
 
Index pos () const
 Identical to offset. 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...
 
bool next ()
 Advance to the next item in the parent node's table. More...
 
void increment ()
 Advance to the next item in the parent node's table. More...
 
void increment (Index n)
 Advance n items in the parent node's table. More...
 
IteratorBaseoperator++ ()
 Advance to the next item in the parent node's table. More...
 
bool isValueOn () const
 Return true if this iterator is pointing to an active value. Return false if it is pointing to either an inactive value or a child node. More...
 
void setValueOn (bool on=true) const
 If this iterator is pointing to a value, set the value's active state. Otherwise, do nothing. More...
 
void setValueOff () const
 If this iterator is pointing to a value, mark the value as inactive. More...
 
Coord getCoord () const
 Return the coordinates of the item to which this iterator is pointing. More...
 
void getCoord (Coord &xyz) const
 Return in xyz the coordinates of the item to which this iterator is pointing. More...
 

Static Public Attributes

static const bool IsSparseIterator = false
 
static const bool IsDenseIterator = true
 

Detailed Description

template<typename MaskIterT, typename IterT, typename NodeT, typename SetItemT, typename UnsetItemT>
struct openvdb::v9_0::tree::DenseIteratorBase< MaskIterT, IterT, NodeT, SetItemT, UnsetItemT >

Base class for dense iterators over internal and leaf nodes.

Note
Dense iterators have no operator*() or operator->(), because their return type would have to vary depending on whether the iterator is pointing to a value or a child node.

Member Typedef Documentation

using ChildNodeType = SetItemT
using NodeType = NodeT
using NonConstChildNodeType = typename std::remove_const<SetItemT>::type
using NonConstNodeType = typename std::remove_const<NodeT>::type
using NonConstValueType = typename std::remove_const<UnsetItemT>::type
using ValueType = UnsetItemT

Constructor & Destructor Documentation

DenseIteratorBase ( )
inline
DenseIteratorBase ( const MaskIterT &  iter,
NodeT *  parent 
)
inline

Member Function Documentation

Coord getCoord ( ) const
inlineinherited

Return the coordinates of the item to which this iterator is pointing.

void getCoord ( Coord &  xyz) const
inlineinherited

Return in xyz the coordinates of the item to which this iterator is pointing.

bool getItem ( Index  ,
SetItemT *&  child,
NonConstValueType value 
) const

Return true if the item at the given index in the parent node's table is a set value and return either the set value in child or the unset value in value.

Note
All subclasses must implement this accessor.
NodeT* getParentNode ( ) const
inlineinherited

Return a pointer to the node (if any) over which this iterator is iterating.

void increment ( )
inlineinherited

Advance to the next item in the parent node's table.

void increment ( Index  n)
inlineinherited

Advance n items in the parent node's table.

bool isChildNode ( ) const
inline

Return true if this iterator is pointing to a child node.

bool isValueOn ( ) const
inlineinherited

Return true if this iterator is pointing to an active value. Return false if it is pointing to either an inactive value or a child node.

bool next ( )
inlineinherited

Advance to the next item in the parent node's table.

Index offset ( ) const
inlineinherited

Return this iterator's position as an index into the parent node's table.

operator bool ( ) const
inlineinherited

Return true if this iterator is not yet exhausted.

bool operator!= ( const IteratorBase< MaskIterT, NodeT > &  other) const
inlineinherited
IteratorBase& operator++ ( )
inlineinherited

Advance to the next item in the parent node's table.

bool operator== ( const IteratorBase< MaskIterT, NodeT > &  other) const
inlineinherited
NodeT& parent ( ) const
inlineinherited

Return a reference to the node over which this iterator is iterating.

Exceptions
ValueErrorif there is no parent node.
Index pos ( ) const
inlineinherited

Identical to offset.

SetItemT* probeChild ( NonConstValueType value) const
inline

If this iterator is pointing to a child node, return a pointer to the node. Otherwise, return nullptr and, in value, the value to which this iterator is pointing.

bool probeChild ( SetItemT *&  child,
NonConstValueType value 
) const
inline

If this iterator is pointing to a child node, return true and return a pointer to the child node in child. Otherwise, return false and return the value to which this iterator is pointing in value.

bool probeValue ( NonConstValueType value) const
inline

Return true if this iterator is pointing to a value and return the value in value. Otherwise, return false.

void setChild ( SetItemT *  child) const
inline

Replace with the given child node the item in the parent node's table to which this iterator is pointing.

void setItem ( Index  ,
SetItemT *   
) const

Set the value of the item at the given index in the parent node's table.

Note
All non-const iterator subclasses must implement this accessor.
void setValue ( const UnsetItemT &  value) const
inline

Replace with the given value the item in the parent node's table to which this iterator is pointing.

void setValueOff ( ) const
inlineinherited

If this iterator is pointing to a value, mark the value as inactive.

If this iterator is pointing to a child node, then the current item in the parent node's table is required to be inactive. In that case, this method has no effect.

void setValueOn ( bool  on = true) const
inlineinherited

If this iterator is pointing to a value, set the value's active state. Otherwise, do nothing.

bool test ( ) const
inlineinherited

Return true if this iterator is not yet exhausted.

void unsetItem ( Index  ,
const UnsetItemT &   
) const

"Unset" the value of the item at the given index in the parent node's table.

Note
All non-const iterator subclasses must implement this accessor.

Member Data Documentation

const bool IsDenseIterator = true
static
const bool IsSparseIterator = false
static