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

Scatters a fixed (and integer) number of points in all active voxels and tiles. More...

#include <openvdb/tools/PointScatter.h>

Inherits BasePointScatter< PointAccessorType, RandomGenerator, InterruptType >.

Public Types

using BaseT = BasePointScatter< PointAccessorType, RandomGenerator, InterruptType >
 

Public Member Functions

 DenseUniformPointScatter (PointAccessorType &points, float pointsPerVoxel, RandomGenerator &randGen, double spread=1.0, InterruptType *interrupt=nullptr)
 
template<typename GridT >
bool 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
 
float getPointsPerVoxel () const
 
Index64 getPointCount () const
 
Index64 getVoxelCount () const
 

Protected Member Functions

void start (const char *name)
 
void end ()
 
bool interrupt ()
 
double getRand01 ()
 Return a random floating point number between zero and one. More...
 
double getRand ()
 Return a random floating point number between 0.5 -+ mSpread/2. More...
 
template<typename GridT >
void addPoint (const GridT &grid, const Vec3R &dmin)
 
template<typename GridT >
void addPoint (const GridT &grid, const Vec3R &dmin, const Coord &size)
 

Protected Attributes

PointAccessorType & mPoints
 
InterruptType * mInterrupter
 
Index64 mPointCount
 
Index64 mVoxelCount
 
Index64 mInterruptCount
 
const double mSpread
 
math::Rand01< double, RandomGenerator > mRand01
 

Detailed Description

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
class openvdb::v9_0::tools::DenseUniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >

Scatters a fixed (and integer) number of points in all active voxels and tiles.

Member Typedef Documentation

using BaseT = BasePointScatter<PointAccessorType, RandomGenerator, InterruptType>

Constructor & Destructor Documentation

DenseUniformPointScatter ( PointAccessorType &  points,
float  pointsPerVoxel,
RandomGenerator &  randGen,
double  spread = 1.0,
InterruptType *  interrupt = nullptr 
)
inline

Member Function Documentation

void addPoint ( const GridT &  grid,
const Vec3R dmin 
)
inlineprotectedinherited
void addPoint ( const GridT &  grid,
const Vec3R dmin,
const Coord &  size 
)
inlineprotectedinherited
void end ( )
inlineprotectedinherited
Index64 getPointCount ( ) const
inlineinherited
float getPointsPerVoxel ( ) const
inline
double getRand ( )
inlineprotectedinherited

Return a random floating point number between 0.5 -+ mSpread/2.

double getRand01 ( )
inlineprotectedinherited

Return a random floating point number between zero and one.

Index64 getVoxelCount ( ) const
inlineinherited
bool interrupt ( )
inlineprotectedinherited
bool 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
void start ( const char *  name)
inlineprotectedinherited

Member Data Documentation

Index64 mInterruptCount
protectedinherited
InterruptType* mInterrupter
protectedinherited
Index64 mPointCount
protectedinherited
PointAccessorType& mPoints
protectedinherited
math::Rand01<double, RandomGenerator> mRand01
protectedinherited
const double mSpread
protectedinherited
Index64 mVoxelCount
protectedinherited