OpenVDB  5.2.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
LeafBuffer< T, Log2Dim > Class Template Reference

Array of fixed size 23Log2Dim that stores the voxel values of a LeafNode. More...

#include <LeafBuffer.h>

Classes

struct  FileInfo
 

Public Types

using ValueType = T
 
using StorageType = ValueType
 
using NodeMaskType = util::NodeMask< Log2Dim >
 

Public Member Functions

 LeafBuffer ()
 Default constructor. More...
 
 LeafBuffer (const ValueType &)
 Construct a buffer populated with the specified value. More...
 
 LeafBuffer (const LeafBuffer &)
 Copy constructor. More...
 
 LeafBuffer (PartialCreate, const ValueType &)
 Construct a buffer but don't allocate memory for the full array of values. More...
 
 ~LeafBuffer ()
 Destructor. More...
 
bool isOutOfCore () const
 Return true if this buffer's values have not yet been read from disk. More...
 
bool empty () const
 Return true if memory for this buffer has not yet been allocated. More...
 
bool allocate ()
 Allocate memory for this buffer if it has not already been allocated. More...
 
void fill (const ValueType &)
 Populate this buffer with a constant value. More...
 
const ValueTypegetValue (Index i) const
 Return a const reference to the i'th element of this buffer. More...
 
const ValueTypeoperator[] (Index i) const
 Return a const reference to the i'th element of this buffer. More...
 
void setValue (Index i, const ValueType &)
 Set the i'th value of this buffer to the specified value. More...
 
LeafBufferoperator= (const LeafBuffer &)
 Copy the other buffer's values into this buffer. More...
 
bool operator== (const LeafBuffer &) const
 Return true if the contents of the other buffer exactly equal the contents of this buffer. More...
 
bool operator!= (const LeafBuffer &other) const
 Return true if the contents of the other buffer are not exactly equal to the contents of this buffer. More...
 
void swap (LeafBuffer &)
 Exchange this buffer's values with the other buffer's values. More...
 
Index memUsage () const
 Return the memory footprint of this buffer in bytes. More...
 
const ValueTypedata () const
 Return a const pointer to the array of voxel values. More...
 
ValueTypedata ()
 Return a pointer to the array of voxel values. More...
 

Static Public Member Functions

static Index size ()
 Return the number of values contained in this buffer. More...
 

Static Public Attributes

static const Index SIZE = 1 << 3 * Log2Dim
 

Friends

class ::TestLeaf
 
template<typename , Index >
class LeafNode
 

Detailed Description

template<typename T, Index Log2Dim>
class openvdb::v5_2::tree::LeafBuffer< T, Log2Dim >

Array of fixed size 23Log2Dim that stores the voxel values of a LeafNode.

Member Typedef Documentation

using NodeMaskType = util::NodeMask<Log2Dim>
using ValueType = T

Constructor & Destructor Documentation

LeafBuffer ( )
inline

Default constructor.

LeafBuffer ( const ValueType val)
inlineexplicit

Construct a buffer populated with the specified value.

LeafBuffer ( const LeafBuffer< T, Log2Dim > &  other)
inline

Copy constructor.

LeafBuffer ( PartialCreate  ,
const ValueType  
)
inline

Construct a buffer but don't allocate memory for the full array of values.

~LeafBuffer ( )
inline

Destructor.

Member Function Documentation

bool allocate ( )
inline

Allocate memory for this buffer if it has not already been allocated.

const LeafBuffer< T, Log2Dim >::ValueType * data ( ) const
inline

Return a const pointer to the array of voxel values.

This method guarantees that the buffer is allocated and loaded.

Warning
This method should only be used by experts seeking low-level optimizations.
LeafBuffer< T, Log2Dim >::ValueType * data ( )
inline

Return a pointer to the array of voxel values.

This method guarantees that the buffer is allocated and loaded.

Warning
This method should only be used by experts seeking low-level optimizations.
bool empty ( ) const
inline

Return true if memory for this buffer has not yet been allocated.

void fill ( const ValueType val)
inline

Populate this buffer with a constant value.

const ValueType& getValue ( Index  i) const
inline

Return a const reference to the i'th element of this buffer.

bool isOutOfCore ( ) const
inline

Return true if this buffer's values have not yet been read from disk.

Index memUsage ( ) const
inline

Return the memory footprint of this buffer in bytes.

bool operator!= ( const LeafBuffer< T, Log2Dim > &  other) const
inline

Return true if the contents of the other buffer are not exactly equal to the contents of this buffer.

LeafBuffer< T, Log2Dim > & operator= ( const LeafBuffer< T, Log2Dim > &  other)
inline

Copy the other buffer's values into this buffer.

bool operator== ( const LeafBuffer< T, Log2Dim > &  other) const
inline

Return true if the contents of the other buffer exactly equal the contents of this buffer.

const ValueType& operator[] ( Index  i) const
inline

Return a const reference to the i'th element of this buffer.

void setValue ( Index  i,
const ValueType val 
)
inline

Set the i'th value of this buffer to the specified value.

static Index size ( )
inlinestatic

Return the number of values contained in this buffer.

void swap ( LeafBuffer< T, Log2Dim > &  other)
inline

Exchange this buffer's values with the other buffer's values.

Friends And Related Function Documentation

friend class ::TestLeaf
friend
friend class LeafNode
friend

Member Data Documentation

ValueType* mData
FileInfo* mFileInfo
const Index SIZE = 1 << 3 * Log2Dim
static

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