ALBA
albaDeviceButtonsPadMouse.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaDeviceButtonsPadMouse
5 Authors: Marco Petrone
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 __albaDeviceButtonsPadMouse_h
18#define __albaDeviceButtonsPadMouse_h
19
21
22//----------------------------------------------------------------------------
23// forward declarations :
24//----------------------------------------------------------------------------
25class albaView;
26class albaRWIBase;
27class vtkRenderer;
28class vtkRenderWindowInteractor;
29
37{
38public:
40
41 //------------------------------------------------------------------------------
42 // Events
43 //------------------------------------------------------------------------------
46 // ALBA_ID_DEC(MOUSE_2D_MOVE)
49 // ALBA_ID_DEC(MOUSE_CHAR_EVENT)
52 // ALBA_ID_DEC(MOUSE_DCLICK)
53
56
59
62
64 virtual void OnEvent(albaEventBase *event);
65
67 void SetLastPosition(double x,double y,unsigned long modifiers = 0);
68
70 const double *GetLastPosition() {return m_LastPosition;}
71 void GetLastPosition(double pos[2]) {pos[0]=m_LastPosition[0];pos[1]=m_LastPosition[1];}
72
74 vtkRenderer *GetRenderer();
75
78
80 vtkRenderWindowInteractor *GetInteractor();
81
84
85 void DisplayToNormalizedDisplay(double display[2]);
86 void NormalizedDisplayToDisplay(double normalized[2]);
87
88protected:
91
94
95 double m_LastPosition[2];
97
100
101private:
102 albaDeviceButtonsPadMouse(const albaDeviceButtonsPadMouse&); // Not implemented.
103 void operator=(const albaDeviceButtonsPadMouse&); // Not implemented.
104};
105#endif
long albaID
type for IDs inside ALBA
Definition: albaDefines.h:58
albaRWIBase * GetRWI()
Return the RenderWindowInteractor used by mouse device.
albaTypeMacro(albaDeviceButtonsPadMouse, albaDeviceButtonsPad)
void DisplayToNormalizedDisplay(double display[2])
virtual ~albaDeviceButtonsPadMouse()
static albaID GetMouseCharEventId()
return the mouse char event id
vtkRenderer * GetRenderer()
Return the renderer of the selected view.
vtkRenderWindowInteractor * GetInteractor()
Return the Interactor.
void NormalizedDisplayToDisplay(double normalized[2])
virtual void SendButtonEvent(albaEventInteraction *event)
add position to the event
void SetLastPosition(double x, double y, unsigned long modifiers=0)
Set the last mouse position and send a 2D MoveEvent.
albaView * m_SelectedView
store the selected view to perform the mouse picking
albaView * GetView()
Return the selected view.
const double * GetLastPosition()
Return the last position.
virtual void OnEvent(albaEventBase *event)
Reimplemented to manage fusion of move events.
static albaID GetMouseDClickId()
return the mouse D click id
Device implementing interface for buttons.
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.
albaRWIBase is a vtkRenderWindowInteractor placed on a wxWindow
Definition: albaRWIBase.h:61
albaView is the base class for Views in alba.
Definition: albaView.h:79
static albaID GetMouse2DMoveId()
Issued when a mouse is moved.