HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim > Class Template Reference

Array of fixed size $2^{3 \times {\rm Log2Dim}}$ that stores the voxel values of a LeafNode. More...

#include <LeafBuffer.h>

Classes

struct  FileInfo
 

Public Types

using ValueType = T
 
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::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >

Array of fixed size $2^{3 \times {\rm Log2Dim}}$ that stores the voxel values of a LeafNode.

Definition at line 53 of file LeafBuffer.h.

Member Typedef Documentation

template<typename T, Index Log2Dim>
using openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::NodeMaskType = util::NodeMask<Log2Dim>

Definition at line 57 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
using openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::ValueType = T

Definition at line 56 of file LeafBuffer.h.

Constructor & Destructor Documentation

template<typename T, Index Log2Dim>
openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::LeafBuffer ( )
inline

Default constructor.

Definition at line 87 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::LeafBuffer ( const ValueType val)
inlineexplicit

Construct a buffer populated with the specified value.

Definition at line 204 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::LeafBuffer ( const LeafBuffer< T, Log2Dim > &  other)
inline

Copy constructor.

Definition at line 226 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::LeafBuffer ( PartialCreate  ,
const ValueType  
)
inline

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

Definition at line 93 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::~LeafBuffer ( )
inline

Destructor.

Definition at line 214 of file LeafBuffer.h.

Member Function Documentation

template<typename T, Index Log2Dim>
bool openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::allocate ( )
inline

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

Definition at line 103 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
const LeafBuffer< T, Log2Dim >::ValueType * openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::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.

Definition at line 347 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
LeafBuffer< T, Log2Dim >::ValueType * openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::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.

Definition at line 363 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
bool openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::empty ( void  ) const
inline

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

Definition at line 100 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
void openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::fill ( const ValueType val)
inline

Populate this buffer with a constant value.

Definition at line 293 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
const ValueType& openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::getValue ( Index  i) const
inline

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

Definition at line 109 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
bool openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::isOutOfCore ( ) const
inline

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

Definition at line 98 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
Index openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::memUsage ( ) const
inline

Return the memory footprint of this buffer in bytes.

Definition at line 332 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
bool openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::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.

Definition at line 123 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
LeafBuffer< T, Log2Dim > & openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::operator= ( const LeafBuffer< T, Log2Dim > &  other)
inline

Copy the other buffer's values into this buffer.

Definition at line 258 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
bool openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::operator== ( const LeafBuffer< T, Log2Dim > &  other) const
inline

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

Definition at line 306 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
const ValueType& openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::operator[] ( Index  i) const
inline

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

Definition at line 111 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
void openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::setValue ( Index  i,
const ValueType val 
)
inline

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

Definition at line 244 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
static Index openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::size ( void  )
inlinestatic

Return the number of values contained in this buffer.

Definition at line 131 of file LeafBuffer.h.

template<typename T , Index Log2Dim>
void openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::swap ( LeafBuffer< T, Log2Dim > &  other)
inline

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

Definition at line 321 of file LeafBuffer.h.

Friends And Related Function Documentation

template<typename T, Index Log2Dim>
friend class ::TestLeaf
friend

Definition at line 184 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
template<typename , Index >
friend class LeafNode
friend

Definition at line 186 of file LeafBuffer.h.

Member Data Documentation

template<typename T, Index Log2Dim>
ValueType* openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::mData

Definition at line 174 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
FileInfo* openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::mFileInfo

Definition at line 175 of file LeafBuffer.h.

template<typename T, Index Log2Dim>
const Index openvdb::OPENVDB_VERSION_NAME::tree::LeafBuffer< T, Log2Dim >::SIZE = 1 << 3 * Log2Dim
static

Definition at line 58 of file LeafBuffer.h.


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