OpenVDB 12.1.0

Loading...
Searching...
No Matches
NonUniformPointScatter< PointAccessorType, RandomGenerator, InterruptType > Class Template Reference

Non-uniform scatters of point in the active voxels. The local point count is implicitly defined as a product of of a global density (called pointsPerVolume) and the local voxel (or tile) value. More...

`#include <openvdb/tools/PointScatter.h>`

Inheritance diagram for NonUniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >:

## Public Types
using | BaseT = BasePointScatter<PointAccessorType, RandomGenerator, InterruptType>

## Public Member Functions
| NonUniformPointScatter (PointAccessorType &points, float pointsPerVolume, 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.
void | print (const std::string &name, std::ostream &os=std::cout) const
float | getPointPerVolume () 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.
double | getRand ()
| Return a random floating point number between 0.5 -+ mSpread/2.
void | addPoint (const GridT &grid, const Vec3R &dmin)

## Protected Attributes
PointAccessorType & | mPoints
util::NullInterrupter * | mInterrupter
Index64 | mInterruptCount
const double | mSpread
math::Rand01< double, RandomGenerator > | mRand01

## Detailed Description

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
class openvdb::v12_1::tools::NonUniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >

Non-uniform scatters of point in the active voxels. The local point count is implicitly defined as a product of of a global density (called pointsPerVolume) and the local voxel (or tile) value.

Note
  This scattering technique can be significantly slower than a uniform scattering since its computational complexity is proportional to the active voxel (and tile) count.

## Member Typedef Documentation

## ◆ BaseT

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>

using BaseT = BasePointScatter<PointAccessorType, RandomGenerator, InterruptType>

## Constructor & Destructor Documentation

## ◆ NonUniformPointScatter()

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>

NonUniformPointScatter | ( | PointAccessorType & | points,
|  | float | pointsPerVolume,
|  | RandomGenerator & | randGen,
|  | double | spread = 1.0,
|  | InterruptType * | interrupt = nullptr )
| inline

## Member Function Documentation

## ◆ addPoint()

void addPoint | ( | const GridT & | grid,
|  | const Vec3R & | dmin )
| inline protected inherited

## ◆ end()

void end | ( |  | ) |
| inline protected inherited

## ◆ getPointCount()

Index64 getPointCount | ( |  | ) | const
| inline inherited

## ◆ getPointPerVolume()

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>

float getPointPerVolume | ( |  | ) | const
| inline

## ◆ getRand()

double getRand | ( |  | ) |
| inline protected inherited

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

## ◆ getRand01()

double getRand01 | ( |  | ) |
| inline protected inherited

Return a random floating point number between zero and one.

## ◆ getVoxelCount()

Index64 getVoxelCount | ( |  | ) | const
| inline inherited

## ◆ interrupt()

bool interrupt | ( |  | ) |
| inline protected inherited

## ◆ operator()()

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
template<typename GridT>

bool operator() | ( | const GridT & | grid | ) |
| inline

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

## ◆ print()

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>

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

## ◆ start()

void start | ( | const char * | name | ) |
| inline protected inherited

## Member Data Documentation

## ◆ mInterruptCount

Index64 mInterruptCount
| protected inherited

## ◆ mInterrupter

util::NullInterrupter* mInterrupter
| protected inherited

## ◆ mPoints

PointAccessorType& mPoints
| protected inherited

## ◆ mRand01

math::Rand01<double, RandomGenerator> mRand01
| protected inherited

## ◆ mSpread

const double mSpread
| protected inherited