VTK  9.7.20260902
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;
32
33class VTKRENDERINGANARI_EXPORT vtkAnariRenderWindow : public vtkRenderWindow
34{
35public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
44 vtkGetObjectMacro(AnariDevice, vtkAnariDevice);
45
50 vtkGetObjectMacro(AnariRenderer, vtkAnariRenderer);
51
63
67 unsigned char* GetPixelData(
68 int x1, int y1, int x2, int y2, int vtkNotUsed(front), int vtkNotUsed(right) = 0) override;
69 int GetPixelData(int x1, int y1, int x2, int y2, int vtkNotUsed(front),
70 vtkUnsignedCharArray* data, int vtkNotUsed(right) = 0) override;
71
75 unsigned char* GetRGBACharPixelData(
76 int x1, int y1, int x2, int y2, int vtkNotUsed(front), int vtkNotUsed(right) = 0) override;
77 int GetRGBACharPixelData(int x1, int y1, int x2, int y2, int vtkNotUsed(front),
78 vtkUnsignedCharArray* data, int vtkNotUsed(right) = 0) override;
80
81protected:
87 ~vtkAnariRenderWindow() override = default;
88
92 void DoStereoRender() override;
93
94private:
96 void operator=(const vtkAnariRenderWindow&) = delete;
97
99
108 unsigned char* SampleSourceColorBuffer(int x1, int y1, int x2, int y2, int channelCount);
109 unsigned char* SampleSourceColorBuffer(
110 int x1, int y1, int x2, int y2, int channelCount, bool& success);
111 int SampleSourceColorBuffer(
112 int x1, int y1, int x2, int y2, int channelCount, vtkUnsignedCharArray* data);
114
119 const unsigned char* SampleSourceColorBuffer(int x, int y) const;
120
122
125 int GetWidth() const;
126 int GetHeight() const;
128
130
131 vtkNew<vtkAnariDevice> AnariDevice;
132 vtkNew<vtkAnariRenderer> AnariRenderer;
133
135};
136
137#define vtkAnariRenderWindow_OVERRIDE_ATTRIBUTES vtkAnariRenderWindow::CreateOverrideAttributes()
138VTK_ABI_NAMESPACE_END
139
140#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...
static vtkOverrideAttribute * CreateOverrideAttributes()
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
Attribute for vtkObjectFactory overrides.
Hold a reference to a vtkObjectBase instance.
dynamic, self-adjusting array of unsigned char