CubbyFlow::GridEmitter2 Class Referenceabstract

Abstract base class for 2-D grid-based emitters. More...

#include <Core/Emitter/GridEmitter2.hpp>

Inheritance diagram for CubbyFlow::GridEmitter2:
CubbyFlow::GridEmitterSet2 CubbyFlow::VolumeGridEmitter2

Public Types

using OnBeginUpdateCallback = std::function< void(GridEmitter2 *, double, double)>
 Callback function type for update calls. More...
 

Public Member Functions

 GridEmitter2 ()=default
 Default constructor. More...
 
 GridEmitter2 (const GridEmitter2 &)=default
 Default copy constructor. More...
 
 GridEmitter2 (GridEmitter2 &&) noexcept=default
 Default move constructor. More...
 
virtual ~GridEmitter2 ()=default
 Default virtual destructor. More...
 
GridEmitter2operator= (const GridEmitter2 &)=default
 Default copy assignment operator. More...
 
GridEmitter2operator= (GridEmitter2 &&) noexcept=default
 Default copy assignment operator. More...
 
void Update (double currentTimeInSeconds, double timeIntervalInSeconds)
 
bool GetIsEnabled () 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...
 

Protected Member Functions

virtual void OnUpdate (double currentTimeInSeconds, double timeIntervalInSeconds)=0
 
void CallOnBeginUpdateCallback (double currentTimeInSeconds, double timeIntervalInSeconds)
 

Detailed Description

Abstract base class for 2-D grid-based emitters.

Member Typedef Documentation

◆ OnBeginUpdateCallback

using CubbyFlow::GridEmitter2::OnBeginUpdateCallback = std::function<void(GridEmitter2*, double, double)>

Callback function type for update calls.

This type of callback function will take the emitter pointer, current time, and time interval in seconds.

Constructor & Destructor Documentation

◆ GridEmitter2() [1/3]

CubbyFlow::GridEmitter2::GridEmitter2 ( )
default

Default constructor.

◆ GridEmitter2() [2/3]

CubbyFlow::GridEmitter2::GridEmitter2 ( const GridEmitter2 )
default

Default copy constructor.

◆ GridEmitter2() [3/3]

CubbyFlow::GridEmitter2::GridEmitter2 ( GridEmitter2 &&  )
defaultnoexcept

Default move constructor.

◆ ~GridEmitter2()

virtual CubbyFlow::GridEmitter2::~GridEmitter2 ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ CallOnBeginUpdateCallback()

void CubbyFlow::GridEmitter2::CallOnBeginUpdateCallback ( double  currentTimeInSeconds,
double  timeIntervalInSeconds 
)
protected

◆ GetIsEnabled()

bool CubbyFlow::GridEmitter2::GetIsEnabled ( ) const

Returns true if the emitter is enabled.

◆ OnUpdate()

virtual void CubbyFlow::GridEmitter2::OnUpdate ( double  currentTimeInSeconds,
double  timeIntervalInSeconds 
)
protectedpure virtual

◆ operator=() [1/2]

GridEmitter2& CubbyFlow::GridEmitter2::operator= ( const GridEmitter2 )
default

Default copy assignment operator.

◆ operator=() [2/2]

GridEmitter2& CubbyFlow::GridEmitter2::operator= ( GridEmitter2 &&  )
defaultnoexcept

Default copy assignment operator.

◆ SetIsEnabled()

void CubbyFlow::GridEmitter2::SetIsEnabled ( bool  enabled)

Sets true/false to enable/disable the emitter.

◆ SetOnBeginUpdateCallback()

void CubbyFlow::GridEmitter2::SetOnBeginUpdateCallback ( const OnBeginUpdateCallback callback)

Sets the callback function to be called when GridEmitter2::Update function is invoked.

The callback function takes current simulation time in seconds unit. Use this callback to track any motion or state changes related to this emitter.

Parameters
[in]callbackThe callback function.

◆ Update()

void CubbyFlow::GridEmitter2::Update ( double  currentTimeInSeconds,
double  timeIntervalInSeconds 
)

Updates the emitter state from currentTimeInSeconds to the following time-step.


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