OpenVDB
0.104.0
|
Value accessor with two levels of node caching. More...
#include <ValueAccessor.h>
Inherits ValueAccessorBase< _TreeType >.
Public Types | |
typedef _TreeType | TreeType |
typedef TreeType::ValueType | ValueType |
typedef TreeType::RootNodeType | RootNodeT |
typedef TreeType::LeafNodeType | LeafNodeT |
typedef ValueAccessorBase < TreeType > | BaseT |
typedef InvertedTree < RootNodeT, RootNodeT::LEVEL > ::Type | InvTreeT |
typedef boost::mpl::at < InvTreeT, boost::mpl::int_ < L0 > >::type | NodeT0 |
typedef boost::mpl::at < InvTreeT, boost::mpl::int_ < L1 > >::type | NodeT1 |
Public Member Functions | |
BOOST_STATIC_ASSERT (_TreeType::DEPTH >=3) | |
BOOST_STATIC_ASSERT (L0< L1 &&L1< _TreeType::RootNodeType::LEVEL) | |
ValueAccessor2 (TreeType &tree) | |
Constructor from a tree. More... | |
ValueAccessor2 (const ValueAccessor2 &other) | |
Copy constructor. More... | |
ValueAccessor2 & | operator= (const ValueAccessor2 &other) |
Asignment operator. More... | |
virtual | ~ValueAccessor2 () |
Virtual destructor. More... | |
bool | isCached (const Coord &xyz) const |
const ValueType & | getValue (const Coord &xyz) const |
Return the value of the voxel at the given coordinates. More... | |
bool | isValueOn (const Coord &xyz) const |
Return the active state of the voxel at the given coordinates. More... | |
bool | probeValue (const Coord &xyz, ValueType &value) const |
Return the active state of the voxel as well as its value. More... | |
int | getValueDepth (const Coord &xyz) const |
bool | isVoxel (const Coord &xyz) const |
void | setValueOnly (const Coord &xyz, const ValueType &value) |
Set the value of the voxel at the given coordinate but preserves its active state. More... | |
void | setValueOff (const Coord &xyz, const ValueType &value) |
Set the value of the voxel at the given coordinates and mark the voxel as inactive. More... | |
void | setValueOnSum (const Coord &xyz, const ValueType &value) |
void | setActiveState (const Coord &xyz, bool on=true) |
Set the active state of the voxel at the given coordinates without changing its value. More... | |
void | setValueOn (const Coord &xyz) |
Mark the voxel at the given coordinates as active without changing its value. More... | |
void | setValueOff (const Coord &xyz) |
Mark the voxel at the given coordinates as inactive without changing its value. More... | |
template<typename NodeT > | |
NodeT * | getNode () |
Return the cached node of type NodeType. [Mainly for internal use]. More... | |
template<typename NodeT > | |
void | insertNode (const Coord &xyz, NodeT &node) |
template<typename NodeT > | |
void | eraseNode () |
LeafNodeT * | touchLeaf (const Coord &xyz) |
LeafNodeT * | probeLeaf (const Coord &xyz) |
const LeafNodeT * | probeConstLeaf (const Coord &xyz) |
virtual void | clear () |
Remove all the cached nodes and invalidate the corresponding hash-keys. More... | |
_TreeType * | getTree () const |
void | setValue (const Coord &xyz, const ValueType &value) |
Set the value of the voxel at the given coordinates and mark the voxel as active. More... | |
void | setValueOn (const Coord &xyz, const ValueType &value) |
Set the value of the voxel at the given coordinates and mark the voxel as active. More... | |
Static Public Member Functions | |
static Index | numCacheLevels () |
Return the number of cache levels employed by this ValueAccessor. More... | |
Static Public Attributes | |
static const bool | IsConstTree |
Protected Attributes | |
_TreeType * | mTree |
Friends | |
template<typename > | |
class | RootNode |
template<typename , Index > | |
class | InternalNode |
template<typename , Index > | |
class | LeafNode |
template<typename > | |
class | Tree |
Value accessor with two levels of node caching.
The node cache levels are specified by L0 and L1 with the default values 0 and 1 (defined in the forward declaration) corresponding to a LeafNode and its parent InternalNode.
typedef ValueAccessorBase<TreeType> BaseT |
typedef InvertedTree<RootNodeT, RootNodeT::LEVEL>::Type InvTreeT |
typedef TreeType::LeafNodeType LeafNodeT |
typedef TreeType::RootNodeType RootNodeT |
typedef _TreeType TreeType |
typedef TreeType::ValueType ValueType |
|
inline |
Constructor from a tree.
|
inline |
Copy constructor.
|
inlinevirtual |
Virtual destructor.
BOOST_STATIC_ASSERT | ( | _TreeType::DEPTH >= | 3 | ) |
BOOST_STATIC_ASSERT | ( | ) |
|
inlinevirtual |
Remove all the cached nodes and invalidate the corresponding hash-keys.
Implements ValueAccessorBase< _TreeType >.
|
inline |
If a node of the given type exists in the cache, remove it, so that isCached(xyz) returns false
for any voxel (x, y, z) contained in that node. [Mainly for internal use]
|
inline |
Return the cached node of type NodeType. [Mainly for internal use].
|
inlineinherited |
Return the value of the voxel at the given coordinates.
|
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).
|
inline |
Cache the given node, which should lie along the path from the root node to the node containing voxel (x, y, z). [Mainly for internal use]
|
inline |
Return true
if any of the nodes along the path to the given voxel have been cached.
|
inline |
Return the active state of the voxel at the given coordinates.
|
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.
|
inlinestatic |
Return the number of cache levels employed by this ValueAccessor.
|
inline |
Asignment operator.
Return the active state of the voxel as well as its value.
|
inline |
Set the active state of the voxel at the given coordinates without changing its value.
Set the value of the voxel at the given coordinates and mark the voxel as active.
Set the value of the voxel at the given coordinates and mark the voxel as inactive.
|
inline |
Mark the voxel at the given coordinates as inactive without changing its value.
Set the value of the voxel at the given coordinates and mark the voxel as active.
|
inline |
Mark the voxel at the given coordinates as active without changing its value.
Set the value of the voxel at the given coordinate but preserves its active state.
Set the value of the voxel at the given coordinates to the sum of its current value and the given value, and mark the voxel as active.
Use this method to preallocate a static tree topology over which to safely perform multithreaded processing.
|
friend |
|
friend |
|
friend |
|
friend |
|
staticinherited |
|
protectedinherited |