ALBA
albaInteractorCompositorMouse.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaInteractorCompositorMouse
5 Authors: Stefano Perticoni
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaInteractorCompositorMouse_h
18#define __albaInteractorCompositorMouse_h
19
20#include "albaInteractor.h"
21#include "albaEvent.h"
23#include "albaTransform.h"
24#include "albaMatrix.h"
25#include "albaSmartPointer.h"
26
27#include <map>
28
29//----------------------------------------------------------------------------
30//forward ref
31//----------------------------------------------------------------------------
32class vtkDoubleArray;
33class vtkCellPicker;
34
35//----------------------------------------------------------------------------
36// combinations of mouse-buttons and key that may start Transformations:
37// es: Translate may be initiated by MOUSE_MIDDLE | MOUSE_LEFT_SHIFT
38//----------------------------------------------------------------------------
40{
44
48
52};
53
54//----------------------------------------------------------------------------
55// pressed mouse button
56//----------------------------------------------------------------------------
58{
63};
64
83{
84public:
86
89
91 virtual void OnEvent(albaEventBase *event);
92
96
100
101protected:
102
105
107
109
115 void OnMouseMove ();
118
119 typedef std::map<int, albaAutoPointer<albaInteractorGenericMouse> > mmuActivatorMap;
120
133
137 void InitInteraction(int buttonPressed, albaEventInteraction *e);
138
142 int MouseToActivator(int mouseButton, int shift, int ctrl);
143
144 // the active behavior
146
147private:
148
150 void operator=(const albaInteractorCompositorMouse&); // Not implemented.
151
152 int m_MousePose[2];
153 int m_LastMousePose[2];
154 int m_ButtonPressed;
155
156 vtkCamera *m_CurrentCamera;
157
159 friend class albaInteractorCompositorMouseTest;
160
161};
162#endif
163
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Event class to transport a triggering button and a position from pointing devices.
Associates instances of albaInteractorGenericMouse to mouse buttons and ctrl/shift keys combinations.
virtual void OnButtonUp(albaEventInteraction *e)
void OnRightButtonDown(albaEventInteraction *e)
void OnRightButtonUp(albaEventInteraction *e)
albaInteractorGenericMouse * m_ActiveMMIGeneric
std::map< int, albaAutoPointer< albaInteractorGenericMouse > > mmuActivatorMap
virtual void OnButtonDown(albaEventInteraction *e)
virtual void OnEvent(albaEventBase *event)
Process events coming from the mouse.
void OnLeftButtonUp(albaEventInteraction *e)
virtual albaInteractorGenericMouse * CreateBehavior(MMI_ACTIVATOR activator)
Create a behavior given the activator.
void OnMiddleButtonUp(albaEventInteraction *e)
void InitInteraction(int buttonPressed, albaEventInteraction *e)
init the interactor for the corresponding pressed button.
void OnLeftButtonDown(albaEventInteraction *e)
mouse driven events
int MouseToActivator(int mouseButton, int shift, int ctrl)
conversion from mouse-keyboard combo to the corresponding activator value ie the value in the MMI_ACT...
void OnMiddleButtonDown(albaEventInteraction *e)
albaInteractorGenericMouse * GetBehavior(MMI_ACTIVATOR activator)
Get a behavior given the activator.
albaTypeMacro(albaInteractorCompositorMouse, albaInteractor)
virtual int StartInteraction(albaDeviceButtonsPadMouse *mouse)
Start the interaction with the selected object; set m_CurrentCamera and Renderer ivar.
Constrained interaction with mouse device.
Abstract class for ALBA interactors This class provides base interface and features of ALBA continuou...