VTK  9.7.20260923
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 "vtkRenderingAnariCoreModule.h" // for export macro
25
26VTK_ABI_NAMESPACE_BEGIN
28class vtkAnariDevice;
32
33class VTKRENDERINGANARICORE_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
53
58 vtkGetMacro(UseDebugDevice, bool);
59 vtkSetMacro(UseDebugDevice, bool);
60 vtkBooleanMacro(UseDebugDevice, bool);
62
74
78 unsigned char* GetPixelData(
79 int x1, int y1, int x2, int y2, int vtkNotUsed(front), int vtkNotUsed(right) = 0) override;
80 int GetPixelData(int x1, int y1, int x2, int y2, int vtkNotUsed(front),
81 vtkUnsignedCharArray* data, int vtkNotUsed(right) = 0) override;
82
86 unsigned char* GetRGBACharPixelData(
87 int x1, int y1, int x2, int y2, int vtkNotUsed(front), int vtkNotUsed(right) = 0) override;
88 int GetRGBACharPixelData(int x1, int y1, int x2, int y2, int vtkNotUsed(front),
89 vtkUnsignedCharArray* data, int vtkNotUsed(right) = 0) override;
91
92protected:
99
103 void DoStereoRender() override;
104
105private:
107 void operator=(const vtkAnariRenderWindow&) = delete;
108
110
119 unsigned char* SampleSourceColorBuffer(int x1, int y1, int x2, int y2, int channelCount);
120 unsigned char* SampleSourceColorBuffer(
121 int x1, int y1, int x2, int y2, int channelCount, bool& success);
122 int SampleSourceColorBuffer(
123 int x1, int y1, int x2, int y2, int channelCount, vtkUnsignedCharArray* data);
125
130 const unsigned char* SampleSourceColorBuffer(int x, int y) const;
131
133
136 int GetWidth() const;
137 int GetHeight() const;
139
141
142 vtkNew<vtkAnariDevice> AnariDevice;
143 bool UseDebugDevice = false;
144 vtkNew<vtkAnariRenderer> AnariRenderer;
145
147};
148
149#define vtkAnariRenderWindow_OVERRIDE_ATTRIBUTES vtkAnariRenderWindow::CreateOverrideAttributes()
150VTK_ABI_NAMESPACE_END
151
152#endif // vtkAnariRenderWindow_h
base class to objects which create + manage a ANARI library + device
~vtkAnariRenderWindow() override
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()
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