OpenVDB  0.104.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType > Class Template Reference

The two point scatters UniformPointScatter and NonUniformPointScatter depend on the following two classes: More...

#include <PointScatter.h>

Public Member Functions

 UniformPointScatter (PointAccessorType &points, int pointCount, RandomGenerator &randGen, InterruptType *interrupt=NULL)
 
 UniformPointScatter (PointAccessorType &points, float pointsPerVolume, RandomGenerator &randGen, InterruptType *interrupt=NULL)
 
template<typename GridT >
void operator() (const GridT &grid)
 This is the main functor method implementing the actual scattering of points. More...
 
void print (const std::string &name, std::ostream &os=std::cout) const
 
int getPointCount () const
 
float getPointsPerVolume () const
 
openvdb::Index64 getVoxelCount () const
 

Protected Member Functions

double getRand ()
 
template<typename GridT >
void addPoint (const GridT &grid, const openvdb::Vec3R &pos, const openvdb::Vec3R &delta)
 
template<typename GridT >
void addPoint (const GridT &grid, const openvdb::Vec3R &dmin)
 
template<typename GridT >
void addPoint (const GridT &grid, const openvdb::Vec3R &dmin, const openvdb::Coord &size)
 

Protected Attributes

PointAccessorType & mPoints
 
InterruptType * mInterrupter
 
int mPointCount
 
float mPointsPerVolume
 
openvdb::Index64 mVoxelCount
 
RandomGenerator & mRandomGen
 
boost::uniform_01< double > mRandom
 

Detailed Description

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = openvdb::util::NullInterrupter>
class openvdb::v0_104_0::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >

The two point scatters UniformPointScatter and NonUniformPointScatter depend on the following two classes:

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

class PointAccessor {
...
public:
void add(const openvdb::Vec3R &pos);// appends point with world positions pos
};

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

class Interrupter {
...
public:
void start(const char* name = NULL)// 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 InterruptType the util::NullInterrupter is used which implies that all interrupter calls are no-ops (i.e. incurs no computational overhead). Uniform scatters of point in the active voxels. The point count is either explicitly defined or implicitly through the specification of a global density (=points-per-volume)
This uniform scattering technique assumes that the number of points is generally smaller than the number of active voxels (including virtual active voxels in active tiles).

Constructor & Destructor Documentation

UniformPointScatter ( PointAccessorType &  points,
int  pointCount,
RandomGenerator &  randGen,
InterruptType *  interrupt = NULL 
)
inline
UniformPointScatter ( PointAccessorType &  points,
float  pointsPerVolume,
RandomGenerator &  randGen,
InterruptType *  interrupt = NULL 
)
inline

Member Function Documentation

void addPoint ( const GridT &  grid,
const openvdb::Vec3R pos,
const openvdb::Vec3R delta 
)
inlineprotected
void addPoint ( const GridT &  grid,
const openvdb::Vec3R dmin 
)
inlineprotected
void addPoint ( const GridT &  grid,
const openvdb::Vec3R dmin,
const openvdb::Coord size 
)
inlineprotected
int getPointCount ( ) const
inline
float getPointsPerVolume ( ) const
inline
double getRand ( )
inlineprotected
openvdb::Index64 getVoxelCount ( ) const
inline
void operator() ( const GridT &  grid)
inline

This is the main functor method implementing the actual scattering of points.

void print ( const std::string &  name,
std::ostream &  os = std::cout 
) const
inline

Member Data Documentation

InterruptType* mInterrupter
protected
int mPointCount
protected
PointAccessorType& mPoints
protected
float mPointsPerVolume
protected
boost::uniform_01<double> mRandom
protected
RandomGenerator& mRandomGen
protected
openvdb::Index64 mVoxelCount
protected

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