Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkMouseReleaseEvent.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3  The Medical Imaging Interaction Toolkit (MITK)
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics.
7  All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without
10  even the implied warranty of MERCHANTABILITY or FITNESS FOR
11  A PARTICULAR PURPOSE.
12 
13  See LICENSE.txt or http://www.mitk.org for details.
14 
15  ===================================================================*/
16 
17 #include "mitkMouseReleaseEvent.h"
18 #include "mitkException.h"
19 
21  const mitk::Point2D &mousePosition,
22  MouseButtons buttonStates,
23  ModifierKeys modifiers,
24  MouseButtons eventButton)
25  : InteractionPositionEvent(baseRenderer, mousePosition),
26  m_EventButton(eventButton),
27  m_ButtonStates(buttonStates),
28  m_Modifiers(modifiers)
29 {
30 }
31 
33 {
34  return m_EventButton;
35 }
36 
38 {
39  m_EventButton = buttons;
40 }
41 
43 {
44  return m_Modifiers;
45 }
46 
48 {
49  return m_ButtonStates;
50 }
51 
53 {
54  m_Modifiers = modifiers;
55 }
56 
58 {
59  m_ButtonStates = buttons;
60 }
61 
63 {
64 }
65 
66 bool mitk::MouseReleaseEvent::IsEqual(const mitk::InteractionEvent &interactionEvent) const
67 {
68  const mitk::MouseReleaseEvent &mre = static_cast<const mitk::MouseReleaseEvent &>(interactionEvent);
69  return (this->GetEventButton() == mre.GetEventButton() && this->GetModifiers() == mre.GetModifiers() &&
70  this->GetButtonStates() == mre.GetButtonStates() && Superclass::IsEqual(interactionEvent));
71 }
72 
74 {
75  return (dynamic_cast<MouseReleaseEvent *>(baseClass.GetPointer()) != NULL);
76 }
Super class for all position events.
Organizes the rendering process.
static std::string GetEventButton(mitk::InteractionEvent *event)
GetEventButton Return EventButton as String.
void SetModifiers(ModifierKeys modifiers)
MouseButtons GetButtonStates() const
virtual bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override
void SetButtonStates(MouseButtons buttons)
MouseReleaseEvent(BaseRenderer *, const mitk::Point2D &mousePosition=Point2D(), MouseButtons buttonStates=NoButton, ModifierKeys modifiers=NoKey, MouseButtons eventButton=NoButton)
ModifierKeys GetModifiers() const
MouseButtons GetEventButton() const
void SetEventButton(MouseButtons buttons)
virtual bool IsEqual(const InteractionEvent &) const override