Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkMousePressEvent.h"
14 #include "mitkException.h"
15 
17  const mitk::Point2D &mousePosition,
18  MouseButtons buttonStates,
19  ModifierKeys modifiers,
20  MouseButtons eventButton)
21  : InteractionPositionEvent(baseRenderer, mousePosition),
22  m_EventButton(eventButton),
23  m_ButtonStates(buttonStates),
24  m_Modifiers(modifiers)
25 {
26 }
27 
29 {
30  return m_EventButton;
31 }
32 
34 {
35  m_EventButton = buttons;
36 }
37 
39 {
40  return m_Modifiers;
41 }
42 
44 {
45  return m_ButtonStates;
46 }
47 
49 {
50  m_Modifiers = modifiers;
51 }
52 
54 {
55  m_ButtonStates = buttons;
56 }
57 
59 {
60 }
61 
62 bool mitk::MousePressEvent::IsEqual(const mitk::InteractionEvent &interactionEvent) const
63 {
64  const auto &mpe = static_cast<const mitk::MousePressEvent &>(interactionEvent);
65  return (this->GetEventButton() == mpe.GetEventButton() && this->GetModifiers() == mpe.GetModifiers() &&
66  this->GetButtonStates() == mpe.GetButtonStates() && Superclass::IsEqual(interactionEvent));
67 }
68 
70 {
71  return (dynamic_cast<MousePressEvent *>(baseClass.GetPointer()) != nullptr);
72 }
Super class for all position events.
ModifierKeys GetModifiers() const
void SetModifiers(ModifierKeys modifiers)
Organizes the rendering process.
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override
void SetEventButton(MouseButtons buttons)
bool IsEqual(const InteractionEvent &) const override
void SetButtonStates(MouseButtons buttons)
MousePressEvent(BaseRenderer *, const Point2D &=Point2D(), MouseButtons buttonStates=NoButton, ModifierKeys modifiers=NoKey, MouseButtons eventButton=NoButton)
MouseButtons GetButtonStates() const
MouseButtons GetEventButton() const
bool IsEqual(const InteractionEvent &) const override