OpenVDB 12.1.0
Loading...
Searching...
No Matches
TreeBase Class Referenceabstract

Base class for typed trees. More...

#include <openvdb/tree/Tree.h>

Inheritance diagram for TreeBase:
Tree< tree::RootNode< tree::InternalNode< tree::InternalNode< PointDataLeafNode< PointDataIndex32, 3 >, 4 >, 5 > > > Tree< typename NodeChainT::Back > Tree< tree::RootNode< tree::InternalNode< tree::InternalNode< PointIndexLeafNode< PointIndex32, 3 >, 4 >, 5 > > > Tree< typename RootType::template ValueConverter< bool >::Type > Tree< typename RootNodeType::template ValueConverter< OtherValueType >::Type > Tree< RootNode< InternalNode< LeafNode< T, N2 >, N1 > > > Tree< RootNode< InternalNode< InternalNode< LeafNode< T, N3 >, N2 >, N1 > > > Tree< RootNode< InternalNode< InternalNode< InternalNode< LeafNode< T, N4 >, N3 >, N2 >, N1 > > > Tree< _RootNodeType >

Public Types

using Ptr = SharedPtr<TreeBase>
using ConstPtr = SharedPtr<const TreeBase>

Public Member Functions

 TreeBase ()=default
 TreeBase (const TreeBase &)=default
TreeBaseoperator= (const TreeBase &)=delete
virtual ~TreeBase ()=default
virtual const Nametype () const =0
 Return the name of this tree's type.
virtual Name valueType () const =0
 Return the name of the type of a voxel's value (e.g., "float" or "vec3d").
template<typename TreeType>
bool isType () const
 Return true if this tree is of the same type as the template parameter.
virtual TreeBase::Ptr copy () const =0
 Return a pointer to a deep copy of this tree.
virtual Metadata::Ptr getBackgroundValue () const
 Return this tree's background value wrapped as metadata.
virtual bool evalLeafBoundingBox (CoordBBox &bbox) const =0
 Return in bbox the axis-aligned bounding box of all active tiles and leaf nodes with active values.
virtual bool evalLeafDim (Coord &dim) const =0
 Return in dim the dimensions of the axis-aligned bounding box of all leaf nodes.
virtual bool evalActiveVoxelBoundingBox (CoordBBox &bbox) const =0
 Return in bbox the axis-aligned bounding box of all active voxels and tiles.
virtual bool evalActiveVoxelDim (Coord &dim) const =0
 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.
virtual void getIndexRange (CoordBBox &bbox) const =0
virtual void clipUnallocatedNodes ()=0
 Replace with background tiles any nodes whose voxel buffers have not yet been allocated.
virtual Index64 unallocatedLeafCount () const =0
 Return the total number of unallocated leaf nodes residing in this tree.
virtual Index treeDepth () const =0
 Return the depth of this tree.
virtual Index64 leafCount () const =0
 Return the number of leaf nodes.
virtual std::vector< Index64nodeCount () const =0
virtual Index64 nonLeafCount () const =0
 Return the number of non-leaf nodes.
virtual Index64 activeLeafVoxelCount () const =0
 Return the number of active voxels stored in leaf nodes.
virtual Index64 inactiveLeafVoxelCount () const =0
 Return the number of inactive voxels stored in leaf nodes.
virtual Index64 activeVoxelCount () const =0
 Return the total number of active voxels.
virtual Index64 inactiveVoxelCount () const =0
 Return the number of inactive voxels within the bounding box of all active voxels.
virtual Index64 activeTileCount () const =0
 Return the total number of active tiles.
virtual Index64 memUsage () const
 Return the total amount of memory in bytes occupied by this tree.
virtual void readTopology (std::istream &, bool saveFloatAsHalf=false)
 Read the tree topology from a stream.
virtual void writeTopology (std::ostream &, bool saveFloatAsHalf=false) const
 Write the tree topology to a stream.
virtual void readBuffers (std::istream &, bool saveFloatAsHalf=false)=0
 Read all data buffers for this tree.
virtual void readBuffers (std::istream &, const CoordBBox &, bool saveFloatAsHalf=false)=0
 Read all of this tree's data buffers that intersect the given bounding box.
virtual void readNonresidentBuffers () const =0
 Read all of this tree's data buffers that are not yet resident in memory (because delayed loading is in effect).
virtual void writeBuffers (std::ostream &, bool saveFloatAsHalf=false) const =0
 Write out all the data buffers for this tree.
virtual void print (std::ostream &os=std::cout, int verboseLevel=1) const
 Print statistics, memory usage and other information about this tree.

Detailed Description

Base class for typed trees.

Member Typedef Documentation

◆ ConstPtr

using ConstPtr = SharedPtr<const TreeBase>

◆ Ptr

Constructor & Destructor Documentation

◆ TreeBase() [1/2]

TreeBase ( )
default

◆ TreeBase() [2/2]

TreeBase ( const TreeBase & )
default

◆ ~TreeBase()

virtual ~TreeBase ( )
virtualdefault

Member Function Documentation

◆ activeLeafVoxelCount()

◆ activeTileCount()

◆ activeVoxelCount()

◆ clipUnallocatedNodes()

◆ copy()

◆ evalActiveVoxelBoundingBox()

◆ evalActiveVoxelDim()

◆ evalLeafBoundingBox()

virtual bool evalLeafBoundingBox ( CoordBBox & bbox) const
pure virtual

◆ evalLeafDim()

◆ getBackgroundValue()

◆ getIndexRange()

◆ inactiveLeafVoxelCount()

◆ inactiveVoxelCount()

◆ isType()

template<typename TreeType>
bool isType ( ) const
inline

Return true if this tree is of the same type as the template parameter.

◆ leafCount()

◆ memUsage()

◆ nodeCount()

◆ nonLeafCount()

◆ operator=()

TreeBase & operator= ( const TreeBase & )
delete

◆ print()

void print ( std::ostream & os = std::cout,
int verboseLevel = 1 ) const
inlinevirtual

◆ readBuffers() [1/2]

◆ readBuffers() [2/2]

◆ readNonresidentBuffers()

◆ readTopology()

◆ treeDepth()

◆ type()

◆ unallocatedLeafCount()

◆ valueType()

◆ writeBuffers()

◆ writeTopology()