OpenVDB  1.1.0
Public Types | Public Member Functions | List of all members
ParticlesToLevelSetAndId< LevelSetGridT, ParticleListT, InterruptT > Class Template Reference

Use this wrapper class to convert particles into a level set and a separate index grid of closest-point particle id. The latter can be used to subsequently transfer particles attributes into separate grids. More...

#include <ParticlesToLevelSet.h>

Public Types

typedef LevelSetGridT::ValueType RealT
 
typedef local::Dual< RealTDualT
 
typedef LevelSetGridT::TreeType RealTreeT
 
typedef RealTreeT::template
ValueConverter< DualT >::Type 
DualTreeT
 
typedef Int32Tree IndxTreeT
 
typedef Grid< DualTreeTDualGridT
 
typedef Int32Grid IndxGridT
 

Public Member Functions

 ParticlesToLevelSetAndId (LevelSetGridT &ls, InterruptT *interrupter=NULL)
 
virtual ~ParticlesToLevelSetAndId ()
 
RealT getHalfWidth () const
 
RealT getVoxelSize () const
 
bool ignoredParticles () const
 
size_t getMinCount () const
 
size_t getMaxCount () const
 
RealT getRmin () const
 
RealT getRmax () const
 
void setRmin (RealT Rmin)
 set the smallest radius allowed in voxel units More...
 
void setRmax (RealT Rmax)
 set the largest radius allowed in voxel units More...
 
int getGrainSize () const
 
void setGrainSize (int grainSize)
 Set the grain-size used for multi-threading. More...
 
IndxGridT::Ptr rasterizeSpheres (const ParticleListT &pa)
 Rasterize a sphere per particle derived from their position and radius. All spheres are CSG unioned. More...
 
IndxGridT::Ptr rasterizeTrails (const ParticleListT &pa, Real delta=1.0)
 Rasterize a trail per particle derived from their position, radius and velocity. Each trail is generated as CSG unions of sphere instances with decreasing radius. More...
 

Detailed Description

template<typename LevelSetGridT, typename ParticleListT, typename InterruptT = util::NullInterrupter>
class openvdb::v1_1_0::tools::ParticlesToLevelSetAndId< LevelSetGridT, ParticleListT, InterruptT >

Use this wrapper class to convert particles into a level set and a separate index grid of closest-point particle id. The latter can be used to subsequently transfer particles attributes into separate grids.

Note
This class has the same API as ParticlesToLevelSet - the only exception being the raster methods that return the index grid!

Member Typedef Documentation

typedef RealTreeT::template ValueConverter<DualT>::Type DualTreeT
typedef LevelSetGridT::ValueType RealT
typedef LevelSetGridT::TreeType RealTreeT

Constructor & Destructor Documentation

ParticlesToLevelSetAndId ( LevelSetGridT &  ls,
InterruptT *  interrupter = NULL 
)
inline
virtual ~ParticlesToLevelSetAndId ( )
inlinevirtual

Member Function Documentation

int getGrainSize ( ) const
inline
Returns
the grain-size used for multi-threading
RealT getHalfWidth ( ) const
inline
Returns
Half-width (in voxle units) of the narrow band level set
size_t getMaxCount ( ) const
inline
Returns
number of large particles that were ignore due to Rmax
size_t getMinCount ( ) const
inline
Returns
number of small particles that were ignore due to Rmin
RealT getRmax ( ) const
inline
Returns
the largest radius allowed in voxel units
RealT getRmin ( ) const
inline
Returns
the smallest radius allowed in voxel units
RealT getVoxelSize ( ) const
inline
Returns
Voxel size in world units
bool ignoredParticles ( ) const
inline
Returns
true if any particles were ignored due to their size
IndxGridT::Ptr rasterizeSpheres ( const ParticleListT &  pa)
inline

Rasterize a sphere per particle derived from their position and radius. All spheres are CSG unioned.

Returns
An index grid storing the id of the closest particle.
Parameters
paparticles with position, radius and velocity.
IndxGridT::Ptr rasterizeTrails ( const ParticleListT &  pa,
Real  delta = 1.0 
)
inline

Rasterize a trail per particle derived from their position, radius and velocity. Each trail is generated as CSG unions of sphere instances with decreasing radius.

Parameters
paparticles with position, radius and velocity.
deltacontrols distance between sphere instances (default=1). Be careful not to use too small values since this can lead to excessive computation per trail (which the interrupter can't stop).
Note
The direction of a trail is inverse to the direction of the velocity vector, and the length is given by |V|. The radius at the head of the trail is given by the radius of the particle and the radius at the tail of the trail is Rmin voxel units which has a default value of 1.5 corresponding to the Nyquist frequency!
void setGrainSize ( int  grainSize)
inline

Set the grain-size used for multi-threading.

Note
A grainsize of 0 or less disables multi-threading!
void setRmax ( RealT  Rmax)
inline

set the largest radius allowed in voxel units

void setRmin ( RealT  Rmin)
inline

set the smallest radius allowed in voxel units


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