Loading...
Searching...
No Matches
TreeIterator.h
Go to the documentation of this file.
// Copyright Contributors to the OpenVDB Project
// SPDX-License-Identifier: MPL-2.0
//
/// @file tree/TreeIterator.h
#ifndef OPENVDB_TREE_TREEITERATOR_HAS_BEEN_INCLUDED
#define OPENVDB_TREE_TREEITERATOR_HAS_BEEN_INCLUDED
#include <tbb/blocked_range.h>
#include <tbb/parallel_for.h>
#include <openvdb/version.h>
#include <openvdb/Types.h>
#include <algorithm>
#include <sstream>
#include <string>
#include <type_traits>
// Prior to 0.96.1, depth-bounded value iterators always descended to the leaf level
// and iterated past leaf nodes. Now, they never descend past the maximum depth.
// Comment out the following line to restore the older, less-efficient behavior:
#define ENABLE_TREE_VALUE_DEPTH_BOUND_OPTIMIZATION
namespace openvdb {
OPENVDB_USE_VERSION_NAMESPACE
namespace OPENVDB_VERSION_NAME {
namespace tree {
namespace iter {
template<typename HeadT, int HeadLevel>
struct InvertedTree {
using SubtreeT = typename InvertedTree<typename HeadT::ChildNodeType, HeadLevel-1>::Type;
using Type = typename SubtreeT::template Append<HeadT>;
};
template<typename HeadT>
struct InvertedTree<HeadT, /*HeadLevel=*/1> {
using Type = TypeList<typename HeadT::ChildNodeType, HeadT>;
};
} // namespace iter
////////////////////////////////////////
/// IterTraits provides the following for iterators of the standard types,
/// i.e., for {Child,Value}{On,Off,All}{Iter,CIter}:
/// - a NodeConverter template to convert an iterator for one type of node
/// to an iterator of the same type for another type of node; for example,
/// IterTraits<RootNode, RootNode::ValueOnIter>::NodeConverter<LeafNode>::Type
/// is synonymous with LeafNode::ValueOnIter.
/// - a begin(node) function that returns a begin iterator for a node of arbitrary type;
/// for example, IterTraits<LeafNode, LeafNode::ValueOnIter>::begin(leaf) returns
/// leaf.beginValueOn()
/// - a getChild() function that returns a pointer to the child node to which the iterator
/// is currently pointing (always null if the iterator is a Value iterator)
template<typename NodeT, typename IterT>
struct IterTraits
{
template<typename ChildT> static ChildT* getChild(const IterT&) { return nullptr; }
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ChildOnIter>
{
using IterT = typename NodeT::ChildOnIter;
static IterT begin(NodeT& node) { return node.beginChildOn(); }
template<typename ChildT> static ChildT* getChild(const IterT& iter) {
return &iter.getValue();
}
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ChildOnIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ChildOnCIter>
{
using IterT = typename NodeT::ChildOnCIter;
static IterT begin(const NodeT& node) { return node.cbeginChildOn(); }
template<typename ChildT> static const ChildT* getChild(const IterT& iter) {
return &iter.getValue();
}
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ChildOnCIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ChildOffIter>
{
using IterT = typename NodeT::ChildOffIter;
static IterT begin(NodeT& node) { return node.beginChildOff(); }
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ChildOffIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ChildOffCIter>
{
using IterT = typename NodeT::ChildOffCIter;
static IterT begin(const NodeT& node) { return node.cbeginChildOff(); }
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ChildOffCIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ChildAllIter>
{
using IterT = typename NodeT::ChildAllIter;
static IterT begin(NodeT& node) { return node.beginChildAll(); }
template<typename ChildT> static ChildT* getChild(const IterT& iter) {
typename IterT::NonConstValueType val;
return iter.probeChild(val);
}
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ChildAllIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ChildAllCIter>
{
using IterT = typename NodeT::ChildAllCIter;
static IterT begin(const NodeT& node) { return node.cbeginChildAll(); }
template<typename ChildT> static ChildT* getChild(const IterT& iter) {
typename IterT::NonConstValueType val;
return iter.probeChild(val);
}
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ChildAllCIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ValueOnIter>
{
using IterT = typename NodeT::ValueOnIter;
static IterT begin(NodeT& node) { return node.beginValueOn(); }
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ValueOnIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ValueOnCIter>
{
using IterT = typename NodeT::ValueOnCIter;
static IterT begin(const NodeT& node) { return node.cbeginValueOn(); }
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ValueOnCIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ValueOffIter>
{
using IterT = typename NodeT::ValueOffIter;
static IterT begin(NodeT& node) { return node.beginValueOff(); }
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ValueOffIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ValueOffCIter>
{
using IterT = typename NodeT::ValueOffCIter;
static IterT begin(const NodeT& node) { return node.cbeginValueOff(); }
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ValueOffCIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ValueAllIter>
{
using IterT = typename NodeT::ValueAllIter;
static IterT begin(NodeT& node) { return node.beginValueAll(); }
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ValueAllIter;
};
};
template<typename NodeT>
struct IterTraits<NodeT, typename NodeT::ValueAllCIter>
{
using IterT = typename NodeT::ValueAllCIter;
static IterT begin(const NodeT& node) { return node.cbeginValueAll(); }
template<typename OtherNodeT> struct NodeConverter {
using Type = typename OtherNodeT::ValueAllCIter;
};
};
////////////////////////////////////////
/// @brief 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.
template<typename PrevItemT, typename NodeVecT, size_t VecSize, Index _Level>
class IterListItem
{
public:
/// The type of iterator stored in the previous list item
using PrevIterT = typename PrevItemT::IterT;
/// The type of node (non-const) whose iterator is stored in this list item
using _NodeT = typename NodeVecT::Front;
/// The type of iterator stored in this list item (e.g., InternalNode::ValueOnCIter)
using IterT = typename IterTraits<typename PrevIterT::NonConstNodeType, PrevIterT>::template
NodeConverter<_NodeT>::Type;
/// The type of node (const or non-const) over which IterT iterates (e.g., const RootNode<...>)
using NodeT = typename IterT::NodeType;
/// The type of the node with const qualifiers removed ("Non-Const")
using NCNodeT = typename IterT::NonConstNodeType;
/// The type of value (with const qualifiers removed) to which the iterator points
using NCValueT = typename IterT::NonConstValueType;
/// NodeT's child node type, with the same constness (e.g., const InternalNode<...>)
using ChildT = typename CopyConstness<NodeT, typename NodeT::ChildNodeType>::Type;
/// NodeT's child node type with const qualifiers removed
using NCChildT = typename CopyConstness<NCNodeT, typename NCNodeT::ChildNodeType>::Type;
using ITraits = IterTraits<NCNodeT, IterT>;
/// NodeT's level in its tree (0 = LeafNode)
static const Index Level = _Level;
IterListItem(PrevItemT* prev): mNext(this), mPrev(prev) {}
IterListItem(const IterListItem& other):
mIter(other.mIter), mNext(other.mNext), mPrev(nullptr) {}
IterListItem& operator=(const IterListItem& other)
{
if (&other != this) {
mIter = other.mIter;
mNext = other.mNext;
mPrev = nullptr; ///< @note external call to updateBackPointers() required
}
return *this;
}
void updateBackPointers(PrevItemT* prev) { mPrev = prev; mNext.updateBackPointers(this); }
void setIter(const IterT& iter) { mIter = iter; }
template<typename OtherIterT>
void setIter(const OtherIterT& iter) { mNext.setIter(iter); }
/// Return the node over which this list element's iterator iterates.
void getNode(Index lvl, NodeT*& node) const
{
node = (lvl <= Level) ? mIter.getParentNode() : nullptr;
}
/// Return the node over which one of the following list elements' iterator iterates.
template<typename OtherNodeT>
void getNode(Index lvl, OtherNodeT*& node) const { mNext.getNode(lvl, node); }
/// @brief Initialize the iterator for level @a lvl of the tree with the node
/// over which the corresponding iterator of @a otherListItem is iterating.
///
/// For example, if @a otherListItem contains a LeafNode::ValueOnIter,
/// initialize this list's leaf iterator with the same LeafNode.
template<typename OtherIterListItemT>
void initLevel(Index lvl, OtherIterListItemT& otherListItem)
{
if (lvl == Level) {
const NodeT* node = nullptr;
otherListItem.getNode(lvl, node);
mIter = (node == nullptr) ? IterT() : ITraits::begin(*const_cast<NodeT*>(node));
} else {
// Forward to one of the following list elements.
mNext.initLevel(lvl, otherListItem);
}
}
/// Return The table offset of the iterator at level @a lvl of the tree.
Index pos(Index lvl) const { return (lvl == Level) ? mIter.pos() : mNext.pos(lvl); }
/// Return @c true if the iterator at level @a lvl of the tree has not yet reached its end.
bool test(Index lvl) const { return (lvl == Level) ? mIter.test() : mNext.test(lvl); }
/// Increment the iterator at level @a lvl of the tree.
bool next(Index lvl) { return (lvl == Level) ? mIter.next() : mNext.next(lvl); }
/// @brief If the iterator at level @a lvl of the tree points to a child node,
/// initialize the next iterator in this list with that child node.
bool down(Index lvl)
{
if (lvl == Level && mPrev != nullptr && mIter) {
if (ChildT* child = ITraits::template getChild<ChildT>(mIter)) {
mPrev->setIter(PrevItemT::ITraits::begin(*child));
return true;
}
}
return (lvl > Level) ? mNext.down(lvl) : false;
}
/// @brief Return the global coordinates of the voxel or tile to which the iterator
/// at level @a lvl of the tree is currently pointing.
Coord getCoord(Index lvl) const
{
return (lvl == Level) ? mIter.getCoord() : mNext.getCoord(lvl);
}
Index getChildDim(Index lvl) const
{
return (lvl == Level) ? NodeT::getChildDim() : mNext.getChildDim(lvl);
}
/// Return the number of (virtual) voxels spanned by a tile value or child node
Index64 getVoxelCount(Index lvl) const
{
return (lvl == Level) ? ChildT::NUM_VOXELS : mNext.getVoxelCount(lvl);
}
/// Return @c true if the iterator at level @a lvl of the tree points to an active value.
bool isValueOn(Index lvl) const
{
return (lvl == Level) ? mIter.isValueOn() : mNext.isValueOn(lvl);
}
/// Return the value to which the iterator at level @a lvl of the tree points.
const NCValueT& getValue(Index lvl) const
{
if (lvl == Level) return mIter.getValue();
return mNext.getValue(lvl);
}
/// @brief Set the value (to @a val) to which the iterator at level @a lvl
/// of the tree points and mark the value as active.
/// @note Not valid when @c IterT is a const iterator type
void setValue(Index lvl, const NCValueT& val) const
{
if (lvl == Level) mIter.setValue(val); else mNext.setValue(lvl, val);
}
/// @brief Set the value (to @a val) to which the iterator at level @a lvl of the tree
/// points and mark the value as active if @a on is @c true, or inactive otherwise.
/// @note Not valid when @c IterT is a const iterator type
void setValueOn(Index lvl, bool on = true) const
{
if (lvl == Level) mIter.setValueOn(on); else mNext.setValueOn(lvl, on);
}
/// @brief Mark the value to which the iterator at level @a lvl of the tree points
/// as inactive.
/// @note Not valid when @c IterT is a const iterator type
void setValueOff(Index lvl) const
{
if (lvl == Level) mIter.setValueOff(); else mNext.setValueOff(lvl);
}
/// @brief Apply a functor to the item to which this iterator is pointing.
/// @note Not valid when @c IterT is a const iterator type
template<typename ModifyOp>
void modifyValue(Index lvl, const ModifyOp& op) const
{
if (lvl == Level) mIter.modifyValue(op); else mNext.modifyValue(lvl, op);
}
private:
using RestT = typename NodeVecT::PopFront; // NodeVecT minus its first item
using NextItem = IterListItem<IterListItem, RestT, VecSize - 1, Level + 1>;
IterT mIter;
NextItem mNext;
PrevItemT* mPrev;
};
/// The initial element of a compile-time linked list of iterators to nodes of different types
template<typename PrevItemT, typename NodeVecT, size_t VecSize>
class IterListItem<PrevItemT, NodeVecT, VecSize, /*Level=*/0U>
{
public:
/// The type of iterator stored in the previous list item
using PrevIterT = typename PrevItemT::IterT;
/// The type of node (non-const) whose iterator is stored in this list item
using _NodeT = typename NodeVecT::Front;
/// The type of iterator stored in this list item (e.g., InternalNode::ValueOnCIter)
using IterT = typename IterTraits<typename PrevIterT::NonConstNodeType, PrevIterT>::template
NodeConverter<_NodeT>::Type;
/// The type of node (const or non-const) over which IterT iterates (e.g., const RootNode<...>)
using NodeT = typename IterT::NodeType;
/// The type of the node with const qualifiers removed ("Non-Const")
using NCNodeT = typename IterT::NonConstNodeType;
/// The type of value (with const qualifiers removed) to which the iterator points
using NCValueT = typename IterT::NonConstValueType;
using ITraits = IterTraits<NCNodeT, IterT>;
/// NodeT's level in its tree (0 = LeafNode)
static const Index Level = 0;
IterListItem(PrevItemT*): mNext(this), mPrev(nullptr) {}
IterListItem(const IterListItem& other):
mIter(other.mIter), mNext(other.mNext), mPrev(nullptr) {}
IterListItem& operator=(const IterListItem& other)
{
if (&other != this) {
mIter = other.mIter;
mNext = other.mNext;
mPrev = nullptr;
}
return *this;
}
void updateBackPointers(PrevItemT* = nullptr)
{
mPrev = nullptr; mNext.updateBackPointers(this);
}
void setIter(const IterT& iter) { mIter = iter; }
template<typename OtherIterT>
void setIter(const OtherIterT& iter) { mNext.setIter(iter); }
void getNode(Index lvl, NodeT*& node) const
{
node = (lvl == 0) ? mIter.getParentNode() : nullptr;
}
template<typename OtherNodeT>
void getNode(Index lvl, OtherNodeT*& node) const { mNext.getNode(lvl, node); }
template<typename OtherIterListItemT>
void initLevel(Index lvl, OtherIterListItemT& otherListItem)
{
if (lvl == 0) {
const NodeT* node = nullptr;
otherListItem.getNode(lvl, node);
mIter = (node == nullptr) ? IterT() : ITraits::begin(*const_cast<NodeT*>(node));
} else {
mNext.initLevel(lvl, otherListItem);
}
}
Index pos(Index lvl) const { return (lvl == 0) ? mIter.pos() : mNext.pos(lvl); }
bool test(Index lvl) const { return (lvl == 0) ? mIter.test() : mNext.test(lvl); }
bool next(Index lvl) { return (lvl == 0) ? mIter.next() : mNext.next(lvl); }
bool down(Index lvl) { return (lvl == 0) ? false : mNext.down(lvl); }
Coord getCoord(Index lvl) const
{
return (lvl == 0) ? mIter.getCoord() : mNext.getCoord(lvl);
}
Index getChildDim(Index lvl) const
{
return (lvl == 0) ? NodeT::getChildDim() : mNext.getChildDim(lvl);
}
Index64 getVoxelCount(Index lvl) const
{
return (lvl == 0) ? 1 : mNext.getVoxelCount(lvl);
}
bool isValueOn(Index lvl) const
{
return (lvl == 0) ? mIter.isValueOn() : mNext.isValueOn(lvl);
}
const NCValueT& getValue(Index lvl) const
{
if (lvl == 0) return mIter.getValue();
return mNext.getValue(lvl);
}
void setValue(Index lvl, const NCValueT& val) const
{
if (lvl == 0) mIter.setValue(val); else mNext.setValue(lvl, val);
}
void setValueOn(Index lvl, bool on = true) const
{
if (lvl == 0) mIter.setValueOn(on); else mNext.setValueOn(lvl, on);
}
void setValueOff(Index lvl) const
{
if (lvl == 0) mIter.setValueOff(); else mNext.setValueOff(lvl);
}
template<typename ModifyOp>
void modifyValue(Index lvl, const ModifyOp& op) const
{
if (lvl == 0) mIter.modifyValue(op); else mNext.modifyValue(lvl, op);
}
private:
using RestT = typename NodeVecT::PopFront; // NodeVecT minus its first item
using NextItem = IterListItem<IterListItem, RestT, VecSize - 1, /*Level=*/1>;
IterT mIter;
NextItem mNext;
PrevItemT* mPrev;
};
/// The final element of a compile-time linked list of iterators to nodes of different types
template<typename PrevItemT, typename NodeVecT, Index _Level>
class IterListItem<PrevItemT, NodeVecT, /*VecSize=*/1, _Level>
{
public:
using _NodeT = typename NodeVecT::Front;
/// The type of iterator stored in the previous list item
using PrevIterT = typename PrevItemT::IterT;
/// The type of iterator stored in this list item (e.g., RootNode::ValueOnCIter)
using IterT = typename IterTraits<typename PrevIterT::NonConstNodeType, PrevIterT>::template
NodeConverter<_NodeT>::Type;
/// The type of node over which IterT iterates (e.g., const RootNode<...>)
using NodeT = typename IterT::NodeType;
/// The type of the node with const qualifiers removed ("Non-Const")
using NCNodeT = typename IterT::NonConstNodeType;
/// The type of value (with const qualifiers removed) to which the iterator points
using NCValueT = typename IterT::NonConstValueType;
/// NodeT's child node type, with the same constness (e.g., const InternalNode<...>)
using ChildT = typename CopyConstness<NodeT, typename NodeT::ChildNodeType>::Type;
/// NodeT's child node type with const qualifiers removed
using NCChildT = typename CopyConstness<NCNodeT, typename NCNodeT::ChildNodeType>::Type;
using ITraits = IterTraits<NCNodeT, IterT>;
/// NodeT's level in its tree (0 = LeafNode)
static const Index Level = _Level;
IterListItem(PrevItemT* prev): mPrev(prev) {}
IterListItem(const IterListItem& other): mIter(other.mIter), mPrev(nullptr) {}
IterListItem& operator=(const IterListItem& other)
{
if (&other != this) {
mIter = other.mIter;
mPrev = nullptr; ///< @note external call to updateBackPointers() required
}
return *this;
}
void updateBackPointers(PrevItemT* prev) { mPrev = prev; }
// The following method specializations differ from the default template
// implementations mainly in that they don't forward.
void setIter(const IterT& iter) { mIter = iter; }
void getNode(Index lvl, NodeT*& node) const
{
node = (lvl <= Level) ? mIter.getParentNode() : nullptr;
}
template<typename OtherIterListItemT>
void initLevel(Index lvl, OtherIterListItemT& otherListItem)
{
if (lvl == Level) {
const NodeT* node = nullptr;
otherListItem.getNode(lvl, node);
mIter = (node == nullptr) ? IterT() : ITraits::begin(*const_cast<NodeT*>(node));
}
}
Index pos(Index lvl) const { return (lvl == Level) ? mIter.pos() : Index(-1); }
bool test(Index lvl) const { return (lvl == Level) ? mIter.test() : false; }
bool next(Index lvl) { return (lvl == Level) ? mIter.next() : false; }
bool down(Index lvl)
{
if (lvl == Level && mPrev != nullptr && mIter) {
if (ChildT* child = ITraits::template getChild<ChildT>(mIter)) {
mPrev->setIter(PrevItemT::ITraits::begin(*child));
return true;
}
}
return false;
}
Coord getCoord(Index lvl) const { return (lvl == Level) ? mIter.getCoord() : Coord(); }
Index getChildDim(Index lvl) const { return (lvl == Level) ? NodeT::getChildDim() : 0; }
Index64 getVoxelCount(Index lvl) const { return (lvl == Level) ? ChildT::NUM_VOXELS : 0; }
bool isValueOn(Index lvl) const { return (lvl == Level) ? mIter.isValueOn() : false; }
const NCValueT& getValue(Index lvl) const
{
assert(lvl == Level);
(void)lvl; // avoid unused variable warning in optimized builds
return mIter.getValue();
}
void setValue(Index lvl, const NCValueT& val) const { if (lvl == Level) mIter.setValue(val); }
void setValueOn(Index lvl, bool on = true) const { if (lvl == Level) mIter.setValueOn(on); }
void setValueOff(Index lvl) const { if (lvl == Level) mIter.setValueOff(); }
template<typename ModifyOp>
void modifyValue(Index lvl, const ModifyOp& op) const
{
if (lvl == Level) mIter.modifyValue(op);
}
private:
IterT mIter;
PrevItemT* mPrev;
};
////////////////////////////////////////
//#define DEBUG_TREE_VALUE_ITERATOR
/// @brief Base class for tree-traversal iterators over tile and voxel values
template<typename _TreeT, typename _ValueIterT>
class TreeValueIteratorBase
{
public:
using TreeT = _TreeT;
using ValueIterT = _ValueIterT;
using NodeT = typename ValueIterT::NodeType;
using ValueT = typename ValueIterT::NonConstValueType;
using ChildOnIterT = typename NodeT::ChildOnCIter;
static const Index ROOT_LEVEL = NodeT::LEVEL;
static_assert(ValueIterT::NodeType::LEVEL == ROOT_LEVEL, "invalid value iterator node type");
static const Index LEAF_LEVEL = 0, ROOT_DEPTH = 0, LEAF_DEPTH = ROOT_LEVEL;
TreeValueIteratorBase(TreeT&);
TreeValueIteratorBase(const TreeValueIteratorBase& other);
TreeValueIteratorBase& operator=(const TreeValueIteratorBase& other);
/// Specify the depth of the highest level of the tree to which to ascend (depth 0 = root).
void setMinDepth(Index minDepth);
/// Return the depth of the highest level of the tree to which this iterator ascends.
Index getMinDepth() const { return ROOT_LEVEL - Index(mMaxLevel); }
/// Specify the depth of the lowest level of the tree to which to descend (depth 0 = root).
void setMaxDepth(Index maxDepth);
/// Return the depth of the lowest level of the tree to which this iterator ascends.
Index getMaxDepth() const { return ROOT_LEVEL - Index(mMinLevel); }
//@{
/// Return @c true if this iterator is not yet exhausted.
bool test() const { return mValueIterList.test(mLevel); }
operator bool() const { return this->test(); }
//@}
/// @brief Advance to the next tile or voxel value.
/// Return @c true if this iterator is not yet exhausted.
bool next();
/// Advance to the next tile or voxel value.
TreeValueIteratorBase& operator++() { this->next(); return *this; }
/// @brief Return the level in the tree (0 = leaf) of the node to which
/// this iterator is currently pointing.
Index getLevel() const { return mLevel; }
/// @brief Return the depth in the tree (0 = root) of the node to which
/// this iterator is currently pointing.
Index getDepth() const { return ROOT_LEVEL - mLevel; }
static Index getLeafDepth() { return LEAF_DEPTH; }
/// @brief Return in @a node a pointer to the node over which this iterator is
/// currently iterating or one of that node's parents, as determined by @a NodeType.
/// Sets @a node to null pointer if @a NodeType specifies a node at a lower level
/// of the tree than that given by getLevel().
template<typename NodeType>
void getNode(NodeType*& node) const { mValueIterList.getNode(mLevel, node); }
/// @brief Return the global coordinates of the voxel or tile to which
/// this iterator is currently pointing.
Coord getCoord() const { return mValueIterList.getCoord(mLevel); }
/// @brief Return in @a bbox the axis-aligned bounding box of
/// the voxel or tile to which this iterator is currently pointing.
/// @return false if the bounding box is empty.
bool getBoundingBox(CoordBBox&) const;
/// @brief Return the axis-aligned bounding box of the voxel or tile to which
/// this iterator is currently pointing.
CoordBBox getBoundingBox() const { CoordBBox b; this->getBoundingBox(b); return b; }
/// Return the number of (virtual) voxels corresponding to the value
Index64 getVoxelCount() const { return mValueIterList.getVoxelCount(mLevel);}
/// Return @c true if this iterator is currently pointing to a (non-leaf) tile value.
bool isTileValue() const { return mLevel != 0 && this->test(); }
/// Return @c true if this iterator is currently pointing to a (leaf) voxel value.
bool isVoxelValue() const { return mLevel == 0 && this->test(); }
/// Return @c true if the value to which this iterator is currently pointing is active.
bool isValueOn() const { return mValueIterList.isValueOn(mLevel); }
//@{
/// Return the tile or voxel value to which this iterator is currently pointing.
const ValueT& getValue() const { return mValueIterList.getValue(mLevel); }
const ValueT& operator*() const { return this->getValue(); }
const ValueT* operator->() const { return &(this->operator*()); }
//@}
/// @brief Change the tile or voxel value to which this iterator is currently pointing
/// and mark it as active.
void setValue(const ValueT& val) const { mValueIterList.setValue(mLevel, val); }
/// @brief Change the active/inactive state of the tile or voxel value to which
/// this iterator is currently pointing.
void setActiveState(bool on) const { mValueIterList.setValueOn(mLevel, on); }
/// Mark the tile or voxel value to which this iterator is currently pointing as inactive.
void setValueOff() const { mValueIterList.setValueOff(mLevel); }
/// @brief Apply a functor to the item to which this iterator is pointing.
/// (Not valid for const iterators.)
/// @param op a functor of the form <tt>void op(ValueType&) const</tt> that modifies
/// its argument in place
/// @see Tree::modifyValue()
template<typename ModifyOp>
void modifyValue(const ModifyOp& op) const { mValueIterList.modifyValue(mLevel, op); }
/// Return a pointer to the tree over which this iterator is iterating.
TreeT* getTree() const { return mTree; }
/// Return a string (for debugging, mainly) describing this iterator's current state.
std::string summary() const;
private:
bool advance(bool dontIncrement = false);
using InvTreeT = typename iter::InvertedTree<NodeT, NodeT::LEVEL>::Type;
struct PrevChildItem { using IterT = ChildOnIterT; };
struct PrevValueItem { using IterT = ValueIterT; };
IterListItem<PrevChildItem, InvTreeT, /*VecSize=*/ROOT_LEVEL+1, /*Level=*/0> mChildIterList;
IterListItem<PrevValueItem, InvTreeT, /*VecSize=*/ROOT_LEVEL+1, /*Level=*/0> mValueIterList;
Index mLevel;
int mMinLevel, mMaxLevel;
TreeT* mTree;
}; // class TreeValueIteratorBase
template<typename TreeT, typename ValueIterT>
inline
TreeValueIteratorBase<TreeT, ValueIterT>::TreeValueIteratorBase(TreeT& tree):
mChildIterList(nullptr),
mValueIterList(nullptr),
mLevel(ROOT_LEVEL),
mMinLevel(int(LEAF_LEVEL)),
mMaxLevel(int(ROOT_LEVEL)),
mTree(&tree)
{
mChildIterList.setIter(IterTraits<NodeT, ChildOnIterT>::begin(tree.root()));
mValueIterList.setIter(IterTraits<NodeT, ValueIterT>::begin(tree.root()));
this->advance(/*dontIncrement=*/true);
}
template<typename TreeT, typename ValueIterT>
inline
TreeValueIteratorBase<TreeT, ValueIterT>::TreeValueIteratorBase(const TreeValueIteratorBase& other):
mChildIterList(other.mChildIterList),
mValueIterList(other.mValueIterList),
mLevel(other.mLevel),
mMinLevel(other.mMinLevel),
mMaxLevel(other.mMaxLevel),
mTree(other.mTree)
{
mChildIterList.updateBackPointers();
mValueIterList.updateBackPointers();
}
template<typename TreeT, typename ValueIterT>
inline TreeValueIteratorBase<TreeT, ValueIterT>&
TreeValueIteratorBase<TreeT, ValueIterT>::operator=(const TreeValueIteratorBase& other)
{
if (&other != this) {
mChildIterList = other.mChildIterList;
mValueIterList = other.mValueIterList;
mLevel = other.mLevel;
mMinLevel = other.mMinLevel;
mMaxLevel = other.mMaxLevel;
mTree = other.mTree;
mChildIterList.updateBackPointers();
mValueIterList.updateBackPointers();
}
return *this;
}
template<typename TreeT, typename ValueIterT>
inline void
TreeValueIteratorBase<TreeT, ValueIterT>::setMinDepth(Index minDepth)
{
mMaxLevel = int(ROOT_LEVEL - minDepth); // level = ROOT_LEVEL - depth
if (int(mLevel) > mMaxLevel) this->next();
}
template<typename TreeT, typename ValueIterT>
inline void
TreeValueIteratorBase<TreeT, ValueIterT>::setMaxDepth(Index maxDepth)
{
// level = ROOT_LEVEL - depth
mMinLevel = int(ROOT_LEVEL - std::min(maxDepth, this->getLeafDepth()));
if (int(mLevel) < mMinLevel) this->next();
}
template<typename TreeT, typename ValueIterT>
inline bool
TreeValueIteratorBase<TreeT, ValueIterT>::next()
{
do {
if (!this->advance()) return false;
} while (int(mLevel) < mMinLevel || int(mLevel) > mMaxLevel);
return true;
}
template<typename TreeT, typename ValueIterT>
inline bool
TreeValueIteratorBase<TreeT, ValueIterT>::advance(bool dontIncrement)
{
bool recurse = false;
do {
recurse = false;
Index
vPos = mValueIterList.pos(mLevel),
cPos = mChildIterList.pos(mLevel);
if (vPos == cPos && mChildIterList.test(mLevel)) {
/// @todo Once ValueOff iterators properly skip child pointers, remove this block.
mValueIterList.next(mLevel);
vPos = mValueIterList.pos(mLevel);
}
if (vPos < cPos) {
if (dontIncrement) return true;
if (mValueIterList.next(mLevel)) {
if (mValueIterList.pos(mLevel) == cPos && mChildIterList.test(mLevel)) {
/// @todo Once ValueOff iterators properly skip child pointers,
/// remove this block.
mValueIterList.next(mLevel);
}
// If there is a next value and it precedes the next child, return.
if (mValueIterList.pos(mLevel) < cPos) return true;
}
} else {
// Advance to the next child, which may or may not precede the next value.
if (!dontIncrement) mChildIterList.next(mLevel);
}
#ifdef DEBUG_TREE_VALUE_ITERATOR
std::cout << "\n" << this->summary() << std::flush;
#endif
// Descend to the lowest level at which the next value precedes the next child.
while (mChildIterList.pos(mLevel) < mValueIterList.pos(mLevel)) {
#ifdef ENABLE_TREE_VALUE_DEPTH_BOUND_OPTIMIZATION
if (int(mLevel) == mMinLevel) {
// If the current node lies at the lowest allowed level, none of its
// children can be visited, so just advance its child iterator.
mChildIterList.next(mLevel);
if (mValueIterList.pos(mLevel) == mChildIterList.pos(mLevel)
&& mChildIterList.test(mLevel))
{
/// @todo Once ValueOff iterators properly skip child pointers,
/// remove this block.
mValueIterList.next(mLevel);
}
} else
#endif
if (mChildIterList.down(mLevel)) {
--mLevel; // descend one level
mValueIterList.initLevel(mLevel, mChildIterList);
if (mValueIterList.pos(mLevel) == mChildIterList.pos(mLevel)
&& mChildIterList.test(mLevel))
{
/// @todo Once ValueOff iterators properly skip child pointers,
/// remove this block.
mValueIterList.next(mLevel);
}
} else break;
#ifdef DEBUG_TREE_VALUE_ITERATOR
std::cout << "\n" << this->summary() << std::flush;
#endif
}
// Ascend to the nearest level at which one of the iterators is not yet exhausted.
while (!mChildIterList.test(mLevel) && !mValueIterList.test(mLevel)) {
if (mLevel == ROOT_LEVEL) return false;
++mLevel;
mChildIterList.next(mLevel);
dontIncrement = true;
recurse = true;
}
} while (recurse);
return true;
}
template<typename TreeT, typename ValueIterT>
inline bool
TreeValueIteratorBase<TreeT, ValueIterT>::getBoundingBox(CoordBBox& bbox) const
{
if (!this->test()) {
bbox = CoordBBox();
return false;
}
bbox.min() = mValueIterList.getCoord(mLevel);
bbox.max() = bbox.min().offsetBy(mValueIterList.getChildDim(mLevel) - 1);
return true;
}
template<typename TreeT, typename ValueIterT>
inline std::string
TreeValueIteratorBase<TreeT, ValueIterT>::summary() const
{
std::ostringstream ostr;
for (int lvl = int(ROOT_LEVEL); lvl >= 0 && lvl >= int(mLevel); --lvl) {
if (lvl == 0) ostr << "leaf";
else if (lvl == int(ROOT_LEVEL)) ostr << "root";
else ostr << "int" << (ROOT_LEVEL - lvl);
ostr << " v" << mValueIterList.pos(lvl)
<< " c" << mChildIterList.pos(lvl);
if (lvl > int(mLevel)) ostr << " / ";
}
if (this->test() && mValueIterList.pos(mLevel) < mChildIterList.pos(mLevel)) {
if (mLevel == 0) {
ostr << " " << this->getCoord();
} else {
ostr << " " << this->getBoundingBox();
}
}
return ostr.str();
}
////////////////////////////////////////
/// @brief Base class for tree-traversal iterators over all nodes
template<typename _TreeT, typename RootChildOnIterT>
class NodeIteratorBase
{
public:
using TreeT = _TreeT;
using RootIterT = RootChildOnIterT;
using RootNodeT = typename RootIterT::NodeType;
using NCRootNodeT = typename RootIterT::NonConstNodeType;
static const Index ROOT_LEVEL = RootNodeT::LEVEL;
using InvTreeT = typename iter::InvertedTree<NCRootNodeT, ROOT_LEVEL>::Type;
static const Index LEAF_LEVEL = 0, ROOT_DEPTH = 0, LEAF_DEPTH = ROOT_LEVEL;
using RootIterTraits = IterTraits<NCRootNodeT, RootIterT>;
NodeIteratorBase();
NodeIteratorBase(TreeT&);
NodeIteratorBase(const NodeIteratorBase& other);
NodeIteratorBase& operator=(const NodeIteratorBase& other);
/// Specify the depth of the highest level of the tree to which to ascend (depth 0 = root).
void setMinDepth(Index minDepth);
/// Return the depth of the highest level of the tree to which this iterator ascends.
Index getMinDepth() const { return ROOT_LEVEL - Index(mMaxLevel); }
/// Specify the depth of the lowest level of the tree to which to descend (depth 0 = root).
void setMaxDepth(Index maxDepth);
/// Return the depth of the lowest level of the tree to which this iterator ascends.
Index getMaxDepth() const { return ROOT_LEVEL - Index(mMinLevel); }
//@{
/// Return @c true if this iterator is not yet exhausted.
bool test() const { return !mDone; }
operator bool() const { return this->test(); }
//@}
/// @brief Advance to the next tile or voxel value.
/// @return @c true if this iterator is not yet exhausted.
bool next();
/// Advance the iterator to the next leaf node.
void increment() { this->next(); }
NodeIteratorBase& operator++() { this->increment(); return *this; }
/// Increment the iterator n times.
void increment(Index n) { for (Index i = 0; i < n && this->next(); ++i) {} }
/// @brief Return the level in the tree (0 = leaf) of the node to which
/// this iterator is currently pointing.
Index getLevel() const { return mLevel; }
/// @brief Return the depth in the tree (0 = root) of the node to which
/// this iterator is currently pointing.
Index getDepth() const { return ROOT_LEVEL - mLevel; }
static Index getLeafDepth() { return LEAF_DEPTH; }
/// @brief Return the global coordinates of the voxel or tile to which
/// this iterator is currently pointing.
Coord getCoord() const;
/// @brief Return in @a bbox the axis-aligned bounding box of
/// the voxel or tile to which this iterator is currently pointing.
/// @return false if the bounding box is empty.
bool getBoundingBox(CoordBBox& bbox) const;
/// @brief Return the axis-aligned bounding box of the voxel or tile to which
/// this iterator is currently pointing.
CoordBBox getBoundingBox() const { CoordBBox b; this->getBoundingBox(b); return b; }
//@{
/// @brief Return the node to which the iterator is pointing.
/// @note This iterator doesn't have the usual dereference operators (* and ->),
/// because they would have to be overloaded by the returned node type.
template<typename NodeT>
void getNode(NodeT*& node) const { node = nullptr; mIterList.getNode(mLevel, node); }
template<typename NodeT>
void getNode(const NodeT*& node) const { node = nullptr; mIterList.getNode(mLevel, node); }
//@}
TreeT* getTree() const { return mTree; }
std::string summary() const;
private:
struct PrevItem { using IterT = RootIterT; };
IterListItem<PrevItem, InvTreeT, /*VecSize=*/ROOT_LEVEL+1, LEAF_LEVEL> mIterList;
Index mLevel;
int mMinLevel, mMaxLevel;
bool mDone;
TreeT* mTree;
}; // class NodeIteratorBase
template<typename TreeT, typename RootChildOnIterT>
inline
NodeIteratorBase<TreeT, RootChildOnIterT>::NodeIteratorBase():
mIterList(nullptr),
mLevel(ROOT_LEVEL),
mMinLevel(int(LEAF_LEVEL)),
mMaxLevel(int(ROOT_LEVEL)),
mDone(true),
mTree(nullptr)
{
}
template<typename TreeT, typename RootChildOnIterT>
inline
NodeIteratorBase<TreeT, RootChildOnIterT>::NodeIteratorBase(TreeT& tree):
mIterList(nullptr),
mLevel(ROOT_LEVEL),
mMinLevel(int(LEAF_LEVEL)),
mMaxLevel(int(ROOT_LEVEL)),
mDone(false),
mTree(&tree)
{
mIterList.setIter(RootIterTraits::begin(tree.root()));
}
template<typename TreeT, typename RootChildOnIterT>
inline
NodeIteratorBase<TreeT, RootChildOnIterT>::NodeIteratorBase(const NodeIteratorBase& other):
mIterList(other.mIterList),
mLevel(other.mLevel),
mMinLevel(other.mMinLevel),
mMaxLevel(other.mMaxLevel),
mDone(other.mDone),
mTree(other.mTree)
{
mIterList.updateBackPointers();
}
template<typename TreeT, typename RootChildOnIterT>
inline NodeIteratorBase<TreeT, RootChildOnIterT>&
NodeIteratorBase<TreeT, RootChildOnIterT>::operator=(const NodeIteratorBase& other)
{
if (&other != this) {
mLevel = other.mLevel;
mMinLevel = other.mMinLevel;
mMaxLevel = other.mMaxLevel;
mDone = other.mDone;
mTree = other.mTree;
mIterList = other.mIterList;
mIterList.updateBackPointers();
}
return *this;
}
template<typename TreeT, typename RootChildOnIterT>
inline void
NodeIteratorBase<TreeT, RootChildOnIterT>::setMinDepth(Index minDepth)
{
mMaxLevel = int(ROOT_LEVEL - minDepth); // level = ROOT_LEVEL - depth
if (int(mLevel) > mMaxLevel) this->next();
}
template<typename TreeT, typename RootChildOnIterT>
inline void
NodeIteratorBase<TreeT, RootChildOnIterT>::setMaxDepth(Index maxDepth)
{
// level = ROOT_LEVEL - depth
mMinLevel = int(ROOT_LEVEL - std::min(maxDepth, this->getLeafDepth()));
if (int(mLevel) < mMinLevel) this->next();
}
template<typename TreeT, typename RootChildOnIterT>
inline bool
NodeIteratorBase<TreeT, RootChildOnIterT>::next()
{
do {
if (mDone) return false;
// If the iterator over the current node points to a child,
// descend to the child (depth-first traversal).
if (int(mLevel) > mMinLevel && mIterList.test(mLevel)) {
if (!mIterList.down(mLevel)) return false;
--mLevel;
} else {
// Ascend to the nearest ancestor that has other children.
while (!mIterList.test(mLevel)) {
if (mLevel == ROOT_LEVEL) {
// Can't ascend higher than the root.
mDone = true;
return false;
}
++mLevel; // ascend one level
mIterList.next(mLevel); // advance to the next child, if there is one
}
// Descend to the child.
if (!mIterList.down(mLevel)) return false;
--mLevel;
}
} while (int(mLevel) < mMinLevel || int(mLevel) > mMaxLevel);
return true;
}
template<typename TreeT, typename RootChildOnIterT>
inline Coord
NodeIteratorBase<TreeT, RootChildOnIterT>::getCoord() const
{
if (mLevel != ROOT_LEVEL) return mIterList.getCoord(mLevel + 1);
RootNodeT* root = nullptr;
this->getNode(root);
return root ? root->getMinIndex() : Coord::min();
}
template<typename TreeT, typename RootChildOnIterT>
inline bool
NodeIteratorBase<TreeT, RootChildOnIterT>::getBoundingBox(CoordBBox& bbox) const
{
if (mLevel == ROOT_LEVEL) {
RootNodeT* root = nullptr;
this->getNode(root);
if (root == nullptr) {
bbox = CoordBBox();
return false;
}
root->getIndexRange(bbox);
return true;
}
bbox.min() = mIterList.getCoord(mLevel + 1);
bbox.max() = bbox.min().offsetBy(mIterList.getChildDim(mLevel + 1) - 1);
return true;
}
template<typename TreeT, typename RootChildOnIterT>
inline std::string
NodeIteratorBase<TreeT, RootChildOnIterT>::summary() const
{
std::ostringstream ostr;
for (int lvl = int(ROOT_LEVEL); lvl >= 0 && lvl >= int(mLevel); --lvl) {
if (lvl == 0) ostr << "leaf";
else if (lvl == int(ROOT_LEVEL)) ostr << "root";
else ostr << "int" << (ROOT_LEVEL - lvl);
ostr << " c" << mIterList.pos(lvl);
if (lvl > int(mLevel)) ostr << " / ";
}
CoordBBox bbox;
this->getBoundingBox(bbox);
ostr << " " << bbox;
return ostr.str();
}
////////////////////////////////////////
/// @brief Base class for tree-traversal iterators over all leaf nodes (but not leaf voxels)
template<typename TreeT, typename RootChildOnIterT>
class LeafIteratorBase
{
public:
using RootIterT = RootChildOnIterT;
using RootNodeT = typename RootIterT::NodeType;
using NCRootNodeT = typename RootIterT::NonConstNodeType;
static const Index ROOT_LEVEL = RootNodeT::LEVEL;
using InvTreeT = typename iter::InvertedTree<NCRootNodeT, ROOT_LEVEL>::Type;
using NCLeafNodeT = typename InvTreeT::Front;
using LeafNodeT = typename CopyConstness<RootNodeT, NCLeafNodeT>::Type;
static const Index LEAF_LEVEL = 0, LEAF_PARENT_LEVEL = LEAF_LEVEL + 1;
using RootIterTraits = IterTraits<NCRootNodeT, RootIterT>;
LeafIteratorBase(): mIterList(nullptr), mTree(nullptr) {}
LeafIteratorBase(TreeT& tree): mIterList(nullptr), mTree(&tree)
{
// Initialize the iterator list with a root node iterator.
mIterList.setIter(RootIterTraits::begin(tree.root()));
// Descend along the first branch, initializing the node iterator at each level.
Index lvl = ROOT_LEVEL;
for ( ; lvl > 0 && mIterList.down(lvl); --lvl) {}
// If the first branch terminated above the leaf level, backtrack to the next branch.
if (lvl > 0) this->next();
}
LeafIteratorBase(const LeafIteratorBase& other): mIterList(other.mIterList), mTree(other.mTree)
{
mIterList.updateBackPointers();
}
LeafIteratorBase& operator=(const LeafIteratorBase& other)
{
if (&other != this) {
mTree = other.mTree;
mIterList = other.mIterList;
mIterList.updateBackPointers();
}
return *this;
}
//@{
/// Return the leaf node to which the iterator is pointing.
LeafNodeT* getLeaf() const
{
LeafNodeT* n = nullptr;
mIterList.getNode(LEAF_LEVEL, n);
return n;
}
LeafNodeT& operator*() const { return *this->getLeaf(); }
LeafNodeT* operator->() const { return this->getLeaf(); }
//@}
bool test() const { return mIterList.test(LEAF_PARENT_LEVEL); }
operator bool() const { return this->test(); }
//@{
/// Advance the iterator to the next leaf node.
bool next();
void increment() { this->next(); }
LeafIteratorBase& operator++() { this->increment(); return *this; }
//@}
/// Increment the iterator n times.
void increment(Index n) { for (Index i = 0; i < n && this->next(); ++i) {} }
TreeT* getTree() const { return mTree; }
private:
struct PrevItem { using IterT = RootIterT; };
/// @note Even though a LeafIterator doesn't iterate over leaf voxels,
/// the first item of this linked list of node iterators is a leaf node iterator,
/// whose purpose is only to provide access to its parent leaf node.
IterListItem<PrevItem, InvTreeT, /*VecSize=*/ROOT_LEVEL+1, LEAF_LEVEL> mIterList;
TreeT* mTree;
}; // class LeafIteratorBase
template<typename TreeT, typename RootChildOnIterT>
inline bool
LeafIteratorBase<TreeT, RootChildOnIterT>::next()
{
// If the iterator is valid for the current node one level above the leaf level,
// advance the iterator to the node's next child.
if (mIterList.test(LEAF_PARENT_LEVEL) && mIterList.next(LEAF_PARENT_LEVEL)) {
mIterList.down(LEAF_PARENT_LEVEL); // initialize the leaf iterator
return true;
}
Index lvl = LEAF_PARENT_LEVEL;
while (!mIterList.test(LEAF_PARENT_LEVEL)) {
if (mIterList.test(lvl)) {
mIterList.next(lvl);
} else {
do {
// Ascend to the nearest level at which
// one of the iterators is not yet exhausted.
if (lvl == ROOT_LEVEL) return false;
++lvl;
if (mIterList.test(lvl)) mIterList.next(lvl);
} while (!mIterList.test(lvl));
}
// Descend to the lowest child, but not as far as the leaf iterator.
while (lvl > LEAF_PARENT_LEVEL && mIterList.down(lvl)) --lvl;
}
mIterList.down(LEAF_PARENT_LEVEL); // initialize the leaf iterator
return true;
}
////////////////////////////////////////
/// An IteratorRange wraps a tree or node iterator, giving the iterator TBB
/// splittable range semantics.
template<typename IterT>
class IteratorRange
{
public:
IteratorRange(const IterT& iter, size_t grainSize = 8):
mIter(iter),
mGrainSize(grainSize),
mSize(0)
{
mSize = this->size();
}
IteratorRange(IteratorRange& other, tbb::split):
mIter(other.mIter),
mGrainSize(other.mGrainSize),
mSize(other.mSize >> 1)
{
other.increment(mSize);
}
/// @brief Return a reference to this range's iterator.
/// @note The reference is const, because the iterator should not be
/// incremented directly. Use this range object's increment() instead.
const IterT& iterator() const { return mIter; }
bool empty() const { return mSize == 0 || !mIter.test(); }
bool test() const { return !this->empty(); }
operator bool() const { return !this->empty(); }
/// @brief Return @c true if this range is splittable (i.e., if the iterator
/// can be advanced more than mGrainSize times).
bool is_divisible() const { return mSize > mGrainSize; }
/// Advance the iterator @a n times.
void increment(Index n = 1) { for ( ; n > 0 && mSize > 0; --n, --mSize, ++mIter) {} }
/// Advance the iterator to the next item.
IteratorRange& operator++() { this->increment(); return *this; }
/// @brief Advance the iterator to the next item.
/// @return @c true if the iterator is not yet exhausted.
bool next() { this->increment(); return this->test(); }
private:
Index size() const { Index n = 0; for (IterT it(mIter); it.test(); ++n, ++it) {} return n; }
IterT mIter;
size_t mGrainSize;
/// @note mSize is only an estimate of the number of times mIter can be incremented
/// before it is exhausted (because the topology of the underlying tree could change
/// during iteration). For the purpose of range splitting, though, that should be
/// sufficient, since the two halves need not be of exactly equal size.
Index mSize;
};
////////////////////////////////////////
/// @brief Base class for tree-traversal iterators over real and virtual voxel values
/// @todo class TreeVoxelIteratorBase;
} // namespace tree
} // namespace OPENVDB_VERSION_NAME
} // namespace openvdb
#endif // OPENVDB_TREE_TREEITERATOR_HAS_BEEN_INCLUDED
ROOT_LEVEL
#define ROOT_LEVEL
Definition CNanoVDB.h:53
child
ChildT * child
Definition GridBuilder.h:1289
openvdb::v10_0::Coord::min
static Coord min()
Return the smallest possible coordinate.
Definition Coord.h:43
openvdb::v10_0::math::CoordBBox
Axis-aligned bounding box of signed integer coordinates.
Definition Coord.h:249
openvdb::v10_0::math::CoordBBox::min
const Coord & min() const
Definition Coord.h:321
openvdb::v10_0::math::CoordBBox::max
const Coord & max() const
Definition Coord.h:322
openvdb::v10_0::math::Coord
Signed (x, y, z) 32-bit integer coordinates.
Definition Coord.h:25
openvdb::v10_0::math::Coord::offsetBy
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition Coord.h:91
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::setValueOff
void setValueOff(Index lvl) const
Definition TreeIterator.h:595
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::IterListItem
IterListItem(PrevItemT *prev)
Definition TreeIterator.h:529
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::pos
Index pos(Index lvl) const
Definition TreeIterator.h:563
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::NCNodeT
typename IterT::NonConstNodeType NCNodeT
The type of the node with const qualifiers removed ("Non-Const").
Definition TreeIterator.h:518
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::down
bool down(Index lvl)
Definition TreeIterator.h:569
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::isValueOn
bool isValueOn(Index lvl) const
Definition TreeIterator.h:584
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::ChildT
typename CopyConstness< NodeT, typename NodeT::ChildNodeType >::Type ChildT
NodeT's child node type, with the same constness (e.g., const InternalNode<...>).
Definition TreeIterator.h:522
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::IterT
typename IterTraits< typename PrevIterT::NonConstNodeType, PrevIterT >::template NodeConverter< _NodeT >::Type IterT
The type of iterator stored in this list item (e.g., RootNode::ValueOnCIter).
Definition TreeIterator.h:512
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::_NodeT
typename NodeVecT::Front _NodeT
Definition TreeIterator.h:508
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::NCValueT
typename IterT::NonConstValueType NCValueT
The type of value (with const qualifiers removed) to which the iterator points.
Definition TreeIterator.h:520
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::next
bool next(Index lvl)
Definition TreeIterator.h:567
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::test
bool test(Index lvl) const
Definition TreeIterator.h:565
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::initLevel
void initLevel(Index lvl, OtherIterListItemT &otherListItem)
Definition TreeIterator.h:554
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::NodeT
typename IterT::NodeType NodeT
The type of node over which IterT iterates (e.g., const RootNode<...>).
Definition TreeIterator.h:516
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::Level
static const Index Level
NodeT's level in its tree (0 = LeafNode).
Definition TreeIterator.h:527
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::ITraits
IterTraits< NCNodeT, IterT > ITraits
Definition TreeIterator.h:525
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::modifyValue
void modifyValue(Index lvl, const ModifyOp &op) const
Definition TreeIterator.h:598
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::updateBackPointers
void updateBackPointers(PrevItemT *prev)
Definition TreeIterator.h:541
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::NCChildT
typename CopyConstness< NCNodeT, typename NCNodeT::ChildNodeType >::Type NCChildT
NodeT's child node type with const qualifiers removed.
Definition TreeIterator.h:524
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::getCoord
Coord getCoord(Index lvl) const
Definition TreeIterator.h:580
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::getNode
void getNode(Index lvl, NodeT *&node) const
Definition TreeIterator.h:548
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::operator=
IterListItem & operator=(const IterListItem &other)
Definition TreeIterator.h:532
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::setIter
void setIter(const IterT &iter)
Definition TreeIterator.h:546
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::getVoxelCount
Index64 getVoxelCount(Index lvl) const
Definition TreeIterator.h:582
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::getValue
const NCValueT & getValue(Index lvl) const
Definition TreeIterator.h:586
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::setValueOn
void setValueOn(Index lvl, bool on=true) const
Definition TreeIterator.h:594
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::setValue
void setValue(Index lvl, const NCValueT &val) const
Definition TreeIterator.h:593
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::PrevIterT
typename PrevItemT::IterT PrevIterT
The type of iterator stored in the previous list item.
Definition TreeIterator.h:510
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::getChildDim
Index getChildDim(Index lvl) const
Definition TreeIterator.h:581
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, 1, _Level >::IterListItem
IterListItem(const IterListItem &other)
Definition TreeIterator.h:531
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::setValueOff
void setValueOff(Index lvl) const
Definition TreeIterator.h:482
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::pos
Index pos(Index lvl) const
Definition TreeIterator.h:441
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::NCNodeT
typename IterT::NonConstNodeType NCNodeT
The type of the node with const qualifiers removed ("Non-Const").
Definition TreeIterator.h:392
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::down
bool down(Index lvl)
Definition TreeIterator.h:447
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::isValueOn
bool isValueOn(Index lvl) const
Definition TreeIterator.h:463
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::setIter
void setIter(const OtherIterT &iter)
Definition TreeIterator.h:420
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::IterT
typename IterTraits< typename PrevIterT::NonConstNodeType, PrevIterT >::template NodeConverter< _NodeT >::Type IterT
The type of iterator stored in this list item (e.g., InternalNode::ValueOnCIter).
Definition TreeIterator.h:386
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::_NodeT
typename NodeVecT::Front _NodeT
The type of node (non-const) whose iterator is stored in this list item.
Definition TreeIterator.h:384
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::NCValueT
typename IterT::NonConstValueType NCValueT
The type of value (with const qualifiers removed) to which the iterator points.
Definition TreeIterator.h:394
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::next
bool next(Index lvl)
Definition TreeIterator.h:445
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::test
bool test(Index lvl) const
Definition TreeIterator.h:443
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::initLevel
void initLevel(Index lvl, OtherIterListItemT &otherListItem)
Definition TreeIterator.h:430
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::NodeT
typename IterT::NodeType NodeT
The type of node (const or non-const) over which IterT iterates (e.g., const RootNode<....
Definition TreeIterator.h:390
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::Level
static const Index Level
NodeT's level in its tree (0 = LeafNode).
Definition TreeIterator.h:397
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::ITraits
IterTraits< NCNodeT, IterT > ITraits
Definition TreeIterator.h:395
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::updateBackPointers
void updateBackPointers(PrevItemT *=nullptr)
Definition TreeIterator.h:413
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::modifyValue
void modifyValue(Index lvl, const ModifyOp &op) const
Definition TreeIterator.h:488
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::getCoord
Coord getCoord(Index lvl) const
Definition TreeIterator.h:449
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::getNode
void getNode(Index lvl, NodeT *&node) const
Definition TreeIterator.h:422
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::operator=
IterListItem & operator=(const IterListItem &other)
Definition TreeIterator.h:403
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::setIter
void setIter(const IterT &iter)
Definition TreeIterator.h:418
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::getNode
void getNode(Index lvl, OtherNodeT *&node) const
Definition TreeIterator.h:427
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::getVoxelCount
Index64 getVoxelCount(Index lvl) const
Definition TreeIterator.h:458
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::getValue
const NCValueT & getValue(Index lvl) const
Definition TreeIterator.h:468
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::setValueOn
void setValueOn(Index lvl, bool on=true) const
Definition TreeIterator.h:478
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::IterListItem
IterListItem(PrevItemT *)
Definition TreeIterator.h:399
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::setValue
void setValue(Index lvl, const NCValueT &val) const
Definition TreeIterator.h:474
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::PrevIterT
typename PrevItemT::IterT PrevIterT
The type of iterator stored in the previous list item.
Definition TreeIterator.h:382
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::getChildDim
Index getChildDim(Index lvl) const
Definition TreeIterator.h:453
openvdb::v10_0::tree::IterListItem< PrevItemT, NodeVecT, VecSize, 0U >::IterListItem
IterListItem(const IterListItem &other)
Definition TreeIterator.h:401
openvdb::v10_0::tree::IterListItem
An IterListItem is an element of a compile-time linked list of iterators to nodes of different types.
Definition TreeIterator.h:214
openvdb::v10_0::tree::IterListItem::setValueOff
void setValueOff(Index lvl) const
Mark the value to which the iterator at level lvl of the tree points as inactive.
Definition TreeIterator.h:353
openvdb::v10_0::tree::IterListItem::IterListItem
IterListItem(PrevItemT *prev)
Definition TreeIterator.h:238
openvdb::v10_0::tree::IterListItem::pos
Index pos(Index lvl) const
Return The table offset of the iterator at level lvl of the tree.
Definition TreeIterator.h:286
openvdb::v10_0::tree::IterListItem::NCNodeT
typename IterT::NonConstNodeType NCNodeT
The type of the node with const qualifiers removed ("Non-Const").
Definition TreeIterator.h:227
openvdb::v10_0::tree::IterListItem::down
bool down(Index lvl)
If the iterator at level lvl of the tree points to a child node, initialize the next iterator in this...
Definition TreeIterator.h:296
openvdb::v10_0::tree::IterListItem::isValueOn
bool isValueOn(Index lvl) const
Return true if the iterator at level lvl of the tree points to an active value.
Definition TreeIterator.h:324
openvdb::v10_0::tree::IterListItem::ChildT
typename CopyConstness< NodeT, typename NodeT::ChildNodeType >::Type ChildT
NodeT's child node type, with the same constness (e.g., const InternalNode<...>).
Definition TreeIterator.h:231
openvdb::v10_0::tree::IterListItem::setIter
void setIter(const OtherIterT &iter)
Definition TreeIterator.h:256
openvdb::v10_0::tree::IterListItem::IterT
typename IterTraits< typename PrevIterT::NonConstNodeType, PrevIterT >::template NodeConverter< _NodeT >::Type IterT
The type of iterator stored in this list item (e.g., InternalNode::ValueOnCIter).
Definition TreeIterator.h:221
openvdb::v10_0::tree::IterListItem::_NodeT
typename NodeVecT::Front _NodeT
The type of node (non-const) whose iterator is stored in this list item.
Definition TreeIterator.h:219
openvdb::v10_0::tree::IterListItem::NCValueT
typename IterT::NonConstValueType NCValueT
The type of value (with const qualifiers removed) to which the iterator points.
Definition TreeIterator.h:229
openvdb::v10_0::tree::IterListItem::next
bool next(Index lvl)
Increment the iterator at level lvl of the tree.
Definition TreeIterator.h:292
openvdb::v10_0::tree::IterListItem::test
bool test(Index lvl) const
Return true if the iterator at level lvl of the tree has not yet reached its end.
Definition TreeIterator.h:289
openvdb::v10_0::tree::IterListItem::initLevel
void initLevel(Index lvl, OtherIterListItemT &otherListItem)
Initialize the iterator for level lvl of the tree with the node over which the corresponding iterator...
Definition TreeIterator.h:273
openvdb::v10_0::tree::IterListItem::NodeT
typename IterT::NodeType NodeT
The type of node (const or non-const) over which IterT iterates (e.g., const RootNode<....
Definition TreeIterator.h:225
openvdb::v10_0::tree::IterListItem< IterListItem, RestT, VecSize - 1, Level+1 >::Level
static const Index Level
Definition TreeIterator.h:236
openvdb::v10_0::tree::IterListItem::ITraits
IterTraits< NCNodeT, IterT > ITraits
Definition TreeIterator.h:234
openvdb::v10_0::tree::IterListItem::modifyValue
void modifyValue(Index lvl, const ModifyOp &op) const
Apply a functor to the item to which this iterator is pointing.
Definition TreeIterator.h:361
openvdb::v10_0::tree::IterListItem::updateBackPointers
void updateBackPointers(PrevItemT *prev)
Definition TreeIterator.h:252
openvdb::v10_0::tree::IterListItem::NCChildT
typename CopyConstness< NCNodeT, typename NCNodeT::ChildNodeType >::Type NCChildT
NodeT's child node type with const qualifiers removed.
Definition TreeIterator.h:233
openvdb::v10_0::tree::IterListItem::getCoord
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 ...
Definition TreeIterator.h:309
openvdb::v10_0::tree::IterListItem::getNode
void getNode(Index lvl, NodeT *&node) const
Return the node over which this list element's iterator iterates.
Definition TreeIterator.h:259
openvdb::v10_0::tree::IterListItem::operator=
IterListItem & operator=(const IterListItem &other)
Definition TreeIterator.h:242
openvdb::v10_0::tree::IterListItem::setIter
void setIter(const IterT &iter)
Definition TreeIterator.h:254
openvdb::v10_0::tree::IterListItem::getNode
void getNode(Index lvl, OtherNodeT *&node) const
Return the node over which one of the following list elements' iterator iterates.
Definition TreeIterator.h:265
openvdb::v10_0::tree::IterListItem::getVoxelCount
Index64 getVoxelCount(Index lvl) const
Return the number of (virtual) voxels spanned by a tile value or child node.
Definition TreeIterator.h:318
openvdb::v10_0::tree::IterListItem::getValue
const NCValueT & getValue(Index lvl) const
Return the value to which the iterator at level lvl of the tree points.
Definition TreeIterator.h:330
openvdb::v10_0::tree::IterListItem::setValueOn
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 ac...
Definition TreeIterator.h:346
openvdb::v10_0::tree::IterListItem::setValue
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 ac...
Definition TreeIterator.h:339
openvdb::v10_0::tree::IterListItem::PrevIterT
typename PrevItemT::IterT PrevIterT
The type of iterator stored in the previous list item.
Definition TreeIterator.h:217
openvdb::v10_0::tree::IterListItem::getChildDim
Index getChildDim(Index lvl) const
Definition TreeIterator.h:313
openvdb::v10_0::tree::IterListItem::IterListItem
IterListItem(const IterListItem &other)
Definition TreeIterator.h:240
openvdb::v10_0::tree::IteratorRange::operator++
IteratorRange & operator++()
Advance the iterator to the next item.
Definition TreeIterator.h:1336
openvdb::v10_0::tree::IteratorRange::is_divisible
bool is_divisible() const
Return true if this range is splittable (i.e., if the iterator can be advanced more than mGrainSize t...
Definition TreeIterator.h:1331
openvdb::v10_0::tree::IteratorRange::IteratorRange
IteratorRange(const IterT &iter, size_t grainSize=8)
Definition TreeIterator.h:1305
openvdb::v10_0::tree::IteratorRange::test
bool test() const
Definition TreeIterator.h:1326
openvdb::v10_0::tree::IteratorRange::empty
bool empty() const
Definition TreeIterator.h:1325
openvdb::v10_0::tree::IteratorRange::next
bool next()
Advance the iterator to the next item.
Definition TreeIterator.h:1339
openvdb::v10_0::tree::IteratorRange::iterator
const IterT & iterator() const
Return a reference to this range's iterator.
Definition TreeIterator.h:1323
openvdb::v10_0::tree::IteratorRange::IteratorRange
IteratorRange(IteratorRange &other, tbb::split)
Definition TreeIterator.h:1312
openvdb::v10_0::tree::IteratorRange::increment
void increment(Index n=1)
Advance the iterator n times.
Definition TreeIterator.h:1334
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::LEAF_PARENT_LEVEL
static const Index LEAF_PARENT_LEVEL
Definition TreeIterator.h:1196
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::LEAF_LEVEL
static const Index LEAF_LEVEL
Definition TreeIterator.h:1196
openvdb::v10_0::tree::LeafIteratorBase::test
bool test() const
Definition TreeIterator.h:1239
openvdb::v10_0::tree::LeafIteratorBase::LeafIteratorBase
LeafIteratorBase()
Definition TreeIterator.h:1200
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::NCRootNodeT
typename RootIterT::NonConstNodeType NCRootNodeT
Definition TreeIterator.h:1191
openvdb::v10_0::tree::LeafIteratorBase::LeafIteratorBase
LeafIteratorBase(const LeafIteratorBase &other)
Definition TreeIterator.h:1213
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::NCLeafNodeT
typename InvTreeT::Front NCLeafNodeT
Definition TreeIterator.h:1194
openvdb::v10_0::tree::LeafIteratorBase::operator*
LeafNodeT & operator*() const
Definition TreeIterator.h:1235
openvdb::v10_0::tree::LeafIteratorBase::operator=
LeafIteratorBase & operator=(const LeafIteratorBase &other)
Definition TreeIterator.h:1217
openvdb::v10_0::tree::LeafIteratorBase::next
bool next()
Advance the iterator to the next leaf node.
Definition TreeIterator.h:1266
openvdb::v10_0::tree::LeafIteratorBase::operator++
LeafIteratorBase & operator++()
Definition TreeIterator.h:1246
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::InvTreeT
typename iter::InvertedTree< NCRootNodeT, ROOT_LEVEL >::Type InvTreeT
Definition TreeIterator.h:1193
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::RootIterTraits
IterTraits< NCRootNodeT, RootIterT > RootIterTraits
Definition TreeIterator.h:1198
openvdb::v10_0::tree::LeafIteratorBase::LeafIteratorBase
LeafIteratorBase(TreeT &tree)
Definition TreeIterator.h:1202
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::ROOT_LEVEL
static const Index ROOT_LEVEL
Definition TreeIterator.h:1192
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::LeafNodeT
typename CopyConstness< RootNodeT, NCLeafNodeT >::Type LeafNodeT
Definition TreeIterator.h:1195
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::RootIterT
typename RootNodeType::ChildOnIter RootIterT
Definition TreeIterator.h:1189
openvdb::v10_0::tree::LeafIteratorBase::getLeaf
LeafNodeT * getLeaf() const
Return the leaf node to which the iterator is pointing.
Definition TreeIterator.h:1229
openvdb::v10_0::tree::LeafIteratorBase< Tree, typename RootNodeType::ChildOnIter >::RootNodeT
typename RootIterT::NodeType RootNodeT
Definition TreeIterator.h:1190
openvdb::v10_0::tree::LeafIteratorBase::increment
void increment(Index n)
Increment the iterator n times.
Definition TreeIterator.h:1249
openvdb::v10_0::tree::LeafIteratorBase::increment
void increment()
Definition TreeIterator.h:1245
openvdb::v10_0::tree::LeafIteratorBase::getTree
TreeT * getTree() const
Definition TreeIterator.h:1251
openvdb::v10_0::tree::LeafIteratorBase::operator->
LeafNodeT * operator->() const
Definition TreeIterator.h:1236
openvdb::v10_0::tree::NodeIteratorBase
Base class for tree-traversal iterators over all nodes.
Definition TreeIterator.h:936
openvdb::v10_0::tree::NodeIteratorBase::getMaxDepth
Index getMaxDepth() const
Return the depth of the lowest level of the tree to which this iterator ascends.
Definition TreeIterator.h:961
openvdb::v10_0::tree::NodeIteratorBase::getDepth
Index getDepth() const
Return the depth in the tree (0 = root) of the node to which this iterator is currently pointing.
Definition TreeIterator.h:983
openvdb::v10_0::tree::NodeIteratorBase::getLevel
Index getLevel() const
Return the level in the tree (0 = leaf) of the node to which this iterator is currently pointing.
Definition TreeIterator.h:980
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::ROOT_DEPTH
static const Index ROOT_DEPTH
Definition TreeIterator.h:944
openvdb::v10_0::tree::NodeIteratorBase::getMinDepth
Index getMinDepth() const
Return the depth of the highest level of the tree to which this iterator ascends.
Definition TreeIterator.h:957
openvdb::v10_0::tree::NodeIteratorBase::getCoord
Coord getCoord() const
Return the global coordinates of the voxel or tile to which this iterator is currently pointing.
Definition TreeIterator.h:1133
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::LEAF_LEVEL
static const Index LEAF_LEVEL
Definition TreeIterator.h:944
openvdb::v10_0::tree::NodeIteratorBase::getBoundingBox
bool getBoundingBox(CoordBBox &bbox) const
Return in bbox the axis-aligned bounding box of the voxel or tile to which this iterator is currently...
Definition TreeIterator.h:1144
openvdb::v10_0::tree::NodeIteratorBase::test
bool test() const
Return true if this iterator is not yet exhausted.
Definition TreeIterator.h:965
openvdb::v10_0::tree::NodeIteratorBase::operator=
NodeIteratorBase & operator=(const NodeIteratorBase &other)
Definition TreeIterator.h:1065
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::NCRootNodeT
typename RootIterT::NonConstNodeType NCRootNodeT
Definition TreeIterator.h:941
openvdb::v10_0::tree::NodeIteratorBase::NodeIteratorBase
NodeIteratorBase()
Definition TreeIterator.h:1024
openvdb::v10_0::tree::NodeIteratorBase::getLeafDepth
static Index getLeafDepth()
Definition TreeIterator.h:984
openvdb::v10_0::tree::NodeIteratorBase::next
bool next()
Advance to the next tile or voxel value.
Definition TreeIterator.h:1101
openvdb::v10_0::tree::NodeIteratorBase::setMinDepth
void setMinDepth(Index minDepth)
Specify the depth of the highest level of the tree to which to ascend (depth 0 = root).
Definition TreeIterator.h:1082
openvdb::v10_0::tree::NodeIteratorBase::getNode
void getNode(const NodeT *&node) const
Definition TreeIterator.h:1004
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::InvTreeT
typename iter::InvertedTree< NCRootNodeT, ROOT_LEVEL >::Type InvTreeT
Definition TreeIterator.h:943
openvdb::v10_0::tree::NodeIteratorBase::operator++
NodeIteratorBase & operator++()
Definition TreeIterator.h:974
openvdb::v10_0::tree::NodeIteratorBase::getNode
void getNode(NodeT *&node) const
Return the node to which the iterator is pointing.
Definition TreeIterator.h:1002
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::RootIterTraits
IterTraits< NCRootNodeT, RootIterT > RootIterTraits
Definition TreeIterator.h:946
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::TreeT
Tree TreeT
Definition TreeIterator.h:938
openvdb::v10_0::tree::NodeIteratorBase::setMaxDepth
void setMaxDepth(Index maxDepth)
Specify the depth of the lowest level of the tree to which to descend (depth 0 = root).
Definition TreeIterator.h:1091
openvdb::v10_0::tree::NodeIteratorBase::summary
std::string summary() const
Definition TreeIterator.h:1164
openvdb::v10_0::tree::NodeIteratorBase::NodeIteratorBase
NodeIteratorBase(TreeT &)
Definition TreeIterator.h:1037
openvdb::v10_0::tree::NodeIteratorBase::NodeIteratorBase
NodeIteratorBase(const NodeIteratorBase &other)
Definition TreeIterator.h:1051
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::ROOT_LEVEL
static const Index ROOT_LEVEL
Definition TreeIterator.h:942
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::RootIterT
typename RootNodeType::ChildOnIter RootIterT
Definition TreeIterator.h:939
openvdb::v10_0::tree::NodeIteratorBase::getBoundingBox
CoordBBox getBoundingBox() const
Return the axis-aligned bounding box of the voxel or tile to which this iterator is currently pointin...
Definition TreeIterator.h:995
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::LEAF_DEPTH
static const Index LEAF_DEPTH
Definition TreeIterator.h:944
openvdb::v10_0::tree::NodeIteratorBase< Tree, typename RootNodeType::ChildOnIter >::RootNodeT
typename RootIterT::NodeType RootNodeT
Definition TreeIterator.h:940
openvdb::v10_0::tree::NodeIteratorBase::increment
void increment(Index n)
Increment the iterator n times.
Definition TreeIterator.h:976
openvdb::v10_0::tree::NodeIteratorBase::increment
void increment()
Advance the iterator to the next leaf node.
Definition TreeIterator.h:973
openvdb::v10_0::tree::NodeIteratorBase::getTree
TreeT * getTree() const
Definition TreeIterator.h:1007
openvdb::v10_0::tree::TreeValueIteratorBase
Base class for tree-traversal iterators over tile and voxel values.
Definition TreeIterator.h:617
openvdb::v10_0::tree::TreeValueIteratorBase::isVoxelValue
bool isVoxelValue() const
Return true if this iterator is currently pointing to a (leaf) voxel value.
Definition TreeIterator.h:686
openvdb::v10_0::tree::TreeValueIteratorBase::setValue
void setValue(const ValueT &val) const
Change the tile or voxel value to which this iterator is currently pointing and mark it as active.
Definition TreeIterator.h:699
openvdb::v10_0::tree::TreeValueIteratorBase::getMaxDepth
Index getMaxDepth() const
Return the depth of the lowest level of the tree to which this iterator ascends.
Definition TreeIterator.h:640
openvdb::v10_0::tree::TreeValueIteratorBase::getDepth
Index getDepth() const
Return the depth in the tree (0 = root) of the node to which this iterator is currently pointing.
Definition TreeIterator.h:659
openvdb::v10_0::tree::TreeValueIteratorBase::getLevel
Index getLevel() const
Return the level in the tree (0 = leaf) of the node to which this iterator is currently pointing.
Definition TreeIterator.h:656
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::ValueT
typename ValueIterT::NonConstValueType ValueT
Definition TreeIterator.h:622
openvdb::v10_0::tree::TreeValueIteratorBase::isValueOn
bool isValueOn() const
Return true if the value to which this iterator is currently pointing is active.
Definition TreeIterator.h:688
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::ROOT_DEPTH
static const Index ROOT_DEPTH
Definition TreeIterator.h:626
openvdb::v10_0::tree::TreeValueIteratorBase::getMinDepth
Index getMinDepth() const
Return the depth of the highest level of the tree to which this iterator ascends.
Definition TreeIterator.h:636
openvdb::v10_0::tree::TreeValueIteratorBase::getValue
const ValueT & getValue() const
Return the tile or voxel value to which this iterator is currently pointing.
Definition TreeIterator.h:692
openvdb::v10_0::tree::TreeValueIteratorBase::modifyValue
void modifyValue(const ModifyOp &op) const
Apply a functor to the item to which this iterator is pointing. (Not valid for const iterators....
Definition TreeIterator.h:712
openvdb::v10_0::tree::TreeValueIteratorBase::getCoord
Coord getCoord() const
Return the global coordinates of the voxel or tile to which this iterator is currently pointing.
Definition TreeIterator.h:671
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::LEAF_LEVEL
static const Index LEAF_LEVEL
Definition TreeIterator.h:626
openvdb::v10_0::tree::TreeValueIteratorBase::test
bool test() const
Return true if this iterator is not yet exhausted.
Definition TreeIterator.h:644
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::ValueIterT
typename RootNodeType::ValueAllIter ValueIterT
Definition TreeIterator.h:620
openvdb::v10_0::tree::TreeValueIteratorBase::getNode
void getNode(NodeType *&node) const
Return in node a pointer to the node over which this iterator is currently iterating or one of that n...
Definition TreeIterator.h:667
openvdb::v10_0::tree::TreeValueIteratorBase::isTileValue
bool isTileValue() const
Return true if this iterator is currently pointing to a (non-leaf) tile value.
Definition TreeIterator.h:684
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::ChildOnIterT
typename NodeT::ChildOnCIter ChildOnIterT
Definition TreeIterator.h:623
openvdb::v10_0::tree::TreeValueIteratorBase::setValueOff
void setValueOff() const
Mark the tile or voxel value to which this iterator is currently pointing as inactive.
Definition TreeIterator.h:704
openvdb::v10_0::tree::TreeValueIteratorBase::getLeafDepth
static Index getLeafDepth()
Definition TreeIterator.h:660
openvdb::v10_0::tree::TreeValueIteratorBase::next
bool next()
Advance to the next tile or voxel value. Return true if this iterator is not yet exhausted.
Definition TreeIterator.h:805
openvdb::v10_0::tree::TreeValueIteratorBase::operator=
TreeValueIteratorBase & operator=(const TreeValueIteratorBase &other)
Definition TreeIterator.h:768
openvdb::v10_0::tree::TreeValueIteratorBase::setMinDepth
void setMinDepth(Index minDepth)
Specify the depth of the highest level of the tree to which to ascend (depth 0 = root).
Definition TreeIterator.h:786
openvdb::v10_0::tree::TreeValueIteratorBase::getVoxelCount
Index64 getVoxelCount() const
Return the number of (virtual) voxels corresponding to the value.
Definition TreeIterator.h:681
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::NodeT
typename ValueIterT::NodeType NodeT
Definition TreeIterator.h:621
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::TreeT
Tree TreeT
Definition TreeIterator.h:619
openvdb::v10_0::tree::TreeValueIteratorBase::setMaxDepth
void setMaxDepth(Index maxDepth)
Specify the depth of the lowest level of the tree to which to descend (depth 0 = root).
Definition TreeIterator.h:795
openvdb::v10_0::tree::TreeValueIteratorBase::operator*
const ValueT & operator*() const
Definition TreeIterator.h:693
openvdb::v10_0::tree::TreeValueIteratorBase::summary
std::string summary() const
Return a string (for debugging, mainly) describing this iterator's current state.
Definition TreeIterator.h:908
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::ROOT_LEVEL
static const Index ROOT_LEVEL
Definition TreeIterator.h:624
openvdb::v10_0::tree::TreeValueIteratorBase::TreeValueIteratorBase
TreeValueIteratorBase(TreeT &)
Definition TreeIterator.h:737
openvdb::v10_0::tree::TreeValueIteratorBase::getBoundingBox
CoordBBox getBoundingBox() const
Return the axis-aligned bounding box of the voxel or tile to which this iterator is currently pointin...
Definition TreeIterator.h:678
openvdb::v10_0::tree::TreeValueIteratorBase::operator->
const ValueT * operator->() const
Definition TreeIterator.h:694
openvdb::v10_0::tree::TreeValueIteratorBase< Tree, typename RootNodeType::ValueAllIter >::LEAF_DEPTH
static const Index LEAF_DEPTH
Definition TreeIterator.h:626
openvdb::v10_0::tree::TreeValueIteratorBase::operator++
TreeValueIteratorBase & operator++()
Advance to the next tile or voxel value.
Definition TreeIterator.h:652
openvdb::v10_0::tree::TreeValueIteratorBase::setActiveState
void setActiveState(bool on) const
Change the active/inactive state of the tile or voxel value to which this iterator is currently point...
Definition TreeIterator.h:702
openvdb::v10_0::tree::TreeValueIteratorBase::getTree
TreeT * getTree() const
Return a pointer to the tree over which this iterator is iterating.
Definition TreeIterator.h:715
openvdb::v10_0::tree::TreeValueIteratorBase::getBoundingBox
bool getBoundingBox(CoordBBox &) const
Return in bbox the axis-aligned bounding box of the voxel or tile to which this iterator is currently...
Definition TreeIterator.h:894
openvdb::v10_0::tree::TreeValueIteratorBase::TreeValueIteratorBase
TreeValueIteratorBase(const TreeValueIteratorBase &other)
Definition TreeIterator.h:753
openvdb::v10_0::tree::iter
Definition TreeIterator.h:29
openvdb::v10_0::tree
Definition PointDataGrid.h:169
openvdb::v10_0::Index
Index32 Index
Definition Types.h:54
openvdb::v10_0::Index64
uint64_t Index64
Definition Types.h:53
openvdb
Definition Exceptions.h:13
Types.h
openvdb::v10_0::CopyConstness::Type
typename std::remove_const< ToType >::type Type
Definition Types.h:400
openvdb::v10_0::TypeList
A list of types (not necessarily unique).
Definition TypeList.h:484
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllCIter >::NodeConverter
Definition TreeIterator.h:133
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllCIter >::NodeConverter::Type
typename OtherNodeT::ChildAllCIter Type
Definition TreeIterator.h:134
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllCIter >::begin
static IterT begin(const NodeT &node)
Definition TreeIterator.h:128
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllCIter >::IterT
typename NodeT::ChildAllCIter IterT
Definition TreeIterator.h:127
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllCIter >::getChild
static ChildT * getChild(const IterT &iter)
Definition TreeIterator.h:129
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllIter >::NodeConverter
Definition TreeIterator.h:119
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllIter >::NodeConverter::Type
typename OtherNodeT::ChildAllIter Type
Definition TreeIterator.h:120
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllIter >::IterT
typename NodeT::ChildAllIter IterT
Definition TreeIterator.h:113
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllIter >::begin
static IterT begin(NodeT &node)
Definition TreeIterator.h:114
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildAllIter >::getChild
static ChildT * getChild(const IterT &iter)
Definition TreeIterator.h:115
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOffCIter >::NodeConverter
Definition TreeIterator.h:105
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOffCIter >::NodeConverter::Type
typename OtherNodeT::ChildOffCIter Type
Definition TreeIterator.h:106
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOffCIter >::begin
static IterT begin(const NodeT &node)
Definition TreeIterator.h:104
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOffCIter >::IterT
typename NodeT::ChildOffCIter IterT
Definition TreeIterator.h:103
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOffIter >::NodeConverter
Definition TreeIterator.h:95
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOffIter >::NodeConverter::Type
typename OtherNodeT::ChildOffIter Type
Definition TreeIterator.h:96
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOffIter >::begin
static IterT begin(NodeT &node)
Definition TreeIterator.h:94
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOffIter >::IterT
typename NodeT::ChildOffIter IterT
Definition TreeIterator.h:93
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnCIter >::NodeConverter
Definition TreeIterator.h:85
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnCIter >::NodeConverter::Type
typename OtherNodeT::ChildOnCIter Type
Definition TreeIterator.h:86
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnCIter >::begin
static IterT begin(const NodeT &node)
Definition TreeIterator.h:81
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnCIter >::getChild
static const ChildT * getChild(const IterT &iter)
Definition TreeIterator.h:82
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnCIter >::IterT
typename NodeT::ChildOnCIter IterT
Definition TreeIterator.h:80
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnIter >::NodeConverter
Definition TreeIterator.h:72
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnIter >::NodeConverter::Type
typename OtherNodeT::ChildOnIter Type
Definition TreeIterator.h:73
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnIter >::begin
static IterT begin(NodeT &node)
Definition TreeIterator.h:68
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnIter >::IterT
typename NodeT::ChildOnIter IterT
Definition TreeIterator.h:67
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ChildOnIter >::getChild
static ChildT * getChild(const IterT &iter)
Definition TreeIterator.h:69
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueAllCIter >::NodeConverter
Definition TreeIterator.h:193
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueAllCIter >::NodeConverter::Type
typename OtherNodeT::ValueAllCIter Type
Definition TreeIterator.h:194
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueAllCIter >::begin
static IterT begin(const NodeT &node)
Definition TreeIterator.h:192
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueAllCIter >::IterT
typename NodeT::ValueAllCIter IterT
Definition TreeIterator.h:191
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueAllIter >::NodeConverter
Definition TreeIterator.h:183
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueAllIter >::NodeConverter::Type
typename OtherNodeT::ValueAllIter Type
Definition TreeIterator.h:184
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueAllIter >::begin
static IterT begin(NodeT &node)
Definition TreeIterator.h:182
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueAllIter >::IterT
typename NodeT::ValueAllIter IterT
Definition TreeIterator.h:181
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOffCIter >::NodeConverter
Definition TreeIterator.h:173
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOffCIter >::NodeConverter::Type
typename OtherNodeT::ValueOffCIter Type
Definition TreeIterator.h:174
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOffCIter >::begin
static IterT begin(const NodeT &node)
Definition TreeIterator.h:172
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOffCIter >::IterT
typename NodeT::ValueOffCIter IterT
Definition TreeIterator.h:171
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOffIter >::NodeConverter
Definition TreeIterator.h:163
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOffIter >::NodeConverter::Type
typename OtherNodeT::ValueOffIter Type
Definition TreeIterator.h:164
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOffIter >::begin
static IterT begin(NodeT &node)
Definition TreeIterator.h:162
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOffIter >::IterT
typename NodeT::ValueOffIter IterT
Definition TreeIterator.h:161
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOnCIter >::NodeConverter
Definition TreeIterator.h:153
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOnCIter >::NodeConverter::Type
typename OtherNodeT::ValueOnCIter Type
Definition TreeIterator.h:154
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOnCIter >::begin
static IterT begin(const NodeT &node)
Definition TreeIterator.h:152
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOnCIter >::IterT
typename NodeT::ValueOnCIter IterT
Definition TreeIterator.h:151
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOnIter >::NodeConverter
Definition TreeIterator.h:143
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOnIter >::NodeConverter::Type
typename OtherNodeT::ValueOnIter Type
Definition TreeIterator.h:144
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOnIter >::IterT
typename NodeT::ValueOnIter IterT
Definition TreeIterator.h:141
openvdb::v10_0::tree::IterTraits< NodeT, typename NodeT::ValueOnIter >::begin
static IterT begin(NodeT &node)
Definition TreeIterator.h:142
openvdb::v10_0::tree::IterTraits
Definition TreeIterator.h:60
openvdb::v10_0::tree::IterTraits::getChild
static ChildT * getChild(const IterT &)
Definition TreeIterator.h:61
openvdb::v10_0::tree::iter::InvertedTree< HeadT, 1 >::Type
TypeList< typename HeadT::ChildNodeType, HeadT > Type
Definition TreeIterator.h:38
openvdb::v10_0::tree::iter::InvertedTree
Definition TreeIterator.h:32
openvdb::v10_0::tree::iter::InvertedTree::Type
typename SubtreeT::template Append< HeadT > Type
Definition TreeIterator.h:34
openvdb::v10_0::tree::iter::InvertedTree::SubtreeT
typename InvertedTree< typename HeadT::ChildNodeType, HeadLevel-1 >::Type SubtreeT
Definition TreeIterator.h:33
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:212