HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType > Class Template Reference

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

#include <PointScatter.h>

+ Inheritance diagram for openvdb::OPENVDB_VERSION_NAME::tools::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. More...
 
void print (const std::string &name, std::ostream &os=std::cout) const
 
float getPointsPerVolume () const
 
Index64 getTargetPointCount () const
 
- Public Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::tools::BasePointScatter< PointAccessorType, RandomGenerator, InterruptType >
Index64 getPointCount () const
 
Index64 getVoxelCount () const
 

Additional Inherited Members

- Protected Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::tools::BasePointScatter< PointAccessorType, RandomGenerator, InterruptType >
 BasePointScatter (PointAccessorType &points, RandomGenerator &randGen, double spread, InterruptType *interrupt=nullptr)
 This is a base class so the constructor is protected. More...
 
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 inherited from openvdb::OPENVDB_VERSION_NAME::tools::BasePointScatter< PointAccessorType, RandomGenerator, InterruptType >
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::OPENVDB_VERSION_NAME::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 = 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)
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).

Definition at line 87 of file PointScatter.h.

Member Typedef Documentation

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >::BaseT = BasePointScatter<PointAccessorType, RandomGenerator, InterruptType>

Definition at line 92 of file PointScatter.h.

Constructor & Destructor Documentation

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >::UniformPointScatter ( PointAccessorType &  points,
Index64  pointCount,
RandomGenerator &  randGen,
double  spread = 1.0,
InterruptType *  interrupt = nullptr 
)
inline

Definition at line 94 of file PointScatter.h.

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >::UniformPointScatter ( PointAccessorType &  points,
float  pointsPerVolume,
RandomGenerator &  randGen,
double  spread = 1.0,
InterruptType *  interrupt = nullptr 
)
inline

Definition at line 104 of file PointScatter.h.

Member Function Documentation

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
float openvdb::OPENVDB_VERSION_NAME::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >::getPointsPerVolume ( ) const
inline

Definition at line 171 of file PointScatter.h.

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
Index64 openvdb::OPENVDB_VERSION_NAME::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >::getTargetPointCount ( ) const
inline

Definition at line 172 of file PointScatter.h.

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
template<typename GridT >
bool openvdb::OPENVDB_VERSION_NAME::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >::operator() ( const GridT &  grid)
inline

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

Definition at line 117 of file PointScatter.h.

template<typename PointAccessorType, typename RandomGenerator, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::UniformPointScatter< PointAccessorType, RandomGenerator, InterruptType >::print ( const std::string name,
std::ostream &  os = std::cout 
) const
inline

Definition at line 164 of file PointScatter.h.


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