-
Notifications
You must be signed in to change notification settings - Fork 13
/
vtkCocoaLookingGlassRenderWindow.h
182 lines (147 loc) · 5.25 KB
/
vtkCocoaLookingGlassRenderWindow.h
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*=========================================================================
Copyright (c) 2020 Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkCocoaLookingGlassRenderWindow
* @brief LookingGlass rendering window
*
* A drop in replacement on Windows for vtkOpenGLRenderWindow that will
* render to a LookingGlass display
*/
#ifndef vtkCocoaLookingGlassRenderWindow_h
#define vtkCocoaLookingGlassRenderWindow_h
#include "vtkCocoaRenderWindow.h"
#include "vtkRenderingLookingGlassModule.h" // For export macro
class vtkLookingGlassInterface;
class VTKRENDERINGLOOKINGGLASS_EXPORT vtkCocoaLookingGlassRenderWindow : public vtkCocoaRenderWindow
{
public:
static vtkCocoaLookingGlassRenderWindow* New();
vtkTypeMacro(vtkCocoaLookingGlassRenderWindow, vtkCocoaRenderWindow);
// Get the LookingGlassInterface being used by this window.
vtkGetObjectMacro(Interface, vtkLookingGlassInterface);
/**
* Get the size (width and height) of the rendering window.
* We override so that durnig the render process we can return
* a size of the render framebuffer as opposed to the final
* buffer.
*/
int* GetSize() VTK_SIZEHINT(2) override;
/**
* Free up any graphics resources associated with this window
* a value of nullptr means the context may already be destroyed
*/
void ReleaseGraphicsResources(vtkWindow*) override;
/**
* Give the window a chance to be created on the Looking Glass display.
*/
void Initialize() override;
/**
* Set index of the Looking Glass device on which this window should appear.
*/
void SetLGDeviceIndex(int index);
/**
* Save a quilt to a PNG file
*/
void SaveQuilt(const char* fileName);
/**
* Start recording a quilt
*/
void StartRecordingQuilt(const char* fileName);
/**
* Stop recording a quilt
*/
void StopRecordingQuilt();
/**
* Get the movie extension that should be used for quilt movies
*/
static const char* MovieFileExtension();
/**
* Get the quilt file suffix as a string. The suffix encodes the number of
* tiles in the width and the height. For example, if the quilt file name
* is "quilt_qs5x9.png", the suffix is "_qs5x9", and it means that the quilt
* is 5 tiles wide and 9 tiles high.
*/
std::string QuiltFileSuffix() const;
/**
* Turn on/off use of near and far clipping limits.
*/
void SetUseClippingLimits(bool b);
/**
* Turn on/off use of near and far clipping limits.
*/
bool GetUseClippingLimits() const;
vtkBooleanMacro(UseClippingLimits, bool);
/**
* Set/Get limit for the ratio of the far clipping plane to the focal
* distance. This is a mechanism to limit parallex and resulting
* ghosting when using the looking glass display. The typical value
* should be around 1.2.
*/
void SetFarClippingLimit(double d);
/**
* Set/Get limit for the ratio of the far clipping plane to the focal
* distance. This is a mechanism to limit parallex and resulting
* ghosting when using the looking glass display. The typical value
* should be around 1.2.
*/
double GetFarClippingLimit() const;
/**
* Set/Get limit for the ratio of the near clipping plane to the focal
* distance. This is a mechanism to limit parallex and resulting
* ghosting when using the looking glass display. The typical value
* should be around 0.8.
*/
void SetNearClippingLimit(double d);
/**
* Set/Get limit for the ratio of the near clipping plane to the focal
* distance. This is a mechanism to limit parallex and resulting
* ghosting when using the looking glass display. The typical value
* should be around 0.8.
*/
double GetNearClippingLimit() const;
/**
* Check if a movie quilt is currently being recorded.
*/
bool IsRecordingQuilt() const;
/**
* Set/Get which LookingGlass device to use. DeviceIndex starts at 0 and
* increases.
*/
void SetDeviceIndex(int i) override;
/**
* Set/Get which LookingGlass device to use. DeviceIndex starts at 0 and
* increases.
*/
int GetDeviceIndex() const;
/**
* Set/Get which LookingGlass device type to target. This allows a quilt to be
* generated for a device that is not connected in the future.
*/
void SetDeviceType(const std::string &t);
/**
* Set/Get which LookingGlass device type to target. This allows a quilt to be
* generated for a device that is not connected in the future.
*/
std::string GetDeviceType() const;
/**
* Returns a vector of available device types.
*/
static std::vector<std::string> GetDeviceTypes();
protected:
vtkCocoaLookingGlassRenderWindow();
~vtkCocoaLookingGlassRenderWindow() override;
vtkLookingGlassInterface* Interface = nullptr;
void InitializeInterface();
void DoStereoRender() override;
bool InStereoRender;
private:
vtkCocoaLookingGlassRenderWindow(const vtkCocoaLookingGlassRenderWindow&) = delete;
void operator=(const vtkCocoaLookingGlassRenderWindow&) = delete;
};
#endif