-
Notifications
You must be signed in to change notification settings - Fork 4
/
vtkInteractionDeviceManager.cxx
126 lines (99 loc) · 3.56 KB
/
vtkInteractionDeviceManager.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*=========================================================================
Name: vtkInteractionDeviceManager.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 "vtkInteractionDeviceManager.h"
#include "vtkDeviceInteractor.h"
#include "vtkGraphicsFactory.h"
#include "vtkObjectFactory.h"
#include "vtkRenderWindowInteractor.h"
// Include platform-specific headers via code borrowed from vtkGraphicsFactory.h
// Win32 specific stuff
#ifdef _WIN32
# ifndef VTK_USE_OGLR
# include "vtkWin32RenderWindowDeviceInteractor.h"
# define VTK_DISPLAY_WIN32_OGL
# endif // VTK_USE_OGLR
#endif
// Apple OSX stuff
#ifdef VTK_USE_CARBON
# include "vtkCarbonRenderWindowDeviceInteractor.h"
# define VTK_DISPLAY_CARBON
#endif
#ifdef VTK_USE_COCOA
# include "vtkCocoaRenderWindowDeviceInteractor.h"
# define VTK_DISPLAY_COCOA
#endif
// X OpenGL stuff
#ifdef VTK_USE_OGLR
# include "vtkXOpenGLRenderWindowDeviceInteractor.h"
# define VTK_DISPLAY_X11_OGL
#endif
// OSMESA OpenGL stuff
#ifdef VTK_USE_OSMESA
# include "vtkOSOpenGLRenderWindowDeviceInteractor.h"
//# define VTK_DISPLAY_X11_OGL
#endif
#if defined(VTK_USE_MANGLED_MESA)
#include "vtkXMesaRenderWindowDeviceInteractor.h"
#endif
vtkCxxRevisionMacro(vtkInteractionDeviceManager, "$Revision: 1.0 $");
vtkStandardNewMacro(vtkInteractionDeviceManager);
//----------------------------------------------------------------------------
vtkInteractionDeviceManager::vtkInteractionDeviceManager()
{
}
//----------------------------------------------------------------------------
vtkInteractionDeviceManager::~vtkInteractionDeviceManager()
{
}
//----------------------------------------------------------------------------
vtkRenderWindowInteractor* vtkInteractionDeviceManager::GetInteractor(vtkDeviceInteractor* deviceInteractor)
{
// Return the correct platform-specific vtkRenderWindowInteractor subclass
const char *rl = vtkGraphicsFactory::GetRenderLibrary();
#ifdef VTK_USE_OGLR
if (!vtkGraphicsFactory::GetOffScreenOnlyMode())
{
vtkErrorMacro(<<"Device interaction not implemented for this platform yet.");
return vtkXRenderWindowInteractor::New();
}
#endif
#if defined(VTK_USE_OSMESA)
vtkErrorMacro(<<"Device interaction not implemented for this platform yet.");
return vtkRenderWindowInteractor::New();
#endif
#ifdef VTK_DISPLAY_WIN32_OGL
if (!strcmp("Win32OpenGL",rl))
{
vtkWin32RenderWindowDeviceInteractor* interactor = vtkWin32RenderWindowDeviceInteractor::New();
interactor->SetDeviceInteractor(deviceInteractor);
return interactor;
}
#endif
#ifdef VTK_USE_CARBON
if (!vtkGraphicsFactory::GetOffScreenOnlyMode())
{
vtkErrorMacro(<<"Device interaction not implemented for this platform yet.");
return vtkCarbonRenderWindowInteractor::New();
}
#endif
#ifdef VTK_USE_COCOA
if (!vtkGraphicsFactory::GetOffScreenOnlyMode())
{
vtkErrorMacro(<<"Device interaction not implemented for this platform yet.");
return vtkCocoaRenderWindowInteractor::New();
}
#endif
return 0;
}
//----------------------------------------------------------------------------
void vtkInteractionDeviceManager::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}