OpenVDB 12.1.0

Loading...
Searching...
No Matches
ValueAccessorImpl< _TreeType, IsSafe, MutexT, IntegerSequence > Class Template Reference

The Value Accessor Implementation and API methods. The majoirty of the API matches the API of a compatible OpenVDB Tree Node. More...

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

Inheritance diagram for ValueAccessorImpl< _TreeType, IsSafe, MutexT, IntegerSequence >:

## Public Types
using | BaseT = ValueAccessorBase<_TreeType, IsSafe>
using | LockT = ValueAccessorLock<MutexT>
using | LeafCacheT = ValueAccessorLeafBuffer<_TreeType, IntegerSequence>
using | TreeType = _TreeType
using | ValueType = typename TreeType::ValueType
using | RootNodeT = typename TreeType::RootNodeType
using | LeafNodeT = typename TreeType::LeafNodeType
using | NodeChainT = typename RootNodeT::NodeChainType
using | NodeLevelList
| A resolved, flattened TypeList of node types which this accessor is caching. The nodes index in this list does not necessarily correspond to the nodes level in the tree.
using | NodePtrList = typename NodeLevelList::template Transform<std::add_pointer_t>
template<size_t Level>
using | NodeTypeAtLevel = typename NodeLevelList::template Get<Level>
| Return a node type at a particular cache level in the Value accessor. The node type at a given cache level does not necessarily equal the same node type in the TreeType as this depends entirely on which tree levels this Accessor is caching. For example:

## Public Member Functions
| ValueAccessorImpl (TreeType &tree)
| Constructor from a tree.
| ~ValueAccessorImpl () override final=default
| ValueAccessorImpl (const ValueAccessorImpl &)=default
ValueAccessorImpl & | operator= (const ValueAccessorImpl &)=default
bool | isCached (const Coord &xyz) const
| Return `true` if any of the nodes along the path to the given coordinate have been cached.
const ValueType & | getValue (const Coord &xyz) const
| Return the value of the voxel at the given coordinates.
bool | isValueOn (const Coord &xyz) const
| Return the active state of the voxel at the given coordinates.
bool | probeValue (const Coord &xyz, ValueType &value) const
| Return the active state of the value at a given coordinate as well as its value.
int | getValueDepth (const Coord &xyz) const
| Return the tree depth (0 = root) at which the value of voxel (x, y, z) resides, or -1 if (x, y, z) isn't explicitly represented in the tree (i.e., if it is implicitly a background voxel).
bool | isVoxel (const Coord &xyz) const
| Return `true` if the value of voxel (x, y, z) resides at the leaf level of the tree, i.e., if it is not a tile value.
void | setValue (const Coord &xyz, const ValueType &value)
| Set a particular value at the given coordinate and mark the coordinate as active.
void | setValueOn (const Coord &xyz, const ValueType &value)
void | setValueOnly (const Coord &xyz, const ValueType &value)
| Set a particular value at the given coordinate but preserve its active state.
void | setValueOff (const Coord &xyz, const ValueType &value)
| Set a particular value at the given coordinate and mark the coordinate as inactive.
template<typename ModifyOp>
void | modifyValue (const Coord &xyz, const ModifyOp &op)
| Apply a functor to the value at the given coordinate and mark mark the coordinate as active.
template<typename ModifyOp>
void | modifyValueAndActiveState (const Coord &xyz, const ModifyOp &op)
| Apply a functor to the voxel at the given coordinates.
void | setActiveState (const Coord &xyz, bool on=true)
| Set the active state of the voxel at the given coordinates without changing its value.
void | setValueOn (const Coord &xyz)
| Mark the voxel at the given coordinates as active without changing its value.
void | setValueOff (const Coord &xyz)
| Mark the voxel at the given coordinates as inactive without changing its value.
LeafNodeT * | touchLeaf (const Coord &xyz)
| Returns the leaf node that contains voxel (x, y, z) and if it doesn't exist, create it, but preserve the values and active states of the pre-existing branch.
void | addLeaf (LeafNodeT *leaf)
| Add the specified leaf to this tree, possibly creating a child branch in the process. If the leaf node already exists, replace it.
void | addTile (Index level, const Coord &xyz, const ValueType &value, bool state)
| Add a tile at the specified tree level that contains the coordinate xyz, possibly deleting existing nodes or creating new nodes in the process.
template<typename NodeT>
NodeT * | getNode ()
| Return the node of type NodeT that has been cached on this accessor. If this accessor does not cache this NodeT, or if no node of this type has been cached, returns a nullptr.
template<typename NodeT>
void | insertNode (const Coord &xyz, NodeT &node)
| Explicitly insert a node of the type NodeT into this Value Accessors cache.
template<typename NodeT>
void | eraseNode ()
| Explicitly remove this Value Accessors cached node of the given NodeT. If this Value Accessor does not support the caching of the provided NodeT, this method does nothing.
void | clear () override final
| Remove all the cached nodes and invalidate the corresponding hash-keys.
_TreeType * | getTree () const
| Return a pointer to the tree associated with this accessor.
_TreeType & | tree () const
| Return a reference to the tree associated with this accessor.
const _TreeType::ValueType * | buffer ()
const _TreeType::ValueType * | buffer () const
void | setBuffer (const typename _TreeType::ValueType *b) const
auto | lock () const
template<typename NodeT>
NodeT * | probeNode (const Coord &xyz)
| Return a pointer to the node of the specified type that contains the value located at xyz. If no node of the given NodeT exists which contains the value, a nullptr is returned.
template<typename NodeT>
const NodeT * | probeConstNode (const Coord &xyz) const
| Return a pointer to the node of the specified type that contains the value located at xyz. If no node of the given NodeT exists which contains the value, a nullptr is returned.
LeafNodeT * | probeLeaf (const Coord &xyz)
| Return a pointer to the leaf node that contains the voxel coordinate xyz. If no LeafNode exists, returns a nullptr.
const LeafNodeT * | probeLeaf (const Coord &xyz) const
| Return a pointer to the leaf node that contains the voxel coordinate xyz. If no LeafNode exists, returns a nullptr.
const LeafNodeT * | probeConstLeaf (const Coord &xyz) const
| Return a pointer to the leaf node that contains the voxel coordinate xyz. If no LeafNode exists, returns a nullptr.

## Static Public Member Functions
static constexpr Index | numCacheLevels ()
| Return the number of cache levels employed by this ValueAccessor.
static constexpr bool | isSafe ()
| Return true if this accessor is safe, i.e. registered by the tree from which it is constructed. Un-registered accessors can in rare cases be faster because it avoids the (small) overhead of registration, but they are unsafe if the tree is modified. So unless you're an expert it is highly recommended to set IsSafe = true (which is the default).

## Static Public Attributes
template<typename NodeT>
static constexpr bool | IsLeafAndBypassLeafAPI
| Given a node type, return whether this Accessor can perform optimized value buffer accesses. This is only possible for LeafNodes so will always return false for any non LeafNode type. It also depends on the value type - if the value buffer is a contiguous index-able array of values then this returns true.
static constexpr bool | BypassLeafAPI
| Helper alias which is true if the lowest cached node level is a LeafNode type and has a compatible value type for optimized access.
static constexpr size_t | NumCacheLevels = NodeLevelList::Size-1
| The number of node levels that this accessor can cache, excluding the RootNode.
static constexpr bool | IsConstTree
| Returns true if this accessor is operating on a const tree type.

## Protected Member Functions
void | release () override final
| Release this accessor from the tree, set the tree to null and clear the accessor cache. After calling this method the accessor will be completely invalid.
template<typename NodeT>
OPENVDB_FORCE_INLINE void | insert (const Coord &xyz, const NodeT *node) const
| Insert a node into this ValueAccessor's cache.
template<typename NodeT>
OPENVDB_FORCE_INLINE bool | isHashed (const Coord &xyz) const

## Protected Attributes
_TreeType * | mTree

## Friends
template<typename>
class | RootNode
template<typename, Index>
class | InternalNode
template<typename, Index>
class | LeafNode
template<typename>
class | Tree

## Detailed Description

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
class openvdb::v12_1::tree::ValueAccessorImpl< _TreeType, IsSafe, MutexT, IntegerSequence >

The Value Accessor Implementation and API methods. The majoirty of the API matches the API of a compatible OpenVDB Tree Node.

## Member Typedef Documentation

## ◆ BaseT

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using BaseT = ValueAccessorBase<_TreeType, IsSafe>

Note
  Not strictly the only Base Type but provided for backwards compatibility.

## ◆ LeafCacheT

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using LeafCacheT = ValueAccessorLeafBuffer<_TreeType, IntegerSequence>

## ◆ LeafNodeT

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using LeafNodeT = typename TreeType::LeafNodeType

## ◆ LockT

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using LockT = ValueAccessorLock<MutexT>

## ◆ NodeChainT

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using NodeChainT = typename RootNodeT::NodeChainType

## ◆ NodeLevelList

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using NodeLevelList

Initial value:
typename value_accessor_internal::NodeListBuilder
<NodeChainT, RootNodeT::LEVEL, IntegerSequence>::ListT
openvdb::v12_1::tree::ValueAccessorImpl::NodeChainT
typename RootNodeT::NodeChainType NodeChainT
Definition ValueAccessor.h:379

A resolved, flattened TypeList of node types which this accessor is caching. The nodes index in this list does not necessarily correspond to the nodes level in the tree.

## ◆ NodePtrList

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using NodePtrList = typename NodeLevelList::template Transform<std::add_pointer_t>

## ◆ NodeTypeAtLevel

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<size_t Level>

using NodeTypeAtLevel = typename NodeLevelList::template Get<Level>

Return a node type at a particular cache level in the Value accessor. The node type at a given cache level does not necessarily equal the same node type in the TreeType as this depends entirely on which tree levels this Accessor is caching. For example:

Example:
  // Cache tree levels 0 and 2
  using Impl = ValueAccessorImpl<FloatTree, true, void, 0, 2>
  using CacheLevel1 = Impl::template NodeTypeAtLevel<1>
  using TreeLevel2 = TreeType::RootNodeType::NodeChainType::Get<2>;
  static_assert(std::is_same<CacheLevel1, TreeLevel2>::value);
  openvdb::v12_1::tree::ValueAccessorImpl::NodeTypeAtLevel
  typename NodeLevelList::template Get< Level > NodeTypeAtLevel
  Return a node type at a particular cache level in the Value accessor. The node type at a given cache ...
  Definition ValueAccessor.h:402
  openvdb::v12_1::tree::ValueAccessorImpl::ValueAccessorImpl
  ValueAccessorImpl(TreeType &tree)
  Constructor from a tree.
  Definition ValueAccessor.h:425

## ◆ RootNodeT

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using RootNodeT = typename TreeType::RootNodeType

## ◆ TreeType

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using TreeType = _TreeType

## ◆ ValueType

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

using ValueType = typename TreeType::ValueType

## Constructor & Destructor Documentation

## ◆ ValueAccessorImpl() [1/2]

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

ValueAccessorImpl | ( | TreeType & | tree | ) |
| inline

Constructor from a tree.

## ◆ ~ValueAccessorImpl()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

~ValueAccessorImpl | ( |  | ) |
| final override default

## ◆ ValueAccessorImpl() [2/2]

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

ValueAccessorImpl | ( | const ValueAccessorImpl< _TreeType, IsSafe, MutexT, IntegerSequence > & |  | ) |
| default

## Member Function Documentation

## ◆ addLeaf()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void addLeaf | ( | LeafNodeT * | leaf | ) |
| inline

Add the specified leaf to this tree, possibly creating a child branch in the process. If the leaf node already exists, replace it.

Parameters

  leaf | The LeafNode to insert into the tree. Must not be a nullptr.

## ◆ addTile()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void addTile | ( | Index | level,
|  | const Coord & | xyz,
|  | const ValueType & | value,
|  | bool | state )
| inline

Add a tile at the specified tree level that contains the coordinate xyz, possibly deleting existing nodes or creating new nodes in the process.

Note
  Calling this with a level of 0 will modify voxel values. This function will always densify a tree branch up to the requested level (regardless if the value and active state match).

Parameters

  level | The level of the tree to add a tile. Level 0 refers to voxels (and is similar to setValue, except will always density).
  xyz | The index space coordinate to add a tile
  value | The value of the tile
  state | The active state to set on the new tile

## ◆ buffer() [1/2]

const _TreeType::ValueType * buffer | ( |  | ) |
| inline inherited

## ◆ buffer() [2/2]

const _TreeType::ValueType * buffer | ( |  | ) | const
| inline inherited

## ◆ clear()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void clear | ( |  | ) |
| inline final override virtual

Remove all the cached nodes and invalidate the corresponding hash-keys.

Implements ValueAccessorBase< _TreeType, IsSafe >.

## ◆ eraseNode()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename NodeT>

void eraseNode | ( |  | ) |
| inline

Explicitly remove this Value Accessors cached node of the given NodeT. If this Value Accessor does not support the caching of the provided NodeT, this method does nothing.

## ◆ getNode()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename NodeT>

NodeT * getNode | ( |  | ) |
| inline

Return the node of type NodeT that has been cached on this accessor. If this accessor does not cache this NodeT, or if no node of this type has been cached, returns a nullptr.

## ◆ getTree()

_TreeType * getTree | ( |  | ) | const
| inline inherited

Return a pointer to the tree associated with this accessor.

The pointer will be null only if the tree from which this accessor was constructed was subsequently deleted (which generally leaves the accessor in an unsafe state).

## ◆ getValue()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

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

Return the value of the voxel at the given coordinates.

Parameters

  xyz | The index space coordinate to query

## ◆ getValueDepth()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

int getValueDepth | ( | const Coord & | xyz | ) | const
| inline

Return the tree depth (0 = root) at which the value of voxel (x, y, z) resides, or -1 if (x, y, z) isn't explicitly represented in the tree (i.e., if it is implicitly a background voxel).

Note
  This is the inverse of the node LEVEL (where the RootNode level is the highest in the tree).

Parameters

  xyz | The index space coordinate to query

## ◆ insert()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename NodeT>

OPENVDB_FORCE_INLINE void insert | ( | const Coord & | xyz,
|  | const NodeT * | node ) const
| inline protected

Insert a node into this ValueAccessor's cache.

******************************* WARNING ******************************* Methods here must be force inline otherwise compilers do not optimize out the function call due to recursive templates and performance degradation is significant.

## ◆ insertNode()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename NodeT>

void insertNode | ( | const Coord & | xyz,
|  | NodeT & | node )
| inline

Explicitly insert a node of the type NodeT into this Value Accessors cache.

## ◆ isCached()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

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

Return `true` if any of the nodes along the path to the given coordinate have been cached.

Parameters

  xyz | The index space coordinate to query

## ◆ isHashed()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename NodeT>

OPENVDB_FORCE_INLINE bool isHashed | ( | const Coord & | xyz | ) | const
| inline protected

## ◆ isSafe()

constexpr bool isSafe | ( |  | ) |
| inline static constexpr inherited

Return true if this accessor is safe, i.e. registered by the tree from which it is constructed. Un-registered accessors can in rare cases be faster because it avoids the (small) overhead of registration, but they are unsafe if the tree is modified. So unless you're an expert it is highly recommended to set IsSafe = true (which is the default).

## ◆ isValueOn()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

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

Return the active state of the voxel at the given coordinates.

Parameters

  xyz | The index space coordinate to query

## ◆ isVoxel()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

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

Return `true` if the value of voxel (x, y, z) resides at the leaf level of the tree, i.e., if it is not a tile value.

Parameters

  xyz | The index space coordinate to query

## ◆ lock()

template<typename MutexT>

auto lock | ( |  | ) | const
| inline inherited

## ◆ modifyValue()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename ModifyOp>

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

Apply a functor to the value at the given coordinate and mark mark the coordinate as active.

See Tree::modifyValue() for details.

Parameters

  xyz | The index space coordinate to modify
  op | The modify operation

## ◆ modifyValueAndActiveState()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename ModifyOp>

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

Apply a functor to the voxel at the given coordinates.

See Tree::modifyValueAndActiveState() for details.

Parameters

  xyz | The index space coordinate to modify
  op | The modify operation

## ◆ numCacheLevels()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

constexpr Index numCacheLevels | ( |  | ) |
| inline static constexpr

Return the number of cache levels employed by this ValueAccessor.

Deprecated
  "Use the static NumCacheLevels constant"

## ◆ operator=()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

ValueAccessorImpl & operator= | ( | const ValueAccessorImpl< _TreeType, IsSafe, MutexT, IntegerSequence > & |  | ) |
| default

## ◆ probeConstLeaf()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

const LeafNodeT * probeConstLeaf | ( | const Coord & | xyz | ) | const
| inline

Return a pointer to the leaf node that contains the voxel coordinate xyz. If no LeafNode exists, returns a nullptr.

Parameters

  xyz | The index space coordinate to query

## ◆ probeConstNode()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename NodeT>

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

Return a pointer to the node of the specified type that contains the value located at xyz. If no node of the given NodeT exists which contains the value, a nullptr is returned.

This function may return a nullptr even if the coordinate xyz is represented in tree, as it depends on the type NodeT provided. For example, the value may exist as a tile in an InternalNode but note as a LeafNode.

Parameters

  xyz | The index space coordinate to query

## ◆ probeLeaf() [1/2]

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

LeafNodeT * probeLeaf | ( | const Coord & | xyz | ) |
| inline

Return a pointer to the leaf node that contains the voxel coordinate xyz. If no LeafNode exists, returns a nullptr.

Parameters

  xyz | The index space coordinate to query

## ◆ probeLeaf() [2/2]

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

const LeafNodeT * probeLeaf | ( | const Coord & | xyz | ) | const
| inline

Return a pointer to the leaf node that contains the voxel coordinate xyz. If no LeafNode exists, returns a nullptr.

Parameters

  xyz | The index space coordinate to query

## ◆ probeNode()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename NodeT>

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

Return a pointer to the node of the specified type that contains the value located at xyz. If no node of the given NodeT exists which contains the value, a nullptr is returned.

This function may return a nullptr even if the coordinate xyz is represented in tree, as it depends on the type NodeT provided. For example, the value may exist as a tile in an InternalNode but note as a LeafNode.

Parameters

  xyz | The index space coordinate to query

## ◆ probeValue()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

bool probeValue | ( | const Coord & | xyz,
|  | ValueType & | value ) const
| inline

Return the active state of the value at a given coordinate as well as its value.

Parameters

  xyz | The index space coordinate to query
  value | The value to get

## ◆ release()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void release | ( |  | ) |
| inline final override protected virtual

Release this accessor from the tree, set the tree to null and clear the accessor cache. After calling this method the accessor will be completely invalid.

Reimplemented from ValueAccessorBase< _TreeType, IsSafe >.

## ◆ setActiveState()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void setActiveState | ( | const Coord & | xyz,
|  | bool | on = true )
| inline

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

Note
  This method will densify branches of the tree if the coordinate points to a tile and if the provided activate state flag is different to the tiles

Parameters

  xyz | The index space coordinate to modify
  on | Whether to set the active state to on (true) or off (false)

## ◆ setBuffer()

void setBuffer | ( | const typename _TreeType::ValueType * | b | ) | const
| inline inherited

## ◆ setValue()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void setValue | ( | const Coord & | xyz,
|  | const ValueType & | value )
| inline

Set a particular value at the given coordinate and mark the coordinate as active.

Note
  This method will densify branches of the tree if the coordinate points to a tile and if the provided value or active state is different to the tiles

Parameters

  xyz | The index space coordinate to set
  value | The value to set

## ◆ setValueOff() [1/2]

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

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

Mark the voxel at the given coordinates as inactive without changing its value.

Note
  This method will densify branches of the tree if the coordinate points to a tile and if the tiles active state is on.

Parameters

  xyz | The index space coordinate to modify

## ◆ setValueOff() [2/2]

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void setValueOff | ( | const Coord & | xyz,
|  | const ValueType & | value )
| inline

Set a particular value at the given coordinate and mark the coordinate as inactive.

Note
  This method will densify branches of the tree if the coordinate points to a tile and if the provided value or active state is different to the tiles

Parameters

  xyz | The index space coordinate to set
  value | The value to set

## ◆ setValueOn() [1/2]

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

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

Mark the voxel at the given coordinates as active without changing its value.

Note
  This method will densify branches of the tree if the coordinate points to a tile and if the tiles active state is off.

Parameters

  xyz | The index space coordinate to modify

## ◆ setValueOn() [2/2]

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void setValueOn | ( | const Coord & | xyz,
|  | const ValueType & | value )
| inline

## ◆ setValueOnly()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

void setValueOnly | ( | const Coord & | xyz,
|  | const ValueType & | value )
| inline

Set a particular value at the given coordinate but preserve its active state.

Note
  This method will densify branches of the tree if the coordinate points to a tile and if the provided value is different to the tiles

Parameters

  xyz | The index space coordinate to set
  value | The value to set

## ◆ touchLeaf()

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

LeafNodeT * touchLeaf | ( | const Coord & | xyz | ) |
| inline

Returns the leaf node that contains voxel (x, y, z) and if it doesn't exist, create it, but preserve the values and active states of the pre-existing branch.

Note
  You can use this method to preallocate a static tree topology over which to safely perform multithreaded processing.

Parameters

  xyz | The index space coordinate at which to create a LeafNode. Note that if this coordinate is not a LeafNode origin then the LeafNode that would otherwise contain this coordinate is created and returned.

## ◆ tree()

_TreeType & tree | ( |  | ) | const
| inline inherited

Return a reference to the tree associated with this accessor.

## Friends And Related Symbol Documentation

## ◆ InternalNode

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename, Index>

friend class InternalNode
| friend

## ◆ LeafNode

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename, Index>

friend class LeafNode
| friend

## ◆ RootNode

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename>

friend class RootNode
| friend

## ◆ Tree

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename>

friend class Tree
| friend

## Member Data Documentation

## ◆ BypassLeafAPI

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

bool BypassLeafAPI
| static constexpr

Initial value:
=
IsLeafAndBypassLeafAPI<NodeTypeAtLevel<0>>
openvdb::v12_1::tree::ValueAccessorImpl::IsLeafAndBypassLeafAPI
static constexpr bool IsLeafAndBypassLeafAPI
Given a node type, return whether this Accessor can perform optimized value buffer accesses....
Definition ValueAccessor.h:410

Helper alias which is true if the lowest cached node level is a LeafNode type and has a compatible value type for optimized access.

## ◆ IsConstTree

bool IsConstTree
| static constexpr inherited

Returns true if this accessor is operating on a const tree type.

## ◆ IsLeafAndBypassLeafAPI

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>
template<typename NodeT>

bool IsLeafAndBypassLeafAPI
| static constexpr

Initial value:
=
LeafCacheT::template BypassLeafAPI<NodeT>
openvdb::v12_1::tree::ValueAccessorImpl::BypassLeafAPI
static constexpr bool BypassLeafAPI
Helper alias which is true if the lowest cached node level is a LeafNode type and has a compatible va...
Definition ValueAccessor.h:415

Given a node type, return whether this Accessor can perform optimized value buffer accesses. This is only possible for LeafNodes so will always return false for any non LeafNode type. It also depends on the value type - if the value buffer is a contiguous index-able array of values then this returns true.

## ◆ mTree

_TreeType* mTree
| protected inherited

## ◆ NumCacheLevels

template<typename _TreeType, bool IsSafe, typename MutexT, typename IntegerSequence>

size_t NumCacheLevels = NodeLevelList::Size-1
| static constexpr

The number of node levels that this accessor can cache, excluding the RootNode.