ALBA
albaDeviceButtonsPad.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaDeviceButtonsPad
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 __albaDeviceButtonsPad_h
18#define __albaDeviceButtonsPad_h
19
20#include "albaDevice.h"
21
22//----------------------------------------------------------------------------
23// forward declarations :
24//----------------------------------------------------------------------------
26
31class ALBA_EXPORT albaDeviceButtonsPad : public albaDevice
32{
33public:
35
36 //------------------------------------------------------------------------------
37 // Events
38 //------------------------------------------------------------------------------
41 // ALBA_ID_DEC(BUTTON_DOWN)
44 // ALBA_ID_DEC(BUTTON_UP)
45
50 void SetButtonState(int num, bool value, unsigned long modifiers = 0);
51
53 bool GetButtonState(int num);
54
56 int GetNumberOfButtons() {return m_NumberOfButtons;}
57
61 void SetNumberOfButtons(int num);
62
65
68
71
72protected:
75
81
83 int FlagCheck(bool event,bool &flag);
84
87
88private:
89 albaDeviceButtonsPad(const albaDeviceButtonsPad&); // Not implemented.
90 void operator=(const albaDeviceButtonsPad&); // Not implemented.
91};
92
93#endif
long albaID
type for IDs inside ALBA
Definition: albaDefines.h:58
Device implementing interface for buttons.
void SetNumberOfButtons(int num)
Set the number of buttons for this device.
static albaID GetButtonDownId()
return the button down id
virtual void SendButtonEvent(albaEventInteraction *event)
Internally used to issue the event rised by a button pressure, can be reimplemented by subclasses to ...
int FlagCheck(bool event, bool &flag)
Internally used to check if a button state has changed (used to issue events)
virtual ~albaDeviceButtonsPad()
bool GetButtonState(int num)
return current state of the button
int GetNumberOfButtons()
return the number of buttons for this device
albaTypeMacro(albaDeviceButtonsPad, albaDevice)
static albaID GetButtonUpId()
return the button up id
static albaID GetWheelId()
return the Wheel id
This abstract class manages function calls coming from devices and issue specific events to interacto...
Definition: albaDevice.h:40
Event class to transport a triggering button and a position from pointing devices.
void SetButtonState(int num, bool value, unsigned long modifiers=0)
Issued when one of the tracker's buttons is pressed.