cgv
Loading...
Searching...
No Matches
cgv::gui::throttle_event Class Reference

class to represent events that inform on a change in a one axis controller with the EID_THROTTLE More...

#include <throttle_event.h>

Inheritance diagram for cgv::gui::throttle_event:
cgv::gui::event cgv::gui::gamepad_throttle_event cgv::gui::vr_throttle_event

Public Member Functions

 throttle_event (float _x, float _dx, unsigned _player_index=0, unsigned _controller_index=0, unsigned _throttle_index=0, double _time=0)
 construct a throttle event from value and value change
 
unsigned get_player_index () const
 return player index
 
unsigned get_controller_index () const
 return controller index
 
unsigned get_throttle_index () const
 return throttle index
 
void stream_out (std::ostream &os) const
 write to stream
 
void stream_in (std::istream &is)
 read from stream
 
float get_value () const
 return the current value of the throttle
 
float get_value_change () const
 return the change of value of the throttle
 
float get_last_value () const
 return the last value of the throttle
 
- Public Member Functions inherited from cgv::gui::event
 event (unsigned int _kind=EID_NONE, unsigned char _modifiers=0, unsigned char _toggle_keys=0, double _time=0)
 construct event from its kind
 
virtual ~event ()
 virtual destructor for events
 
virtual void * get_device_id () const
 return the device id, by default returns 0
 
void set_kind (unsigned char _kind)
 set the kind of the event
 
unsigned get_kind () const
 return, what kind of event this is, typically a value from the EventId enum
 
void set_flags (unsigned char _flags)
 return the set the event flags
 
unsigned get_flags () const
 return the event flags
 
void set_modifiers (unsigned char _modifiers)
 set the modifiers
 
unsigned char get_modifiers () const
 return the active modifiers as values from EventModifier combined with a logical or-operation
 
void set_toggle_keys (unsigned char _toggle_keys)
 set the state of the toggle keys
 
unsigned char get_toggle_keys () const
 return the state of the toggle keys as values from EventToggleKeys combined with a logical or-operation
 
void set_time (const double &_time)
 set the time of the event
 
double get_time () const
 return the time of the event in seconds
 

Protected Attributes

unsigned char player_index
 
unsigned char controller_index
 
unsigned char throttle_index
 
float x
 
float dx
 
- Protected Attributes inherited from cgv::gui::event
unsigned char kind
 store which kind of event we have
 
unsigned char flags
 store event flags
 
unsigned char modifiers
 store the active modifiers
 
unsigned char toggle_keys
 store the active toggle keys
 
double time
 store the time of the event in seconds
 

Detailed Description

class to represent events that inform on a change in a one axis controller with the EID_THROTTLE

Definition at line 14 of file throttle_event.h.

Constructor & Destructor Documentation

◆ throttle_event()

cgv::gui::throttle_event::throttle_event ( float  _x,
float  _dx,
unsigned  _player_index = 0,
unsigned  _controller_index = 0,
unsigned  _throttle_index = 0,
double  _time = 0 
)

construct a throttle event from value and value change

Definition at line 7 of file throttle_event.cxx.

Member Function Documentation

◆ get_controller_index()

unsigned cgv::gui::throttle_event::get_controller_index ( ) const

return controller index

Definition at line 18 of file throttle_event.cxx.

Referenced by vr_test::handle().

◆ get_last_value()

float cgv::gui::throttle_event::get_last_value ( ) const

return the last value of the throttle

Definition at line 59 of file throttle_event.cxx.

References get_value(), and get_value_change().

Referenced by vr_test::handle().

◆ get_player_index()

unsigned cgv::gui::throttle_event::get_player_index ( ) const

return player index

Definition at line 13 of file throttle_event.cxx.

◆ get_throttle_index()

unsigned cgv::gui::throttle_event::get_throttle_index ( ) const

return throttle index

return stick index

Definition at line 23 of file throttle_event.cxx.

Referenced by vr_test::handle().

◆ get_value()

float cgv::gui::throttle_event::get_value ( ) const

return the current value of the throttle

Definition at line 47 of file throttle_event.cxx.

Referenced by get_last_value(), and vr_test::handle().

◆ get_value_change()

float cgv::gui::throttle_event::get_value_change ( ) const

return the change of value of the throttle

Definition at line 53 of file throttle_event.cxx.

Referenced by get_last_value().

◆ stream_in()

void cgv::gui::throttle_event::stream_in ( std::istream &  is)
virtual

read from stream

Reimplemented from cgv::gui::event.

Definition at line 41 of file throttle_event.cxx.

◆ stream_out()

void cgv::gui::throttle_event::stream_out ( std::ostream &  os) const
virtual

write to stream

Reimplemented from cgv::gui::event.

Reimplemented in cgv::gui::vr_throttle_event.

Definition at line 30 of file throttle_event.cxx.

References cgv::gui::event::stream_out().

Referenced by cgv::gui::gamepad_throttle_event::stream_out(), and cgv::gui::vr_throttle_event::stream_out().

Member Data Documentation

◆ controller_index

unsigned char cgv::gui::throttle_event::controller_index
protected

Definition at line 18 of file throttle_event.h.

◆ dx

float cgv::gui::throttle_event::dx
protected

Definition at line 22 of file throttle_event.h.

◆ player_index

unsigned char cgv::gui::throttle_event::player_index
protected

Definition at line 18 of file throttle_event.h.

◆ throttle_index

unsigned char cgv::gui::throttle_event::throttle_index
protected

Definition at line 18 of file throttle_event.h.

◆ x

float cgv::gui::throttle_event::x
protected

Definition at line 20 of file throttle_event.h.


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