OpenVDB 11.0.0

Loading...
Searching...
No Matches
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 <openvdb/tools/PointScatter.h>`

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

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

## Public Member Functions
| UniformPointScatter (PointAccessorType &points, Index64 pointCount, RandomGenerator &randGen, double spread=1.0, InterruptType *interrupt=nullptr)
| UniformPointScatter (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 | getPointsPerVolume () const
Index64 | getTargetPointCount () 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)
void | addPoint (const GridT &grid, const Vec3R &dmin, const Coord &size)

## 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::v11_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
};
openvdb::v11_0::math::Vec3< Real >

The `InterruptType` 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 InterruptType the util::NullInterrupter is used which implies that all interrupter calls are no-ops (i.e. incurs no computational overhead).

Uniformly scatters points in the active voxels. The point count is either explicitly defined or implicitly through the specification of a global density (=points-per-volume)

Note
  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

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

using BaseT = BasePointScatter<PointAccessorType, RandomGenerator, InterruptType>

## Constructor & Destructor Documentation

## ◆ UniformPointScatter() [1/2]

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

UniformPointScatter | ( | PointAccessorType & | points,
|  | Index64 | pointCount,
|  | RandomGenerator & | randGen,
|  | double | spread = 1.0,
|  | InterruptType * | interrupt = nullptr )
| inline

## ◆ UniformPointScatter() [2/2]

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

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

## Member Function Documentation

## ◆ addPoint() [1/2]

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

## ◆ addPoint() [2/2]

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

## ◆ end()

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

## ◆ getPointCount()

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

## ◆ getPointsPerVolume()

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

float getPointsPerVolume | ( |  | ) | 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.

## ◆ getTargetPointCount()

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

Index64 getTargetPointCount | ( |  | ) | const
| inline

## ◆ 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