OpenVDB 11.0.0

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
LeafNode< bool, Log2Dim > Class Template Reference

LeafNode specialization for values of type bool that stores both the active states and the values of (2^Log2Dim)^3 voxels as bit masks. More...

`#include <openvdb/tree/LeafNodeBool.h>`

## Classes
struct | ChildIter
| Leaf nodes have no children, so their child iterators have no get/set accessors. More...
struct | DenseIter
struct | SameConfiguration
| SameConfiguration<OtherNodeType>::value is `true` if and only if OtherNodeType is the type of a LeafNode with the same dimensions as this node. More...
struct | ValueConverter
| ValueConverter<T>::Type is the type of a LeafNode having the same dimensions as this node but a different value type, T. More...
struct | ValueIter

## Public Types
using | LeafNodeType = LeafNode<bool, Log2Dim>
using | BuildType = bool
using | ValueType = bool
using | Buffer = LeafBuffer<ValueType, Log2Dim>
using | NodeMaskType = util::NodeMask<Log2Dim>
using | Ptr = SharedPtr<LeafNodeType>
using | ValueOnIter = ValueIter<MaskOnIter, LeafNode, const bool>
using | ValueOnCIter = ValueIter<MaskOnIter, const LeafNode, const bool>
using | ValueOffIter = ValueIter<MaskOffIter, LeafNode, const bool>
using | ValueOffCIter = ValueIter<MaskOffIter, const LeafNode, const bool>
using | ValueAllIter = ValueIter<MaskDenseIter, LeafNode, const bool>
using | ValueAllCIter = ValueIter<MaskDenseIter, const LeafNode, const bool>
using | ChildOnIter = ChildIter<MaskOnIter, LeafNode>
using | ChildOnCIter = ChildIter<MaskOnIter, const LeafNode>
using | ChildOffIter = ChildIter<MaskOffIter, LeafNode>
using | ChildOffCIter = ChildIter<MaskOffIter, const LeafNode>
using | ChildAllIter = DenseIter<LeafNode, bool>
using | ChildAllCIter = DenseIter<const LeafNode, const bool>

## Public Member Functions
| LeafNode ()
| Default constructor.
| LeafNode (const Coord &xyz, bool value=false, bool active=false)
| LeafNode (PartialCreate, const Coord &xyz, bool value=false, bool active=false)
| "Partial creation" constructor used during file input
| LeafNode (const LeafNode &)
| Deep copy constructor.
LeafNode & | operator= (const LeafNode &)=default
| Deep assignment operator.
template<typename OtherValueType >
| LeafNode (const LeafNode< OtherValueType, Log2Dim > &other)
| Value conversion copy constructor.
template<typename ValueType >
| LeafNode (const LeafNode< ValueType, Log2Dim > &other, TopologyCopy)
| Deprecated topology copy constructor.
| LeafNode (const Coord &xyz, const NodeMaskType &mask, const Buffer &buff, const Index32 trans=0)
| Construct a LeafNodeBool with its individual components.
template<typename ValueType >
| LeafNode (const LeafNode< ValueType, Log2Dim > &other, bool offValue, bool onValue, TopologyCopy)
| Topology copy constructors.
template<typename ValueType >
| LeafNode (const LeafNode< ValueType, Log2Dim > &other, bool background, TopologyCopy)
| ~LeafNode ()
| Destructor.
void | nodeCount (std::vector< Index32 > &) const
| no-op
Index64 | onVoxelCount () const
| Return the number of active voxels.
Index64 | offVoxelCount () const
| Return the number of inactive voxels.
Index64 | onLeafVoxelCount () const
Index64 | offLeafVoxelCount () const
bool | isEmpty () const
| Return `true` if this node has no active voxels.
bool | isDense () const
| Return `true` if this node only contains active voxels.
bool | isAllocated () const
| Return `true` if memory for this node's buffer has been allocated.
bool | allocate ()
| Allocate memory for this node's buffer if it has not already been allocated.
Index64 | memUsage () const
| Return the memory in bytes occupied by this node.
Index64 | memUsageIfLoaded () const
void | evalActiveBoundingBox (CoordBBox &bbox, bool visitVoxels=true) const
CoordBBox | getNodeBoundingBox () const
| Return the bounding box of this node, i.e., the full index space spanned by this leaf node.
void | setOrigin (const Coord &origin)
| Set the grid index coordinates of this node's local origin.
const Coord & | origin () const
| Return the grid index coordinates of this node's local origin.
void | getOrigin (Coord &origin) const
void | getOrigin (Int32 &x, Int32 &y, Int32 &z) const
Coord | offsetToGlobalCoord (Index n) const
| Return the global coordinates for a linear table offset.
Index32 | transientData () const
| Return the transient data value.
void | setTransientData (Index32 transientData)
| Set the transient data value.
std::string | str () const
| Return a string representation of this node.
template<typename OtherType , Index OtherLog2Dim>
bool | hasSameTopology (const LeafNode< OtherType, OtherLog2Dim > *other) const
| Return `true` if the given node (which may have a different `ValueType` than this node) has the same active value topology as this node.
bool | operator== (const LeafNode &) const
| Check for buffer equivalence by value.
bool | operator!= (const LeafNode &) const
void | swap (Buffer &other)
| Exchange this node's data buffer with the given data buffer without changing the active states of the values.
const Buffer & | buffer () const
Buffer & | buffer ()
void | readTopology (std::istream &, bool fromHalf=false)
| Read in just the topology.
void | writeTopology (std::ostream &, bool toHalf=false) const
| Write out just the topology.
void | readBuffers (std::istream &, bool fromHalf=false)
| Read in the topology and the origin.
void | readBuffers (std::istream &is, const CoordBBox &, bool fromHalf=false)
void | writeBuffers (std::ostream &, bool toHalf=false) const
| Write out the topology and the origin.
const bool & | getValue (const Coord &xyz) const
| Return the value of the voxel at the given coordinates.
const bool & | getValue (Index offset) const
| Return the value of the voxel at the given offset.
bool | probeValue (const Coord &xyz, bool &val) const
| Return `true` if the voxel at the given coordinates is active.
void | setActiveState (const Coord &xyz, bool on)
| Set the active state of the voxel at the given coordinates but don't change its value.
void | setActiveState (Index offset, bool on)
| Set the active state of the voxel at the given offset but don't change its value.
void | setValueOnly (const Coord &xyz, bool val)
| Set the value of the voxel at the given coordinates but don't change its active state.
void | setValueOnly (Index offset, bool val)
| Set the value of the voxel at the given offset but don't change its active state.
void | setValueOff (const Coord &xyz)
| Mark the voxel at the given coordinates as inactive but don't change its value.
void | setValueOff (Index offset)
| Mark the voxel at the given offset as inactive but don't change its value.
void | setValueOff (const Coord &xyz, bool val)
| Set the value of the voxel at the given coordinates and mark the voxel as inactive.
void | setValueOff (Index offset, bool val)
| Set the value of the voxel at the given offset and mark the voxel as inactive.
void | setValueOn (const Coord &xyz)
| Mark the voxel at the given coordinates as active but don't change its value.
void | setValueOn (Index offset)
| Mark the voxel at the given offset as active but don't change its value.
void | setValueOn (const Coord &xyz, bool val)
| Set the value of the voxel at the given coordinates and mark the voxel as active.
void | setValue (const Coord &xyz, bool val)
| Set the value of the voxel at the given coordinates and mark the voxel as active.
void | setValueOn (Index offset, bool val)
| Set the value of the voxel at the given offset and mark the voxel as active.
template<typename ModifyOp >
void | modifyValue (Index offset, const ModifyOp &op)
| Apply a functor to the value of the voxel at the given offset and mark the voxel as active.
template<typename ModifyOp >
void | modifyValue (const Coord &xyz, const ModifyOp &op)
| Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active.
template<typename ModifyOp >
void | modifyValueAndActiveState (const Coord &xyz, const ModifyOp &op)
| Apply a functor to the voxel at the given coordinates.
void | setValuesOn ()
| Mark all voxels as active but don't change their values.
void | setValuesOff ()
| Mark all voxels as inactive but don't change their values.
bool | isValueOn (const Coord &xyz) const
| Return `true` if the voxel at the given coordinates is active.
bool | isValueOn (Index offset) const
| Return `true` if the voxel at the given offset is active.
void | clip (const CoordBBox &, bool background)
| Set all voxels that lie outside the given axis-aligned box to the background.
void | fill (const CoordBBox &bbox, bool value, bool active=true)
| Set all voxels within an axis-aligned box to the specified value and active state.
void | denseFill (const CoordBBox &bbox, bool val, bool on=true)
| Set all voxels within an axis-aligned box to the specified value and active state.
void | fill (const bool &value)
| Set all voxels to the specified value but don't change their active states.
void | fill (const bool &value, bool active)
| Set all voxels to the specified value and active state.
template<typename DenseT >
void | copyToDense (const CoordBBox &bbox, DenseT &dense) const
| Copy into a dense grid the values of the voxels that lie within a given bounding box.
template<typename DenseT >
void | copyFromDense (const CoordBBox &bbox, const DenseT &dense, bool background, bool tolerance)
| Copy from a dense grid into this node the values of the voxels that lie within a given bounding box.
template<typename AccessorT >
const bool & | getValueAndCache (const Coord &xyz, AccessorT &) const
| Return the value of the voxel at the given coordinates.
template<typename AccessorT >
bool | isValueOnAndCache (const Coord &xyz, AccessorT &) const
| Return `true` if the voxel at the given coordinates is active.
template<typename AccessorT >
void | setValueAndCache (const Coord &xyz, bool val, AccessorT &)
| Change the value of the voxel at the given coordinates and mark it as active.
template<typename AccessorT >
void | setValueOnlyAndCache (const Coord &xyz, bool val, AccessorT &)
| Change the value of the voxel at the given coordinates but preserve its state.
template<typename AccessorT >
void | setValueOffAndCache (const Coord &xyz, bool value, AccessorT &)
| Change the value of the voxel at the given coordinates and mark it as inactive.
template<typename ModifyOp , typename AccessorT >
void | modifyValueAndCache (const Coord &xyz, const ModifyOp &op, AccessorT &)
| Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active.
template<typename ModifyOp , typename AccessorT >
void | modifyValueAndActiveStateAndCache (const Coord &xyz, const ModifyOp &op, AccessorT &)
template<typename AccessorT >
void | setActiveStateAndCache (const Coord &xyz, bool on, AccessorT &)
| Set the active state of the voxel at the given coordinates without changing its value.
template<typename AccessorT >
bool | probeValueAndCache (const Coord &xyz, bool &val, AccessorT &) const
| Return `true` if the voxel at the given coordinates is active and return the voxel value in val.
const bool & | getFirstValue () const
| Return a const reference to the first entry in the buffer.
const bool & | getLastValue () const
| Return a const reference to the last entry in the buffer.
bool | isConstant (bool &constValue, bool &state, bool tolerance=0) const
bool | medianAll () const
| Computes the median value of all the active and inactive voxels in this node.
Index | medianOn (ValueType &value) const
| Computes the median value of all the active voxels in this node.
Index | medianOff (ValueType &value) const
| Computes the median value of all the inactive voxels in this node.
bool | isInactive () const
| Return `true` if all of this node's values are inactive.
void | resetBackground (bool oldBackground, bool newBackground)
void | negate ()
template<MergePolicy Policy>
void | merge (const LeafNode &other, bool bg=false, bool otherBG=false)
template<MergePolicy Policy>
void | merge (bool tileValue, bool tileActive)
void | voxelizeActiveTiles (bool=true)
| No-op.
template<typename OtherType >
void | topologyUnion (const LeafNode< OtherType, Log2Dim > &other, const bool preserveTiles=false)
| Union this node's set of active values with the active values of the other node, whose `ValueType` may be different. So a resulting voxel will be active if either of the original voxels were active.
template<typename OtherType >
void | topologyIntersection (const LeafNode< OtherType, Log2Dim > &other, const bool &)
| Intersect this node's set of active values with the active values of the other node, whose `ValueType` may be different. So a resulting voxel will be active only if both of the original voxels were active.
template<typename OtherType >
void | topologyDifference (const LeafNode< OtherType, Log2Dim > &other, const bool &)
| Difference this node's set of active values with the active values of the other node, whose `ValueType` may be different. So a resulting voxel will be active only if the original voxel is active in this LeafNode and inactive in the other LeafNode.
template<typename CombineOp >
void | combine (const LeafNode &other, CombineOp &op)
template<typename CombineOp >
void | combine (bool, bool valueIsActive, CombineOp &op)
template<typename CombineOp , typename OtherType >
void | combine2 (const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
template<typename CombineOp , typename OtherNodeT >
void | combine2 (bool, const OtherNodeT &other, bool valueIsActive, CombineOp &)
template<typename CombineOp , typename OtherNodeT >
void | combine2 (const LeafNode &b0, const OtherNodeT &b1, CombineOp &)
void | prune (const ValueType &=zeroVal< ValueType >())
| This function exists only to enable template instantiation.
void | addLeaf (LeafNode *)
template<typename AccessorT >
void | addLeafAndCache (LeafNode *, AccessorT &)
template<typename NodeT >
NodeT * | stealNode (const Coord &, const ValueType &, bool)
template<typename NodeT >
NodeT * | probeNode (const Coord &)
template<typename NodeT >
const NodeT * | probeConstNode (const Coord &) const
template<typename ArrayT >
void | getNodes (ArrayT &) const
template<typename ArrayT >
void | stealNodes (ArrayT &, const ValueType &, bool)
void | addTile (Index level, const Coord &, bool val, bool active)
void | addTile (Index offset, bool val, bool active)
template<typename AccessorT >
void | addTileAndCache (Index level, const Coord &, bool val, bool active, AccessorT &)
LeafNode * | touchLeaf (const Coord &)
| Return a pointer to this node.
template<typename AccessorT >
LeafNode * | touchLeafAndCache (const Coord &, AccessorT &)
LeafNode * | probeLeaf (const Coord &)
template<typename AccessorT >
LeafNode * | probeLeafAndCache (const Coord &, AccessorT &)
template<typename NodeT , typename AccessorT >
NodeT * | probeNodeAndCache (const Coord &, AccessorT &)
const LeafNode * | probeLeaf (const Coord &) const
| Return a `const` pointer to this node.
template<typename AccessorT >
const LeafNode * | probeLeafAndCache (const Coord &, AccessorT &) const
const LeafNode * | probeConstLeaf (const Coord &) const
template<typename AccessorT >
const LeafNode * | probeConstLeafAndCache (const Coord &, AccessorT &) const
template<typename NodeT , typename AccessorT >
const NodeT * | probeConstNodeAndCache (const Coord &, AccessorT &) const
ValueOnCIter | cbeginValueOn () const
ValueOnCIter | beginValueOn () const
ValueOnIter | beginValueOn ()
ValueOffCIter | cbeginValueOff () const
ValueOffCIter | beginValueOff () const
ValueOffIter | beginValueOff ()
ValueAllCIter | cbeginValueAll () const
ValueAllCIter | beginValueAll () const
ValueAllIter | beginValueAll ()
ValueOnCIter | cendValueOn () const
ValueOnCIter | endValueOn () const
ValueOnIter | endValueOn ()
ValueOffCIter | cendValueOff () const
ValueOffCIter | endValueOff () const
ValueOffIter | endValueOff ()
ValueAllCIter | cendValueAll () const
ValueAllCIter | endValueAll () const
ValueAllIter | endValueAll ()
ChildOnCIter | cbeginChildOn () const
ChildOnCIter | beginChildOn () const
ChildOnIter | beginChildOn ()
ChildOffCIter | cbeginChildOff () const
ChildOffCIter | beginChildOff () const
ChildOffIter | beginChildOff ()
ChildAllCIter | cbeginChildAll () const
ChildAllCIter | beginChildAll () const
ChildAllIter | beginChildAll ()
ChildOnCIter | cendChildOn () const
ChildOnCIter | endChildOn () const
ChildOnIter | endChildOn ()
ChildOffCIter | cendChildOff () const
ChildOffCIter | endChildOff () const
ChildOffIter | endChildOff ()
ChildAllCIter | cendChildAll () const
ChildAllCIter | endChildAll () const
ChildAllIter | endChildAll ()
bool | isValueMaskOn (Index n) const
bool | isValueMaskOn () const
bool | isValueMaskOff (Index n) const
bool | isValueMaskOff () const
const NodeMaskType & | getValueMask () const
const NodeMaskType & | valueMask () const
NodeMaskType & | getValueMask ()
void | setValueMask (const NodeMaskType &mask)
bool | isChildMaskOn (Index) const
bool | isChildMaskOff (Index) const
bool | isChildMaskOff () const
template<typename ValueT >
| LeafNode (const LeafNode< ValueT, Log2Dim > &other)
template<typename ValueT >
| LeafNode (const LeafNode< ValueT, Log2Dim > &other, TopologyCopy)
template<typename ValueT >
| LeafNode (const LeafNode< ValueT, Log2Dim > &other, bool offValue, bool onValue, TopologyCopy)

## Static Public Member Functions
static Index | log2dim ()
| Return log2 of the size of the buffer storage.
static Index | dim ()
| Return the number of voxels in each dimension.
static Index | size ()
static Index | numValues ()
static Index | getLevel ()
static void | getNodeLog2Dims (std::vector< Index > &dims)
static Index | getChildDim ()
static Index32 | leafCount ()
static Index32 | nonLeafCount ()
static Index64 | onTileCount ()
static Index64 | offTileCount ()
static Index | coordToOffset (const Coord &xyz)
| Return the linear table offset of the given global or local coordinates.
static Coord | offsetToLocalCoord (Index n)
| Return the local coordinates for a linear table offset, where offset 0 has coordinates (0, 0, 0).
static Index | getValueLevel (const Coord &)
| Return the level (0) at which leaf node values reside.
static bool | hasActiveTiles ()
| Return `false` since leaf nodes never contain tiles.
template<typename AccessorT >
static Index | getValueLevelAndCache (const Coord &, AccessorT &)
| Return the LEVEL (=0) at which leaf node values reside.

## Static Public Attributes
static const Index | LOG2DIM = Log2Dim
static const Index | TOTAL = Log2Dim
static const Index | DIM = 1 << TOTAL
static const Index | NUM_VALUES = 1 << 3 * Log2Dim
static const Index | NUM_VOXELS = NUM_VALUES
static const Index | SIZE = NUM_VALUES
static const Index | LEVEL = 0

## Protected Types
using | MaskOnIter = typename NodeMaskType::OnIterator
using | MaskOffIter = typename NodeMaskType::OffIterator
using | MaskDenseIter = typename NodeMaskType::DenseIterator

## Protected Member Functions
void | setValueMask (Index n, bool on)
void | setValueMaskOn (Index n)
void | setValueMaskOff (Index n)

## Static Protected Member Functions
static void | evalNodeOrigin (Coord &xyz)
| Compute the origin of the leaf node that contains the voxel with the given coordinates.

## Protected Attributes
NodeMaskType | mValueMask
| Bitmask that determines which voxels are active.
Buffer | mBuffer
| Bitmask representing the values of voxels.
Coord | mOrigin
| Global grid index coordinates (x,y,z) of the local origin of this node.
Index32 | mTransientData = 0
| Transient data (not serialized)

## Friends
template<typename , Index >
class | LeafNode
| During topology-only construction, access is needed to protected/private members of other template instances.
struct | ValueIter< MaskOnIter, LeafNode, bool >
struct | ValueIter< MaskOffIter, LeafNode, bool >
struct | ValueIter< MaskDenseIter, LeafNode, bool >
struct | ValueIter< MaskOnIter, const LeafNode, bool >
struct | ValueIter< MaskOffIter, const LeafNode, bool >
struct | ValueIter< MaskDenseIter, const LeafNode, bool >
class | IteratorBase< MaskOnIter, LeafNode >
class | IteratorBase< MaskOffIter, LeafNode >
class | IteratorBase< MaskDenseIter, LeafNode >

## Detailed Description

template<Index Log2Dim>
class openvdb::v11_0::tree::LeafNode< bool, Log2Dim >

LeafNode specialization for values of type bool that stores both the active states and the values of (2^Log2Dim)^3 voxels as bit masks.

## Member Typedef Documentation

## ◆ Buffer

template<Index Log2Dim>

using Buffer = LeafBuffer<ValueType, Log2Dim>

## ◆ BuildType

template<Index Log2Dim>

using BuildType = bool

## ◆ ChildAllCIter

template<Index Log2Dim>

using ChildAllCIter = DenseIter<const LeafNode, const bool>

## ◆ ChildAllIter

template<Index Log2Dim>

using ChildAllIter = DenseIter<LeafNode, bool>

## ◆ ChildOffCIter

template<Index Log2Dim>

using ChildOffCIter = ChildIter<MaskOffIter, const LeafNode>

## ◆ ChildOffIter

template<Index Log2Dim>

using ChildOffIter = ChildIter<MaskOffIter, LeafNode>

## ◆ ChildOnCIter

template<Index Log2Dim>

using ChildOnCIter = ChildIter<MaskOnIter, const LeafNode>

## ◆ ChildOnIter

template<Index Log2Dim>

using ChildOnIter = ChildIter<MaskOnIter, LeafNode>

## ◆ LeafNodeType

template<Index Log2Dim>

using LeafNodeType = LeafNode<bool, Log2Dim>

## ◆ MaskDenseIter

template<Index Log2Dim>

using MaskDenseIter = typename NodeMaskType::DenseIterator
| protected

## ◆ MaskOffIter

template<Index Log2Dim>

using MaskOffIter = typename NodeMaskType::OffIterator
| protected

## ◆ MaskOnIter

template<Index Log2Dim>

using MaskOnIter = typename NodeMaskType::OnIterator
| protected

## ◆ NodeMaskType

template<Index Log2Dim>

using NodeMaskType = util::NodeMask<Log2Dim>

## ◆ Ptr

template<Index Log2Dim>

using Ptr = SharedPtr<LeafNodeType>

## ◆ ValueAllCIter

template<Index Log2Dim>

using ValueAllCIter = ValueIter<MaskDenseIter, const LeafNode, const bool>

## ◆ ValueAllIter

template<Index Log2Dim>

using ValueAllIter = ValueIter<MaskDenseIter, LeafNode, const bool>

## ◆ ValueOffCIter

template<Index Log2Dim>

using ValueOffCIter = ValueIter<MaskOffIter, const LeafNode, const bool>

## ◆ ValueOffIter

template<Index Log2Dim>

using ValueOffIter = ValueIter<MaskOffIter, LeafNode, const bool>

## ◆ ValueOnCIter

template<Index Log2Dim>

using ValueOnCIter = ValueIter<MaskOnIter, const LeafNode, const bool>

## ◆ ValueOnIter

template<Index Log2Dim>

using ValueOnIter = ValueIter<MaskOnIter, LeafNode, const bool>

## ◆ ValueType

template<Index Log2Dim>

using ValueType = bool

## Constructor & Destructor Documentation

## ◆ LeafNode() [1/12]

template<Index Log2Dim>

LeafNode | ( |  | ) |
| inline

Default constructor.

## ◆ LeafNode() [2/12]

template<Index Log2Dim>

LeafNode | ( | const Coord & | xyz,
|  | bool | value = false,
|  | bool | active = false )
| inline explicit

Constructor

Parameters

  xyz | the coordinates of a voxel that lies within the node
  value | the initial value for all of this node's voxels
  active | the active state to which to initialize all voxels

## ◆ LeafNode() [3/12]

template<Index Log2Dim>

LeafNode | ( | PartialCreate | ,
|  | const Coord & | xyz,
|  | bool | value = false,
|  | bool | active = false )
| inline

"Partial creation" constructor used during file input

## ◆ LeafNode() [4/12]

template<Index Log2Dim>

LeafNode | ( | const LeafNode< bool, Log2Dim > & |  | ) |

Deep copy constructor.

## ◆ LeafNode() [5/12]

template<Index Log2Dim>
template<typename OtherValueType >

LeafNode | ( | const LeafNode< OtherValueType, Log2Dim > & | other | ) |
| explicit

Value conversion copy constructor.

## ◆ LeafNode() [6/12]

template<Index Log2Dim>
template<typename ValueType >

LeafNode | ( | const LeafNode< ValueType, Log2Dim > & | other,
|  | TopologyCopy | )

Deprecated topology copy constructor.

Note
  This constructor initialises the bool buffer to the ValueMask states (i.e. value will be true if the active state is on and vice-versa). This is not really a "TopologyCopy" and is therefor deprecated. Use the explicit mask/buffer constructor instead:
  // build new leaf node with the mask of 'a', but with the mask of
  // 'b' as the the new value buffer.
  const LeafNode a = ... ;
  const LeafNode b = ... ;
  const LeafNode copy(a.origin(), /*mask=*/a.getValueMask(),
  /*buff=*/b.getValueMask());
  openvdb::v11_0::tree::LeafNode
  Templated block class to hold specific data types and a fixed number of values determined by Log2Dim....
  Definition LeafNode.h:38
  openvdb::v11_0::tree::LeafNode::origin
  const Coord & origin() const
  Return the grid index coordinates of this node's local origin.
  Definition LeafNode.h:173
  openvdb::v11_0::tree::LeafNode::getValueMask
  const NodeMaskType & getValueMask() const
  Definition LeafNode.h:854

Deprecated
  "Use LeafNodeBool component constructor."

## ◆ LeafNode() [7/12]

template<Index Log2Dim>

LeafNode | ( | const Coord & | xyz,
|  | const NodeMaskType & | mask,
|  | const Buffer & | buff,
|  | const Index32 | trans = 0 )
| inline

Construct a LeafNodeBool with its individual components.

Parameters

  xyz | Leaf origin
  mask | The ValueMask to copy
  buff | The LeafBuffer to copy (also constructable from a ValueMask)
  trans | Transient data (ignored until ABI 9)

## ◆ LeafNode() [8/12]

template<Index Log2Dim>
template<typename ValueType >

LeafNode | ( | const LeafNode< ValueType, Log2Dim > & | other,
|  | bool | offValue,
|  | bool | onValue,
|  | TopologyCopy | )

Topology copy constructors.

## ◆ LeafNode() [9/12]

template<Index Log2Dim>
template<typename ValueType >

LeafNode | ( | const LeafNode< ValueType, Log2Dim > & | other,
|  | bool | background,
|  | TopologyCopy | )

## ◆ ~LeafNode()

template<Index Log2Dim>

~LeafNode | ( |  | ) |
| inline

Destructor.

## ◆ LeafNode() [10/12]

template<Index Log2Dim>
template<typename ValueT >

LeafNode | ( | const LeafNode< ValueT, Log2Dim > & | other | ) |
| inline

## ◆ LeafNode() [11/12]

template<Index Log2Dim>
template<typename ValueT >

LeafNode | ( | const LeafNode< ValueT, Log2Dim > & | other,
|  | TopologyCopy | )
| inline

## ◆ LeafNode() [12/12]

template<Index Log2Dim>
template<typename ValueT >

LeafNode | ( | const LeafNode< ValueT, Log2Dim > & | other,
|  | bool | offValue,
|  | bool | onValue,
|  | TopologyCopy | )
| inline

## Member Function Documentation

## ◆ addLeaf()

template<Index Log2Dim>

void addLeaf | ( | LeafNode< bool, Log2Dim > * |  | ) |
| inline

## ◆ addLeafAndCache()

template<Index Log2Dim>
template<typename AccessorT >

void addLeafAndCache | ( | LeafNode< bool, Log2Dim > * | ,
|  | AccessorT & | )
| inline

## ◆ addTile() [1/2]

template<Index Log2Dim>

void addTile | ( | Index | level,
|  | const Coord & | xyz,
|  | bool | val,
|  | bool | active )
| inline

## ◆ addTile() [2/2]

template<Index Log2Dim>

void addTile | ( | Index | offset,
|  | bool | val,
|  | bool | active )
| inline

## ◆ addTileAndCache()

template<Index Log2Dim>
template<typename AccessorT >

void addTileAndCache | ( | Index | level,
|  | const Coord & | xyz,
|  | bool | val,
|  | bool | active,
|  | AccessorT & | )
| inline

## ◆ allocate()

template<Index Log2Dim>

bool allocate | ( |  | ) |
| inline

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

Currently, boolean leaf nodes don't support partial creation, so this has no effect.

## ◆ beginChildAll() [1/2]

template<Index Log2Dim>

ChildAllIter beginChildAll | ( |  | ) |
| inline

## ◆ beginChildAll() [2/2]

template<Index Log2Dim>

ChildAllCIter beginChildAll | ( |  | ) | const
| inline

## ◆ beginChildOff() [1/2]

template<Index Log2Dim>

ChildOffIter beginChildOff | ( |  | ) |
| inline

## ◆ beginChildOff() [2/2]

template<Index Log2Dim>

ChildOffCIter beginChildOff | ( |  | ) | const
| inline

## ◆ beginChildOn() [1/2]

template<Index Log2Dim>

ChildOnIter beginChildOn | ( |  | ) |
| inline

## ◆ beginChildOn() [2/2]

template<Index Log2Dim>

ChildOnCIter beginChildOn | ( |  | ) | const
| inline

## ◆ beginValueAll() [1/2]

template<Index Log2Dim>

ValueAllIter beginValueAll | ( |  | ) |
| inline

## ◆ beginValueAll() [2/2]

template<Index Log2Dim>

ValueAllCIter beginValueAll | ( |  | ) | const
| inline

## ◆ beginValueOff() [1/2]

template<Index Log2Dim>

ValueOffIter beginValueOff | ( |  | ) |
| inline

## ◆ beginValueOff() [2/2]

template<Index Log2Dim>

ValueOffCIter beginValueOff | ( |  | ) | const
| inline

## ◆ beginValueOn() [1/2]

template<Index Log2Dim>

ValueOnIter beginValueOn | ( |  | ) |
| inline

## ◆ beginValueOn() [2/2]

template<Index Log2Dim>

ValueOnCIter beginValueOn | ( |  | ) | const
| inline

## ◆ buffer() [1/2]

template<Index Log2Dim>

Buffer & buffer | ( |  | ) |
| inline

## ◆ buffer() [2/2]

template<Index Log2Dim>

const Buffer & buffer | ( |  | ) | const
| inline

## ◆ cbeginChildAll()

template<Index Log2Dim>

ChildAllCIter cbeginChildAll | ( |  | ) | const
| inline

## ◆ cbeginChildOff()

template<Index Log2Dim>

ChildOffCIter cbeginChildOff | ( |  | ) | const
| inline

## ◆ cbeginChildOn()

template<Index Log2Dim>

ChildOnCIter cbeginChildOn | ( |  | ) | const
| inline

## ◆ cbeginValueAll()

template<Index Log2Dim>

ValueAllCIter cbeginValueAll | ( |  | ) | const
| inline

## ◆ cbeginValueOff()

template<Index Log2Dim>

ValueOffCIter cbeginValueOff | ( |  | ) | const
| inline

## ◆ cbeginValueOn()

template<Index Log2Dim>

ValueOnCIter cbeginValueOn | ( |  | ) | const
| inline

## ◆ cendChildAll()

template<Index Log2Dim>

ChildAllCIter cendChildAll | ( |  | ) | const
| inline

## ◆ cendChildOff()

template<Index Log2Dim>

ChildOffCIter cendChildOff | ( |  | ) | const
| inline

## ◆ cendChildOn()

template<Index Log2Dim>

ChildOnCIter cendChildOn | ( |  | ) | const
| inline

## ◆ cendValueAll()

template<Index Log2Dim>

ValueAllCIter cendValueAll | ( |  | ) | const
| inline

## ◆ cendValueOff()

template<Index Log2Dim>

ValueOffCIter cendValueOff | ( |  | ) | const
| inline

## ◆ cendValueOn()

template<Index Log2Dim>

ValueOnCIter cendValueOn | ( |  | ) | const
| inline

## ◆ clip()

template<Index Log2Dim>

void clip | ( | const CoordBBox & | clipBBox,
|  | bool | background )
| inline

Set all voxels that lie outside the given axis-aligned box to the background.

## ◆ combine() [1/2]

template<Index Log2Dim>
template<typename CombineOp >

void combine | ( | bool | value,
|  | bool | valueIsActive,
|  | CombineOp & | op )
| inline

## ◆ combine() [2/2]

template<Index Log2Dim>
template<typename CombineOp >

void combine | ( | const LeafNode< bool, Log2Dim > & | other,
|  | CombineOp & | op )
| inline

## ◆ combine2() [1/3]

template<Index Log2Dim>
template<typename CombineOp , typename OtherNodeT >

void combine2 | ( | bool | value,
|  | const OtherNodeT & | other,
|  | bool | valueIsActive,
|  | CombineOp & | op )
| inline

## ◆ combine2() [2/3]

template<Index Log2Dim>
template<typename CombineOp , typename OtherNodeT >

void combine2 | ( | const LeafNode< bool, Log2Dim > & | b0,
|  | const OtherNodeT & | b1,
|  | CombineOp & | op )
| inline

## ◆ combine2() [3/3]

template<Index Log2Dim>
template<typename CombineOp , typename OtherType >

void combine2 | ( | const LeafNode< bool, Log2Dim > & | other,
|  | const OtherType & | value,
|  | bool | valueIsActive,
|  | CombineOp & | op )
| inline

## ◆ coordToOffset()

template<Index Log2Dim>

Index coordToOffset | ( | const Coord & | xyz | ) |
| inline static

Return the linear table offset of the given global or local coordinates.

## ◆ copyFromDense()

template<Index Log2Dim>
template<typename DenseT >

void copyFromDense | ( | const CoordBBox & | bbox,
|  | const DenseT & | dense,
|  | bool | background,
|  | bool | tolerance )
| inline

Copy from a dense grid into this node the values of the voxels that lie within a given bounding box.

Only values that are different (by more than the given tolerance) from the background value will be active. Other values are inactive and truncated to the background value.

Parameters

  bbox | inclusive bounding box of the voxels to be copied into this node
  dense | dense grid with a stride in z of one (see tools::Dense in tools/Dense.h for the required API)
  background | background value of the tree that this node belongs to
  tolerance | tolerance within which a value equals the background value

Note
  bbox is assumed to be identical to or contained in the coordinate domains of both the dense grid and this node, i.e., no bounds checking is performed.
  Consider using tools::CopyFromDense in tools/Dense.h instead of calling this method directly.

## ◆ copyToDense()

template<Index Log2Dim>
template<typename DenseT >

void copyToDense | ( | const CoordBBox & | bbox,
|  | DenseT & | dense ) const
| inline

Copy into a dense grid the values of the voxels that lie within a given bounding box.

Parameters

  bbox | inclusive bounding box of the voxels to be copied into the dense grid
  dense | dense grid with a stride in z of one (see tools::Dense in tools/Dense.h for the required API)

Note
  bbox is assumed to be identical to or contained in the coordinate domains of both the dense grid and this node, i.e., no bounds checking is performed.
  Consider using tools::CopyToDense in tools/Dense.h instead of calling this method directly.

## ◆ denseFill()

template<Index Log2Dim>

void denseFill | ( | const CoordBBox & | bbox,
|  | bool | val,
|  | bool | on = true )
| inline

Set all voxels within an axis-aligned box to the specified value and active state.

## ◆ dim()

template<Index Log2Dim>

static Index dim | ( |  | ) |
| inline static

Return the number of voxels in each dimension.

## ◆ endChildAll() [1/2]

template<Index Log2Dim>

ChildAllIter endChildAll | ( |  | ) |
| inline

## ◆ endChildAll() [2/2]

template<Index Log2Dim>

ChildAllCIter endChildAll | ( |  | ) | const
| inline

## ◆ endChildOff() [1/2]

template<Index Log2Dim>

ChildOffIter endChildOff | ( |  | ) |
| inline

## ◆ endChildOff() [2/2]

template<Index Log2Dim>

ChildOffCIter endChildOff | ( |  | ) | const
| inline

## ◆ endChildOn() [1/2]

template<Index Log2Dim>

ChildOnIter endChildOn | ( |  | ) |
| inline

## ◆ endChildOn() [2/2]

template<Index Log2Dim>

ChildOnCIter endChildOn | ( |  | ) | const
| inline

## ◆ endValueAll() [1/2]

template<Index Log2Dim>

ValueAllIter endValueAll | ( |  | ) |
| inline

## ◆ endValueAll() [2/2]

template<Index Log2Dim>

ValueAllCIter endValueAll | ( |  | ) | const
| inline

## ◆ endValueOff() [1/2]

template<Index Log2Dim>

ValueOffIter endValueOff | ( |  | ) |
| inline

## ◆ endValueOff() [2/2]

template<Index Log2Dim>

ValueOffCIter endValueOff | ( |  | ) | const
| inline

## ◆ endValueOn() [1/2]

template<Index Log2Dim>

ValueOnIter endValueOn | ( |  | ) |
| inline

## ◆ endValueOn() [2/2]

template<Index Log2Dim>

ValueOnCIter endValueOn | ( |  | ) | const
| inline

## ◆ evalActiveBoundingBox()

template<Index Log2Dim>

void evalActiveBoundingBox | ( | CoordBBox & | bbox,
|  | bool | visitVoxels = true ) const
| inline

Expand the given bounding box so that it includes this leaf node's active voxels. If visitVoxels is false this LeafNode will be approximated as dense, i.e. with all voxels active. Else the individual active voxels are visited to produce a tight bbox.

## ◆ evalNodeOrigin()

template<Index Log2Dim>

static void evalNodeOrigin | ( | Coord & | xyz | ) |
| inline static protected

Compute the origin of the leaf node that contains the voxel with the given coordinates.

## ◆ fill() [1/3]

template<Index Log2Dim>

void fill | ( | const bool & | value | ) |
| inline

Set all voxels to the specified value but don't change their active states.

## ◆ fill() [2/3]

template<Index Log2Dim>

void fill | ( | const bool & | value,
|  | bool | active )
| inline

Set all voxels to the specified value and active state.

## ◆ fill() [3/3]

template<Index Log2Dim>

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

Set all voxels within an axis-aligned box to the specified value and active state.

## ◆ getChildDim()

template<Index Log2Dim>

static Index getChildDim | ( |  | ) |
| inline static

## ◆ getFirstValue()

template<Index Log2Dim>

const bool & getFirstValue | ( |  | ) | const
| inline

Return a const reference to the first entry in the buffer.

Note
  Since it's actually a reference to a static data member it should not be converted to a non-const pointer!

## ◆ getLastValue()

template<Index Log2Dim>

const bool & getLastValue | ( |  | ) | const
| inline

Return a const reference to the last entry in the buffer.

Note
  Since it's actually a reference to a static data member it should not be converted to a non-const pointer!

## ◆ getLevel()

template<Index Log2Dim>

static Index getLevel | ( |  | ) |
| inline static

## ◆ getNodeBoundingBox()

template<Index Log2Dim>

CoordBBox getNodeBoundingBox | ( |  | ) | const
| inline

Return the bounding box of this node, i.e., the full index space spanned by this leaf node.

## ◆ getNodeLog2Dims()

template<Index Log2Dim>

static void getNodeLog2Dims | ( | std::vector< Index > & | dims | ) |
| inline static

## ◆ getNodes()

template<Index Log2Dim>
template<typename ArrayT >

void getNodes | ( | ArrayT & |  | ) | const
| inline

## ◆ getOrigin() [1/2]

template<Index Log2Dim>

void getOrigin | ( | Coord & | origin | ) | const
| inline

## ◆ getOrigin() [2/2]

template<Index Log2Dim>

void getOrigin | ( | Int32 & | x,
|  | Int32 & | y,
|  | Int32 & | z ) const
| inline

## ◆ getValue() [1/2]

template<Index Log2Dim>

const bool & getValue | ( | const Coord & | xyz | ) | const
| inline

Return the value of the voxel at the given coordinates.

## ◆ getValue() [2/2]

template<Index Log2Dim>

const bool & getValue | ( | Index | offset | ) | const
| inline

Return the value of the voxel at the given offset.

## ◆ getValueAndCache()

template<Index Log2Dim>
template<typename AccessorT >

const bool & getValueAndCache | ( | const Coord & | xyz,
|  | AccessorT & | ) const
| inline

Return the value of the voxel at the given coordinates.

Note
  Used internally by ValueAccessor.

## ◆ getValueLevel()

template<Index Log2Dim>

static Index getValueLevel | ( | const Coord & |  | ) |
| inline static

Return the level (0) at which leaf node values reside.

## ◆ getValueLevelAndCache()

template<Index Log2Dim>
template<typename AccessorT >

static Index getValueLevelAndCache | ( | const Coord & | ,
|  | AccessorT & | )
| inline static

Return the LEVEL (=0) at which leaf node values reside.

Note
  Used internally by ValueAccessor.

## ◆ getValueMask() [1/2]

template<Index Log2Dim>

NodeMaskType & getValueMask | ( |  | ) |
| inline

## ◆ getValueMask() [2/2]

template<Index Log2Dim>

const NodeMaskType & getValueMask | ( |  | ) | const
| inline

## ◆ hasActiveTiles()

template<Index Log2Dim>

static bool hasActiveTiles | ( |  | ) |
| inline static

Return `false` since leaf nodes never contain tiles.

## ◆ hasSameTopology()

template<Index Log2Dim>
template<typename OtherType , Index OtherLog2Dim>

bool hasSameTopology | ( | const LeafNode< OtherType, OtherLog2Dim > * | other | ) | const
| inline

Return `true` if the given node (which may have a different `ValueType` than this node) has the same active value topology as this node.

## ◆ isAllocated()

template<Index Log2Dim>

bool isAllocated | ( |  | ) | const
| inline

Return `true` if memory for this node's buffer has been allocated.

Currently, boolean leaf nodes don't support partial creation, so this always returns `true`.

## ◆ isChildMaskOff() [1/2]

template<Index Log2Dim>

bool isChildMaskOff | ( |  | ) | const
| inline

## ◆ isChildMaskOff() [2/2]

template<Index Log2Dim>

bool isChildMaskOff | ( | Index |  | ) | const
| inline

## ◆ isChildMaskOn()

template<Index Log2Dim>

bool isChildMaskOn | ( | Index |  | ) | const
| inline

## ◆ isConstant()

template<Index Log2Dim>

bool isConstant | ( | bool & | constValue,
|  | bool & | state,
|  | bool | tolerance = 0 ) const
| inline

Return `true` if all of this node's voxels have the same active state and are equal to within the given tolerance, and return the value in constValue and the active state in state.

## ◆ isDense()

template<Index Log2Dim>

bool isDense | ( |  | ) | const
| inline

Return `true` if this node only contains active voxels.

## ◆ isEmpty()

template<Index Log2Dim>

bool isEmpty | ( |  | ) | const
| inline

Return `true` if this node has no active voxels.

## ◆ isInactive()

template<Index Log2Dim>

bool isInactive | ( |  | ) | const
| inline

Return `true` if all of this node's values are inactive.

## ◆ isValueMaskOff() [1/2]

template<Index Log2Dim>

bool isValueMaskOff | ( |  | ) | const
| inline

## ◆ isValueMaskOff() [2/2]

template<Index Log2Dim>

bool isValueMaskOff | ( | Index | n | ) | const
| inline

## ◆ isValueMaskOn() [1/2]

template<Index Log2Dim>

bool isValueMaskOn | ( |  | ) | const
| inline

## ◆ isValueMaskOn() [2/2]

template<Index Log2Dim>

bool isValueMaskOn | ( | Index | n | ) | const
| inline

## ◆ isValueOn() [1/2]

template<Index Log2Dim>

bool isValueOn | ( | const Coord & | xyz | ) | const
| inline

Return `true` if the voxel at the given coordinates is active.

## ◆ isValueOn() [2/2]

template<Index Log2Dim>

bool isValueOn | ( | Index | offset | ) | const
| inline

Return `true` if the voxel at the given offset is active.

## ◆ isValueOnAndCache()

template<Index Log2Dim>
template<typename AccessorT >

bool isValueOnAndCache | ( | const Coord & | xyz,
|  | AccessorT & | ) const
| inline

Return `true` if the voxel at the given coordinates is active.

Note
  Used internally by ValueAccessor.

## ◆ leafCount()

template<Index Log2Dim>

static Index32 leafCount | ( |  | ) |
| inline static

## ◆ log2dim()

template<Index Log2Dim>

static Index log2dim | ( |  | ) |
| inline static

Return log2 of the size of the buffer storage.

## ◆ medianAll()

template<Index Log2Dim>

bool medianAll | ( |  | ) | const
| inline

Computes the median value of all the active and inactive voxels in this node.

Returns
  The median value.

The median for boolean values is defined as the mode of the values, i.e. the value that occurs most often.

## ◆ medianOff()

template<Index Log2Dim>

Index medianOff | ( | ValueType & | value | ) | const
| inline

Computes the median value of all the inactive voxels in this node.

Returns
  The number of inactive voxels.

Parameters

  value | Updated with the median value of all the inactive voxels.

The median for boolean values is defined as the mode of the values, i.e. the value that occurs most often.

## ◆ medianOn()

template<Index Log2Dim>

Index medianOn | ( | ValueType & | value | ) | const
| inline

Computes the median value of all the active voxels in this node.

Returns
  The number of active voxels.

Parameters

  value | Updated with the median value of all the active voxels.

The median for boolean values is defined as the mode of the values, i.e. the value that occurs most often.

## ◆ memUsage()

template<Index Log2Dim>

Index64 memUsage | ( |  | ) | const
| inline

Return the memory in bytes occupied by this node.

## ◆ memUsageIfLoaded()

template<Index Log2Dim>

Index64 memUsageIfLoaded | ( |  | ) | const
| inline

## ◆ merge() [1/2]

template<Index Log2Dim>
template<MergePolicy Policy>

void merge | ( | bool | tileValue,
|  | bool | tileActive )
| inline

## ◆ merge() [2/2]

template<Index Log2Dim>
template<MergePolicy Policy>

void merge | ( | const LeafNode< bool, Log2Dim > & | other,
|  | bool | bg = false,
|  | bool | otherBG = false )
| inline

## ◆ modifyValue() [1/2]

template<Index Log2Dim>
template<typename ModifyOp >

void modifyValue | ( | const Coord & | xyz,
|  | const ModifyOp & | op )
| inline

Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active.

## ◆ modifyValue() [2/2]

template<Index Log2Dim>
template<typename ModifyOp >

void modifyValue | ( | Index | offset,
|  | const ModifyOp & | op )
| inline

Apply a functor to the value of the voxel at the given offset and mark the voxel as active.

## ◆ modifyValueAndActiveState()

template<Index Log2Dim>
template<typename ModifyOp >

void modifyValueAndActiveState | ( | const Coord & | xyz,
|  | const ModifyOp & | op )
| inline

Apply a functor to the voxel at the given coordinates.

## ◆ modifyValueAndActiveStateAndCache()

template<Index Log2Dim>
template<typename ModifyOp , typename AccessorT >

void modifyValueAndActiveStateAndCache | ( | const Coord & | xyz,
|  | const ModifyOp & | op,
|  | AccessorT & | )
| inline

Apply a functor to the voxel at the given coordinates.

Note
  Used internally by ValueAccessor.

## ◆ modifyValueAndCache()

template<Index Log2Dim>
template<typename ModifyOp , typename AccessorT >

void modifyValueAndCache | ( | const Coord & | xyz,
|  | const ModifyOp & | op,
|  | AccessorT & | )
| inline

Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active.

Note
  Used internally by ValueAccessor.

## ◆ negate()

template<Index Log2Dim>

void negate | ( |  | ) |
| inline

## ◆ nodeCount()

template<Index Log2Dim>

void nodeCount | ( | std::vector< Index32 > & |  | ) | const
| inline

no-op

## ◆ nonLeafCount()

template<Index Log2Dim>

static Index32 nonLeafCount | ( |  | ) |
| inline static

## ◆ numValues()

template<Index Log2Dim>

static Index numValues | ( |  | ) |
| inline static

## ◆ offLeafVoxelCount()

template<Index Log2Dim>

Index64 offLeafVoxelCount | ( |  | ) | const
| inline

## ◆ offsetToGlobalCoord()

template<Index Log2Dim>

Coord offsetToGlobalCoord | ( | Index | n | ) | const
| inline

Return the global coordinates for a linear table offset.

## ◆ offsetToLocalCoord()

template<Index Log2Dim>

Coord offsetToLocalCoord | ( | Index | n | ) |
| inline static

Return the local coordinates for a linear table offset, where offset 0 has coordinates (0, 0, 0).

## ◆ offTileCount()

template<Index Log2Dim>

static Index64 offTileCount | ( |  | ) |
| inline static

## ◆ offVoxelCount()

template<Index Log2Dim>

Index64 offVoxelCount | ( |  | ) | const
| inline

Return the number of inactive voxels.

## ◆ onLeafVoxelCount()

template<Index Log2Dim>

Index64 onLeafVoxelCount | ( |  | ) | const
| inline

## ◆ onTileCount()

template<Index Log2Dim>

static Index64 onTileCount | ( |  | ) |
| inline static

## ◆ onVoxelCount()

template<Index Log2Dim>

Index64 onVoxelCount | ( |  | ) | const
| inline

Return the number of active voxels.

## ◆ operator!=()

template<Index Log2Dim>

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

## ◆ operator=()

template<Index Log2Dim>

LeafNode & operator= | ( | const LeafNode< bool, Log2Dim > & |  | ) |
| default

Deep assignment operator.

## ◆ operator==()

template<Index Log2Dim>

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

Check for buffer equivalence by value.

## ◆ origin()

template<Index Log2Dim>

const Coord & origin | ( |  | ) | const
| inline

Return the grid index coordinates of this node's local origin.

## ◆ probeConstLeaf()

template<Index Log2Dim>

const LeafNode * probeConstLeaf | ( | const Coord & |  | ) | const
| inline

## ◆ probeConstLeafAndCache()

template<Index Log2Dim>
template<typename AccessorT >

const LeafNode * probeConstLeafAndCache | ( | const Coord & | ,
|  | AccessorT & | ) const
| inline

## ◆ probeConstNode()

template<Index Log2Dim>
template<typename NodeT >

const NodeT * probeConstNode | ( | const Coord & |  | ) | const
| inline

## ◆ probeConstNodeAndCache()

template<Index Log2Dim>
template<typename NodeT , typename AccessorT >

const NodeT * probeConstNodeAndCache | ( | const Coord & | ,
|  | AccessorT & | ) const
| inline

## ◆ probeLeaf() [1/2]

template<Index Log2Dim>

LeafNode * probeLeaf | ( | const Coord & |  | ) |
| inline

## ◆ probeLeaf() [2/2]

template<Index Log2Dim>

const LeafNode * probeLeaf | ( | const Coord & |  | ) | const
| inline

Return a `const` pointer to this node.

## ◆ probeLeafAndCache() [1/2]

template<Index Log2Dim>
template<typename AccessorT >

LeafNode * probeLeafAndCache | ( | const Coord & | ,
|  | AccessorT & | )
| inline

## ◆ probeLeafAndCache() [2/2]

template<Index Log2Dim>
template<typename AccessorT >

const LeafNode * probeLeafAndCache | ( | const Coord & | ,
|  | AccessorT & | ) const
| inline

## ◆ probeNode()

template<Index Log2Dim>
template<typename NodeT >

NodeT * probeNode | ( | const Coord & |  | ) |
| inline

## ◆ probeNodeAndCache()

template<Index Log2Dim>
template<typename NodeT , typename AccessorT >

NodeT * probeNodeAndCache | ( | const Coord & | ,
|  | AccessorT & | )
| inline

## ◆ probeValue()

template<Index Log2Dim>

bool probeValue | ( | const Coord & | xyz,
|  | bool & | val ) const
| inline

Return `true` if the voxel at the given coordinates is active.

Parameters

  | xyz | the coordinates of the voxel to be probed
  [out] | val | the value of the voxel at the given coordinates

## ◆ probeValueAndCache()

template<Index Log2Dim>
template<typename AccessorT >

bool probeValueAndCache | ( | const Coord & | xyz,
|  | bool & | val,
|  | AccessorT & | ) const
| inline

Return `true` if the voxel at the given coordinates is active and return the voxel value in val.

Note
  Used internally by ValueAccessor.

## ◆ prune()

template<Index Log2Dim>

void prune | ( | const ValueType & | = zeroVal<ValueType>() | ) |
| inline

This function exists only to enable template instantiation.

## ◆ readBuffers() [1/2]

template<Index Log2Dim>

void readBuffers | ( | std::istream & | is,
|  | bool | fromHalf = false )
| inline

Read in the topology and the origin.

## ◆ readBuffers() [2/2]

template<Index Log2Dim>

void readBuffers | ( | std::istream & | is,
|  | const CoordBBox & | clipBBox,
|  | bool | fromHalf = false )
| inline

## ◆ readTopology()

template<Index Log2Dim>

void readTopology | ( | std::istream & | is,
|  | bool | fromHalf = false )
| inline

Read in just the topology.

## ◆ resetBackground()

template<Index Log2Dim>

void resetBackground | ( | bool | oldBackground,
|  | bool | newBackground )
| inline

## ◆ setActiveState() [1/2]

template<Index Log2Dim>

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.

## ◆ setActiveState() [2/2]

template<Index Log2Dim>

void setActiveState | ( | Index | offset,
|  | bool | on )
| inline

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

## ◆ setActiveStateAndCache()

template<Index Log2Dim>
template<typename AccessorT >

void setActiveStateAndCache | ( | const Coord & | xyz,
|  | bool | on,
|  | AccessorT & | )
| inline

Set the active state of the voxel at the given coordinates without changing its value.

Note
  Used internally by ValueAccessor.

## ◆ setOrigin()

template<Index Log2Dim>

void setOrigin | ( | const Coord & | origin | ) |
| inline

Set the grid index coordinates of this node's local origin.

## ◆ setTransientData()

template<Index Log2Dim>

void setTransientData | ( | Index32 | transientData | ) |
| inline

Set the transient data value.

## ◆ setValue()

template<Index Log2Dim>

void setValue | ( | const Coord & | xyz,
|  | bool | val )
| inline

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

## ◆ setValueAndCache()

template<Index Log2Dim>
template<typename AccessorT >

void setValueAndCache | ( | const Coord & | xyz,
|  | bool | val,
|  | AccessorT & | )
| inline

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

Note
  Used internally by ValueAccessor.

## ◆ setValueMask() [1/2]

template<Index Log2Dim>

void setValueMask | ( | const NodeMaskType & | mask | ) |
| inline

## ◆ setValueMask() [2/2]

template<Index Log2Dim>

void setValueMask | ( | Index | n,
|  | bool | on )
| inline protected

## ◆ setValueMaskOff()

template<Index Log2Dim>

void setValueMaskOff | ( | Index | n | ) |
| inline protected

## ◆ setValueMaskOn()

template<Index Log2Dim>

void setValueMaskOn | ( | Index | n | ) |
| inline protected

## ◆ setValueOff() [1/4]

template<Index Log2Dim>

void setValueOff | ( | const Coord & | xyz | ) |
| inline

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

## ◆ setValueOff() [2/4]

template<Index Log2Dim>

void setValueOff | ( | const Coord & | xyz,
|  | bool | val )
| inline

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

## ◆ setValueOff() [3/4]

template<Index Log2Dim>

void setValueOff | ( | Index | offset | ) |
| inline

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

## ◆ setValueOff() [4/4]

template<Index Log2Dim>

void setValueOff | ( | Index | offset,
|  | bool | val )
| inline

Set the value of the voxel at the given offset and mark the voxel as inactive.

## ◆ setValueOffAndCache()

template<Index Log2Dim>
template<typename AccessorT >

void setValueOffAndCache | ( | const Coord & | xyz,
|  | bool | value,
|  | AccessorT & | )
| inline

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

Note
  Used internally by ValueAccessor.

## ◆ setValueOn() [1/4]

template<Index Log2Dim>

void setValueOn | ( | const Coord & | xyz | ) |
| inline

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

## ◆ setValueOn() [2/4]

template<Index Log2Dim>

void setValueOn | ( | const Coord & | xyz,
|  | bool | val )
| inline

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

## ◆ setValueOn() [3/4]

template<Index Log2Dim>

void setValueOn | ( | Index | offset | ) |
| inline

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

## ◆ setValueOn() [4/4]

template<Index Log2Dim>

void setValueOn | ( | Index | offset,
|  | bool | val )
| inline

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

## ◆ setValueOnly() [1/2]

template<Index Log2Dim>

void setValueOnly | ( | const Coord & | xyz,
|  | bool | val )
| inline

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

## ◆ setValueOnly() [2/2]

template<Index Log2Dim>

void setValueOnly | ( | Index | offset,
|  | bool | val )
| inline

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

## ◆ setValueOnlyAndCache()

template<Index Log2Dim>
template<typename AccessorT >

void setValueOnlyAndCache | ( | const Coord & | xyz,
|  | bool | val,
|  | AccessorT & | )
| inline

Change the value of the voxel at the given coordinates but preserve its state.

Note
  Used internally by ValueAccessor.

## ◆ setValuesOff()

template<Index Log2Dim>

void setValuesOff | ( |  | ) |
| inline

Mark all voxels as inactive but don't change their values.

## ◆ setValuesOn()

template<Index Log2Dim>

void setValuesOn | ( |  | ) |
| inline

Mark all voxels as active but don't change their values.

## ◆ size()

template<Index Log2Dim>

static Index size | ( |  | ) |
| inline static

## ◆ stealNode()

template<Index Log2Dim>
template<typename NodeT >

NodeT * stealNode | ( | const Coord & | ,
|  | const ValueType & | ,
|  | bool | )
| inline

## ◆ stealNodes()

template<Index Log2Dim>
template<typename ArrayT >

void stealNodes | ( | ArrayT & | ,
|  | const ValueType & | ,
|  | bool | )
| inline

## ◆ str()

template<Index Log2Dim>

std::string str | ( |  | ) | const
| inline

Return a string representation of this node.

## ◆ swap()

template<Index Log2Dim>

void swap | ( | Buffer & | other | ) |
| inline

Exchange this node's data buffer with the given data buffer without changing the active states of the values.

## ◆ topologyDifference()

template<Index Log2Dim>
template<typename OtherType >

void topologyDifference | ( | const LeafNode< OtherType, Log2Dim > & | other,
|  | const bool & | )
| inline

Difference this node's set of active values with the active values of the other node, whose `ValueType` may be different. So a resulting voxel will be active only if the original voxel is active in this LeafNode and inactive in the other LeafNode.

The last dummy argument is required to match the signature for InternalNode::topologyDifference.

Note
  This operation modifies only active states, not values. Also, because it can deactivate all of this node's voxels, consider subsequently calling prune.

## ◆ topologyIntersection()

template<Index Log2Dim>
template<typename OtherType >

void topologyIntersection | ( | const LeafNode< OtherType, Log2Dim > & | other,
|  | const bool & | )
| inline

Intersect this node's set of active values with the active values of the other node, whose `ValueType` may be different. So a resulting voxel will be active only if both of the original voxels were active.

The last dummy argument is required to match the signature for InternalNode::topologyIntersection.

Note
  This operation modifies only active states, not values. Also note that this operation can result in all voxels being inactive so consider subsequently calling prune.

## ◆ topologyUnion()

template<Index Log2Dim>
template<typename OtherType >

void topologyUnion | ( | const LeafNode< OtherType, Log2Dim > & | other,
|  | const bool | preserveTiles = false )
| inline

Union this node's set of active values with the active values of the other node, whose `ValueType` may be different. So a resulting voxel will be active if either of the original voxels were active.

Note
  This operation modifies only active states, not values.

## ◆ touchLeaf()

template<Index Log2Dim>

LeafNode * touchLeaf | ( | const Coord & |  | ) |
| inline

Return a pointer to this node.

## ◆ touchLeafAndCache()

template<Index Log2Dim>
template<typename AccessorT >

LeafNode * touchLeafAndCache | ( | const Coord & | ,
|  | AccessorT & | )
| inline

## ◆ transientData()

template<Index Log2Dim>

Index32 transientData | ( |  | ) | const
| inline

Return the transient data value.

## ◆ valueMask()

template<Index Log2Dim>

const NodeMaskType & valueMask | ( |  | ) | const
| inline

## ◆ voxelizeActiveTiles()

template<Index Log2Dim>

void voxelizeActiveTiles | ( | bool | = true | ) |
| inline

No-op.

This function exists only to enable template instantiation.

## ◆ writeBuffers()

template<Index Log2Dim>

void writeBuffers | ( | std::ostream & | os,
|  | bool | toHalf = false ) const
| inline

Write out the topology and the origin.

## ◆ writeTopology()

template<Index Log2Dim>

void writeTopology | ( | std::ostream & | os,
|  | bool | toHalf = false ) const
| inline

Write out just the topology.

## Friends And Related Symbol Documentation

## ◆ IteratorBase< MaskDenseIter, LeafNode >

template<Index Log2Dim>

friend class IteratorBase< MaskDenseIter, LeafNode >
| friend

## ◆ IteratorBase< MaskOffIter, LeafNode >

template<Index Log2Dim>

friend class IteratorBase< MaskOffIter, LeafNode >
| friend

## ◆ IteratorBase< MaskOnIter, LeafNode >

template<Index Log2Dim>

friend class IteratorBase< MaskOnIter, LeafNode >
| friend

Allow iterators to call mask accessor methods (see below).

## ◆ LeafNode

template<Index Log2Dim>
template<typename , Index >

friend class LeafNode
| friend

During topology-only construction, access is needed to protected/private members of other template instances.

## ◆ ValueIter< MaskDenseIter, const LeafNode, bool >

template<Index Log2Dim>

friend struct ValueIter< MaskDenseIter, const LeafNode, bool >
| friend

## ◆ ValueIter< MaskDenseIter, LeafNode, bool >

template<Index Log2Dim>

friend struct ValueIter< MaskDenseIter, LeafNode, bool >
| friend

## ◆ ValueIter< MaskOffIter, const LeafNode, bool >

template<Index Log2Dim>

friend struct ValueIter< MaskOffIter, const LeafNode, bool >
| friend

## ◆ ValueIter< MaskOffIter, LeafNode, bool >

template<Index Log2Dim>

friend struct ValueIter< MaskOffIter, LeafNode, bool >
| friend

## ◆ ValueIter< MaskOnIter, const LeafNode, bool >

template<Index Log2Dim>

friend struct ValueIter< MaskOnIter, const LeafNode, bool >
| friend

## ◆ ValueIter< MaskOnIter, LeafNode, bool >

template<Index Log2Dim>

friend struct ValueIter< MaskOnIter, LeafNode, bool >
| friend

## Member Data Documentation

## ◆ DIM

template<Index Log2Dim>

const Index DIM = 1 << TOTAL
| static

## ◆ LEVEL

template<Index Log2Dim>

const Index LEVEL = 0
| static

## ◆ LOG2DIM

template<Index Log2Dim>

const Index LOG2DIM = Log2Dim
| static

## ◆ mBuffer

template<Index Log2Dim>

Buffer mBuffer
| protected

Bitmask representing the values of voxels.

## ◆ mOrigin

template<Index Log2Dim>

Coord mOrigin
| protected

Global grid index coordinates (x,y,z) of the local origin of this node.

## ◆ mTransientData

template<Index Log2Dim>

Index32 mTransientData = 0
| protected

Transient data (not serialized)

## ◆ mValueMask

template<Index Log2Dim>

NodeMaskType mValueMask
| protected

Bitmask that determines which voxels are active.

## ◆ NUM_VALUES

template<Index Log2Dim>

const Index NUM_VALUES = 1 << 3 * Log2Dim
| static

## ◆ NUM_VOXELS

template<Index Log2Dim>

const Index NUM_VOXELS = NUM_VALUES
| static

## ◆ SIZE

template<Index Log2Dim>

const Index SIZE = NUM_VALUES
| static

## ◆ TOTAL

template<Index Log2Dim>

const Index TOTAL = Log2Dim
| static