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

#include <event.h>

Inheritance diagram for cgv::gui::event:
cgv::gui::choice_event cgv::gui::key_event cgv::gui::mouse_event cgv::gui::pose_event cgv::gui::stick_event cgv::gui::throttle_event cgv::gui::gamepad_key_event cgv::gui::vr_key_event cgv::gui::vr_pose_event cgv::gui::gamepad_stick_event cgv::gui::vr_stick_event cgv::gui::gamepad_throttle_event cgv::gui::vr_throttle_event

Public Member Functions

 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 stream_out (std::ostream &os) const
 write to stream
 
virtual void stream_in (std::istream &is)
 read from stream
 
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 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

most simple event class that holds an id, modifiers, toggle keys and the event time. All other event classes are derived from this.

Definition at line 58 of file event.h.

Constructor & Destructor Documentation

◆ event()

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

Definition at line 20 of file event.cxx.

◆ ~event()

cgv::gui::event::~event ( )
virtual

virtual destructor for events

Definition at line 26 of file event.cxx.

Member Function Documentation

◆ get_device_id()

void * cgv::gui::event::get_device_id ( ) const
virtual

return the device id, by default returns 0

Reimplemented in cgv::gui::vr_key_event, cgv::gui::vr_throttle_event, cgv::gui::vr_stick_event, and cgv::gui::vr_pose_event.

Definition at line 31 of file event.cxx.

◆ get_flags()

unsigned cgv::gui::event::get_flags ( ) const

return the event flags

Definition at line 214 of file event.cxx.

References flags.

Referenced by vr_view_interactor::handle(), vr_test::handle(), stream_out(), and cgv::gui::mouse_event::stream_out().

◆ get_kind()

unsigned int cgv::gui::event::get_kind ( ) const

◆ get_modifiers()

unsigned char cgv::gui::event::get_modifiers ( ) const

◆ get_time()

double cgv::gui::event::get_time ( ) const

return the time of the event in seconds

Definition at line 247 of file event.cxx.

References time.

Referenced by cgv::gui::key_control< T >::handle(), and cgv::app::navigator::handle_mouse_event().

◆ get_toggle_keys()

unsigned char cgv::gui::event::get_toggle_keys ( ) const

return the state of the toggle keys as values from EventToggleKeys combined with a logical or-operation

Definition at line 226 of file event.cxx.

References toggle_keys.

Referenced by stream_out().

◆ set_flags()

void cgv::gui::event::set_flags ( unsigned char  _flags)

return the set the event flags

set the event flags

Definition at line 208 of file event.cxx.

References flags.

Referenced by cgv::gui::vr_server::grab_focus().

◆ set_kind()

void cgv::gui::event::set_kind ( unsigned char  _kind)

set the kind of the event

Definition at line 197 of file event.cxx.

References kind.

◆ set_modifiers()

void cgv::gui::event::set_modifiers ( unsigned char  _modifiers)

set the modifiers

Definition at line 232 of file event.cxx.

References modifiers.

◆ set_time()

void cgv::gui::event::set_time ( const double &  _time)

set the time of the event

Definition at line 242 of file event.cxx.

References time.

◆ set_toggle_keys()

void cgv::gui::event::set_toggle_keys ( unsigned char  _toggle_keys)

set the state of the toggle keys

Definition at line 220 of file event.cxx.

References toggle_keys.

◆ stream_in()

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

◆ stream_out()

Member Data Documentation

◆ flags

◆ kind

unsigned char cgv::gui::event::kind
protected

store which kind of event we have

Definition at line 62 of file event.h.

Referenced by get_kind(), set_kind(), and stream_out().

◆ modifiers

unsigned char cgv::gui::event::modifiers
protected

store the active modifiers

Definition at line 66 of file event.h.

Referenced by get_modifiers(), and set_modifiers().

◆ time

double cgv::gui::event::time
protected

store the time of the event in seconds

Definition at line 70 of file event.h.

Referenced by get_time(), set_time(), and stream_out().

◆ toggle_keys

unsigned char cgv::gui::event::toggle_keys
protected

store the active toggle keys

Definition at line 68 of file event.h.

Referenced by get_toggle_keys(), and set_toggle_keys().


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