OpenVDB 12.0.0
 
Loading...
Searching...
No Matches
LeafBuffer< bool, Log2Dim > Class Template Reference

#include <openvdb/tree/LeafBuffer.h>

Public Types

using NodeMaskType = util::NodeMask<Log2Dim>
 
using WordType = typename NodeMaskType::Word
 
using ValueType = bool
 
using StorageType = WordType
 
using ValueType
 
using StorageType
 
using NodeMaskType
 

Public Member Functions

 LeafBuffer ()
 
 LeafBuffer (bool on)
 
 LeafBuffer (const NodeMaskType &other)
 
 LeafBuffer (const LeafBuffer &other)
 
 ~LeafBuffer ()
 
void fill (bool val)
 
LeafBufferoperator= (const LeafBuffer &b)
 
const bool & getValue (Index i) const
 
const bool & operator[] (Index i) const
 
bool operator== (const LeafBuffer &other) const
 
bool operator!= (const LeafBuffer &other) const
 
void setValue (Index i, bool val)
 
void swap (LeafBuffer &other)
 
Index memUsage () const
 
Index memUsageIfLoaded () const
 
WordTypedata ()
 Return a pointer to the C-style array of words encoding the bits.
 
const WordTypedata () const
 Return a const pointer to the C-style array of words encoding the bits.
 
 LeafBuffer ()
 Default constructor.
 
 LeafBuffer (const ValueType &)
 Construct a buffer populated with the specified value.
 
 LeafBuffer (const LeafBuffer &)
 Copy constructor.
 
 LeafBuffer (PartialCreate, const ValueType &)
 Construct a buffer but don't allocate memory for the full array of values.
 
 ~LeafBuffer ()
 Destructor.
 
bool isOutOfCore () const
 Return true if this buffer's values have not yet been read from disk.
 
bool empty () const
 Return true if memory for this buffer has not yet been allocated.
 
bool allocate ()
 Allocate memory for this buffer if it has not already been allocated.
 
void fill (const ValueType &)
 Populate this buffer with a constant value.
 
const ValueTypegetValue (Index i) const
 Return a const reference to the i'th element of this buffer.
 
const ValueTypeoperator[] (Index i) const
 Return a const reference to the i'th element of this buffer.
 
void setValue (Index i, const ValueType &)
 Set the i'th value of this buffer to the specified value.
 
LeafBufferoperator= (const LeafBuffer &)
 Copy the other buffer's values into this buffer.
 
bool operator== (const LeafBuffer &) const
 Return true if the contents of the other buffer exactly equal the contents of this buffer.
 
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.
 
void swap (LeafBuffer &)
 Exchange this buffer's values with the other buffer's values.
 
Index memUsage () const
 Return the memory footprint of this buffer in bytes.
 
Index memUsageIfLoaded () const
 
const ValueTypedata () const
 Return a const pointer to the array of voxel values.
 
ValueTypedata ()
 Return a pointer to the array of voxel values.
 

Static Public Member Functions

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

Static Public Attributes

static const Index WORD_COUNT = NodeMaskType::WORD_COUNT
 
static const Index SIZE = 1 << 3 * Log2Dim
 
static const bool sOn = true
 
static const bool sOff = false
 
static const Index SIZE
 

Friends

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

Member Typedef Documentation

◆ NodeMaskType [1/2]

using NodeMaskType

◆ NodeMaskType [2/2]

template<Index Log2Dim>
using NodeMaskType = util::NodeMask<Log2Dim>

◆ StorageType [1/2]

using StorageType

◆ StorageType [2/2]

template<Index Log2Dim>
using StorageType = WordType

◆ ValueType [1/2]

using ValueType

◆ ValueType [2/2]

template<Index Log2Dim>
using ValueType = bool

◆ WordType

template<Index Log2Dim>
using WordType = typename NodeMaskType::Word

Constructor & Destructor Documentation

◆ LeafBuffer() [1/8]

template<Index Log2Dim>
LeafBuffer ( )
inline

◆ LeafBuffer() [2/8]

template<Index Log2Dim>
LeafBuffer ( bool on)
inline

◆ LeafBuffer() [3/8]

template<Index Log2Dim>
LeafBuffer ( const NodeMaskType & other)
inline

◆ LeafBuffer() [4/8]

template<Index Log2Dim>
LeafBuffer ( const LeafBuffer< bool, Log2Dim > & other)
inline

◆ ~LeafBuffer() [1/2]

template<Index Log2Dim>
~LeafBuffer ( )
inline

◆ LeafBuffer() [5/8]

LeafBuffer ( )
inline

Default constructor.

◆ LeafBuffer() [6/8]

LeafBuffer ( const ValueType & val)
inlineexplicit

Construct a buffer populated with the specified value.

◆ LeafBuffer() [7/8]

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

Copy constructor.

◆ LeafBuffer() [8/8]

LeafBuffer ( PartialCreate ,
const ValueType &  )
inline

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

◆ ~LeafBuffer() [2/2]

~LeafBuffer ( )
inline

Destructor.

Member Function Documentation

◆ allocate()

bool allocate ( )
inline

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

◆ data() [1/4]

LeafBuffer< bool, 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.

◆ data() [2/4]

template<Index Log2Dim>
WordType * data ( )
inline

Return a pointer to the C-style array of words encoding the bits.

Warning
This method should only be used by experts seeking low-level optimizations.

◆ data() [3/4]

const LeafBuffer< bool, 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.

◆ data() [4/4]

template<Index Log2Dim>
const WordType * data ( ) const
inline

Return a const pointer to the C-style array of words encoding the bits.

Warning
This method should only be used by experts seeking low-level optimizations.

◆ empty()

bool empty ( ) const
inline

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

◆ fill() [1/2]

template<Index Log2Dim>
void fill ( bool val)
inline

◆ fill() [2/2]

void fill ( const ValueType & val)
inline

Populate this buffer with a constant value.

◆ getValue() [1/2]

const ValueType & getValue ( Index i) const
inline

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

◆ getValue() [2/2]

template<Index Log2Dim>
const bool & getValue ( Index i) const
inline

◆ isOutOfCore()

bool isOutOfCore ( ) const
inline

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

◆ memUsage() [1/2]

Index memUsage ( ) const
inline

Return the memory footprint of this buffer in bytes.

◆ memUsage() [2/2]

template<Index Log2Dim>
Index memUsage ( ) const
inline

◆ memUsageIfLoaded() [1/2]

Index memUsageIfLoaded ( ) const
inline

◆ memUsageIfLoaded() [2/2]

template<Index Log2Dim>
Index memUsageIfLoaded ( ) const
inline

◆ operator!=() [1/2]

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

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

◆ operator!=() [2/2]

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

◆ operator=() [1/2]

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

Copy the other buffer's values into this buffer.

◆ operator=() [2/2]

template<Index Log2Dim>
LeafBuffer & operator= ( const LeafBuffer< bool, Log2Dim > & b)
inline

◆ operator==() [1/2]

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

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

◆ operator==() [2/2]

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

◆ operator[]() [1/2]

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

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

◆ operator[]() [2/2]

template<Index Log2Dim>
const bool & operator[] ( Index i) const
inline

◆ setValue() [1/2]

template<Index Log2Dim>
void setValue ( Index i,
bool val )
inline

◆ setValue() [2/2]

void setValue ( Index i,
const ValueType & val )
inline

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

◆ size() [1/2]

static Index size ( )
inlinestatic

Return the number of values contained in this buffer.

◆ size() [2/2]

template<Index Log2Dim>
static Index size ( )
inlinestatic

◆ swap() [1/2]

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

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

◆ swap() [2/2]

template<Index Log2Dim>
void swap ( LeafBuffer< bool, Log2Dim > & other)
inline

Friends And Related Symbol Documentation

◆ ::TestLeaf

friend class ::TestLeaf
friend

◆ LeafNode [1/2]

friend class LeafNode
friend

◆ LeafNode [2/2]

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

Member Data Documentation

◆ SIZE [1/2]

const Index SIZE
static

◆ SIZE [2/2]

template<Index Log2Dim>
const Index SIZE = 1 << 3 * Log2Dim
static

◆ sOff

template<Index Log2Dim>
const bool sOff = false
inlinestatic

◆ sOn

template<Index Log2Dim>
const bool sOn = true
inlinestatic

◆ WORD_COUNT

template<Index Log2Dim>
const Index WORD_COUNT = NodeMaskType::WORD_COUNT
static