Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkMousePressEvent.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 "mitkMousePressEvent.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::MousePressEvent::IsEqual(const mitk::InteractionEvent &interactionEvent) const
67 {
68  const mitk::MousePressEvent &mpe = static_cast<const mitk::MousePressEvent &>(interactionEvent);
69  return (this->GetEventButton() == mpe.GetEventButton() && this->GetModifiers() == mpe.GetModifiers() &&
70  this->GetButtonStates() == mpe.GetButtonStates() && Superclass::IsEqual(interactionEvent));
71 }
72 
74 {
75  return (dynamic_cast<MousePressEvent *>(baseClass.GetPointer()) != NULL);
76 }
Super class for all position events.
ModifierKeys GetModifiers() const
void SetModifiers(ModifierKeys modifiers)
Organizes the rendering process.
virtual bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override
static std::string GetEventButton(mitk::InteractionEvent *event)
GetEventButton Return EventButton as String.
void SetEventButton(MouseButtons buttons)
virtual bool IsEqual(const InteractionEvent &) const override
void SetButtonStates(MouseButtons buttons)
MouseButtons GetButtonStates() const
MouseButtons GetEventButton() const
MousePressEvent(BaseRenderer *, const Point2D &=Point2D(), MouseButtons buttonStates=NoButton, ModifierKeys modifiers=NoKey, MouseButtons eventButton=NoButton)