VTK  9.7.20261123
vtkWebGPUVolumeRayCastMapper.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
46
47#ifndef vtkWebGPUVolumeRayCastMapper_h
48#define vtkWebGPUVolumeRayCastMapper_h
49
51#include "vtkRenderingVolumeWebGPUModule.h" // for export macro
52#include "vtkWeakPointer.h" // for vtkWeakPointer
53
54#include <memory> // for std::unique_ptr
55
56VTK_ABI_NAMESPACE_BEGIN
57class vtkImageData;
58
61
62class VTKRENDERINGVOLUMEWEBGPU_EXPORT vtkWebGPUVolumeRayCastMapper
64{
65public:
68 void PrintSelf(ostream& os, vtkIndent indent) override;
69
71
76 double* GetBounds() VTK_SIZEHINT(6) override;
77 using Superclass::GetBounds;
78
79 void GPURender(vtkRenderer* ren, vtkVolume* vol) override;
80
84 void Render(vtkRenderer* ren, vtkVolume* vol) override;
85
91 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
92
94
99 void GetColorImage(vtkImageData* output) override;
100 void GetDepthImage(vtkImageData* output) override;
102 int IsRenderSupported(vtkRenderWindow* window, vtkVolumeProperty* property) override;
103 void ReleaseGraphicsResources(vtkWindow* window) override;
104
110 void GetReductionRatio(double ratio[3]) override;
111
113
118 void SetVolumeProperty(int port, vtkVolumeProperty* property);
121
123
131 vtkSetMacro(AdaptiveSampling, bool);
132 vtkGetMacro(AdaptiveSampling, bool);
133 vtkBooleanMacro(AdaptiveSampling, bool);
135
137
141 vtkSetMacro(EmptySpaceSkipping, bool);
142 vtkGetMacro(EmptySpaceSkipping, bool);
143 vtkBooleanMacro(EmptySpaceSkipping, bool);
145
147
156 vtkSetClampMacro(BrickSize, int, 4, 128);
157 vtkGetMacro(BrickSize, int);
159
161
166 vtkSetClampMacro(MinimumSampleDistanceFactor, double, 0.05, 100.0);
167 vtkGetMacro(MinimumSampleDistanceFactor, double);
168 vtkSetClampMacro(MaximumSampleDistanceFactor, double, 0.05, 100.0);
169 vtkGetMacro(MaximumSampleDistanceFactor, double);
171
173
177 vtkSetClampMacro(EmptySpaceOpacityThreshold, double, 0.0, 1.0);
178 vtkGetMacro(EmptySpaceOpacityThreshold, double);
180
182
187 vtkSetClampMacro(InteractiveMaximumNumberOfSamples, int, 16, 65536);
190
192
203 vtkSetClampMacro(StreamingThresholdMB, int, 0, VTK_INT_MAX);
204 vtkGetMacro(StreamingThresholdMB, int);
206
210 bool IsStreaming(int port = 0);
211
213 class vtkInternals;
214
215protected:
218
219 // AMR rendering is not supported by this mapper.
220 void PreRender(vtkRenderer* ren, vtkVolume* vol, double datasetBounds[6], double scalarRange[2],
221 int numberOfScalarComponents, unsigned int numberOfLevels) override;
222 void RenderBlock(vtkRenderer* ren, vtkVolume* vol, unsigned int level) override;
223 void PostRender(vtkRenderer* ren, int numberOfScalarComponents) override;
224
225 bool AdaptiveSampling = true;
227 int BrickSize = 8;
233
234private:
236 void operator=(const vtkWebGPUVolumeRayCastMapper&) = delete;
237
238 std::unique_ptr<vtkInternals> Internals;
239
242 vtkWeakPointer<vtkRenderer> LastRenderer;
243};
244
245#define vtkWebGPUVolumeRayCastMapper_OVERRIDE_ATTRIBUTES \
246 vtkWebGPUVolumeRayCastMapper::CreateOverrideAttributes()
247
248VTK_ABI_NAMESPACE_END
249#endif
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Attribute for vtkObjectFactory overrides.
create a window for renderers to draw into
abstract specification for renderers
represents the common properties for rendering a volume.
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:130
a weak reference to a vtkObject.
void ReleaseGraphicsResources(vtkWindow *window) override
Release any graphics resources that are being consumed by this mapper.
void GPURender(vtkRenderer *ren, vtkVolume *vol) override
Handled in the subclass - the actual render method.
void Render(vtkRenderer *ren, vtkVolume *vol) override
Reads streamed inputs a brick at a time instead of updating them whole first.
double * GetBounds() override
Bounds of every connected input taken together, so that a mapper with several inputs is framed and cu...
int IsRenderSupported(vtkRenderWindow *window, vtkVolumeProperty *property) override
Based on hardware and properties, we may or may not be able to render using 3D texture mapping.
void RenderBlock(vtkRenderer *ren, vtkVolume *vol, unsigned int level) override
bool IsStreaming(int port=0)
Whether the input on port is read a brick at a time.
void SetVolumeProperty(int port, vtkVolumeProperty *property)
Appearance of the input connected to port.
void GetDepthImage(vtkImageData *output) override
What the last render produced while RenderToImage was on: the volume drawn alone over a transparent b...
void PostRender(vtkRenderer *ren, int numberOfScalarComponents) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void GetColorImage(vtkImageData *output) override
What the last render produced while RenderToImage was on: the volume drawn alone over a transparent b...
static vtkOverrideAttribute * CreateOverrideAttributes()
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Asks nothing of a streamed input when the mapper is updated, as vtkVolume does before every render: i...
vtkVolumeProperty * GetVolumeProperty(int port)
Appearance of the input connected to port.
void PreRender(vtkRenderer *ren, vtkVolume *vol, double datasetBounds[6], double scalarRange[2], int numberOfScalarComponents, unsigned int numberOfLevels) override
static vtkWebGPUVolumeRayCastMapper * New()
void GetReductionRatio(double ratio[3]) override
Return how much the dataset has to be reduced in each dimension to fit on the GPU.
window superclass for vtkRenderWindow
Definition vtkWindow.h:62
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_INT_MAX
Definition vtkType.h:195
#define VTK_SIZEHINT(...)