MinVR  0.9.0
A multi-platform virtual reality library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
MinVR::Event Class Reference

Public Types

enum  EventType {
  EVENTTYPE_STANDARD = 0, EVENTTYPE_1D = 1, EVENTTYPE_2D = 2, EVENTTYPE_3D = 3,
  EVENTTYPE_4D = 4, EVENTTYPE_COORDINATEFRAME = 5, EVENTTYPE_MSG = 6
}
 

Public Member Functions

 Event (const std::string &name, const WindowRef window=nullptr, const int id=-1)
 
 Event (const std::string &name, const double data, const WindowRef window=nullptr, const int id=-1)
 
 Event (const std::string &name, const glm::vec2 &data, const WindowRef window=nullptr, const int id=-1)
 
 Event (const std::string &name, const glm::vec3 &data, const WindowRef window=nullptr, const int id=-1)
 
 Event (const std::string &name, const glm::vec4 &data, const WindowRef window=nullptr, const int id=-1)
 
 Event (const std::string &name, const glm::mat4 &data, const WindowRef window=nullptr, const int id=-1)
 
 Event (const std::string &name, const std::string &data, const WindowRef window=nullptr, const int id=-1)
 
virtual ~Event ()
 
std::string getName () const
 
EventType getType () const
 
int getId () const
 
WindowRef getWindow () const
 
double get1DData ()
 
glm::vec2 get2DData ()
 
glm::vec3 get3DData ()
 
glm::vec4 get4DData ()
 
glm::mat4 getCoordinateFrameData ()
 
std::string getMsgData ()
 
boost::posix_time::ptime getTimestamp ()
 
bool operator< (Event other) const
 
bool operator< (EventRef otherRef) const
 
std::string toString ()
 
void rename (const std::string &newname)
 

Protected Attributes

std::string _name
 
int _id
 
WindowRef _window
 
boost::posix_time::ptime _timestamp
 
EventType _type
 
double _data1D
 
glm::vec2 _data2D
 
glm::vec3 _data3D
 
glm::vec4 _data4D
 
glm::mat4 _dataCF
 
std::string _dataMsg
 

Detailed Description

G3DVR Event class.  To keep things simple, there are no subclasses

of Event. The type of data that the event carries is interpreted differently based on the value of the type of the event. Button Events are typically sent by devices as two separate EVENTTYPE_STANDARD Events, the first named ButtonName_down and then when the button is released ButtonName_up.

Member Enumeration Documentation

Enumerator
EVENTTYPE_STANDARD 
EVENTTYPE_1D 

standard type, carries no additional info

EVENTTYPE_2D 

event that stores 1D data in a double

EVENTTYPE_3D 

stores two doubles

EVENTTYPE_4D 

stores three doubles

EVENTTYPE_COORDINATEFRAME 

stores four doubles

EVENTTYPE_MSG 

stores a CoordinateFrame

Constructor & Destructor Documentation

MinVR::Event::Event ( const std::string &  name,
const WindowRef  window = nullptr,
const int  id = -1 
)
MinVR::Event::Event ( const std::string &  name,
const double  data,
const WindowRef  window = nullptr,
const int  id = -1 
)
MinVR::Event::Event ( const std::string &  name,
const glm::vec2 &  data,
const WindowRef  window = nullptr,
const int  id = -1 
)
MinVR::Event::Event ( const std::string &  name,
const glm::vec3 &  data,
const WindowRef  window = nullptr,
const int  id = -1 
)
MinVR::Event::Event ( const std::string &  name,
const glm::vec4 &  data,
const WindowRef  window = nullptr,
const int  id = -1 
)
MinVR::Event::Event ( const std::string &  name,
const glm::mat4 &  data,
const WindowRef  window = nullptr,
const int  id = -1 
)
MinVR::Event::Event ( const std::string &  name,
const std::string &  data,
const WindowRef  window = nullptr,
const int  id = -1 
)
virtual MinVR::Event::~Event ( )
virtual

Member Function Documentation

double MinVR::Event::get1DData ( )
glm::vec2 MinVR::Event::get2DData ( )
glm::vec3 MinVR::Event::get3DData ( )
glm::vec4 MinVR::Event::get4DData ( )
glm::mat4 MinVR::Event::getCoordinateFrameData ( )
int MinVR::Event::getId ( ) const
std::string MinVR::Event::getMsgData ( )
std::string MinVR::Event::getName ( ) const
boost::posix_time::ptime MinVR::Event::getTimestamp ( )
EventType MinVR::Event::getType ( ) const
WindowRef MinVR::Event::getWindow ( ) const
bool MinVR::Event::operator< ( Event  other) const
bool MinVR::Event::operator< ( EventRef  otherRef) const
void MinVR::Event::rename ( const std::string &  newname)
std::string MinVR::Event::toString ( )

Member Data Documentation

double MinVR::Event::_data1D
protected
glm::vec2 MinVR::Event::_data2D
protected
glm::vec3 MinVR::Event::_data3D
protected
glm::vec4 MinVR::Event::_data4D
protected
glm::mat4 MinVR::Event::_dataCF
protected
std::string MinVR::Event::_dataMsg
protected
int MinVR::Event::_id
protected
std::string MinVR::Event::_name
protected
boost::posix_time::ptime MinVR::Event::_timestamp
protected
EventType MinVR::Event::_type
protected
WindowRef MinVR::Event::_window
protected

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