Virtual Testbed
Ship dynamics simulator for extreme conditions
Public Types | Public Member Functions | List of all members
vtb::gui::TestbedPipeline< T > Class Template Reference

Public Types

using testbed_type = vtb::core::Testbed< T, 3 >
 
using testbed_gui_type = TestbedGUI< T >
 
using clock_type = std::chrono::high_resolution_clock
 
using time_point = clock_type::time_point
 
using duration = clock_type::duration
 
using float_duration = std::chrono::duration< T >
 
using mutex_type = std::recursive_mutex
 
using thread_type = std::thread
 
using statistics_type = vtb::core::Statistics< T >
 
using Record = typename statistics_type::Record
 
using callback_type = std::function< void(testbed_type &)>
 
using gui_callback_type = std::function< void(testbed_gui_type &)>
 
using callback_array = std::vector< callback_type >
 
using gui_callback_array = std::vector< gui_callback_type >
 
using lock_type = std::lock_guard< mutex_type >
 

Public Member Functions

void start ()
 
void stop ()
 
void reset ()
 
void wait ()
 
bool initial () const
 
bool stopped () const
 
bool started () const
 
void testbed_gui (testbed_gui_type *rhs)
 
testbed_gui_typetestbed_gui ()
 
void testbed (testbed_type &&rhs)
 
testbed_typetestbed ()
 
min_time_step () const
 
void min_time_step (T rhs)
 
max_time_step () const
 
void max_time_step (T rhs)
 
speed () const
 
void speed (T rhs)
 
time_step () const
 
void fixed_time_step (bool rhs)
 
bool fixed_time_step () const
 
frame_rate () const
 
void accumulate_dt (T dt)
 Accumulate FPS using exponential moving average.
 
template<class Callback >
void call (Callback &&cb)
 Insert computational callback. More...
 
template<class Callback >
void gui_call (Callback &&cb)
 Insert computational and graphical callbacks. More...
 
void do_gui_callbacks ()
 

Detailed Description

template<class T>
class vtb::gui::TestbedPipeline< T >

Definition at line 17 of file TestbedPipeline.hh.

Member Function Documentation

◆ call()

template<class T >
template<class Callback >
void vtb::gui::TestbedPipeline< T >::call ( Callback &&  cb)
inline

Insert computational callback.

Date
2019-06-03

The callback will be called before the next computational step in the thread of the pipeline (a thread that computes everything). The argument to this function is non-constant reference to object, using which you can copy-in simulation parameters (e.g. change wavy surface size).

Definition at line 116 of file TestbedPipeline.hh.

◆ gui_call()

template<class T >
template<class Callback >
void vtb::gui::TestbedPipeline< T >::gui_call ( Callback &&  cb)
inline

Insert computational and graphical callbacks.

Date
2019-06-03

The callback will be called before the next rendering step in OpenGL thread. The argument to this function is non-constant reference to object using which you can copy-out simulation results (e.g. wavy surface) from the previous step.

Definition at line 132 of file TestbedPipeline.hh.