HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe > Class Template Reference

ValueAccessor with no mutex and no node caching. More...

#include <ValueAccessor.h>

+ Inheritance diagram for openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >:

Public Types

typedef _TreeType TreeType
 
typedef TreeType::ValueType ValueType
 
typedef TreeType::RootNodeType RootNodeT
 
typedef TreeType::LeafNodeType LeafNodeT
 
typedef ValueAccessorBase
< TreeType, IsSafe > 
BaseT
 

Public Member Functions

 ValueAccessor0 (TreeType &tree)
 
 ValueAccessor0 (const ValueAccessor0 &other)
 
ValueAccessor0operator= (const ValueAccessor0 &other)
 
virtual ~ValueAccessor0 ()
 
bool isCached (const Coord &) const
 Return true if nodes along the path to the given voxel have been cached. More...
 
const ValueTypegetValue (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 and, in value, the value of the voxel at the given coordinates. 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 don't change 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...
 
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 setActiveState (const Coord &xyz, bool on=true)
 Set the active state of the voxel at the given coordinates but don't change its value. More...
 
void setValueOn (const Coord &xyz)
 Mark the voxel at the given coordinates as active but don't change its value. More...
 
void setValueOff (const Coord &xyz)
 Mark the voxel at the given coordinates as inactive but don't change 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 &, NodeT &)
 
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. More...
 
void addTile (Index level, const Coord &xyz, const ValueType &value, bool state)
 Add a tile at the specified tree level that contains voxel (x, y, z), possibly deleting existing nodes or creating new nodes in the process. More...
 
template<typename NodeT >
void eraseNode ()
 
LeafNodeTtouchLeaf (const Coord &xyz)
 
template<typename NodeT >
NodeT * probeNode (const Coord &xyz)
 
template<typename NodeT >
const NodeT * probeConstNode (const Coord &xyz) const
 
LeafNodeTprobeLeaf (const Coord &xyz)
 
const LeafNodeTprobeConstLeaf (const Coord &xyz) const
 
const LeafNodeTprobeLeaf (const Coord &xyz) const
 
virtual void clear ()
 Remove all nodes from this cache, then reinsert the root node. More...
 
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...
 
- Public Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorBase< _TreeType, IsSafe >
 ValueAccessorBase (_TreeType &tree)
 
 ValueAccessorBase (const ValueAccessorBase &other)
 
virtual ~ValueAccessorBase ()
 
_TreeType * getTree () const
 Return a pointer to the tree associated with this accessor. More...
 
_TreeType & tree () const
 Return a reference to the tree associated with this accessor. More...
 
ValueAccessorBaseoperator= (const ValueAccessorBase &other)
 

Static Public Member Functions

static Index numCacheLevels ()
 Return the number of cache levels employed by this accessor. More...
 
- Static Public Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorBase< _TreeType, IsSafe >
static 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). More...
 

Friends

template<typename >
class Tree
 

Additional Inherited Members

- Static Public Attributes inherited from openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorBase< _TreeType, IsSafe >
static const bool IsConstTree
 
- Protected Attributes inherited from openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorBase< _TreeType, IsSafe >
_TreeType * mTree
 

Detailed Description

template<typename TreeType, bool IsSafe = true>
class openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >

ValueAccessor with no mutex and no node caching.

This specialization is provided mainly for benchmarking. Accessors with caching will almost always be faster.

Definition at line 87 of file ValueAccessor.h.

Member Typedef Documentation

template<typename TreeType , bool IsSafe = true>
typedef ValueAccessorBase<TreeType, IsSafe> openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::BaseT

Definition at line 1053 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
typedef TreeType::LeafNodeType openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::LeafNodeT

Definition at line 1052 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
typedef TreeType::RootNodeType openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::RootNodeT

Definition at line 1051 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
typedef _TreeType openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::TreeType

Definition at line 1049 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
typedef TreeType::ValueType openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::ValueType

Definition at line 1050 of file ValueAccessor.h.

Constructor & Destructor Documentation

template<typename TreeType , bool IsSafe = true>
openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::ValueAccessor0 ( TreeType tree)
inline

Definition at line 1055 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::ValueAccessor0 ( const ValueAccessor0< TreeType, IsSafe > &  other)
inline

Definition at line 1057 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
virtual openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::~ValueAccessor0 ( )
inlinevirtual

Definition at line 1068 of file ValueAccessor.h.

Member Function Documentation

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::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.

Definition at line 1180 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::addTile ( Index  level,
const Coord &  xyz,
const ValueType value,
bool  state 
)
inline

Add a tile at the specified tree level that contains voxel (x, y, z), possibly deleting existing nodes or creating new nodes in the process.

Definition at line 1189 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
virtual void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::clear ( void  )
inlinevirtual

Remove all nodes from this cache, then reinsert the root node.

Implements openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorBase< _TreeType, IsSafe >.

Definition at line 1239 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
template<typename NodeT >
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::eraseNode ( )
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]

Definition at line 1199 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
template<typename NodeT >
NodeT* openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::getNode ( void  )
inline

Return the cached node of type NodeType. [Mainly for internal use].

Definition at line 1172 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
const ValueType& openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::getValue ( const Coord &  xyz) const
inline

Return the value of the voxel at the given coordinates.

Definition at line 1074 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
int openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::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).

Definition at line 1097 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
template<typename NodeT >
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::insertNode ( const Coord &  ,
NodeT &   
)
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]

Definition at line 1176 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
bool openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::isCached ( const Coord &  ) const
inline

Return true if nodes along the path to the given voxel have been cached.

Definition at line 1071 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
bool openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::isValueOn ( const Coord &  xyz) const
inline

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

Definition at line 1081 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
bool openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::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.

Definition at line 1105 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
template<typename ModifyOp >
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::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.

See Tree::modifyValue() for details.

Definition at line 1142 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
template<typename ModifyOp >
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::modifyValueAndActiveState ( const Coord &  xyz,
const ModifyOp &  op 
)
inline

Apply a functor to the voxel at the given coordinates.

See Tree::modifyValueAndActiveState() for details.

Definition at line 1152 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
static Index openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::numCacheLevels ( )
inlinestatic

Return the number of cache levels employed by this accessor.

Definition at line 1060 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
ValueAccessor0& openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::operator= ( const ValueAccessor0< TreeType, IsSafe > &  other)
inline

Definition at line 1062 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
const LeafNodeT* openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::probeConstLeaf ( const Coord &  xyz) const
inline

Definition at line 1228 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
template<typename NodeT >
const NodeT* openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::probeConstNode ( const Coord &  xyz) const
inline

Definition at line 1217 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
LeafNodeT* openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::probeLeaf ( const Coord &  xyz)
inline

Definition at line 1223 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
const LeafNodeT* openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::probeLeaf ( const Coord &  xyz) const
inline

Definition at line 1233 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
template<typename NodeT >
NodeT* openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::probeNode ( const Coord &  xyz)
inline

Definition at line 1209 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
bool openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::probeValue ( const Coord &  xyz,
ValueType value 
) const
inline

Return the active state and, in value, the value of the voxel at the given coordinates.

Definition at line 1088 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::setActiveState ( const Coord &  xyz,
bool  on = true 
)
inline

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

Definition at line 1160 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::setValue ( const Coord &  xyz,
const ValueType value 
)
inline

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

Definition at line 1113 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::setValueOff ( const Coord &  xyz,
const ValueType value 
)
inline

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

Definition at line 1131 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::setValueOff ( const Coord &  xyz)
inline

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

Definition at line 1169 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::setValueOn ( const Coord &  xyz,
const ValueType value 
)
inline

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

Definition at line 1119 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::setValueOn ( const Coord &  xyz)
inline

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

Definition at line 1167 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
void openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::setValueOnly ( const Coord &  xyz,
const ValueType value 
)
inline

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

Definition at line 1123 of file ValueAccessor.h.

template<typename TreeType , bool IsSafe = true>
LeafNodeT* openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessor0< TreeType, IsSafe >::touchLeaf ( const Coord &  xyz)
inline

Definition at line 1201 of file ValueAccessor.h.

Friends And Related Function Documentation

template<typename TreeType , bool IsSafe = true>
template<typename >
friend class Tree
friend

Definition at line 1243 of file ValueAccessor.h.


The documentation for this class was generated from the following file: