OpenVDB  8.1.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
FindActiveValues< TreeT > Class Template Reference

Finds the active values in a tree which intersects a bounding box. More...

#include <FindActiveValues.h>

Classes

struct  RootChild
 

Public Types

using TileDataT = TileData< typename TreeT::ValueType >
 
using AccT = tree::ValueAccessor< const TreeT, false >
 
using RootChildType = typename TreeT::RootNodeType::ChildNodeType
 

Public Member Functions

 FindActiveValues (const TreeT &tree)
 Constructor from a const tree, which is assumed not to be modified after construction. More...
 
 ~FindActiveValues ()
 Default destructor. More...
 
void update (const TreeT &tree)
 Initiate this class with a new (or modified) tree. More...
 
bool anyActiveValues (const CoordBBox &bbox, bool useAccessor=false) const
 Returns true if the specified bounding box intersects any active values. More...
 
bool anyActiveVoxels (const CoordBBox &bbox) const
 Returns true if the specified bounding box intersects any active tiles only. More...
 
bool anyActiveTiles (const CoordBBox &bbox) const
 Returns true if the specified bounding box intersects any active tiles only. More...
 
bool noActiveValues (const CoordBBox &bbox, bool useAccessor=false) const
 Returns true if the specified bounding box does not intersect any active values. More...
 
Index64 count (const CoordBBox &bbox) const
 Returns the number of active voxels intersected by the specified bounding box. More...
 
std::vector< TileDataTactiveTiles (const CoordBBox &bbox) const
 Return a vector with bounding boxes that represents all the intersections between active tiles in the tree and the specified bounding box. More...
 
 OPENVDB_DEPRECATED_MESSAGE ("Use anyActiveValues() instead") inline bool any(const CoordBBox &bbox
 
void init (const TreeT &tree)
 
template<typename NodeT >
NodeT::NodeMaskType getBBoxMask (const CoordBBox &bbox, const NodeT *node) const
 
bool anyActiveValues (const typename TreeT::LeafNodeType *leaf, const CoordBBox &bbox) const
 
bool anyActiveVoxels (const typename TreeT::LeafNodeType *leaf, const CoordBBox &bbox) const
 
void activeTiles (const typename TreeT::LeafNodeType *, const CoordBBox &, std::vector< TileDataT > &) const
 
Index64 count (const typename TreeT::LeafNodeType *leaf, const CoordBBox &bbox) const
 
template<typename NodeT >
bool anyActiveValues (const NodeT *node, const CoordBBox &bbox) const
 
template<typename NodeT >
bool anyActiveVoxels (const NodeT *node, const CoordBBox &bbox) const
 
template<typename NodeT >
bool anyActiveTiles (const NodeT *node, const CoordBBox &bbox) const
 
template<typename NodeT >
void activeTiles (const NodeT *node, const CoordBBox &bbox, std::vector< TileDataT > &tiles) const
 
template<typename NodeT >
Index64 count (const NodeT *node, const CoordBBox &bbox) const
 

Static Public Member Functions

static bool anyActiveTiles (const typename TreeT::LeafNodeType *, const CoordBBox &)
 

Public Attributes

bool useAccessor
 
AccT mAcc
 
std::vector< TileDataTmRootTiles
 
std::vector< RootChildmRootNodes
 

Detailed Description

template<typename TreeT>
class openvdb::v8_1::tools::FindActiveValues< TreeT >

Finds the active values in a tree which intersects a bounding box.

Two methods are provided, one that count the number of active values and one that simply tests if any active values intersect the bbox.

Warning
Tree nodes are cached by this class so it's important that the tree is not modified after this class is instantiated and before its methods are called.

Member Typedef Documentation

using AccT = tree::ValueAccessor<const TreeT, false>
using RootChildType = typename TreeT::RootNodeType::ChildNodeType
using TileDataT = TileData<typename TreeT::ValueType>

Constructor & Destructor Documentation

FindActiveValues ( const TreeT &  tree)

Constructor from a const tree, which is assumed not to be modified after construction.

Default destructor.

Member Function Documentation

std::vector< TileData< typename TreeT::ValueType > > activeTiles ( const CoordBBox &  bbox) const

Return a vector with bounding boxes that represents all the intersections between active tiles in the tree and the specified bounding box.

void activeTiles ( const typename TreeT::LeafNodeType *  ,
const CoordBBox &  ,
std::vector< TileDataT > &   
) const
inline
void activeTiles ( const NodeT *  node,
const CoordBBox &  bbox,
std::vector< TileDataT > &  tiles 
) const
bool anyActiveTiles ( const CoordBBox &  bbox) const

Returns true if the specified bounding box intersects any active tiles only.

static bool anyActiveTiles ( const typename TreeT::LeafNodeType *  ,
const CoordBBox &   
)
inlinestatic
bool anyActiveTiles ( const NodeT *  node,
const CoordBBox &  bbox 
) const
bool anyActiveValues ( const CoordBBox &  bbox,
bool  useAccessor = false 
) const

Returns true if the specified bounding box intersects any active values.

Warning
Using a ValueAccessor (i.e. useAccessor = true) can improve performance for especially small bounding boxes, but at the cost of no thread-safety. So if multiple threads are calling this method concurrently use the default setting, useAccessor = false.
bool anyActiveValues ( const typename TreeT::LeafNodeType *  leaf,
const CoordBBox &  bbox 
) const
inline
bool anyActiveValues ( const NodeT *  node,
const CoordBBox &  bbox 
) const
bool anyActiveVoxels ( const CoordBBox &  bbox) const

Returns true if the specified bounding box intersects any active tiles only.

bool anyActiveVoxels ( const typename TreeT::LeafNodeType *  leaf,
const CoordBBox &  bbox 
) const
inline
bool anyActiveVoxels ( const NodeT *  node,
const CoordBBox &  bbox 
) const
Index64 count ( const CoordBBox &  bbox) const

Returns the number of active voxels intersected by the specified bounding box.

Index64 count ( const typename TreeT::LeafNodeType *  leaf,
const CoordBBox &  bbox 
) const
inline
Index64 count ( const NodeT *  node,
const CoordBBox &  bbox 
) const
NodeT::NodeMaskType getBBoxMask ( const CoordBBox &  bbox,
const NodeT *  node 
) const
void init ( const TreeT &  tree)
bool noActiveValues ( const CoordBBox &  bbox,
bool  useAccessor = false 
) const
inline

Returns true if the specified bounding box does not intersect any active values.

Warning
Using a ValueAccessor (i.e. useAccessor = true) can improve performance for especially small bounding boxes, but at the cost of no thread-safety. So if multiple threads are calling this method concurrently use the default setting, useAccessor = false.
OPENVDB_DEPRECATED_MESSAGE ( "Use anyActiveValues() instead"  ) const
void update ( const TreeT &  tree)

Initiate this class with a new (or modified) tree.

Member Data Documentation

AccT mAcc
std::vector<RootChild> mRootNodes
std::vector<TileDataT> mRootTiles
bool useAccessor
Initial value:
= false) const
{
return this->anyActiveValues(bbox, useAccessor);
}
OPENVDB_DEPRECATED_MESSAGE("Use noActiveValues() instead") inline bool none(const CoordBBox &bbox, bool useAccessor = false) const
{
return this->noActiveValues(bbox, useAccessor);
}
private:
void clear()

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