Public Member Functions | Protected Attributes

mitk::Event Class Reference
[Interaction Classes]

represents an Event with all its information More...

#include <mitkEvent.h>

Inheritance diagram for mitk::Event:
Inheritance graph
[legend]
Collaboration diagram for mitk::Event:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Event (mitk::BaseRenderer *sender, int type, int button, int buttonState, int key)
virtual ~Event ()
mitk::BaseRendererGetSender () const
int GetType () const
int GetButton () const
int GetKey () const
bool operator== (const Event &event) const
int GetButtonState () const

Protected Attributes

mitk::BaseRendererm_Sender
int m_Type
int m_Button
int m_ButtonState
int m_Key

Detailed Description

represents an Event with all its information

Class, that stores mouse as well as key-events. Type stores the type of event, that has been activated (KeyPress, MouseMove...), Button and Key represent the cause of this event and ButtonState holds the Modifiers, that might have been pressed during the appearance of this event. Ether Button (Mouse) or Key (Keyboard) is set. if both are set accidentally then the button is accepted.

Definition at line 38 of file mitkEvent.h.


Constructor & Destructor Documentation

mitk::Event::Event ( mitk::BaseRenderer sender,
int  type,
int  button,
int  buttonState,
int  key 
)
Parameters:
senderNeeded for DisplayCoordinateOperation in DisplayVectorInteractor....???? if not needed, then set on NULL
typeType of Event: Mouse or Key Event? (look in mitkInteractionConst.h)
buttonMouse button
buttonStateWhich other key has been pressed? (Mouse/Keyboard modifier-keys)
keyPressed key

Definition at line 21 of file mitkEvent.cpp.

: m_Sender( sender ), m_Type( type ), m_Button( button ), m_ButtonState( buttonState ),
  m_Key( key )
{
}
mitk::Event::~Event (  ) [virtual]

Definition at line 28 of file mitkEvent.cpp.

{
}

Member Function Documentation

int mitk::Event::GetButton (  ) const
int mitk::Event::GetButtonState (  ) const
int mitk::Event::GetKey (  ) const
mitk::BaseRenderer * mitk::Event::GetSender (  ) const
int mitk::Event::GetType (  ) const
bool mitk::Event::operator== ( const Event event ) const

Definition at line 58 of file mitkEvent.cpp.

References GetButton(), GetButtonState(), GetKey(), and GetType().

{
  const mitk::Event *input = dynamic_cast<const mitk::Event*>(&event);
  if(input==NULL) return false;

  if ( (m_Type == event.GetType())
    && (m_Button == event.GetButton())
    && (m_ButtonState == event.GetButtonState())
    && (m_Key == event.GetKey()) )
  {
    return true;
  }
  else 
  {
    return false;
  }
}

Member Data Documentation

int mitk::Event::m_Button [protected]

Definition at line 68 of file mitkEvent.h.

int mitk::Event::m_ButtonState [protected]

Definition at line 70 of file mitkEvent.h.

int mitk::Event::m_Key [protected]

Reimplemented in mitk::KeyEvent.

Definition at line 72 of file mitkEvent.h.

Definition at line 64 of file mitkEvent.h.

Referenced by mitk::KeyEvent::GetWorldPosition().

int mitk::Event::m_Type [protected]

Definition at line 66 of file mitkEvent.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines