OpenVDB: IterListItem< PrevItemT, NodeVecT, VecSize, _Level > Class Template Reference

OpenVDB 13.0.0

Loading...
Searching...
No Matches
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 <openvdb/tree/TreeIterator.h>`

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

## Public Member Functions
| IterListItem (PrevItemT *prev)
| IterListItem (const IterListItem &other)
IterListItem & | operator= (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.
template<typename OtherNodeT>
void | getNode (Index lvl, OtherNodeT *&node) const
| Return the node over which one of the following list elements' iterator iterates.
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.
Index | pos (Index lvl) const
| Return The table offset of the iterator at level lvl of the tree.
bool | test (Index lvl) const
| Return `true` if the iterator at level lvl of the tree has not yet reached its end.
bool | next (Index lvl)
| Increment the iterator at level lvl of the tree.
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.
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.
Index | getChildDim (Index lvl) const
Index64 | getVoxelCount (Index lvl) const
| Return the number of (virtual) voxels spanned by a tile value or child node.
bool | isValueOn (Index lvl) const
| Return `true` if the iterator at level lvl of the tree points to an active value.
const NCValueT & | getValue (Index lvl) const
| Return the value to which the iterator at level lvl of the tree points.
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.
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.
void | setValueOff (Index lvl) const
| Mark the value to which the iterator at level lvl of the tree points as inactive.
template<typename ModifyOp>
void | modifyValue (Index lvl, const ModifyOp &op) const
| Apply a functor to the item to which this iterator is pointing.

## Static Public Attributes
static const Index | Level = _Level
| NodeT's level in its tree (0 = LeafNode).

## Detailed Description

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
class openvdb::v13_0::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.

## Member Typedef Documentation

## ◆ _NodeT

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using _NodeT = typename NodeVecT::Front

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

## ◆ ChildT

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using ChildT = typename CopyConstness<NodeT, typename NodeT::ChildNodeType>::Type

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

## ◆ IterT

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using IterT

Initial value:
typename IterTraits<typename PrevIterT::NonConstNodeType, PrevIterT>::template
NodeConverter<_NodeT>::Type
openvdb::v13_0::tree::IterTraits
Definition TreeIterator.h:61

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

## ◆ ITraits

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using ITraits = IterTraits<NCNodeT, IterT>

## ◆ NCChildT

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using NCChildT = typename CopyConstness<NCNodeT, typename NCNodeT::ChildNodeType>::Type

NodeT's child node type with const qualifiers removed.

## ◆ NCNodeT

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using NCNodeT = typename IterT::NonConstNodeType

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

## ◆ NCValueT

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using NCValueT = typename IterT::NonConstValueType

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

## ◆ NodeT

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using NodeT = typename IterT::NodeType

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

## ◆ PrevIterT

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

using PrevIterT = typename PrevItemT::IterT

The type of iterator stored in the previous list item.

## Constructor & Destructor Documentation

## ◆ IterListItem() [1/2]

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

IterListItem | ( | PrevItemT * | prev | ) |
| inline

## ◆ IterListItem() [2/2]

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

IterListItem | ( | const IterListItem< PrevItemT, NodeVecT, VecSize, _Level > & | other | ) |
| inline

## Member Function Documentation

## ◆ down()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

bool 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.

## ◆ getChildDim()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

Index getChildDim | ( | Index | lvl | ) | const
| inline

## ◆ getCoord()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

Coord 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.

## ◆ getNode() [1/2]

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

void getNode | ( | Index | lvl,
|  | NodeT *& | node ) const
| inline

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

## ◆ getNode() [2/2]

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
template<typename OtherNodeT>

void getNode | ( | Index | lvl,
|  | OtherNodeT *& | node ) const
| inline

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

## ◆ getValue()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

const NCValueT & getValue | ( | Index | lvl | ) | const
| inline

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

## ◆ getVoxelCount()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

Index64 getVoxelCount | ( | Index | lvl | ) | const
| inline

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

## ◆ initLevel()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
template<typename OtherIterListItemT>

void 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.

## ◆ isValueOn()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

bool isValueOn | ( | Index | lvl | ) | const
| inline

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

## ◆ modifyValue()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
template<typename ModifyOp>

void 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

## ◆ next()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

bool next | ( | Index | lvl | ) |
| inline

Increment the iterator at level lvl of the tree.

## ◆ operator=()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

IterListItem & operator= | ( | const IterListItem< PrevItemT, NodeVecT, VecSize, _Level > & | other | ) |
| inline

## ◆ pos()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

Index pos | ( | Index | lvl | ) | const
| inline

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

## ◆ setIter() [1/2]

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

void setIter | ( | const IterT & | iter | ) |
| inline

## ◆ setIter() [2/2]

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
template<typename OtherIterT>

void setIter | ( | const OtherIterT & | iter | ) |
| inline

## ◆ setValue()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

void 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

## ◆ setValueOff()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

void 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

## ◆ setValueOn()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

void 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

## ◆ test()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

bool test | ( | Index | lvl | ) | const
| inline

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

## ◆ updateBackPointers()

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

void updateBackPointers | ( | PrevItemT * | prev | ) |
| inline

## Member Data Documentation

## ◆ Level

template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>

const Index Level = _Level
| static

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