Jet  v1.3.3
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
jet::VolumeGridEmitter2 Class Referencefinal

2-D grid-based volumetric emitter. More...

#include <jet/volume_grid_emitter2.h>

Inheritance diagram for jet::VolumeGridEmitter2:
jet::GridEmitter2

Classes

class  Builder
 Front-end to create VolumeGridEmitter2 objects step by step. More...
 

Public Types

typedef std::function< double(double, const Vector2D &, double)> ScalarMapper
 Maps to a scalar value for given signed-dist, location, and old value. More...
 
typedef std::function< Vector2D(double, const Vector2D &, const Vector2D &)> VectorMapper
 Maps to a vector value for given signed-dist, location, and old value. More...
 
- Public Types inherited from jet::GridEmitter2
typedef std::function< void(double, double)> OnBeginUpdateCallback
 Callback function type for update calls. More...
 

Public Member Functions

 VolumeGridEmitter2 (const ImplicitSurface2Ptr &sourceRegion, bool isOneShot=true)
 Constructs an emitter with a source and is-one-shot flag. More...
 
virtual ~VolumeGridEmitter2 ()
 Destructor. More...
 
void addSignedDistanceTarget (const ScalarGrid2Ptr &scalarGridTarget)
 Adds signed-distance target to the scalar grid. More...
 
void addStepFunctionTarget (const ScalarGrid2Ptr &scalarGridTarget, double minValue, double maxValue)
 Adds step function target to the scalar grid. More...
 
void addTarget (const ScalarGrid2Ptr &scalarGridTarget, const ScalarMapper &customMapper)
 Adds a scalar grid target. More...
 
void addTarget (const VectorGrid2Ptr &vectorGridTarget, const VectorMapper &customMapper)
 Adds a vector grid target. More...
 
const ImplicitSurface2PtrsourceRegion () const
 Returns implicit surface which defines the source region. More...
 
bool isOneShot () const
 Returns true if this emits only once. More...
 
- Public Member Functions inherited from jet::GridEmitter2
 GridEmitter2 ()
 Constructs an emitter. More...
 
virtual ~GridEmitter2 ()
 Destructor. More...
 
void update (double currentTimeInSeconds, double timeIntervalInSeconds)
 
bool isEnabled () const
 Returns true if the emitter is enabled. More...
 
void setIsEnabled (bool enabled)
 Sets true/false to enable/disable the emitter. More...
 
void setOnBeginUpdateCallback (const OnBeginUpdateCallback &callback)
 Sets the callback function to be called when GridEmitter2::update function is invoked. More...
 

Static Public Member Functions

static Builder builder ()
 Returns builder fox VolumeGridEmitter2. More...
 

Additional Inherited Members

Detailed Description

2-D grid-based volumetric emitter.

Member Typedef Documentation

◆ ScalarMapper

typedef std::function<double(double, const Vector2D&, double)> jet::VolumeGridEmitter2::ScalarMapper

Maps to a scalar value for given signed-dist, location, and old value.

◆ VectorMapper

typedef std::function<Vector2D(double, const Vector2D&, const Vector2D&)> jet::VolumeGridEmitter2::VectorMapper

Maps to a vector value for given signed-dist, location, and old value.

Constructor & Destructor Documentation

◆ VolumeGridEmitter2()

jet::VolumeGridEmitter2::VolumeGridEmitter2 ( const ImplicitSurface2Ptr sourceRegion,
bool  isOneShot = true 
)
explicit

Constructs an emitter with a source and is-one-shot flag.

Parameters
[in]sourceRegionEmitting region given by the SDF.
[in]isOneShotTrue if emitter gets disabled after one shot.

◆ ~VolumeGridEmitter2()

virtual jet::VolumeGridEmitter2::~VolumeGridEmitter2 ( )
virtual

Destructor.

Member Function Documentation

◆ addSignedDistanceTarget()

void jet::VolumeGridEmitter2::addSignedDistanceTarget ( const ScalarGrid2Ptr scalarGridTarget)

Adds signed-distance target to the scalar grid.

◆ addStepFunctionTarget()

void jet::VolumeGridEmitter2::addStepFunctionTarget ( const ScalarGrid2Ptr scalarGridTarget,
double  minValue,
double  maxValue 
)

Adds step function target to the scalar grid.

Parameters
[in]scalarGridTargetThe scalar grid target.
[in]minValueThe minimum value of the step function.
[in]maxValueThe maximum value of the step function.

◆ addTarget() [1/2]

void jet::VolumeGridEmitter2::addTarget ( const ScalarGrid2Ptr scalarGridTarget,
const ScalarMapper customMapper 
)

Adds a scalar grid target.

This function adds a custom target to the emitter. The first parameter defines which grid should it write to. The second parameter, customMapper, defines how to map signed-distance field from the volume geometry and location of the point to the final scalar value that is going to be written to the target grid. The third parameter defines how to blend the old value from the target grid and the new value from the mapper function.

Parameters
[in]scalarGridTargetThe scalar grid target
[in]customMapperThe custom mapper.

◆ addTarget() [2/2]

void jet::VolumeGridEmitter2::addTarget ( const VectorGrid2Ptr vectorGridTarget,
const VectorMapper customMapper 
)

Adds a vector grid target.

This function adds a custom target to the emitter. The first parameter defines which grid should it write to. The second parameter, customMapper, defines how to map sigend-distance field from the volume geometry and location of the point to the final vector value that is going to be written to the target grid. The third parameter defines how to blend the old value from the target grid and the new value from the mapper function.

Parameters
[in]scalarGridTargetThe vector grid target
[in]customMapperThe custom mapper.

◆ builder()

static Builder jet::VolumeGridEmitter2::builder ( )
static

Returns builder fox VolumeGridEmitter2.

◆ isOneShot()

bool jet::VolumeGridEmitter2::isOneShot ( ) const

Returns true if this emits only once.

◆ sourceRegion()

const ImplicitSurface2Ptr& jet::VolumeGridEmitter2::sourceRegion ( ) const

Returns implicit surface which defines the source region.


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