cgv
|
#include <event.h>
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 | |
most simple event class that holds an id, modifiers, toggle keys and the event time. All other event classes are derived from this.
cgv::gui::event::event | ( | unsigned int | _kind = EID_NONE , |
unsigned char | _modifiers = 0 , |
||
unsigned char | _toggle_keys = 0 , |
||
double | _time = 0 |
||
) |
|
virtual |
|
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.
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().
unsigned int cgv::gui::event::get_kind | ( | ) | const |
return, what kind of event this is, typically a value from the EventId enum
Definition at line 202 of file event.cxx.
References kind.
Referenced by cgv::app::overlay::handle(), vr_view_interactor::handle(), vr_test::handle(), vr_emulator::handle(), cgv::app::gizmo::handle(), cgv::gui::key_control< T >::handle(), cgv::gui::key_control< bool >::handle(), and vr_view_interactor::handle_vr_events().
unsigned char cgv::gui::event::get_modifiers | ( | ) | const |
return the active modifiers as values from EventModifier combined with a logical or-operation
Definition at line 237 of file event.cxx.
References modifiers.
Referenced by vr_view_interactor::handle(), vr_emulator::handle(), cgv::gui::key_control< T >::handle(), cgv::gui::key_control< bool >::handle(), cgv::app::color_map_editor::handle_mouse_event(), stream_out(), and cgv::gui::vr_key_event::stream_out().
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().
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().
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().
void cgv::gui::event::set_kind | ( | unsigned char | _kind | ) |
void cgv::gui::event::set_modifiers | ( | unsigned char | _modifiers | ) |
void cgv::gui::event::set_time | ( | const double & | _time | ) |
void cgv::gui::event::set_toggle_keys | ( | unsigned char | _toggle_keys | ) |
|
virtual |
read from stream
Reimplemented in cgv::gui::choice_event, cgv::gui::key_event, cgv::gui::mouse_event, cgv::gui::pose_event, cgv::gui::stick_event, cgv::gui::throttle_event, and cgv::gui::vr_key_event.
|
virtual |
write to stream
Reimplemented in 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::gamepad_throttle_event, cgv::gui::gamepad_stick_event, cgv::gui::vr_key_event, cgv::gui::vr_throttle_event, cgv::gui::vr_stick_event, and cgv::gui::vr_pose_event.
Definition at line 139 of file event.cxx.
References cgv::gui::EF_DND, cgv::gui::EF_MULTI, cgv::gui::EF_PAD, cgv::gui::EF_VR, cgv::gui::ETK_CAPS_LOCK, cgv::gui::ETK_NUM_LOCK, cgv::gui::ETK_SCROLL_LOCK, flags, get_flags(), cgv::gui::get_modifier_string(), get_modifiers(), get_toggle_keys(), kind, and time.
Referenced by vr_view_interactor::handle(), cgv::gui::choice_event::stream_out(), cgv::gui::key_event::stream_out(), cgv::gui::mouse_event::stream_out(), cgv::gui::pose_event::stream_out(), cgv::gui::stick_event::stream_out(), cgv::gui::throttle_event::stream_out(), cgv::gui::gamepad_key_event::stream_out(), and cgv::gui::vr_key_event::stream_out().
|
protected |
store event flags
Definition at line 64 of file event.h.
Referenced by cgv::gui::gamepad_key_event::gamepad_key_event(), cgv::gui::gamepad_stick_event::gamepad_stick_event(), cgv::gui::gamepad_throttle_event::gamepad_throttle_event(), get_flags(), set_flags(), stream_out(), cgv::gui::vr_key_event::vr_key_event(), cgv::gui::vr_pose_event::vr_pose_event(), cgv::gui::vr_stick_event::vr_stick_event(), and cgv::gui::vr_throttle_event::vr_throttle_event().
|
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().
|
protected |
store the active modifiers
Definition at line 66 of file event.h.
Referenced by get_modifiers(), and set_modifiers().
|
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().
|
protected |
store the active toggle keys
Definition at line 68 of file event.h.
Referenced by get_toggle_keys(), and set_toggle_keys().