VTK  9.7.1
vtkWebXRRenderWindow.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
30 #ifndef vtkWebXRRenderWindow_h
31 #define vtkWebXRRenderWindow_h
32 
33 #include "vtkRenderingWebXRModule.h" // For export macro
34 #include "vtkVRRenderWindow.h"
35 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 
39 class VTKRENDERINGWEBXR_EXPORT VTK_MARSHALAUTO vtkWebXRRenderWindow : public vtkVRRenderWindow
40 {
41 public:
42  static vtkWebXRRenderWindow* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
50 
54  void AddRenderer(vtkRenderer*) override;
55 
60  void Render() override;
61 
66  int GetColorBufferSizes(int* rgba) override;
67 
71  void SetCanvasSelector(const char* _arg);
72 
76  char* GetCanvasSelector();
77 
82  void Initialize() override;
83 
87  void Finalize() override;
88 
92  const char* ReportCapabilities() override { return "WebXR System"; }
93 
97  bool GetSizeFromAPI() override;
98 
103  void StereoMidpoint() override;
104 
109  void StereoRenderComplete() override;
110 
116  void UpdateHMDMatrixPose() override;
117 
121  void RenderModels() override;
122 
123 protected:
125  ~vtkWebXRRenderWindow() override;
126 
130  bool CreateFramebuffers(uint32_t vtkNotUsed(viewCount) = 1) override { return true; };
131 
135  void RenderFramebuffer(FramebufferDesc& vtkNotUsed(framebufferDesc)) override {};
136 
137 private:
139  void operator=(const vtkWebXRRenderWindow&) = delete;
140 
141  vtkNew<vtkMatrix4x4> TempMatrix4x4;
142 
143  class vtkInternals;
144  vtkInternals* Internal;
145 };
146 
147 VTK_ABI_NAMESPACE_END
148 #endif
149 // VTK-HeaderTest-Exclude: vtkWebXRRenderWindow.h
virtual void RenderModels()=0
Render the controller and base station models.
VR rendering window.
void AddRenderer(vtkRenderer *) override
Add a renderer to the list of renderers.
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkRenderWindowInteractor * MakeRenderWindowInteractor() override=0
Create an interactor to control renderers in this window.
void RenderFramebuffer(FramebufferDesc &framebufferDesc) override
no-op to satisfy the base class API
virtual void Finalize()
Finalize the rendering process.
platform-independent render window interaction including picking and frame rate control.
static vtkOpenGLRenderWindow * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
void Initialize() override
Initialize the rendering window.
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
virtual bool GetSizeFromAPI()=0
Attempt to get the size of the display from the API and store it in this->Size.
#define VTK_NEWINSTANCE
void Render() override
Overridden to not release resources that would interfere with an external application's rendering...
WebXR rendering window.
virtual void StereoRenderComplete()
Handles work required once both views have been rendered when using stereo rendering.
#define VTK_MARSHALAUTO
virtual void UpdateHMDMatrixPose()
Update the HMD pose.
bool CreateFramebuffers(uint32_t viewCount=1) override
no-op because the WebXR API already gives us a framebuffer
void StereoMidpoint() override
Intermediate method performs operations required between the rendering of the left and right eye...
const char * ReportCapabilities() override
Get report of capabilities for the render window.