VTK  9.7.20260813
vtkAnariRenderWindow.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
19
20#ifndef vtkAnariRenderWindow_h
21#define vtkAnariRenderWindow_h
22
23#include "vtkRenderWindow.h"
24#include "vtkRenderingAnariModule.h" // for export macro
25
26VTK_ABI_NAMESPACE_BEGIN
28class vtkAnariDevice;
31
32class VTKRENDERINGANARI_EXPORT vtkAnariRenderWindow : public vtkRenderWindow
33{
34public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
42 vtkGetObjectMacro(AnariDevice, vtkAnariDevice);
43
48 vtkGetObjectMacro(AnariRenderer, vtkAnariRenderer);
49
61
65 unsigned char* GetPixelData(
66 int x1, int y1, int x2, int y2, int vtkNotUsed(front), int vtkNotUsed(right) = 0) override;
67 int GetPixelData(int x1, int y1, int x2, int y2, int vtkNotUsed(front),
68 vtkUnsignedCharArray* data, int vtkNotUsed(right) = 0) override;
69
73 unsigned char* GetRGBACharPixelData(
74 int x1, int y1, int x2, int y2, int vtkNotUsed(front), int vtkNotUsed(right) = 0) override;
75 int GetRGBACharPixelData(int x1, int y1, int x2, int y2, int vtkNotUsed(front),
76 vtkUnsignedCharArray* data, int vtkNotUsed(right) = 0) override;
78
79protected:
85 ~vtkAnariRenderWindow() override = default;
86
90 void DoStereoRender() override;
91
92private:
94 void operator=(const vtkAnariRenderWindow&) = delete;
95
97
106 unsigned char* SampleSourceColorBuffer(int x1, int y1, int x2, int y2, int channelCount);
107 unsigned char* SampleSourceColorBuffer(
108 int x1, int y1, int x2, int y2, int channelCount, bool& success);
109 int SampleSourceColorBuffer(
110 int x1, int y1, int x2, int y2, int channelCount, vtkUnsignedCharArray* data);
112
117 const unsigned char* SampleSourceColorBuffer(int x, int y) const;
118
120
123 int GetWidth() const;
124 int GetHeight() const;
126
128
129 vtkNew<vtkAnariDevice> AnariDevice;
130 vtkNew<vtkAnariRenderer> AnariRenderer;
131
133};
134
135VTK_ABI_NAMESPACE_END
136
137#endif // vtkAnariRenderWindow_h
base class to objects which create + manage a ANARI library + device
unsigned char * GetRGBACharPixelData(int x1, int y1, int x2, int y2, int front, int right=0) override
Functions that query RGBA pixel image.
unsigned char * GetPixelData(int x1, int y1, int x2, int y2, int front, int right=0) override
Functions that query RGB pixel image.
~vtkAnariRenderWindow() override=default
vtkAnariRenderWindow()
As the render window only supports offscreen rendering for the moment, the constructor calls Offscree...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetPixelData(int x1, int y1, int x2, int y2, int front, vtkUnsignedCharArray *data, int right=0) override
Functions that query RGB pixel image.
void DoStereoRender() override
Called to trigger the rendering to ANARI.
int GetRGBACharPixelData(int x1, int y1, int x2, int y2, int front, vtkUnsignedCharArray *data, int right=0) override
Functions that query RGB pixel image.
static vtkAnariRenderWindow * New()
base class to objects which create + manage an ANARI library, device, and renderer
links vtkRenderers to ANARI
matches vtk rendering classes to specific ANARI ViewNode classes
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:168
Hold a reference to a vtkObjectBase instance.
dynamic, self-adjusting array of unsigned char