00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef EVENT_H_HEADER_INCLUDED_C1889CEE 00020 #define EVENT_H_HEADER_INCLUDED_C1889CEE 00021 00022 #include "mitkCommon.h" 00023 00024 namespace mitk { 00025 00026 class BaseRenderer; 00027 00028 //##Documentation 00029 //## @brief represents an Event with all its information 00030 //## 00031 //## Class, that stores mouse as well as key-events. Type stores the type of 00032 //## event, that has been activated (KeyPress, MouseMove...), Button and Key 00033 //## represent the cause of this event and ButtonState holds the Modifiers, 00034 //## that might have been pressed during the appearance of this event. 00035 //## Ether Button (Mouse) or Key (Keyboard) is set. if both are set 00036 //## accidentally then the button is accepted. 00037 //## @ingroup Interaction 00038 class MITK_CORE_EXPORT Event 00039 { 00040 public: 00041 //##Documentation 00042 //## @param sender Needed for DisplayCoordinateOperation in DisplayVectorInteractor....???? if not needed, then set on NULL 00043 //## @param type Type of Event: Mouse or Key Event? (look in mitkInteractionConst.h) 00044 //## @param button Mouse button 00045 //## @param buttonState Which other key has been pressed? (Mouse/Keyboard modifier-keys) 00046 //## @param key Pressed key 00047 Event(mitk::BaseRenderer* sender, int type, int button, int buttonState, int key); 00048 00049 virtual ~Event(); 00050 00051 mitk::BaseRenderer* GetSender() const; 00052 00053 int GetType() const; 00054 00055 int GetButton() const; 00056 00057 int GetKey() const; 00058 00059 bool operator==(const Event& event) const; 00060 00061 int GetButtonState() const; 00062 00063 protected: 00064 mitk::BaseRenderer* m_Sender; 00065 00066 int m_Type; 00067 00068 int m_Button; 00069 00070 int m_ButtonState; 00071 00072 int m_Key; 00073 }; 00074 00075 } // namespace mitk 00076 00077 #endif /* EVENT_H_HEADER_INCLUDED_C1889CEE */