diff --git a/Core/Code/Interactions/mitkMousePressEvent.cpp b/Core/Code/Interactions/mitkMousePressEvent.cpp index b571666e4b..e8fdff0887 100644 --- a/Core/Code/Interactions/mitkMousePressEvent.cpp +++ b/Core/Code/Interactions/mitkMousePressEvent.cpp @@ -1,75 +1,75 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkException.h" #include "mitkMousePressEvent.h" -mitk::MousePressEvent::MousePressEvent(mitk::BaseRenderer* baseRenderer = NULL, - mitk::Point2D mousePosition = NULL, - mitk::MouseButtons buttonStates = NoButton, - mitk::ModifierKeys modifiers = NoKey, - mitk::MouseButtons eventButton = NoButton) +mitk::MousePressEvent::MousePressEvent(mitk::BaseRenderer* baseRenderer, + mitk::Point2D mousePosition, + mitk::MouseButtons buttonStates, + mitk::ModifierKeys modifiers, + mitk::MouseButtons eventButton) : InteractionPositionEvent(baseRenderer, mousePosition, "MousePressEvent") , m_EventButton(eventButton) , m_ButtonStates(buttonStates) , m_Modifiers( modifiers) { } mitk::MouseButtons mitk::MousePressEvent::GetEventButton() const { return m_EventButton; } void mitk::MousePressEvent::SetEventButton(MouseButtons buttons) { m_EventButton = buttons; } mitk::ModifierKeys mitk::MousePressEvent::GetModifiers() const { return m_Modifiers; } mitk::MouseButtons mitk::MousePressEvent::GetButtonStates() const { return m_ButtonStates; } void mitk::MousePressEvent::SetModifiers(ModifierKeys modifiers) { m_Modifiers = modifiers; } void mitk::MousePressEvent::SetButtonStates(MouseButtons buttons) { m_ButtonStates = buttons; } mitk::MousePressEvent::~MousePressEvent() { } bool mitk::MousePressEvent::MatchesTemplate(mitk::InteractionEvent::Pointer interactionEvent) { mitk::MousePressEvent* mpe = dynamic_cast(interactionEvent.GetPointer()); if (mpe == NULL) { return false; } return (this->GetEventButton() == mpe->GetEventButton() && this->GetModifiers() == mpe->GetModifiers() && this->GetButtonStates() == mpe->GetButtonStates()); } diff --git a/Core/Code/Interactions/mitkMouseReleaseEvent.cpp b/Core/Code/Interactions/mitkMouseReleaseEvent.cpp index 9a17417dca..a9bebdb8bb 100644 --- a/Core/Code/Interactions/mitkMouseReleaseEvent.cpp +++ b/Core/Code/Interactions/mitkMouseReleaseEvent.cpp @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkException.h" #include "mitkMouseReleaseEvent.h" -mitk::MouseReleaseEvent::MouseReleaseEvent(mitk::BaseRenderer* baseRenderer = NULL, - mitk::Point2D mousePosition = NULL, - mitk::MouseButtons buttonStates = NoButton, - mitk::ModifierKeys modifiers = NoKey, - mitk::MouseButtons eventButton = NoButton) +mitk::MouseReleaseEvent::MouseReleaseEvent(mitk::BaseRenderer* baseRenderer, + mitk::Point2D mousePosition, + mitk::MouseButtons buttonStates, + mitk::ModifierKeys modifiers, + mitk::MouseButtons eventButton) : InteractionPositionEvent(baseRenderer, mousePosition, "MouseReleaseEvent") , m_EventButton(eventButton) ,m_ButtonStates(buttonStates) , m_Modifiers(modifiers) { } mitk::MouseButtons mitk::MouseReleaseEvent::GetEventButton() const { return m_EventButton; } void mitk::MouseReleaseEvent::SetEventButton(MouseButtons buttons) { m_EventButton = buttons; } mitk::ModifierKeys mitk::MouseReleaseEvent::GetModifiers() const { return m_Modifiers; } mitk::MouseButtons mitk::MouseReleaseEvent::GetButtonStates() const { return m_ButtonStates; } void mitk::MouseReleaseEvent::SetModifiers(ModifierKeys modifiers) { m_Modifiers = modifiers; } void mitk::MouseReleaseEvent::SetButtonStates(MouseButtons buttons) { m_ButtonStates = buttons; } mitk::MouseReleaseEvent::~MouseReleaseEvent() { } bool mitk::MouseReleaseEvent::MatchesTemplate(mitk::InteractionEvent::Pointer interactionEvent) { mitk::MouseReleaseEvent* mre = dynamic_cast(interactionEvent.GetPointer()); if (mre == NULL) { return false; } return (this->GetEventButton() == mre->GetEventButton() && this->GetModifiers() == mre->GetModifiers() && this->GetButtonStates() == mre->GetButtonStates() ); } diff --git a/Core/Code/Interactions/mitkMouseWheelEvent.cpp b/Core/Code/Interactions/mitkMouseWheelEvent.cpp index 146cfd06ca..b97968007a 100644 --- a/Core/Code/Interactions/mitkMouseWheelEvent.cpp +++ b/Core/Code/Interactions/mitkMouseWheelEvent.cpp @@ -1,74 +1,74 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkMouseWheelEvent.h" -mitk::MouseWheelEvent::MouseWheelEvent(BaseRenderer* baseRenderer = NULL, - Point2D mousePosition = NULL, - MouseButtons buttonStates = NoButton, - ModifierKeys modifiers = NoKey, - int wheelDelta = 0) +mitk::MouseWheelEvent::MouseWheelEvent(BaseRenderer* baseRenderer, + Point2D mousePosition, + MouseButtons buttonStates, + ModifierKeys modifiers, + int wheelDelta) : InteractionPositionEvent(baseRenderer, mousePosition, "MouseWheelEvent") , m_WheelDelta(wheelDelta) , m_ButtonStates(buttonStates) , m_Modifiers(modifiers) { } int mitk::MouseWheelEvent::GetWheelDelta() const { return m_WheelDelta; } void mitk::MouseWheelEvent::SetWheelDelta(int delta) { m_WheelDelta = delta; } mitk::ModifierKeys mitk::MouseWheelEvent::GetModifiers() const { return m_Modifiers; } mitk::MouseButtons mitk::MouseWheelEvent::GetButtonStates() const { return m_ButtonStates; } void mitk::MouseWheelEvent::SetModifiers(ModifierKeys modifiers) { m_Modifiers = modifiers; } void mitk::MouseWheelEvent::SetButtonStates(MouseButtons buttons) { m_ButtonStates = buttons; } mitk::MouseWheelEvent::~MouseWheelEvent() { } bool mitk::MouseWheelEvent::MatchesTemplate(mitk::InteractionEvent::Pointer interactionEvent) { const mitk::MouseWheelEvent* mwe = dynamic_cast(interactionEvent.GetPointer()); if (mwe == NULL) { return false; } return ((this->GetWheelDelta() * mwe->GetWheelDelta() > 0) // Consider WheelEvents to be equal if the scrolling is done in the same direction. && this->GetModifiers() == mwe->GetModifiers() && this->GetButtonStates() == mwe->GetButtonStates()); }