HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PointsToMask.h File Reference

This tool produces a grid where every voxel that contains a point is active. It employs thread-local storage for best performance. More...

#include <openvdb/openvdb.h>
#include <openvdb/Grid.h>
#include <openvdb/Types.h>
#include <openvdb/util/NullInterrupter.h>
#include <openvdb/thread/Threading.h>
#include <tbb/enumerable_thread_specific.h>
#include <tbb/parallel_for.h>
#include <tbb/parallel_reduce.h>
#include <tbb/blocked_range.h>
#include <vector>
+ Include dependency graph for PointsToMask.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openvdb::OPENVDB_VERSION_NAME::tools::PointsToMask< GridT, InterrupterT >
 Makes every voxel of a grid active if it contains a point. More...
 
class  openvdb::OPENVDB_VERSION_NAME::tools::PointsToMask< GridT, InterrupterT >
 Makes every voxel of a grid active if it contains a point. More...
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::PointsToMask< GridT, InterrupterT >::ReducePool
 

Namespaces

 openvdb
 
 openvdb::OPENVDB_VERSION_NAME
 
 openvdb::OPENVDB_VERSION_NAME::tools
 

Functions

template<typename PointListT , typename GridT >
void openvdb::OPENVDB_VERSION_NAME::tools::maskPoints (const PointListT &points, GridT &grid)
 Makes every voxel of the grid active if it contains a point. More...
 
template<typename PointListT >
MaskGrid::Ptr openvdb::OPENVDB_VERSION_NAME::tools::createPointMask (const PointListT &points, const math::Transform &xform)
 Return a MaskGrid where each binary voxel value is on if the voxel contains one (or more) points (i.e. the 3D position of a point is closer to this voxel than any other voxels). More...
 

Detailed Description

This tool produces a grid where every voxel that contains a point is active. It employs thread-local storage for best performance.

Author
Ken Museth

The PointListT template argument below refers to any class with the following interface (see unittest/TestPointsToMask.cc and SOP_OpenVDB_From_Particles.cc for practical examples):

class PointList {
...
public:
// Return the total number of particles in list.
size_t size() const;
// Get the world space position of the nth particle.
void getPos(size_t n, Vec3R& xyz) const;
};
Note
See unittest/TestPointsToMask.cc for an example.

The InterruptT template argument below refers to any class with the following interface:

class Interrupter {
...
public:
void start(const char* name = nullptr) // called when computations begin
void end() // called when computations end
bool wasInterrupted(int percent = -1) // return true to break computation
};
Note
If no template argument is provided for this InterruptT the util::NullInterrupter is used which implies that all interrupter calls are no-ops (i.e. incurs no computational overhead).

Definition in file PointsToMask.h.