OpenVDB: UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType > Class Template Reference

OpenVDB 3.2.0

Public Types | 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>`

Inherits BasePointScatter< PointAccessorType, RandomGenerator, InterruptType >.

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

## Public Member Functions
| UniformPointScatter (PointAccessorType &points, Index64 pointCount, RandomGenerator &randGen, InterruptType *interrupt=NULL)
| UniformPointScatter (PointAccessorType &points, float pointsPerVolume, RandomGenerator &randGen, InterruptType *interrupt=NULL)
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 | getPointsPerVolume () const
Index64 | getTargetPointCount () const
Index64 | getPointCount () const
Index64 | getVoxelCount () const

## Protected Member Functions
void | start (const char *name)
void | end ()
bool | interrupt ()
double | getRand ()
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
math::Rand01< double, RandomGenerator > | mRand01

## Detailed Description

### template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
class openvdb::v3_2_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).

## Member Typedef Documentation

## § BaseT

typedef BasePointScatter<PointAccessorType, RandomGenerator, InterruptType> BaseT

## Constructor & Destructor Documentation

## § UniformPointScatter() [1/2]

UniformPointScatter | ( | PointAccessorType & | points,
|  | Index64 | pointCount,
|  | RandomGenerator & | randGen,
|  | InterruptType * | interrupt = `NULL`
| ) |  |
| inline

## § UniformPointScatter() [2/2]

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

## Member Function Documentation

## § addPoint() [1/2]

void addPoint | ( | const GridT & | grid,
|  | const Vec3R & | dmin
| ) |  |
| inlineprotectedinherited

## § addPoint() [2/2]

void addPoint | ( | const GridT & | grid,
|  | const Vec3R & | dmin,
|  | const Coord & | size
| ) |  |
| inlineprotectedinherited

## § end()

void end | ( |  | ) |
| inlineprotectedinherited

## § getPointCount()

Index64 getPointCount | ( |  | ) | const
| inlineinherited

## § getPointsPerVolume()

float getPointsPerVolume | ( |  | ) | const
| inline

## § getRand()

double getRand | ( |  | ) |
| inlineprotectedinherited

## § getTargetPointCount()

Index64 getTargetPointCount | ( |  | ) | const
| inline

## § getVoxelCount()

Index64 getVoxelCount | ( |  | ) | const
| inlineinherited

## § interrupt()

bool interrupt | ( |  | ) |
| inlineprotectedinherited

## § operator()()

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

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

## § print()

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

## § start()

void start | ( | const char * | name | ) |
| inlineprotectedinherited

## Member Data Documentation

## § mInterruptCount

Index64 mInterruptCount
| protectedinherited

## § mInterrupter

InterruptType* mInterrupter
| protectedinherited

## § mPointCount

Index64 mPointCount
| protectedinherited

## § mPoints

PointAccessorType& mPoints
| protectedinherited

## § mRand01

math::Rand01<double, RandomGenerator> mRand01
| protectedinherited

## § mVoxelCount

Index64 mVoxelCount
| protectedinherited

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

- PointScatter.h