forked from davidborland/vtkInteractionDevice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkDeviceInteractorStyle.cxx
63 lines (46 loc) · 2.16 KB
/
vtkDeviceInteractorStyle.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
/*=========================================================================
Name: vtkDeviceInteractorStyle.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 "vtkDeviceInteractorStyle.h"
#include "vtkCallbackCommand.h"
#include "vtkRenderer.h"
vtkCxxRevisionMacro(vtkDeviceInteractorStyle, "$Revision: 1.0 $");
vtkCxxSetObjectMacro(vtkDeviceInteractorStyle, Renderer, vtkRenderer);
//----------------------------------------------------------------------------
vtkDeviceInteractorStyle::vtkDeviceInteractorStyle()
{
this->Renderer = NULL;
this->DeviceCallback = vtkCallbackCommand::New();
this->DeviceCallback->SetClientData(this);
this->DeviceCallback->SetCallback(vtkDeviceInteractorStyle::ProcessEvents);
}
//----------------------------------------------------------------------------
vtkDeviceInteractorStyle::~vtkDeviceInteractorStyle()
{
this->DeviceCallback->Delete();
this->SetRenderer(NULL);
}
//----------------------------------------------------------------------------
void vtkDeviceInteractorStyle::ProcessEvents(vtkObject* caller,
unsigned long eid,
void* clientdata,
void* calldata)
{
vtkDeviceInteractorStyle* self = static_cast<vtkDeviceInteractorStyle*>(clientdata);
self->OnEvent(caller, eid, calldata);
}
//----------------------------------------------------------------------------
void vtkDeviceInteractorStyle::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Renderer:\n";
this->Renderer->PrintSelf(os,indent.GetNextIndent());
os << indent << "DeviceCallback:\n";
this->DeviceCallback->PrintSelf(os,indent.GetNextIndent());
}