OpenVDB  1.2.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Tree< _RootNodeType > Class Template Reference

#include <Tree.h>

Inherits TreeBase.

Classes

struct  ValueConverter
 ValueConverter<T>::Type is the type of a tree having the same hierarchy as this tree but a different value type, T. More...
 

Public Types

typedef boost::shared_ptr< TreePtr
 
typedef boost::shared_ptr
< const Tree
ConstPtr
 
typedef _RootNodeType RootNodeType
 
typedef RootNodeType::ValueType ValueType
 
typedef RootNodeType::LeafNodeType LeafNodeType
 
typedef TreeValueIteratorBase
< Tree, typename
RootNodeType::ValueAllIter > 
ValueAllIter
 
typedef TreeValueIteratorBase
< const Tree, typename
RootNodeType::ValueAllCIter > 
ValueAllCIter
 
typedef TreeValueIteratorBase
< Tree, typename
RootNodeType::ValueOnIter > 
ValueOnIter
 
typedef TreeValueIteratorBase
< const Tree, typename
RootNodeType::ValueOnCIter > 
ValueOnCIter
 
typedef TreeValueIteratorBase
< Tree, typename
RootNodeType::ValueOffIter > 
ValueOffIter
 
typedef TreeValueIteratorBase
< const Tree, typename
RootNodeType::ValueOffCIter > 
ValueOffCIter
 
typedef NodeIteratorBase< Tree,
typename
RootNodeType::ChildOnIter > 
NodeIter
 Iterator over all nodes in this tree. More...
 
typedef NodeIteratorBase
< const Tree, typename
RootNodeType::ChildOnCIter > 
NodeCIter
 Iterator over all nodes in this tree. More...
 
typedef LeafIteratorBase< Tree,
typename
RootNodeType::ChildOnIter > 
LeafIter
 Iterator over all leaf nodes in this tree. More...
 
typedef LeafIteratorBase
< const Tree, typename
RootNodeType::ChildOnCIter > 
LeafCIter
 Iterator over all leaf nodes in this tree. More...
 

Public Member Functions

 Tree ()
 
 Tree (const Tree &other)
 Deep copy constructor. More...
 
template<typename OtherTreeType >
 Tree (const OtherTreeType &other, const ValueType &inactiveValue, const ValueType &activeValue, TopologyCopy)
 Topology copy constructor from a tree of a different type. More...
 
template<typename OtherTreeType >
 Tree (const OtherTreeType &other, const ValueType &background, TopologyCopy)
 Topology copy constructor from a tree of a different type. More...
 
 Tree (const ValueType &background)
 Empty tree constructor. More...
 
virtual ~Tree ()
 
virtual TreeBase::Ptr copy () const
 Return a pointer to a deep copy of this tree. More...
 
virtual Name valueType () const
 Return the name of the type of a voxel's value (e.g., "float" or "vec3d") More...
 
virtual const Nametype () const
 Return the name of this type of tree. More...
 
bool operator== (const Tree &) const
 
bool operator!= (const Tree &) const
 
template<typename OtherRootNodeType >
bool hasSameTopology (const Tree< OtherRootNodeType > &other) const
 Return true if the given tree has the same node and active value topology as this tree (but possibly a different ValueType). More...
 
virtual bool evalLeafBoundingBox (CoordBBox &bbox) const
 Return in bbox the axis-aligned bounding box of all leaf nodes. More...
 
virtual bool evalActiveVoxelBoundingBox (CoordBBox &bbox) const
 Return in bbox the axis-aligned bounding box of all active voxels and tiles. This is a tighter bounding box than the leaf node bounding box. More...
 
virtual bool evalActiveVoxelDim (Coord &dim) const
 Return in dim the dimensions of the axis-aligned bounding box of all active voxels. This is a tighter bounding box than the leaf node bounding box. More...
 
virtual bool evalLeafDim (Coord &dim) const
 Return in dim the dimensions of the axis-aligned bounding box of all leaf nodes. More...
 
virtual void readTopology (std::istream &, bool saveFloatAsHalf=false)
 Read the tree topology from a stream. More...
 
virtual void writeTopology (std::ostream &, bool saveFloatAsHalf=false) const
 Write the tree topology to a stream. More...
 
virtual void readBuffers (std::istream &, bool saveFloatAsHalf=false)
 Read all data buffers for this tree. More...
 
virtual void writeBuffers (std::ostream &, bool saveFloatAsHalf=false) const
 Write out all data buffers for this tree. More...
 
virtual void print (std::ostream &os=std::cout, int verboseLevel=1) const
 Print statistics, memory usage and other information about this tree. More...
 
virtual Index treeDepth () const
 Return the depth of this tree. More...
 
virtual Index32 leafCount () const
 Return the number of leaf nodes. More...
 
virtual Index32 nonLeafCount () const
 Return the number of non-leaf nodes. More...
 
virtual Index64 activeLeafVoxelCount () const
 Return the number of active voxels stored in leaf nodes. More...
 
virtual Index64 inactiveLeafVoxelCount () const
 Return the number of inactive voxels stored in leaf nodes. More...
 
virtual Index64 activeVoxelCount () const
 Return the total number of active voxels. More...
 
virtual Index64 inactiveVoxelCount () const
 Return the number of inactive voxels within the bounding box of all active voxels. More...
 
void evalMinMax (ValueType &min, ValueType &max) const
 Return the minimum and maximum active values in this tree. More...
 
virtual Index64 memUsage () const
 Return the total amount of memory in bytes occupied by this tree. More...
 
const ValueTypegetValue (const Coord &xyz) const
 Return the value of the voxel at the given coordinates. More...
 
template<typename AccessT >
const ValueTypegetValue (const Coord &xyz, AccessT &) const
 Return the value of the voxel at the given coordinates and update the given accessor's node cache. More...
 
int getValueDepth (const Coord &xyz) const
 Return the tree depth (0 = root) at which the value of voxel (x, y, z) resides. More...
 
void setValue (const Coord &xyz, const ValueType &value)
 Set the value of the voxel at the given coordinates and mark the voxel as active. More...
 
void setValueOnly (const Coord &xyz, const ValueType &value)
 Set the value of the voxel at the given coordinates but preserve it active state. More...
 
template<typename AccessT >
void setValue (const Coord &xyz, const ValueType &value, AccessT &)
 Set the value of the voxel at the given coordinates, mark the voxel as active, and update the given accessor's node cache. More...
 
void setValueOn (const Coord &xyz)
 Mark the voxel at the given coordinates as active, but don't change its value. More...
 
void setValueOn (const Coord &xyz, const ValueType &value)
 Set the value of the voxel at the given coordinates and mark the voxel as active. More...
 
void setValueOnMin (const Coord &xyz, const ValueType &value)
 Set the value of the voxel at the given coordinates to the minimum of its current value and the given value, and mark the voxel as active. More...
 
void setValueOnMax (const Coord &xyz, const ValueType &value)
 Set the value of the voxel at the given coordinates to the maximum of its current value and the given value, and mark the voxel as active. More...
 
void setValueOnSum (const Coord &xyz, const ValueType &value)
 Set the value of the voxel at the given coordinates to the sum of its current value and the given value, and mark the voxel as active. More...
 
void setValueOff (const Coord &xyz)
 Mark the voxel at the given coordinates as inactive, but don't change its value. More...
 
void setValueOff (const Coord &xyz, const ValueType &value)
 Change the value of the voxel at the given coordinates and mark the voxel as inactive. More...
 
void setActiveState (const Coord &xyz, bool on)
 Set the active state of the voxel at the given coordinates, but don't change its value. More...
 
bool probeValue (const Coord &xyz, ValueType &value) const
 Get the value of the voxel at the given coordinates. More...
 
bool isValueOn (const Coord &xyz) const
 Return true if the value at the given coordinates is active. More...
 
bool isValueOff (const Coord &xyz) const
 Return true if the value at the given coordinates is inactive. More...
 
bool hasActiveTiles () const
 Return true if this tree has any active tiles. More...
 
void fill (const CoordBBox &bbox, const ValueType &value, bool active=true)
 Set all voxels within a given axis-aligned box to a constant value. If necessary, subdivide tiles that intersect the box. More...
 
template<typename PruneOp >
void pruneOp (PruneOp &)
 
void prune (const ValueType &tolerance=zeroVal< ValueType >())
 Reduce the memory footprint of this tree by replacing with tiles any nodes whose values are all the same (optionally to within a tolerance) and have the same active state. More...
 
void pruneInactive (const ValueType &)
 Reduce the memory footprint of this tree by replacing with tiles of the given value any nodes whose values are all inactive. More...
 
void pruneInactive ()
 Reduce the memory footprint of this tree by replacing with background tiles any nodes whose values are all inactive. More...
 
void pruneLevelSet ()
 Prune any descendants whose values are all inactive and replace them with inactive tiles having a values equal to the first value encountered in the (inactive) child. More...
 
void addLeaf (LeafNodeType &leaf)
 Add the given leaf node to this tree, creating a new branch if necessary. If a leaf node with the same origin already exists, replace it. More...
 
void addTile (Index level, const Coord &xyz, const ValueType &value, bool active)
 Add a tile containing voxel (x, y, z) at the specified tree level, creating a new branch if necessary. Delete any existing lower-level nodes that contain (x, y, z). More...
 
template<typename NodeT >
NodeT * stealNode (const Coord &xyz, const ValueType &value, bool active)
 Return a pointer to the node of type NodeT that contains voxel (x, y, z) and replace it with a tile of the specified value and state. If no such node exists, leave the tree unchanged and return NULL. More...
 
LeafNodeTypetouchLeaf (const Coord &xyz)
 
LeafNodeTypeprobeLeaf (const Coord &xyz)
 
const LeafNodeTypeprobeConstLeaf (const Coord &xyz) const
 
const LeafNodeTypeprobeLeaf (const Coord &xyz) const
 
bool empty () const
 Return true if this tree contains no nodes other than the root node and no tiles other than background tiles. More...
 
void clear ()
 Remove all tiles from this tree and all nodes other than the root node. More...
 
void clearAllAccessors ()
 Clear all registered accessors. More...
 
virtual Metadata::Ptr getBackgroundValue () const
 Return this tree's background value wrapped as metadata. More...
 
const ValueTypebackground () const
 Return this tree's background value. More...
 
OPENVDB_DEPRECATED ValueType getBackground () const
 
void setBackground (const ValueType &background)
 Replace this tree's background value. More...
 
virtual void getIndexRange (CoordBBox &bbox) const
 Min and max are both inclusive. More...
 
void signedFloodFill ()
 Set the values of all inactive voxels and tiles of a narrow-band level set from the signs of the active voxels, setting outside values to +background and inside values to -background. More...
 
void signedFloodFill (const ValueType &outside, const ValueType &inside)
 Set the values of all inactive voxels and tiles of a narrow-band level set from the signs of the active voxels, setting exterior values to outside and interior values to inside. Set the background value of this tree to outside. More...
 
void merge (Tree &other)
 
void voxelizeActiveTiles ()
 Turns active tiles into dense voxels, i.e. active leaf nodes. More...
 
template<typename OtherRootNodeType >
void topologyUnion (const Tree< OtherRootNodeType > &other)
 Union this tree's set of active values with the active values of the other tree, whose ValueType may be different. More...
 
template<typename CombineOp >
void combine (Tree &other, CombineOp &op, bool prune=false)
 
template<typename CombineOp >
void combine (Tree &other, const CombineOp &op, bool prune=false)
 
template<typename ExtendedCombineOp >
void combineExtended (Tree &other, ExtendedCombineOp &op, bool prune=false)
 
template<typename ExtendedCombineOp >
void combineExtended (Tree &other, const ExtendedCombineOp &op, bool prune=false)
 
template<typename CombineOp >
void combine2 (const Tree &a, const Tree &b, CombineOp &op, bool prune=false)
 
template<typename CombineOp >
void combine2 (const Tree &a, const Tree &b, const CombineOp &op, bool prune=false)
 
template<typename ExtendedCombineOp >
void combine2Extended (const Tree &a, const Tree &b, ExtendedCombineOp &op, bool prune=false)
 
template<typename ExtendedCombineOp >
void combine2Extended (const Tree &a, const Tree &b, const ExtendedCombineOp &, bool prune=false)
 
template<typename BBoxOp >
void visitActiveBBox (BBoxOp &op) const
 
template<typename VisitorOp >
void visit (VisitorOp &op)
 
template<typename VisitorOp >
void visit (const VisitorOp &op)
 
template<typename VisitorOp >
void visit (VisitorOp &op) const
 
template<typename VisitorOp >
void visit (const VisitorOp &op) const
 
template<typename OtherTreeType , typename VisitorOp >
void visit2 (OtherTreeType &other, VisitorOp &op)
 
template<typename OtherTreeType , typename VisitorOp >
void visit2 (OtherTreeType &other, const VisitorOp &op)
 
template<typename OtherTreeType , typename VisitorOp >
void visit2 (OtherTreeType &other, VisitorOp &op) const
 
template<typename OtherTreeType , typename VisitorOp >
void visit2 (OtherTreeType &other, const VisitorOp &op) const
 
template<typename IterT >
IterT begin ()
 Return an iterator of type IterT (for example, begin<ValueOnIter>() is equivalent to beginValueOn()). More...
 
template<typename CIterT >
CIterT cbegin () const
 Return a const iterator of type CIterT (for example, cbegin<ValueOnCIter>() is equivalent to cbeginValueOn()). More...
 
template<typename IterT >
IterT cbegin () const
 
template<typename AccessT >
const RootNodeType::ValueType & getValue (const Coord &xyz, AccessT &accessor) const
 
RootNodeTyperoot ()
 Return this tree's root node. More...
 
const RootNodeTyperoot () const
 Return this tree's root node. More...
 
RootNodeTypegetRootNode ()
 Return this tree's root node. More...
 
const RootNodeTypegetRootNode () const
 Return this tree's root node. More...
 
void attachAccessor (ValueAccessorBase< Tree > &) const
 Register an accessor for this tree. Registered accessors are automatically cleared whenever one of this tree's nodes is deleted. More...
 
void attachAccessor (ValueAccessorBase< const Tree > &) const
 Register an accessor for this tree. Registered accessors are automatically cleared whenever one of this tree's nodes is deleted. More...
 
void releaseAccessor (ValueAccessorBase< Tree > &) const
 Deregister an accessor so that it is no longer automatically cleared. More...
 
void releaseAccessor (ValueAccessorBase< const Tree > &) const
 Deregister an accessor so that it is no longer automatically cleared. More...
 
RootNodeType::ChildOnCIter beginRootChildren () const
 Return an iterator over children of the root node. More...
 
RootNodeType::ChildOnCIter cbeginRootChildren () const
 Return an iterator over children of the root node. More...
 
RootNodeType::ChildOnIter beginRootChildren ()
 Return an iterator over children of the root node. More...
 
RootNodeType::ChildOffCIter beginRootTiles () const
 Return an iterator over non-child entries of the root node's table. More...
 
RootNodeType::ChildOffCIter cbeginRootTiles () const
 Return an iterator over non-child entries of the root node's table. More...
 
RootNodeType::ChildOffIter beginRootTiles ()
 Return an iterator over non-child entries of the root node's table. More...
 
RootNodeType::ChildAllCIter beginRootDense () const
 Return an iterator over all entries of the root node's table. More...
 
RootNodeType::ChildAllCIter cbeginRootDense () const
 Return an iterator over all entries of the root node's table. More...
 
RootNodeType::ChildAllIter beginRootDense ()
 Return an iterator over all entries of the root node's table. More...
 
NodeIter beginNode ()
 Return an iterator over all nodes in this tree. More...
 
NodeCIter beginNode () const
 Return an iterator over all nodes in this tree. More...
 
NodeCIter cbeginNode () const
 Return an iterator over all nodes in this tree. More...
 
LeafIter beginLeaf ()
 Return an iterator over all leaf nodes in this tree. More...
 
LeafCIter beginLeaf () const
 Return an iterator over all leaf nodes in this tree. More...
 
LeafCIter cbeginLeaf () const
 Return an iterator over all leaf nodes in this tree. More...
 
ValueAllIter beginValueAll ()
 Return an iterator over all values (tile and voxel) across all nodes. More...
 
ValueAllCIter beginValueAll () const
 Return an iterator over all values (tile and voxel) across all nodes. More...
 
ValueAllCIter cbeginValueAll () const
 Return an iterator over all values (tile and voxel) across all nodes. More...
 
ValueOnIter beginValueOn ()
 Return an iterator over active values (tile and voxel) across all nodes. More...
 
ValueOnCIter beginValueOn () const
 Return an iterator over active values (tile and voxel) across all nodes. More...
 
ValueOnCIter cbeginValueOn () const
 Return an iterator over active values (tile and voxel) across all nodes. More...
 
ValueOffIter beginValueOff ()
 Return an iterator over inactive values (tile and voxel) across all nodes. More...
 
ValueOffCIter beginValueOff () const
 Return an iterator over inactive values (tile and voxel) across all nodes. More...
 
ValueOffCIter cbeginValueOff () const
 Return an iterator over inactive values (tile and voxel) across all nodes. More...
 

Static Public Member Functions

static const NametreeType ()
 Return the name of this type of tree. More...
 
static void getNodeLog2Dims (std::vector< Index > &dims)
 Traverse the type hierarchy of nodes, and return, in dims, a list of the Log2Dims of nodes in order from RootNode to LeafNode. More...
 

Static Public Attributes

static const Index DEPTH = RootNodeType::LEVEL + 1
 

Protected Types

typedef
tbb::concurrent_hash_map
< ValueAccessorBase< Tree >
*, bool > 
AccessorRegistry
 
typedef
tbb::concurrent_hash_map
< ValueAccessorBase< const
Tree > *, bool > 
ConstAccessorRegistry
 

Protected Member Functions

Treeoperator= (const Tree &)
 
void releaseAllAccessors ()
 Notify all registered accessors, by calling ValueAccessor::release(), that this tree is about to be deleted. More...
 

Protected Attributes

RootNodeType mRoot
 
AccessorRegistry mAccessorRegistry
 
ConstAccessorRegistry mConstAccessorRegistry
 

Member Typedef Documentation

typedef tbb::concurrent_hash_map<ValueAccessorBase<Tree>*, bool> AccessorRegistry
protected
typedef tbb::concurrent_hash_map<ValueAccessorBase<const Tree>*, bool> ConstAccessorRegistry
protected
typedef boost::shared_ptr<const Tree> ConstPtr
typedef LeafIteratorBase<const Tree, typename RootNodeType::ChildOnCIter> LeafCIter

Iterator over all leaf nodes in this tree.

typedef LeafIteratorBase<Tree, typename RootNodeType::ChildOnIter> LeafIter

Iterator over all leaf nodes in this tree.

typedef RootNodeType::LeafNodeType LeafNodeType
typedef NodeIteratorBase<const Tree, typename RootNodeType::ChildOnCIter> NodeCIter

Iterator over all nodes in this tree.

typedef NodeIteratorBase<Tree, typename RootNodeType::ChildOnIter> NodeIter

Iterator over all nodes in this tree.

typedef boost::shared_ptr<Tree> Ptr
typedef _RootNodeType RootNodeType
typedef TreeValueIteratorBase<const Tree, typename RootNodeType::ValueAllCIter> ValueAllCIter
typedef TreeValueIteratorBase<Tree, typename RootNodeType::ValueAllIter> ValueAllIter
typedef TreeValueIteratorBase<const Tree, typename RootNodeType::ValueOffCIter> ValueOffCIter
typedef TreeValueIteratorBase<Tree, typename RootNodeType::ValueOffIter> ValueOffIter
typedef TreeValueIteratorBase<const Tree, typename RootNodeType::ValueOnCIter> ValueOnCIter
typedef TreeValueIteratorBase<Tree, typename RootNodeType::ValueOnIter> ValueOnIter
typedef RootNodeType::ValueType ValueType

Constructor & Destructor Documentation

Tree ( )
inline
Tree ( const Tree< _RootNodeType > &  other)
inline

Deep copy constructor.

Tree ( const OtherTreeType &  other,
const ValueType inactiveValue,
const ValueType activeValue,
TopologyCopy   
)
inline

Topology copy constructor from a tree of a different type.

Copy the structure, i.e., the active states of tiles and voxels, of another tree of a possibly different type, but don't copy any tile or voxel values. Instead, initialize tiles and voxels with the given active and inactive values.

Parameters
othera tree having (possibly) a different ValueType
inactiveValuebackground value for this tree, and the value to which all inactive tiles and voxels are initialized
activeValuevalue to which active tiles and voxels are initialized
Tree ( const OtherTreeType &  other,
const ValueType background,
TopologyCopy   
)
inline

Topology copy constructor from a tree of a different type.

Note
This topology copy constructor is generally faster than the one that takes both a foreground and a background value.

Copy the structure, i.e., the active states of tiles and voxels, of another tree of a possibly different type, but don't copy any tile or voxel values. Instead, initialize tiles and voxels with the given background value.

Parameters
othera tree having (possibly) a different ValueType
backgroundthe value to which tiles and voxels are initialized
Tree ( const ValueType background)
inline

Empty tree constructor.

virtual ~Tree ( )
inlinevirtual

Member Function Documentation

virtual Index64 activeLeafVoxelCount ( ) const
inlinevirtual

Return the number of active voxels stored in leaf nodes.

Implements TreeBase.

virtual Index64 activeVoxelCount ( ) const
inlinevirtual

Return the total number of active voxels.

Implements TreeBase.

void addLeaf ( LeafNodeType leaf)
inline

Add the given leaf node to this tree, creating a new branch if necessary. If a leaf node with the same origin already exists, replace it.

void addTile ( Index  level,
const Coord xyz,
const ValueType value,
bool  active 
)
inline

Add a tile containing voxel (x, y, z) at the specified tree level, creating a new branch if necessary. Delete any existing lower-level nodes that contain (x, y, z).

Note
Level must be greater than zero (i.e., the level of leaf nodes) and less than this tree's depth.
void attachAccessor ( ValueAccessorBase< Tree< _RootNodeType > > &  accessor) const
inline

Register an accessor for this tree. Registered accessors are automatically cleared whenever one of this tree's nodes is deleted.

void attachAccessor ( ValueAccessorBase< const Tree< _RootNodeType > > &  accessor) const
inline

Register an accessor for this tree. Registered accessors are automatically cleared whenever one of this tree's nodes is deleted.

const ValueType& background ( ) const
inline

Return this tree's background value.

IterT begin ( )
inline

Return an iterator of type IterT (for example, begin<ValueOnIter>() is equivalent to beginValueOn()).

LeafIter beginLeaf ( )
inline

Return an iterator over all leaf nodes in this tree.

LeafCIter beginLeaf ( ) const
inline

Return an iterator over all leaf nodes in this tree.

NodeIter beginNode ( )
inline

Return an iterator over all nodes in this tree.

NodeCIter beginNode ( ) const
inline

Return an iterator over all nodes in this tree.

RootNodeType::ChildOnCIter beginRootChildren ( ) const
inline

Return an iterator over children of the root node.

RootNodeType::ChildOnIter beginRootChildren ( )
inline

Return an iterator over children of the root node.

RootNodeType::ChildAllCIter beginRootDense ( ) const
inline

Return an iterator over all entries of the root node's table.

RootNodeType::ChildAllIter beginRootDense ( )
inline

Return an iterator over all entries of the root node's table.

RootNodeType::ChildOffCIter beginRootTiles ( ) const
inline

Return an iterator over non-child entries of the root node's table.

RootNodeType::ChildOffIter beginRootTiles ( )
inline

Return an iterator over non-child entries of the root node's table.

ValueAllIter beginValueAll ( )
inline

Return an iterator over all values (tile and voxel) across all nodes.

ValueAllCIter beginValueAll ( ) const
inline

Return an iterator over all values (tile and voxel) across all nodes.

ValueOffIter beginValueOff ( )
inline

Return an iterator over inactive values (tile and voxel) across all nodes.

ValueOffCIter beginValueOff ( ) const
inline

Return an iterator over inactive values (tile and voxel) across all nodes.

ValueOnIter beginValueOn ( )
inline

Return an iterator over active values (tile and voxel) across all nodes.

ValueOnCIter beginValueOn ( ) const
inline

Return an iterator over active values (tile and voxel) across all nodes.

CIterT cbegin ( ) const

Return a const iterator of type CIterT (for example, cbegin<ValueOnCIter>() is equivalent to cbeginValueOn()).

IterT cbegin ( ) const
inline
LeafCIter cbeginLeaf ( ) const
inline

Return an iterator over all leaf nodes in this tree.

NodeCIter cbeginNode ( ) const
inline

Return an iterator over all nodes in this tree.

RootNodeType::ChildOnCIter cbeginRootChildren ( ) const
inline

Return an iterator over children of the root node.

RootNodeType::ChildAllCIter cbeginRootDense ( ) const
inline

Return an iterator over all entries of the root node's table.

RootNodeType::ChildOffCIter cbeginRootTiles ( ) const
inline

Return an iterator over non-child entries of the root node's table.

ValueAllCIter cbeginValueAll ( ) const
inline

Return an iterator over all values (tile and voxel) across all nodes.

ValueOffCIter cbeginValueOff ( ) const
inline

Return an iterator over inactive values (tile and voxel) across all nodes.

ValueOnCIter cbeginValueOn ( ) const
inline

Return an iterator over active values (tile and voxel) across all nodes.

void clear ( )
inline

Remove all tiles from this tree and all nodes other than the root node.

void clearAllAccessors ( )
inline

Clear all registered accessors.

void combine ( Tree< _RootNodeType > &  other,
CombineOp &  op,
bool  prune = false 
)
inline

For a given function f, use sparse traversal to compute f(this, other) over all corresponding pairs of values (tile or voxel) of this tree and the other tree and store the result in this tree. This method is typically more space-efficient than the two-tree combine2(), since it moves rather than copies nodes from the other tree into this tree.

Note
This operation always empties the other tree.
Parameters
othera tree of the same type as this tree
opa functor of the form void op(const T& a, const T& b, T& result), where T is this tree's ValueType, that computes result = f(a, b)
pruneif true, prune the resulting tree one branch at a time (this is usually more space-efficient than pruning the entire tree in one pass)
Example:
Compute the per-voxel difference between two floating-point trees, aTree and bTree, and store the result in aTree (leaving bTree empty).
{
struct Local {
static inline void diff(const float& a, const float& b, float& result) {
result = a - b;
}
};
aTree.combine(bTree, Local::diff);
}
Example:
Compute f * a + (1 - f) * b over all voxels of two floating-point trees, aTree and bTree, and store the result in aTree (leaving bTree empty).
namespace {
struct Blend {
Blend(float f): frac(f) {}
inline void operator()(const float& a, const float& b, float& result) const {
result = frac * a + (1.0 - frac) * b;
}
float frac;
};
}
{
aTree.combine(bTree, Blend(0.25)); // 0.25 * a + 0.75 * b
}
void combine ( Tree< _RootNodeType > &  other,
const CombineOp &  op,
bool  prune = false 
)
inline
void combine2 ( const Tree< _RootNodeType > &  a,
const Tree< _RootNodeType > &  b,
CombineOp &  op,
bool  prune = false 
)
inline

For a given function f, use sparse traversal to compute f(a, b) over all corresponding pairs of values (tile or voxel) of trees A and B and store the result in this tree.

Parameters
a,btwo trees of the same type
opa functor of the form void op(const T& a, const T& b, T& result), where T is this tree's ValueType, that computes result = f(a, b)
pruneif true, prune the resulting tree one branch at a time (this is usually more space-efficient than pruning the entire tree in one pass)
Example:
Compute the per-voxel difference between two floating-point trees, aTree and bTree, and store the result in a third tree.
{
struct Local {
static inline void diff(const float& a, const float& b, float& result) {
result = a - b;
}
};
FloatTree resultTree;
resultTree.combine2(aTree, bTree, Local::diff);
}
void combine2 ( const Tree< _RootNodeType > &  a,
const Tree< _RootNodeType > &  b,
const CombineOp &  op,
bool  prune = false 
)
inline
void combine2Extended ( const Tree< _RootNodeType > &  a,
const Tree< _RootNodeType > &  b,
ExtendedCombineOp &  op,
bool  prune = false 
)
inline

Like combine2(), but with

Parameters
a,btwo trees of the same type
opa functor of the form void op(CombineArgs<ValueType>& args) that computes args.setResult(f(args.a(), args.b())) and, optionally, args.setResultIsActive(g(args.aIsActive(), args.bIsActive())) for some functions f and g
pruneif true, prune the resulting tree one branch at a time (this is usually more space-efficient than pruning the entire tree in one pass) This variant passes not only the a and b values but also the active states of the a and b values to the functor, which may then return, by calling args.setResultIsActive(), a computed active state for the result value. By default, the result is active if either the a or the b value is active.
See Also
openvdb/Types.h for the definition of the CombineArgs struct.
Example:
Compute the per-voxel maximum values of two floating-point trees, aTree and bTree, and store the result in a third tree. Set the active state of each output value to that of the larger of the two input values.
{
struct Local {
static inline void max(CombineArgs<float>& args) {
if (args.b() > args.a()) {
// Transfer the B value and its active state.
args.setResult(args.b());
args.setResultIsActive(args.bIsActive());
} else {
// Preserve the A value and its active state.
args.setResult(args.a());
args.setResultIsActive(args.aIsActive());
}
}
};
FloatTree resultTree;
resultTree.combine2Extended(aTree, bTree, Local::max);
}
void combine2Extended ( const Tree< _RootNodeType > &  a,
const Tree< _RootNodeType > &  b,
const ExtendedCombineOp &  op,
bool  prune = false 
)
inline
void combineExtended ( Tree< _RootNodeType > &  other,
ExtendedCombineOp &  op,
bool  prune = false 
)
inline

Like combine(), but with

Parameters
othera tree of the same type as this tree
opa functor of the form void op(CombineArgs<ValueType>& args) that computes args.setResult(f(args.a(), args.b())) and, optionally, args.setResultIsActive(g(args.aIsActive(), args.bIsActive())) for some functions f and g
pruneif true, prune the resulting tree one branch at a time (this is usually more space-efficient than pruning the entire tree in one pass)

This variant passes not only the a and b values but also the active states of the a and b values to the functor, which may then return, by calling args.setResultIsActive(), a computed active state for the result value. By default, the result is active if either the a or the b value is active.

See Also
openvdb/Types.h for the definition of the CombineArgs struct.
Example:
Replace voxel values in floating-point aTree with corresponding values from floating-point bTree (leaving bTree empty) wherever the bTree values are larger. Also, preserve the active states of any transferred values.
{
struct Local {
static inline void max(CombineArgs<float>& args) {
if (args.b() > args.a()) {
// Transfer the B value and its active state.
args.setResult(args.b());
args.setResultIsActive(args.bIsActive());
} else {
// Preserve the A value and its active state.
args.setResult(args.a());
args.setResultIsActive(args.aIsActive());
}
}
};
aTree.combineExtended(bTree, Local::max);
}
void combineExtended ( Tree< _RootNodeType > &  other,
const ExtendedCombineOp &  op,
bool  prune = false 
)
inline
virtual TreeBase::Ptr copy ( ) const
inlinevirtual

Return a pointer to a deep copy of this tree.

Implements TreeBase.

bool empty ( ) const
inline

Return true if this tree contains no nodes other than the root node and no tiles other than background tiles.

bool evalActiveVoxelBoundingBox ( CoordBBox bbox) const
inlinevirtual

Return in bbox the axis-aligned bounding box of all active voxels and tiles. This is a tighter bounding box than the leaf node bounding box.

Returns
false if the bounding box is empty (in which case the bbox is set to its default value).

Implements TreeBase.

bool evalActiveVoxelDim ( Coord dim) const
inlinevirtual

Return in dim the dimensions of the axis-aligned bounding box of all active voxels. This is a tighter bounding box than the leaf node bounding box.

Returns
false if the bounding box is empty.

Implements TreeBase.

bool evalLeafBoundingBox ( CoordBBox bbox) const
inlinevirtual

Return in bbox the axis-aligned bounding box of all leaf nodes.

Returns
false if the bounding box is empty (in which case the bbox is set to its default value).

Implements TreeBase.

bool evalLeafDim ( Coord dim) const
inlinevirtual

Return in dim the dimensions of the axis-aligned bounding box of all leaf nodes.

Returns
false if the bounding box is empty.

Implements TreeBase.

void evalMinMax ( ValueType min,
ValueType max 
) const
inline

Return the minimum and maximum active values in this tree.

void fill ( const CoordBBox bbox,
const ValueType value,
bool  active = true 
)
inline

Set all voxels within a given axis-aligned box to a constant value. If necessary, subdivide tiles that intersect the box.

Parameters
bboxinclusive coordinates of opposite corners of an axis-aligned box
valuethe value to which to set voxels within the box
activeif true, mark voxels within the box as active, otherwise mark them as inactive
Note
This operation generates a sparse, but not always optimally sparse, representation of the filled box. Follow fill operations with a prune() operation for optimal sparseness.
OPENVDB_DEPRECATED ValueType getBackground ( ) const
inline
Metadata::Ptr getBackgroundValue ( ) const
virtual

Return this tree's background value wrapped as metadata.

Note
Query the metadata object for the value's type.

Reimplemented from TreeBase.

virtual void getIndexRange ( CoordBBox bbox) const
inlinevirtual

Min and max are both inclusive.

Implements TreeBase.

void getNodeLog2Dims ( std::vector< Index > &  dims)
inlinestatic

Traverse the type hierarchy of nodes, and return, in dims, a list of the Log2Dims of nodes in order from RootNode to LeafNode.

Note
Because RootNodes are resizable, the RootNode Log2Dim is 0 for all trees.
RootNodeType& getRootNode ( )
inline

Return this tree's root node.

const RootNodeType& getRootNode ( ) const
inline

Return this tree's root node.

const RootNodeType::ValueType & getValue ( const Coord xyz) const
inline

Return the value of the voxel at the given coordinates.

const ValueType& getValue ( const Coord xyz,
AccessT &   
) const

Return the value of the voxel at the given coordinates and update the given accessor's node cache.

const RootNodeType::ValueType& getValue ( const Coord xyz,
AccessT &  accessor 
) const
inline
int getValueDepth ( const Coord xyz) const
inline

Return the tree depth (0 = root) at which the value of voxel (x, y, z) resides.

If (x, y, z) isn't explicitly represented in the tree (i.e., it is implicitly a background voxel), return -1.

bool hasActiveTiles ( ) const
inline

Return true if this tree has any active tiles.

bool hasSameTopology ( const Tree< OtherRootNodeType > &  other) const
inline

Return true if the given tree has the same node and active value topology as this tree (but possibly a different ValueType).

virtual Index64 inactiveLeafVoxelCount ( ) const
inlinevirtual

Return the number of inactive voxels stored in leaf nodes.

Implements TreeBase.

Index64 inactiveVoxelCount ( ) const
virtual

Return the number of inactive voxels within the bounding box of all active voxels.

Implements TreeBase.

bool isValueOff ( const Coord xyz) const
inline

Return true if the value at the given coordinates is inactive.

bool isValueOn ( const Coord xyz) const
inline

Return true if the value at the given coordinates is active.

virtual Index32 leafCount ( ) const
inlinevirtual

Return the number of leaf nodes.

Implements TreeBase.

virtual Index64 memUsage ( ) const
inlinevirtual

Return the total amount of memory in bytes occupied by this tree.

Reimplemented from TreeBase.

void merge ( Tree< _RootNodeType > &  other)
inline

Move child nodes from the other tree into this tree wherever those nodes correspond to constant-value tiles in this tree, and replace leaf-level inactive voxels in this tree with corresponding voxels in the other tree that are active.

Note
This operation always empties the other tree.
virtual Index32 nonLeafCount ( ) const
inlinevirtual

Return the number of non-leaf nodes.

Implements TreeBase.

bool operator!= ( const Tree< _RootNodeType > &  ) const
inline
Tree& operator= ( const Tree< _RootNodeType > &  )
protected
bool operator== ( const Tree< _RootNodeType > &  ) const
inline
void print ( std::ostream &  os = std::cout,
int  verboseLevel = 1 
) const
inlinevirtual

Print statistics, memory usage and other information about this tree.

Parameters
osa stream to which to write textual information
verboseLevel1: print tree configuration only; 2: include node and voxel statistics; 3: include memory usage

Reimplemented from TreeBase.

const RootNodeType::LeafNodeType * probeConstLeaf ( const Coord xyz) const
inline
Returns
a const pointer to the leaf node that contains voxel (x, y, z) and if it doesn't exist, return NULL.
RootNodeType::LeafNodeType * probeLeaf ( const Coord xyz)
inline
Returns
a pointer to the leaf node that contains voxel (x, y, z) and if it doesn't exist, return NULL.
const LeafNodeType* probeLeaf ( const Coord xyz) const
inline
bool probeValue ( const Coord xyz,
ValueType value 
) const
inline

Get the value of the voxel at the given coordinates.

Returns
true if the value is active.
void prune ( const ValueType tolerance = zeroVal<ValueType>())
inline

Reduce the memory footprint of this tree by replacing with tiles any nodes whose values are all the same (optionally to within a tolerance) and have the same active state.

void pruneInactive ( const ValueType bg)
inline

Reduce the memory footprint of this tree by replacing with tiles of the given value any nodes whose values are all inactive.

void pruneInactive ( )
inline

Reduce the memory footprint of this tree by replacing with background tiles any nodes whose values are all inactive.

void pruneLevelSet ( )
inline

Prune any descendants whose values are all inactive and replace them with inactive tiles having a values equal to the first value encountered in the (inactive) child.

Note
This method is faster then tolerance based prune and useful for narrow-band level set applications where inactive values are limited to either an inside or outside value.
void pruneOp ( PruneOp &  op)
inline

Call the PruneOp functor for each non-root node in the tree. If the functor returns true, prune the node and replace it with a tile.

This method is used to implement all of the various pruning algorithms (prune(), pruneInactive(), etc.). It should rarely be called directly.

See Also
openvdb/tree/Util.h for the definition of the PruneOp functor
void readBuffers ( std::istream &  is,
bool  saveFloatAsHalf = false 
)
inlinevirtual

Read all data buffers for this tree.

Implements TreeBase.

void readTopology ( std::istream &  is,
bool  saveFloatAsHalf = false 
)
virtual

Read the tree topology from a stream.

This will read the tree structure and tile values, but not voxel data.

Reimplemented from TreeBase.

void releaseAccessor ( ValueAccessorBase< Tree< _RootNodeType > > &  accessor) const
inline

Deregister an accessor so that it is no longer automatically cleared.

void releaseAccessor ( ValueAccessorBase< const Tree< _RootNodeType > > &  accessor) const
inline

Deregister an accessor so that it is no longer automatically cleared.

void releaseAllAccessors ( )
inlineprotected

Notify all registered accessors, by calling ValueAccessor::release(), that this tree is about to be deleted.

RootNodeType& root ( )
inline

Return this tree's root node.

const RootNodeType& root ( ) const
inline

Return this tree's root node.

void setActiveState ( const Coord xyz,
bool  on 
)
inline

Set the active state of the voxel at the given coordinates, but don't change its value.

void setBackground ( const ValueType background)
inline

Replace this tree's background value.

void setValue ( const Coord xyz,
const ValueType value 
)
inline

Set the value of the voxel at the given coordinates and mark the voxel as active.

void setValue ( const Coord xyz,
const ValueType value,
AccessT &  accessor 
)
inline

Set the value of the voxel at the given coordinates, mark the voxel as active, and update the given accessor's node cache.

void setValueOff ( const Coord xyz)
inline

Mark the voxel at the given coordinates as inactive, but don't change its value.

void setValueOff ( const Coord xyz,
const ValueType value 
)
inline

Change the value of the voxel at the given coordinates and mark the voxel as inactive.

void setValueOn ( const Coord xyz)
inline

Mark the voxel at the given coordinates as active, but don't change its value.

void setValueOn ( const Coord xyz,
const ValueType value 
)
inline

Set the value of the voxel at the given coordinates and mark the voxel as active.

void setValueOnly ( const Coord xyz,
const ValueType value 
)
inline

Set the value of the voxel at the given coordinates but preserve it active state.

void setValueOnMax ( const Coord xyz,
const ValueType value 
)
inline

Set the value of the voxel at the given coordinates to the maximum of its current value and the given value, and mark the voxel as active.

void setValueOnMin ( const Coord xyz,
const ValueType value 
)
inline

Set the value of the voxel at the given coordinates to the minimum of its current value and the given value, and mark the voxel as active.

void setValueOnSum ( const Coord xyz,
const ValueType value 
)
inline

Set the value of the voxel at the given coordinates to the sum of its current value and the given value, and mark the voxel as active.

void signedFloodFill ( )
inline

Set the values of all inactive voxels and tiles of a narrow-band level set from the signs of the active voxels, setting outside values to +background and inside values to -background.

Note
This method should only be used on closed, narrow-band level sets!
void signedFloodFill ( const ValueType outside,
const ValueType inside 
)
inline

Set the values of all inactive voxels and tiles of a narrow-band level set from the signs of the active voxels, setting exterior values to outside and interior values to inside. Set the background value of this tree to outside.

Note
This method should only be used on closed, narrow-band level sets!
NodeT * stealNode ( const Coord xyz,
const ValueType value,
bool  active 
)
inline

Return a pointer to the node of type NodeT that contains voxel (x, y, z) and replace it with a tile of the specified value and state. If no such node exists, leave the tree unchanged and return NULL.

Note
The caller takes ownership of the node and is responsible for deleting it.
void topologyUnion ( const Tree< OtherRootNodeType > &  other)
inline

Union this tree's set of active values with the active values of the other tree, whose ValueType may be different.

The resulting state of a value is active if the corresponding value was already active OR if it is active in the other tree. Also, a resulting value maps to a voxel if the corresponding value already mapped to a voxel OR if it is a voxel in the other tree. Thus, a resulting value can only map to a tile if the corresponding value already mapped to a tile AND if it is a tile value in other tree.

Note
This operation modifies only active states, not values. Specifically, active tiles and voxels in this tree are not changed, and tiles or voxels that were inactive in this tree but active in the other tree are marked as active in this tree but left with their original values.
RootNodeType::LeafNodeType * touchLeaf ( const Coord xyz)
inline
Returns
the leaf node that contains voxel (x, y, z) and if it doesn't exist, create it, but preserve the values and active states of all voxels.

Use this method to preallocate a static tree topology over which to safely perform multithreaded processing.

virtual Index treeDepth ( ) const
inlinevirtual

Return the depth of this tree.

A tree with only a root node and leaf nodes has depth 2, for example.

Implements TreeBase.

const Name & treeType ( )
inlinestatic

Return the name of this type of tree.

virtual const Name& type ( ) const
inlinevirtual

Return the name of this type of tree.

Implements TreeBase.

virtual Name valueType ( ) const
inlinevirtual

Return the name of the type of a voxel's value (e.g., "float" or "vec3d")

Implements TreeBase.

void visit ( VisitorOp &  op)
inline

Traverse this tree in depth-first order, and at each node call the given functor with a DenseIterator (see Iterator.h) that points to either a child node or a tile value. If the iterator points to a child node and the functor returns true, do not descend to the child node; instead, continue the traversal at the next iterator position.

Parameters
opa functor of the form template<typename IterT> bool op(IterT&), where IterT is either a RootNode::ChildAllIter, an InternalNode::ChildAllIter or a LeafNode::ChildAllIter
Note
There is no iterator that points to a RootNode, so to visit the root node, retrieve the parent() of a RootNode::ChildAllIter.
Example:
Print information about the nodes and tiles of a tree, but not individual voxels.
namespace {
template<typename TreeT>
struct PrintTreeVisitor
{
typedef typename TreeT::RootNodeType RootT;
bool visitedRoot;
PrintTreeVisitor(): visitedRoot(false) {}
template<typename IterT>
inline bool operator()(IterT& iter)
{
if (!visitedRoot && iter.parent().getLevel() == RootT::LEVEL) {
visitedRoot = true;
std::cout << "Level-" << RootT::LEVEL << " node" << std::endl;
}
typename IterT::NonConstValueType value;
typename IterT::ChildNodeType* child = iter.probeChild(value);
if (child == NULL) {
std::cout << "Tile with value " << value << std::endl;
return true; // no child to visit, so stop descending
}
std::cout << "Level-" << child->getLevel() << " node" << std::endl;
return (child->getLevel() == 0); // don't visit leaf nodes
}
// The generic method, above, calls iter.probeChild(), which is not defined
// for LeafNode::ChildAllIter. These overloads ensure that the generic
// method template doesn't get instantiated for LeafNode iterators.
bool operator()(typename TreeT::LeafNodeType::ChildAllIter&) { return true; }
bool operator()(typename TreeT::LeafNodeType::ChildAllCIter&) { return true; }
};
}
{
PrintTreeVisitor visitor;
tree.visit(visitor);
}
void visit ( const VisitorOp &  op)
inline
void visit ( VisitorOp &  op) const
inline

Like visit(), but using const iterators, i.e., with

Parameters
opa functor of the form template<typename IterT> bool op(IterT&), where IterT is either a RootNode::ChildAllCIter, an InternalNode::ChildAllCIter or a LeafNode::ChildAllCIter
void visit ( const VisitorOp &  op) const
inline
void visit2 ( OtherTreeType &  other,
VisitorOp &  op 
)
inline

Traverse this tree and another tree in depth-first order, and for corresponding subregions of index space call the given functor with two DenseIterators (see Iterator.h), each of which points to either a child node or a tile value of this tree and the other tree. If the A iterator points to a child node and the functor returns a nonzero value with bit 0 set (e.g., 1), do not descend to the child node; instead, continue the traversal at the next A iterator position. Similarly, if the B iterator points to a child node and the functor returns a value with bit 1 set (e.g., 2), continue the traversal at the next B iterator position.

Note
The other tree must have the same index space and fan-out factors as this tree, but it may have a different ValueType and a different topology.
Parameters
othera tree of the same type as this tree
opa functor of the form template<class AIterT, class BIterT> int op(AIterT&, BIterT&), where AIterT and BIterT are any combination of a RootNode::ChildAllIter, an InternalNode::ChildAllIter or a LeafNode::ChildAllIter with an OtherTreeType::RootNode::ChildAllIter, an OtherTreeType::InternalNode::ChildAllIter or an OtherTreeType::LeafNode::ChildAllIter
Example:
Given two trees of the same type, aTree and bTree, replace leaf nodes of aTree with corresponding leaf nodes of bTree, leaving bTree partially empty.
namespace {
template<typename AIterT, typename BIterT>
inline int stealLeafNodes(AIterT& aIter, BIterT& bIter)
{
typename AIterT::NonConstValueType aValue;
typename AIterT::ChildNodeType* aChild = aIter.probeChild(aValue);
typename BIterT::NonConstValueType bValue;
typename BIterT::ChildNodeType* bChild = bIter.probeChild(bValue);
const Index aLevel = aChild->getLevel(), bLevel = bChild->getLevel();
if (aChild && bChild && aLevel == 0 && bLevel == 0) { // both are leaf nodes
aIter.setChild(bChild); // give B's child to A
bIter.setValue(bValue); // replace B's child with a constant tile value
}
// Don't iterate over leaf node voxels of either A or B.
int skipBranch = (aLevel == 0) ? 1 : 0;
if (bLevel == 0) skipBranch = skipBranch | 2;
return skipBranch;
}
}
{
aTree.visit2(bTree, stealLeafNodes);
}
void visit2 ( OtherTreeType &  other,
const VisitorOp &  op 
)
inline
void visit2 ( OtherTreeType &  other,
VisitorOp &  op 
) const
inline

Like visit2(), but using const iterators, i.e., with

Parameters
othera tree of the same type as this tree
opa functor of the form template<class AIterT, class BIterT> int op(AIterT&, BIterT&), where AIterT and BIterT are any combination of a RootNode::ChildAllCIter, an InternalNode::ChildAllCIter or a LeafNode::ChildAllCIter with an OtherTreeType::RootNode::ChildAllCIter, an OtherTreeType::InternalNode::ChildAllCIter or an OtherTreeType::LeafNode::ChildAllCIter
void visit2 ( OtherTreeType &  other,
const VisitorOp &  op 
) const
inline
void visitActiveBBox ( BBoxOp &  op) const
inline

For a given function use sparse traversal to call it with bounding box information for all active tiles and leaf nodes or active voxels in the tree.

Note
The bounding boxes are guarenteed to be non-overlapping.
Parameters
opa template functor of the form template<Index LEVEL> void op(const CoordBBox& bbox), where bbox defines the bbox of an active tile if LEVEL>0, and else a LeafNode or active voxel. The functor must also provide a template method of the form template<Index LEVEL> bool descent() that returns false if no bboxes are to be derived below the templated tree level. In such cases of early tree termination a bbox is instead derived from each terminating child node.
Example:
Render all active tiles and leaf nodes in a tree. Note in this example descent returns false if LEVEL==0 which means the functor will never descent to the active voxels. In other words the smallest BBoxes correspond to LeafNodes or active tiles at LEVEL=1!
{
struct RenderTilesAndLeafs {
template<Index LEVEL>
inline bool descent() { return LEVEL>0; }//only descent to leaf nodes
//inline bool descent() { return true; }//use this to decent to voxels
template<Index LEVEL>
inline void operator()(const CoordBBox &bbox) {
if (LEVEL>0) {
// code to render active tile
} else {
// code to render leaf node
}
}
};
RenderTilesAndLeafs op;
aTree.visitActiveBBox(op);
}
See Also
openvdb/unittest/TestTree.cc for another example.
void voxelizeActiveTiles ( )
inline

Turns active tiles into dense voxels, i.e. active leaf nodes.

void writeBuffers ( std::ostream &  os,
bool  saveFloatAsHalf = false 
) const
inlinevirtual

Write out all data buffers for this tree.

Implements TreeBase.

void writeTopology ( std::ostream &  os,
bool  saveFloatAsHalf = false 
) const
virtual

Write the tree topology to a stream.

This will write the tree structure and tile values, but not voxel data.

Reimplemented from TreeBase.

Member Data Documentation

const Index DEPTH = RootNodeType::LEVEL + 1
static
AccessorRegistry mAccessorRegistry
mutableprotected
ConstAccessorRegistry mConstAccessorRegistry
mutableprotected
RootNodeType mRoot
protected

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