Rumba C++ SDK
maquina::EvaluationEngine Class Referenceabstract

An evaluation engine to compute plug values. More...

#include <EvaluationEngine.h>

Public Member Functions

virtual void start (const Plug &plug, int32_t eval_first_frame, int32_t eval_last_frame, int32_t cache_first_frame, int32_t cache_last_frame)=0
 Compute the plug values on the interval [eval_start_frame, eval_end_frame] in background. More...
 
virtual void stop_and_wait ()=0
 Stop the engine and wait for it. More...
 
virtual void wait ()=0
 Wait until the engine complete its job. More...
 
virtual bool done () const =0
 Returns true if the background evaluation is done. More...
 
virtual float progression () const =0
 Returns the current background evaluation progression between 0~1. More...
 
virtual void set_notification (const std::function< void()> &notify)=0
 Set the notification callback. More...
 
virtual Value evaluate_rest_value (const Plug &plug, int32_t cache_first_frame, int32_t cache_last_frame)=0
 Evaluate a plug value in rest pose. More...
 
virtual Value evaluate (const Plug &plug, float time, int32_t cache_first_frame, int32_t cache_last_frame, bool incremental=false, bool exact=true)=0
 Evaluate a plug value at a specific time. More...
 
virtual Value evaluate (const Plug &plug, float time, const gsl::span< const float > &subframes, int32_t cache_first_frame, int32_t cache_last_frame, bool incremental=false, bool exact=true)=0
 Evaluate a plug value at a specific time. More...
 
virtual std::vector< Valueevaluate (const maquina::Plug &plug, const gsl::span< const float > &frames, int32_t cache_first_frame, int32_t cache_last_frame, bool incremental=false, bool exact=false)=0
 Evaluate a plug value at multiple times. More...
 
virtual void clear_incremental (uint32_t initial_token)=0
 Clear the incremental data. More...
 
virtual void start_profiling ()=0
 Start a profiling session. More...
 
virtual void clear_profiling ()=0
 Clear the profiling session data. More...
 
virtual std::vector< std::pair< std::string, Imath::V2f > > end_profiling ()=0
 Finish a profiling session. More...
 

Static Public Member Functions

static std::shared_ptr< EvaluationEnginecreate ()
 

Detailed Description

An evaluation engine to compute plug values.

Member Function Documentation

◆ clear_incremental()

virtual void maquina::EvaluationEngine::clear_incremental ( uint32_t  initial_token)
pure virtual

Clear the incremental data.

◆ clear_profiling()

virtual void maquina::EvaluationEngine::clear_profiling ( )
pure virtual

Clear the profiling session data.

◆ create()

static std::shared_ptr<EvaluationEngine> maquina::EvaluationEngine::create ( )
static

◆ done()

virtual bool maquina::EvaluationEngine::done ( ) const
pure virtual

Returns true if the background evaluation is done.

◆ end_profiling()

virtual std::vector<std::pair<std::string, Imath::V2f> > maquina::EvaluationEngine::end_profiling ( )
pure virtual

Finish a profiling session.

◆ evaluate() [1/3]

virtual Value maquina::EvaluationEngine::evaluate ( const Plug plug,
float  time,
int32_t  cache_first_frame,
int32_t  cache_last_frame,
bool  incremental = false,
bool  exact = true 
)
pure virtual

Evaluate a plug value at a specific time.

incremental:

Set incremental to true when evaluating multiple time the same modifications, like in an interactive rig modification. During this incremental session, the plug structure shall not be modified. The engine will keep informations to speed up the next evaluation.

Call clear_incremental to end the incremental session, free the resources or start a session.

[cache_first_frame, cache_last_frame] is the interval keeped in cache.

◆ evaluate() [2/3]

virtual Value maquina::EvaluationEngine::evaluate ( const Plug plug,
float  time,
const gsl::span< const float > &  subframes,
int32_t  cache_first_frame,
int32_t  cache_last_frame,
bool  incremental = false,
bool  exact = true 
)
pure virtual

Evaluate a plug value at a specific time.

If the plug has dependencies that can be subsampled, they will be at specified subframe times (only in exact mode)

[cache_first_frame, cache_last_frame] is the interval keeped in cache.

◆ evaluate() [3/3]

virtual std::vector<Value> maquina::EvaluationEngine::evaluate ( const maquina::Plug plug,
const gsl::span< const float > &  frames,
int32_t  cache_first_frame,
int32_t  cache_last_frame,
bool  incremental = false,
bool  exact = false 
)
pure virtual

Evaluate a plug value at multiple times.

One frame in frames can be an arbitrary floating number frame (outside of the frame range and/or non integer) the other ones must be integer frames inside the frame range. Only one frame can be evaluated in non exact mode.

[cache_first_frame, cache_last_frame] is the interval keeped in cache.

◆ evaluate_rest_value()

virtual Value maquina::EvaluationEngine::evaluate_rest_value ( const Plug plug,
int32_t  cache_first_frame,
int32_t  cache_last_frame 
)
pure virtual

Evaluate a plug value in rest pose.

◆ progression()

virtual float maquina::EvaluationEngine::progression ( ) const
pure virtual

Returns the current background evaluation progression between 0~1.

◆ set_notification()

virtual void maquina::EvaluationEngine::set_notification ( const std::function< void()> &  notify)
pure virtual

Set the notification callback.

This notification is called during the evaluation progression and at the end

◆ start()

virtual void maquina::EvaluationEngine::start ( const Plug plug,
int32_t  eval_first_frame,
int32_t  eval_last_frame,
int32_t  cache_first_frame,
int32_t  cache_last_frame 
)
pure virtual

Compute the plug values on the interval [eval_start_frame, eval_end_frame] in background.

The function returns before the evaluation is done. Call wait() to wait for the job completion.

The plug and all his dependencies connection and values should not change during the evaluation. The engine must be stopped with stop_and_wait() before such modifications are done.

[cache_first_frame, cache_last_frame] is the interval keeped in cache. It can be larger than [eval_start_frame, eval_end_frame] but not smaller.

◆ start_profiling()

virtual void maquina::EvaluationEngine::start_profiling ( )
pure virtual

Start a profiling session.

◆ stop_and_wait()

virtual void maquina::EvaluationEngine::stop_and_wait ( )
pure virtual

Stop the engine and wait for it.

The job won't be completed. Some of the intermediate cached values may have been computed.

◆ wait()

virtual void maquina::EvaluationEngine::wait ( )
pure virtual

Wait until the engine complete its job.


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