OpenVDB 9.0.0
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< ValueMask, Log2Dim > Class Template Reference

LeafNode specialization for values of type ValueMask that encodes both the active states and the boolean values of (2^Log2Dim)^3 voxels in a single bit mask, i.e. voxel values and states are indistinguishable! More...

#include <openvdb/tree/LeafNodeMask.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< ValueMask, Log2Dim >
 
using BuildType = ValueMask
 
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. More...
 
 LeafNode (const Coord &xyz, bool value=false, bool dummy=false)
 
 LeafNode (PartialCreate, const Coord &xyz, bool value=false, bool dummy=false)
 "Partial creation" constructor used during file input More...
 
 LeafNode (const LeafNode &)
 Deep copy constructor. More...
 
template<typename OtherValueType >
 LeafNode (const LeafNode< OtherValueType, Log2Dim > &other)
 Value conversion copy constructor. More...
 
template<typename ValueType >
 LeafNode (const LeafNode< ValueType, Log2Dim > &other, TopologyCopy)
 Topology copy constructor. More...
 
template<typename ValueType >
 LeafNode (const LeafNode< ValueType, Log2Dim > &other, bool offValue, bool onValue, TopologyCopy)
 Topology copy constructor. More...
 
template<typename ValueType >
 LeafNode (const LeafNode< ValueType, Log2Dim > &other, bool background, TopologyCopy)
 
 ~LeafNode ()
 Destructor. More...
 
void nodeCount (std::vector< Index32 > &) const
 no-op More...
 
Index64 onVoxelCount () const
 Return the number of active voxels. More...
 
Index64 offVoxelCount () const
 Return the number of inactive voxels. More...
 
Index64 onLeafVoxelCount () const
 
Index64 offLeafVoxelCount () const
 
bool isEmpty () const
 Return true if this node has no active voxels. More...
 
bool isDense () const
 Return true if this node only contains active voxels. More...
 
bool isAllocated () const
 Return true if memory for this node's buffer has been allocated. More...
 
bool allocate ()
 Allocate memory for this node's buffer if it has not already been allocated. More...
 
Index64 memUsage () const
 Return the memory in bytes occupied by this node. More...
 
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. More...
 
void setOrigin (const Coord &origin)
 Set the grid index coordinates of this node's local origin. More...
 
const Coordorigin () const
 Return the grid index coordinates of this node's local origin. More...
 
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. More...
 
Index32 transientData () const
 Return the transient data value. More...
 
void setTransientData (Index32 transientData)
 Set the transient data value. More...
 
std::string str () const
 Return a string representation of this node. More...
 
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. More...
 
bool operator== (const LeafNode &) const
 Check for buffer equivalence by value. More...
 
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. More...
 
const Bufferbuffer () const
 
Bufferbuffer ()
 
void readTopology (std::istream &, bool fromHalf=false)
 Read in just the topology. More...
 
void writeTopology (std::ostream &, bool toHalf=false) const
 Write out just the topology. More...
 
void readBuffers (std::istream &, bool fromHalf=false)
 Read in the topology and the origin. More...
 
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. More...
 
const bool & getValue (const Coord &xyz) const
 Return the value of the voxel at the given coordinates. More...
 
const bool & getValue (Index offset) const
 Return the value of the voxel at the given offset. More...
 
bool probeValue (const Coord &xyz, bool &val) const
 Return true if the voxel at the given coordinates is active. More...
 
void setActiveState (const Coord &xyz, bool on)
 Set the active state of the voxel at the given coordinates but don't change its value. More...
 
void setActiveState (Index offset, bool on)
 Set the active state of the voxel at the given offset but don't change its value. More...
 
void setValueOnly (const Coord &xyz, bool val)
 Set the value of the voxel at the given coordinates but don't change its active state. More...
 
void setValueOnly (Index offset, bool val)
 Set the value of the voxel at the given offset but don't change its active state. More...
 
void setValueOff (const Coord &xyz)
 Mark the voxel at the given coordinates as inactive but don't change its value. More...
 
void setValueOff (Index offset)
 Mark the voxel at the given offset as inactive but don't change its value. More...
 
void setValueOff (const Coord &xyz, bool val)
 Set the value of the voxel at the given coordinates and mark the voxel as inactive. More...
 
void setValueOff (Index offset, bool val)
 Set the value of the voxel at the given offset and mark the voxel as inactive. More...
 
void setValueOn (const Coord &xyz)
 Mark the voxel at the given coordinates as active but don't change its value. More...
 
void setValueOn (Index offset)
 Mark the voxel at the given offset as active but don't change its value. More...
 
void setValueOn (const Coord &xyz, bool val)
 Set the value of the voxel at the given coordinates and mark the voxel as active. More...
 
void setValue (const Coord &xyz, bool val)
 Set the value of the voxel at the given coordinates and mark the voxel as active. More...
 
void setValueOn (Index offset, bool val)
 Set the value of the voxel at the given offset and mark the voxel as active. More...
 
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. More...
 
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. More...
 
template<typename ModifyOp >
void modifyValueAndActiveState (const Coord &xyz, const ModifyOp &op)
 Apply a functor to the voxel at the given coordinates. More...
 
void setValuesOn ()
 Mark all voxels as active but don't change their values. More...
 
void setValuesOff ()
 Mark all voxels as inactive but don't change their values. More...
 
bool isValueOn (const Coord &xyz) const
 Return true if the voxel at the given coordinates is active. More...
 
bool isValueOn (Index offset) const
 Return true if the voxel at the given offset is active. More...
 
void clip (const CoordBBox &, bool background)
 Set all voxels that lie outside the given axis-aligned box to the background. More...
 
void fill (const CoordBBox &bbox, bool value, bool=false)
 Set all voxels within an axis-aligned box to the specified value. More...
 
void denseFill (const CoordBBox &bbox, bool value, bool=false)
 Set all voxels within an axis-aligned box to the specified value. More...
 
void fill (const bool &value, bool dummy=false)
 Set the state of all voxels to the specified active state. More...
 
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. More...
 
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. More...
 
template<typename AccessorT >
const bool & getValueAndCache (const Coord &xyz, AccessorT &) const
 Return the value of the voxel at the given coordinates. More...
 
template<typename AccessorT >
bool isValueOnAndCache (const Coord &xyz, AccessorT &) const
 Return true if the voxel at the given coordinates is active. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
const bool & getFirstValue () const
 Return a const reference to the first entry in the buffer. More...
 
const bool & getLastValue () const
 Return a const reference to the last entry in the buffer. More...
 
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. More...
 
Index medianOn (ValueType &value) const
 Computes the median value of all the active voxels in this node. More...
 
Index medianOff (ValueType &value) const
 Computes the median value of all the inactive voxels in this node. More...
 
bool isInactive () const
 Return true if all of this node's values are inactive. More...
 
void resetBackground (bool, bool)
 no-op since for this template specialization voxel values and states are indistinguishable. More...
 
void negate ()
 Invert the bits of the voxels, i.e. states and values. More...
 
template<MergePolicy Policy>
void merge (const LeafNode &other, bool bg=false, bool otherBG=false)
 
template<MergePolicy Policy>
void merge (bool tileValue, bool tileActive=false)
 
void voxelizeActiveTiles (bool=true)
 No-op. More...
 
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. More...
 
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. More...
 
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. More...
 
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 &)
 
template<typename BBoxOp >
void visitActiveBBox (BBoxOp &) const
 Calls the templated functor BBoxOp with bounding box information. An additional level argument is provided to the callback. More...
 
template<typename VisitorOp >
void visit (VisitorOp &)
 
template<typename VisitorOp >
void visit (VisitorOp &) const
 
template<typename OtherLeafNodeType , typename VisitorOp >
void visit2Node (OtherLeafNodeType &other, VisitorOp &)
 
template<typename OtherLeafNodeType , typename VisitorOp >
void visit2Node (OtherLeafNodeType &other, VisitorOp &) const
 
template<typename IterT , typename VisitorOp >
void visit2 (IterT &otherIter, VisitorOp &, bool otherIsLHS=false)
 
template<typename IterT , typename VisitorOp >
void visit2 (IterT &otherIter, VisitorOp &, bool otherIsLHS=false) const
 
void prune (const ValueType &=zeroVal< ValueType >())
 This function exists only to enable template instantiation. More...
 
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 &)
 
LeafNodetouchLeaf (const Coord &)
 Return a pointer to this node. More...
 
template<typename AccessorT >
LeafNodetouchLeafAndCache (const Coord &, AccessorT &)
 
LeafNodeprobeLeaf (const Coord &)
 
template<typename AccessorT >
LeafNodeprobeLeafAndCache (const Coord &, AccessorT &)
 
template<typename NodeT , typename AccessorT >
NodeT * probeNodeAndCache (const Coord &, AccessorT &)
 
const LeafNodeprobeLeaf (const Coord &) const
 Return a const pointer to this node. More...
 
template<typename AccessorT >
const LeafNodeprobeLeafAndCache (const Coord &, AccessorT &) const
 
const LeafNodeprobeConstLeaf (const Coord &) const
 
template<typename AccessorT >
const LeafNodeprobeConstLeafAndCache (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 NodeMaskTypegetValueMask () const
 
const NodeMaskTypevalueMask () const
 
NodeMaskTypegetValueMask ()
 
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, bool, TopologyCopy)
 
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. More...
 
static Index dim ()
 Return the number of voxels in each dimension. More...
 
static Index size ()
 Return the total number of voxels represented by this LeafNode. More...
 
static Index numValues ()
 Return the total number of voxels represented by this LeafNode. More...
 
static Index getLevel ()
 Return the level of this node, which by definition is zero for LeafNodes. More...
 
static void getNodeLog2Dims (std::vector< Index > &dims)
 Append the Log2Dim of this LeafNode to the specified vector. More...
 
static Index getChildDim ()
 Return the dimension of child nodes of this LeafNode, which is one for voxels. More...
 
static Index32 leafCount ()
 Return the leaf count for this node, which is one. More...
 
static Index32 nonLeafCount ()
 Return the non-leaf count for this node, which is zero. More...
 
static Index64 onTileCount ()
 
static Index64 offTileCount ()
 
static Index coordToOffset (const Coord &xyz)
 Return the linear table offset of the given global or local coordinates. More...
 
static Coord offsetToLocalCoord (Index n)
 Return the local coordinates for a linear table offset, where offset 0 has coordinates (0, 0, 0). More...
 
static Index getValueLevel (const Coord &)
 Return the level (0) at which leaf node values reside. More...
 
static bool hasActiveTiles ()
 Return false since leaf nodes never contain tiles. More...
 
template<typename AccessorT >
static Index getValueLevelAndCache (const Coord &, AccessorT &)
 Return the LEVEL (=0) at which leaf node values reside. More...
 

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. More...
 
template<typename NodeT , typename VisitorOp , typename ChildAllIterT >
static void doVisit (NodeT &, VisitorOp &)
 
template<typename NodeT , typename OtherNodeT , typename VisitorOp , typename ChildAllIterT , typename OtherChildAllIterT >
static void doVisit2Node (NodeT &self, OtherNodeT &other, VisitorOp &)
 
template<typename NodeT , typename VisitorOp , typename ChildAllIterT , typename OtherChildAllIterT >
static void doVisit2 (NodeT &self, OtherChildAllIterT &, VisitorOp &, bool otherIsLHS)
 

Protected Attributes

Buffer mBuffer
 Bitmask representing the values AND state of voxels. More...
 
Coord mOrigin
 Global grid index coordinates (x,y,z) of the local origin of this node. More...
 
Index32 mTransientData = 0
 Transient data (not serialized) More...
 

Friends

template<typename , Index >
class LeafNode
 During topology-only construction, access is needed to protected/private members of other template instances. More...
 
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 >
 
template<typename , Index >
class LeafBuffer
 

Detailed Description

template<Index Log2Dim>
class openvdb::v9_0::tree::LeafNode< ValueMask, Log2Dim >

LeafNode specialization for values of type ValueMask that encodes both the active states and the boolean values of (2^Log2Dim)^3 voxels in a single bit mask, i.e. voxel values and states are indistinguishable!

Member Typedef Documentation

◆ Buffer

using Buffer = LeafBuffer<ValueType, Log2Dim>

◆ BuildType

◆ ChildAllCIter

using ChildAllCIter = DenseIter<const LeafNode, const bool>

◆ ChildAllIter

using ChildAllIter = DenseIter<LeafNode, bool>

◆ ChildOffCIter

using ChildOffCIter = ChildIter<MaskOffIter, const LeafNode>

◆ ChildOffIter

using ChildOffIter = ChildIter<MaskOffIter, LeafNode>

◆ ChildOnCIter

using ChildOnCIter = ChildIter<MaskOnIter, const LeafNode>

◆ ChildOnIter

using ChildOnIter = ChildIter<MaskOnIter, LeafNode>

◆ LeafNodeType

using LeafNodeType = LeafNode<ValueMask, Log2Dim>

◆ MaskDenseIter

using MaskDenseIter = typename NodeMaskType::DenseIterator
protected

◆ MaskOffIter

using MaskOffIter = typename NodeMaskType::OffIterator
protected

◆ MaskOnIter

using MaskOnIter = typename NodeMaskType::OnIterator
protected

◆ NodeMaskType

using NodeMaskType = util::NodeMask<Log2Dim>

◆ Ptr

◆ ValueAllCIter

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

◆ ValueAllIter

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

◆ ValueOffCIter

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

◆ ValueOffIter

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

◆ ValueOnCIter

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

◆ ValueOnIter

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

◆ ValueType

using ValueType = bool

Constructor & Destructor Documentation

◆ LeafNode() [1/12]

LeafNode
inline

Default constructor.

◆ LeafNode() [2/12]

LeafNode ( const Coord xyz,
bool  value = false,
bool  dummy = false 
)
inlineexplicit

Constructor

Parameters
xyzthe coordinates of a voxel that lies within the node
valuethe initial value = state for all of this node's voxels
dummydummy value

◆ LeafNode() [3/12]

LeafNode ( PartialCreate  ,
const Coord xyz,
bool  value = false,
bool  dummy = false 
)
inline

"Partial creation" constructor used during file input

◆ LeafNode() [4/12]

LeafNode ( const LeafNode< ValueMask, Log2Dim > &  other)
inline

Deep copy constructor.

◆ LeafNode() [5/12]

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

Value conversion copy constructor.

◆ LeafNode() [6/12]

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

Topology copy constructor.

◆ LeafNode() [7/12]

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

Topology copy constructor.

Note
This variant exists mainly to enable template instantiation.

◆ LeafNode() [8/12]

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

◆ ~LeafNode()

~LeafNode
inline

Destructor.

◆ LeafNode() [9/12]

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

◆ LeafNode() [10/12]

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

◆ LeafNode() [11/12]

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

◆ LeafNode() [12/12]

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

Member Function Documentation

◆ addLeaf()

void addLeaf ( LeafNode< ValueMask, Log2Dim > *  )
inline

◆ addLeafAndCache()

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

◆ addTile() [1/2]

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

◆ addTile() [2/2]

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

◆ addTileAndCache()

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

◆ allocate()

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]

ChildAllIter beginChildAll ( )
inline

◆ beginChildAll() [2/2]

ChildAllCIter beginChildAll ( ) const
inline

◆ beginChildOff() [1/2]

ChildOffIter beginChildOff ( )
inline

◆ beginChildOff() [2/2]

ChildOffCIter beginChildOff ( ) const
inline

◆ beginChildOn() [1/2]

ChildOnIter beginChildOn ( )
inline

◆ beginChildOn() [2/2]

ChildOnCIter beginChildOn ( ) const
inline

◆ beginValueAll() [1/2]

ValueAllIter beginValueAll ( )
inline

◆ beginValueAll() [2/2]

ValueAllCIter beginValueAll ( ) const
inline

◆ beginValueOff() [1/2]

ValueOffIter beginValueOff ( )
inline

◆ beginValueOff() [2/2]

ValueOffCIter beginValueOff ( ) const
inline

◆ beginValueOn() [1/2]

ValueOnIter beginValueOn ( )
inline

◆ beginValueOn() [2/2]

ValueOnCIter beginValueOn ( ) const
inline

◆ buffer() [1/2]

Buffer & buffer ( )
inline

◆ buffer() [2/2]

const Buffer & buffer ( ) const
inline

◆ cbeginChildAll()

ChildAllCIter cbeginChildAll ( ) const
inline

◆ cbeginChildOff()

ChildOffCIter cbeginChildOff ( ) const
inline

◆ cbeginChildOn()

ChildOnCIter cbeginChildOn ( ) const
inline

◆ cbeginValueAll()

ValueAllCIter cbeginValueAll ( ) const
inline

◆ cbeginValueOff()

ValueOffCIter cbeginValueOff ( ) const
inline

◆ cbeginValueOn()

ValueOnCIter cbeginValueOn ( ) const
inline

◆ cendChildAll()

ChildAllCIter cendChildAll ( ) const
inline

◆ cendChildOff()

ChildOffCIter cendChildOff ( ) const
inline

◆ cendChildOn()

ChildOnCIter cendChildOn ( ) const
inline

◆ cendValueAll()

ValueAllCIter cendValueAll ( ) const
inline

◆ cendValueOff()

ValueOffCIter cendValueOff ( ) const
inline

◆ cendValueOn()

ValueOnCIter cendValueOn ( ) const
inline

◆ clip()

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]

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

◆ combine() [2/2]

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

◆ combine2() [1/3]

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

◆ combine2() [2/3]

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

◆ combine2() [3/3]

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

◆ coordToOffset()

Index coordToOffset ( const Coord xyz)
inlinestatic

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

◆ copyFromDense()

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
bboxinclusive bounding box of the voxels to be copied into this node
densedense grid with a stride in z of one (see tools::Dense in tools/Dense.h for the required API)
backgroundbackground value of the tree that this node belongs to
tolerancetolerance 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()

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
bboxinclusive bounding box of the voxels to be copied into the dense grid
densedense 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()

void denseFill ( const CoordBBox bbox,
bool  value,
bool  = false 
)
inline

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

◆ dim()

static Index dim ( )
inlinestatic

Return the number of voxels in each dimension.

◆ doVisit()

void doVisit ( NodeT &  self,
VisitorOp &  op 
)
inlinestaticprotected

◆ doVisit2()

void doVisit2 ( NodeT &  self,
OtherChildAllIterT &  otherIter,
VisitorOp &  op,
bool  otherIsLHS 
)
inlinestaticprotected

◆ doVisit2Node()

void doVisit2Node ( NodeT &  self,
OtherNodeT &  other,
VisitorOp &  op 
)
inlinestaticprotected

◆ endChildAll() [1/2]

ChildAllIter endChildAll ( )
inline

◆ endChildAll() [2/2]

ChildAllCIter endChildAll ( ) const
inline

◆ endChildOff() [1/2]

ChildOffIter endChildOff ( )
inline

◆ endChildOff() [2/2]

ChildOffCIter endChildOff ( ) const
inline

◆ endChildOn() [1/2]

ChildOnIter endChildOn ( )
inline

◆ endChildOn() [2/2]

ChildOnCIter endChildOn ( ) const
inline

◆ endValueAll() [1/2]

ValueAllIter endValueAll ( )
inline

◆ endValueAll() [2/2]

ValueAllCIter endValueAll ( ) const
inline

◆ endValueOff() [1/2]

ValueOffIter endValueOff ( )
inline

◆ endValueOff() [2/2]

ValueOffCIter endValueOff ( ) const
inline

◆ endValueOn() [1/2]

ValueOnIter endValueOn ( )
inline

◆ endValueOn() [2/2]

ValueOnCIter endValueOn ( ) const
inline

◆ evalActiveBoundingBox()

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()

static void evalNodeOrigin ( Coord xyz)
inlinestaticprotected

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

◆ fill() [1/2]

void fill ( const bool &  value,
bool  dummy = false 
)
inline

Set the state of all voxels to the specified active state.

◆ fill() [2/2]

void fill ( const CoordBBox bbox,
bool  value,
bool  = false 
)
inline

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

◆ getChildDim()

static Index getChildDim ( )
inlinestatic

Return the dimension of child nodes of this LeafNode, which is one for voxels.

◆ getFirstValue()

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()

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()

static Index getLevel ( )
inlinestatic

Return the level of this node, which by definition is zero for LeafNodes.

◆ getNodeBoundingBox()

CoordBBox getNodeBoundingBox ( ) const
inline

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

◆ getNodeLog2Dims()

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

Append the Log2Dim of this LeafNode to the specified vector.

◆ getNodes()

void getNodes ( ArrayT &  ) const
inline

◆ getOrigin() [1/2]

void getOrigin ( Coord origin) const
inline

◆ getOrigin() [2/2]

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

◆ getValue() [1/2]

const bool & getValue ( const Coord xyz) const
inline

Return the value of the voxel at the given coordinates.

◆ getValue() [2/2]

const bool & getValue ( Index  offset) const
inline

Return the value of the voxel at the given offset.

◆ getValueAndCache()

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()

static Index getValueLevel ( const Coord )
inlinestatic

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

◆ getValueLevelAndCache()

static Index getValueLevelAndCache ( const Coord ,
AccessorT &   
)
inlinestatic

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

Note
Used internally by ValueAccessor.

◆ getValueMask() [1/2]

NodeMaskType & getValueMask ( )
inline

◆ getValueMask() [2/2]

const NodeMaskType & getValueMask ( ) const
inline

◆ hasActiveTiles()

static bool hasActiveTiles ( )
inlinestatic

Return false since leaf nodes never contain tiles.

◆ hasSameTopology()

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()

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]

bool isChildMaskOff ( ) const
inline

◆ isChildMaskOff() [2/2]

bool isChildMaskOff ( Index  ) const
inline

◆ isChildMaskOn()

bool isChildMaskOn ( Index  ) const
inline

◆ isConstant()

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()

bool isDense ( ) const
inline

Return true if this node only contains active voxels.

◆ isEmpty()

bool isEmpty ( ) const
inline

Return true if this node has no active voxels.

◆ isInactive()

bool isInactive ( ) const
inline

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

◆ isValueMaskOff() [1/2]

bool isValueMaskOff ( ) const
inline

◆ isValueMaskOff() [2/2]

bool isValueMaskOff ( Index  n) const
inline

◆ isValueMaskOn() [1/2]

bool isValueMaskOn ( ) const
inline

◆ isValueMaskOn() [2/2]

bool isValueMaskOn ( Index  n) const
inline

◆ isValueOn() [1/2]

bool isValueOn ( const Coord xyz) const
inline

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

◆ isValueOn() [2/2]

bool isValueOn ( Index  offset) const
inline

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

◆ isValueOnAndCache()

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()

static Index32 leafCount ( )
inlinestatic

Return the leaf count for this node, which is one.

◆ log2dim()

static Index log2dim ( )
inlinestatic

Return log2 of the size of the buffer storage.

◆ medianAll()

bool medianAll
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()

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
valueUpdated with the median value of all the inactive voxels.
Note
Since the value and state are shared for this specialization of the LeafNode the value will always be false!

◆ medianOn()

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
valueUpdated with the median value of all the active voxels.
Note
Since the value and state are shared for this specialization of the LeafNode the value will always be true!

◆ memUsage()

Index64 memUsage
inline

Return the memory in bytes occupied by this node.

◆ merge() [1/2]

void merge ( bool  tileValue,
bool  tileActive = false 
)
inline

◆ merge() [2/2]

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

◆ modifyValue() [1/2]

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]

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()

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

Apply a functor to the voxel at the given coordinates.

◆ modifyValueAndActiveStateAndCache()

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()

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()

void negate ( )
inline

Invert the bits of the voxels, i.e. states and values.

◆ nodeCount()

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

no-op

◆ nonLeafCount()

static Index32 nonLeafCount ( )
inlinestatic

Return the non-leaf count for this node, which is zero.

◆ numValues()

static Index numValues ( )
inlinestatic

Return the total number of voxels represented by this LeafNode.

◆ offLeafVoxelCount()

Index64 offLeafVoxelCount ( ) const
inline

◆ offsetToGlobalCoord()

Coord offsetToGlobalCoord ( Index  n) const
inline

Return the global coordinates for a linear table offset.

◆ offsetToLocalCoord()

Coord offsetToLocalCoord ( Index  n)
inlinestatic

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

◆ offTileCount()

static Index64 offTileCount ( )
inlinestatic

◆ offVoxelCount()

Index64 offVoxelCount ( ) const
inline

Return the number of inactive voxels.

◆ onLeafVoxelCount()

Index64 onLeafVoxelCount ( ) const
inline

◆ onTileCount()

static Index64 onTileCount ( )
inlinestatic

◆ onVoxelCount()

Index64 onVoxelCount ( ) const
inline

Return the number of active voxels.

◆ operator!=()

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

◆ operator==()

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

Check for buffer equivalence by value.

◆ origin()

const Coord & origin ( ) const
inline

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

◆ probeConstLeaf()

const LeafNode * probeConstLeaf ( const Coord ) const
inline

◆ probeConstLeafAndCache()

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

◆ probeConstNode()

const NodeT * probeConstNode ( const Coord ) const
inline

◆ probeConstNodeAndCache()

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

◆ probeLeaf() [1/2]

LeafNode * probeLeaf ( const Coord )
inline

◆ probeLeaf() [2/2]

const LeafNode * probeLeaf ( const Coord ) const
inline

Return a const pointer to this node.

◆ probeLeafAndCache() [1/2]

LeafNode * probeLeafAndCache ( const Coord ,
AccessorT &   
)
inline

◆ probeLeafAndCache() [2/2]

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

◆ probeNode()

NodeT * probeNode ( const Coord )
inline

◆ probeNodeAndCache()

NodeT * probeNodeAndCache ( const Coord ,
AccessorT &   
)
inline

◆ probeValue()

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

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

Parameters
xyzthe coordinates of the voxel to be probed
[out]valthe value of the voxel at the given coordinates

◆ probeValueAndCache()

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()

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

This function exists only to enable template instantiation.

◆ readBuffers() [1/2]

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

Read in the topology and the origin.

◆ readBuffers() [2/2]

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

◆ readTopology()

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

Read in just the topology.

◆ resetBackground()

void resetBackground ( bool  ,
bool   
)
inline

no-op since for this template specialization voxel values and states are indistinguishable.

◆ setActiveState() [1/2]

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]

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()

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()

void setOrigin ( const Coord origin)
inline

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

◆ setTransientData()

void setTransientData ( Index32  transientData)
inline

Set the transient data value.

◆ setValue()

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()

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]

void setValueMask ( const NodeMaskType mask)
inline

◆ setValueMask() [2/2]

void setValueMask ( Index  n,
bool  on 
)
inlineprotected

◆ setValueMaskOff()

void setValueMaskOff ( Index  n)
inlineprotected

◆ setValueMaskOn()

void setValueMaskOn ( Index  n)
inlineprotected

◆ setValueOff() [1/4]

void setValueOff ( const Coord xyz)
inline

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

◆ setValueOff() [2/4]

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]

void setValueOff ( Index  offset)
inline

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

◆ setValueOff() [4/4]

void setValueOff ( Index  offset,
bool  val 
)
inline

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

◆ setValueOffAndCache()

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]

void setValueOn ( const Coord xyz)
inline

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

◆ setValueOn() [2/4]

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]

void setValueOn ( Index  offset)
inline

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

◆ setValueOn() [4/4]

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]

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]

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()

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()

void setValuesOff ( )
inline

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

◆ setValuesOn()

void setValuesOn ( )
inline

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

◆ size()

static Index size ( )
inlinestatic

Return the total number of voxels represented by this LeafNode.

◆ stealNode()

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

◆ stealNodes()

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

◆ str()

std::string str
inline

Return a string representation of this node.

◆ swap()

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()

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()

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()

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()

LeafNode * touchLeaf ( const Coord )
inline

Return a pointer to this node.

◆ touchLeafAndCache()

LeafNode * touchLeafAndCache ( const Coord ,
AccessorT &   
)
inline

◆ transientData()

Index32 transientData ( ) const
inline

Return the transient data value.

◆ valueMask()

const NodeMaskType & valueMask ( ) const
inline

◆ visit() [1/2]

void visit ( VisitorOp &  op)
inline

◆ visit() [2/2]

void visit ( VisitorOp &  op) const
inline

◆ visit2() [1/2]

void visit2 ( IterT &  otherIter,
VisitorOp &  op,
bool  otherIsLHS = false 
)
inline

◆ visit2() [2/2]

void visit2 ( IterT &  otherIter,
VisitorOp &  op,
bool  otherIsLHS = false 
) const
inline

◆ visit2Node() [1/2]

void visit2Node ( OtherLeafNodeType &  other,
VisitorOp &  op 
)
inline

◆ visit2Node() [2/2]

void visit2Node ( OtherLeafNodeType &  other,
VisitorOp &  op 
) const
inline

◆ visitActiveBBox()

void visitActiveBBox ( BBoxOp &  op) const
inline

Calls the templated functor BBoxOp with bounding box information. An additional level argument is provided to the callback.

Note
The bounding boxes are guaranteed to be non-overlapping.

◆ voxelizeActiveTiles()

void voxelizeActiveTiles ( bool  = true)
inline

No-op.

This function exists only to enable template instantiation.

◆ writeBuffers()

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

Write out the topology and the origin.

◆ writeTopology()

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

Write out just the topology.

Friends And Related Function Documentation

◆ IteratorBase< MaskDenseIter, LeafNode >

friend class IteratorBase< MaskDenseIter, LeafNode >
friend

◆ IteratorBase< MaskOffIter, LeafNode >

friend class IteratorBase< MaskOffIter, LeafNode >
friend

◆ IteratorBase< MaskOnIter, LeafNode >

friend class IteratorBase< MaskOnIter, LeafNode >
friend

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

◆ LeafBuffer

friend class LeafBuffer
friend

◆ LeafNode

friend class LeafNode
friend

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

◆ ValueIter< MaskDenseIter, const LeafNode, bool >

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

◆ ValueIter< MaskDenseIter, LeafNode, bool >

friend struct ValueIter< MaskDenseIter, LeafNode, bool >
friend

◆ ValueIter< MaskOffIter, const LeafNode, bool >

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

◆ ValueIter< MaskOffIter, LeafNode, bool >

friend struct ValueIter< MaskOffIter, LeafNode, bool >
friend

◆ ValueIter< MaskOnIter, const LeafNode, bool >

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

◆ ValueIter< MaskOnIter, LeafNode, bool >

friend struct ValueIter< MaskOnIter, LeafNode, bool >
friend

Member Data Documentation

◆ DIM

const Index DIM = 1 << TOTAL
static

◆ LEVEL

const Index LEVEL = 0
static

◆ LOG2DIM

const Index LOG2DIM = Log2Dim
static

◆ mBuffer

Buffer mBuffer
protected

Bitmask representing the values AND state of voxels.

◆ mOrigin

Coord mOrigin
protected

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

◆ mTransientData

Index32 mTransientData = 0
protected

Transient data (not serialized)

◆ NUM_VALUES

const Index NUM_VALUES = 1 << 3 * Log2Dim
static

◆ NUM_VOXELS

const Index NUM_VOXELS = NUM_VALUES
static

◆ SIZE

const Index SIZE = NUM_VALUES
static

◆ TOTAL

const Index TOTAL = Log2Dim
static