forked from davidborland/vtkInteractionDevice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkWiiMoteStyle.cxx
66 lines (50 loc) · 1.94 KB
/
vtkWiiMoteStyle.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*=========================================================================
Name: vtkWiiMoteStyle.cxx
Author: David Borland, The Renaissance Computing Institute (RENCI)
Copyright: The Renaissance Computing Institute (RENCI)
License: Licensed under the RENCI Open Source Software License v. 1.0.
See included License.txt or
http://www.renci.org/resources/open-source-software-license
for details.
=========================================================================*/
#include "vtkWiiMoteStyle.h"
#include "vtkCallbackCommand.h"
#include "vtkVRPNAnalog.h"
#include "vtkVRPNAnalogOutput.h"
#include "vtkVRPNButton.h"
vtkCxxRevisionMacro(vtkWiiMoteStyle, "$Revision: 1.0 $");
vtkCxxSetObjectMacro(vtkWiiMoteStyle, AnalogOutput, vtkVRPNAnalogOutput);
//----------------------------------------------------------------------------
vtkWiiMoteStyle::vtkWiiMoteStyle()
{
this->AnalogOutput = NULL;
}
//----------------------------------------------------------------------------
vtkWiiMoteStyle::~vtkWiiMoteStyle()
{
this->SetAnalogOutput(NULL);
}
//----------------------------------------------------------------------------
void vtkWiiMoteStyle::SetAnalog(vtkVRPNAnalog* analog)
{
if (analog != NULL)
{
analog->SetNumberOfChannels(16);
analog->AddObserver(vtkVRPNDevice::AnalogEvent, this->DeviceCallback);
}
}
//----------------------------------------------------------------------------
void vtkWiiMoteStyle::SetButton(vtkVRPNButton* button)
{
if (button != NULL)
{
button->SetNumberOfButtons(16);
button->AddObserver(vtkVRPNDevice::ButtonEvent, this->DeviceCallback);
}
}
//----------------------------------------------------------------------------
void vtkWiiMoteStyle::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "AnalogOutput: " << this->AnalogOutput << "\n";
}