HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level > Class Template Reference

An IterListItem is an element of a compile-time linked list of iterators to nodes of different types. More...

#include <TreeIterator.h>

Public Types

typedef PrevItemT::IterT PrevIterT
 The type of iterator stored in the previous list item. More...
 
typedef hboost::mpl::front
< NodeVecT >::type 
_NodeT
 The type of node (non-const) whose iterator is stored in this list item. More...
 
typedef IterTraits< typename
PrevIterT::NonConstNodeType,
PrevIterT >::template
NodeConverter< _NodeT >::Type 
IterT
 The type of iterator stored in this list item (e.g., InternalNode::ValueOnCIter) More...
 
typedef IterT::NodeType NodeT
 The type of node (const or non-const) over which IterT iterates (e.g., const RootNode<...>) More...
 
typedef IterT::NonConstNodeType NCNodeT
 The type of the node with const qualifiers removed ("Non-Const") More...
 
typedef IterT::NonConstValueType NCValueT
 The type of value (with const qualifiers removed) to which the iterator points. More...
 
typedef CopyConstness< NodeT,
typename NodeT::ChildNodeType >
::Type 
ChildT
 NodeT's child node type, with the same constness (e.g., const InternalNode<...>) More...
 
typedef CopyConstness< NCNodeT,
typename
NCNodeT::ChildNodeType >::Type 
NCChildT
 NodeT's child node type with const qualifiers removed. More...
 
typedef IterTraits< NCNodeT,
IterT
ITraits
 

Public Member Functions

 IterListItem (PrevItemT *prev)
 
 IterListItem (const IterListItem &other)
 
IterListItemoperator= (const IterListItem &other)
 
void updateBackPointers (PrevItemT *prev)
 
void setIter (const IterT &iter)
 
template<typename OtherIterT >
void setIter (const OtherIterT &iter)
 
void getNode (Index lvl, NodeT *&node) const
 Return the node over which this list element's iterator iterates. More...
 
template<typename OtherNodeT >
void getNode (Index lvl, OtherNodeT *&node) const
 Return the node over which one of the following list elements' iterator iterates. More...
 
template<typename OtherIterListItemT >
void initLevel (Index lvl, OtherIterListItemT &otherListItem)
 Initialize the iterator for level lvl of the tree with the node over which the corresponding iterator of otherListItem is iterating. More...
 
Index pos (Index lvl) const
 Return The table offset of the iterator at level lvl of the tree. More...
 
bool test (Index lvl) const
 Return true if the iterator at level lvl of the tree has not yet reached its end. More...
 
bool next (Index lvl)
 Increment the iterator at level lvl of the tree. More...
 
bool down (Index lvl)
 If the iterator at level lvl of the tree points to a child node, initialize the next iterator in this list with that child node. More...
 
Coord getCoord (Index lvl) const
 Return the global coordinates of the voxel or tile to which the iterator at level lvl of the tree is currently pointing. More...
 
Index getChildDim (Index lvl) const
 
Index64 getVoxelCount (Index lvl) const
 Return the number of (virtual) voxels spanned by a tile value or child node. More...
 
bool isValueOn (Index lvl) const
 Return true if the iterator at level lvl of the tree points to an active value. More...
 
const NCValueTgetValue (Index lvl) const
 Return the value to which the iterator at level lvl of the tree points. More...
 
void setValue (Index lvl, const NCValueT &val) const
 Set the value (to val) to which the iterator at level lvl of the tree points and mark the value as active. More...
 
void setValueOn (Index lvl, bool on=true) const
 Set the value (to val) to which the iterator at level lvl of the tree points and mark the value as active if on is true, or inactive otherwise. More...
 
void setValueOff (Index lvl) const
 Mark the value to which the iterator at level lvl of the tree points as inactive. More...
 
template<typename ModifyOp >
void modifyValue (Index lvl, const ModifyOp &op) const
 Apply a functor to the item to which this iterator is pointing. More...
 

Static Public Attributes

static const Index Level = _Level
 NodeT's level in its tree (0 = LeafNode) More...
 

Detailed Description

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
class openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >

An IterListItem is an element of a compile-time linked list of iterators to nodes of different types.

The list is constructed by traversing the template hierarchy of a Tree in reverse order, so typically the elements will be a LeafNode iterator of some type (e.g., ValueOnCIter), followed by one or more InternalNode iterators of the same type, followed by a RootNode iterator of the same type.

The length of the list is fixed at compile time, and because it is implemented using nested, templated classes, much of the list traversal logic can be optimized away.

Definition at line 260 of file TreeIterator.h.

Member Typedef Documentation

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef hboost::mpl::front<NodeVecT>::type openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::_NodeT

The type of node (non-const) whose iterator is stored in this list item.

Definition at line 266 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef CopyConstness<NodeT, typename NodeT::ChildNodeType>::Type openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::ChildT

NodeT's child node type, with the same constness (e.g., const InternalNode<...>)

Definition at line 278 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef IterTraits<typename PrevIterT::NonConstNodeType, PrevIterT>::template NodeConverter<_NodeT>::Type openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::IterT

The type of iterator stored in this list item (e.g., InternalNode::ValueOnCIter)

Definition at line 269 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef IterTraits<NCNodeT, IterT> openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::ITraits

Definition at line 281 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef CopyConstness<NCNodeT, typename NCNodeT::ChildNodeType>::Type openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::NCChildT

NodeT's child node type with const qualifiers removed.

Definition at line 280 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef IterT::NonConstNodeType openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::NCNodeT

The type of the node with const qualifiers removed ("Non-Const")

Definition at line 274 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef IterT::NonConstValueType openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::NCValueT

The type of value (with const qualifiers removed) to which the iterator points.

Definition at line 276 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef IterT::NodeType openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::NodeT

The type of node (const or non-const) over which IterT iterates (e.g., const RootNode<...>)

Definition at line 272 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
typedef PrevItemT::IterT openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::PrevIterT

The type of iterator stored in the previous list item.

Definition at line 264 of file TreeIterator.h.

Constructor & Destructor Documentation

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::IterListItem ( PrevItemT *  prev)
inline

Definition at line 285 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::IterListItem ( const IterListItem< PrevItemT, NodeVecT, VecSize, _Level > &  other)
inline

Definition at line 287 of file TreeIterator.h.

Member Function Documentation

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
bool openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::down ( Index  lvl)
inline

If the iterator at level lvl of the tree points to a child node, initialize the next iterator in this list with that child node.

Definition at line 342 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
Index openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::getChildDim ( Index  lvl) const
inline

Definition at line 359 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
Coord openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::getCoord ( Index  lvl) const
inline

Return the global coordinates of the voxel or tile to which the iterator at level lvl of the tree is currently pointing.

Definition at line 355 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::getNode ( Index  lvl,
NodeT *&  node 
) const
inline

Return the node over which this list element's iterator iterates.

Definition at line 305 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
template<typename OtherNodeT >
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::getNode ( Index  lvl,
OtherNodeT *&  node 
) const
inline

Return the node over which one of the following list elements' iterator iterates.

Definition at line 311 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
const NCValueT& openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::getValue ( Index  lvl) const
inline

Return the value to which the iterator at level lvl of the tree points.

Definition at line 376 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
Index64 openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::getVoxelCount ( Index  lvl) const
inline

Return the number of (virtual) voxels spanned by a tile value or child node.

Definition at line 364 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
template<typename OtherIterListItemT >
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::initLevel ( Index  lvl,
OtherIterListItemT &  otherListItem 
)
inline

Initialize the iterator for level lvl of the tree with the node over which the corresponding iterator of otherListItem is iterating.

For example, if otherListItem contains a LeafNode::ValueOnIter, initialize this list's leaf iterator with the same LeafNode.

Definition at line 319 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
bool openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::isValueOn ( Index  lvl) const
inline

Return true if the iterator at level lvl of the tree points to an active value.

Definition at line 370 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
template<typename ModifyOp >
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::modifyValue ( Index  lvl,
const ModifyOp &  op 
) const
inline

Apply a functor to the item to which this iterator is pointing.

Note
Not valid when IterT is a const iterator type

Definition at line 407 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
bool openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::next ( Index  lvl)
inline

Increment the iterator at level lvl of the tree.

Definition at line 338 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
IterListItem& openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::operator= ( const IterListItem< PrevItemT, NodeVecT, VecSize, _Level > &  other)
inline

<

Note
external call to updateBackPointers() required

Definition at line 288 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
Index openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::pos ( Index  lvl) const
inline

Return The table offset of the iterator at level lvl of the tree.

Definition at line 332 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::setIter ( const IterT iter)
inline

Definition at line 300 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
template<typename OtherIterT >
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::setIter ( const OtherIterT &  iter)
inline

Definition at line 302 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::setValue ( Index  lvl,
const NCValueT val 
) const
inline

Set the value (to val) to which the iterator at level lvl of the tree points and mark the value as active.

Note
Not valid when IterT is a const iterator type

Definition at line 385 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::setValueOff ( Index  lvl) const
inline

Mark the value to which the iterator at level lvl of the tree points as inactive.

Note
Not valid when IterT is a const iterator type

Definition at line 399 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::setValueOn ( Index  lvl,
bool  on = true 
) const
inline

Set the value (to val) to which the iterator at level lvl of the tree points and mark the value as active if on is true, or inactive otherwise.

Note
Not valid when IterT is a const iterator type

Definition at line 392 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
bool openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::test ( Index  lvl) const
inline

Return true if the iterator at level lvl of the tree has not yet reached its end.

Definition at line 335 of file TreeIterator.h.

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
void openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::updateBackPointers ( PrevItemT *  prev)
inline

Definition at line 298 of file TreeIterator.h.

Member Data Documentation

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
const Index openvdb::OPENVDB_VERSION_NAME::tree::IterListItem< PrevItemT, NodeVecT, VecSize, _Level >::Level = _Level
static

NodeT's level in its tree (0 = LeafNode)

Definition at line 283 of file TreeIterator.h.


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