VTK  9.7.20261123
vtkWebGPUVolumeRayCastContribution.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
12
13#ifndef vtkWebGPUVolumeRayCastContribution_h
14#define vtkWebGPUVolumeRayCastContribution_h
15
16#include "vtkABINamespace.h"
17#include "vtkSetGet.h" // for vtkNotUsed
18#include "vtkType.h"
19
20#include <cstdint>
21#include <vector>
22
23VTK_ABI_NAMESPACE_BEGIN
24
25class vtkImageData;
26class vtkMatrix4x4;
28class vtkVolume;
31
34
38
47{
48 virtual ~vtkWebGPUVolumeBrickSource() = default;
49
56 virtual bool FetchBrick(const int brick[3], int slotSize, void* voxels) = 0;
57
62 virtual bool FetchMask(
63 const int vtkNotUsed(brick)[3], int vtkNotUsed(slotSize), unsigned char* vtkNotUsed(voxels))
64 {
65 return false;
66 }
67};
68
70{
73 vtkVolume* Volume = nullptr;
74 int Port = 0;
75
76 vtkImageData* Data = nullptr;
85
88 bool BytePool = false;
91 int PoolChannels = 1;
92
101 bool CellData = false;
102
106 bool HasMask = false;
108
110 std::uint32_t PropId = 0;
111
115 float MaskBlendFactor = 1.0f;
117 const std::vector<std::uint16_t>* LabelTable = nullptr;
118
119 int Dimensions[3] = { 0, 0, 0 };
121 float ValueScale = 1.0f;
122 float ValueBias = 0.0f;
123
125 double ScalarRange[4][2] = { { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 } };
127 double GradientRange[4][2] = { { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 } };
128
131 int CellSize = 8;
132 int CellDimensions[3] = { 0, 0, 0 };
134 const std::vector<float>* CellClassification = nullptr;
135
138 bool Transfer2D = false;
141 const std::vector<std::uint16_t>* Transfer2DTable = nullptr;
142
144 const std::vector<std::uint16_t>* ColorTable = nullptr;
145 const std::vector<std::uint16_t>* OpacityTable = nullptr;
146 const std::vector<std::uint16_t>* GradientTable = nullptr;
147
158 bool Streaming = false;
159};
160
161VTK_ABI_NAMESPACE_END
162#endif
163// VTK-HeaderTest-Exclude: vtkWebGPUVolumeRayCastContribution.h
topologically and geometrically regular array of data
represent and manipulate 4x4 transformation matrices
maintain a list of planes
represents the common properties for rendering a volume.
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:130
GPU ray cast volume mapper for the WebGPU backend.
Where the coordinator gets the voxels of a brick from.
virtual bool FetchMask(const int brick[3], int slotSize, unsigned char *voxels)
Fill voxels with one byte per voxel of the same brick, non zero where the voxel is not to be drawn.
virtual bool FetchBrick(const int brick[3], int slotSize, void *voxels)=0
Copy the brick at brick, with a one voxel apron from its neighbours, into voxels, which holds slotSiz...
virtual ~vtkWebGPUVolumeBrickSource()=default
One input offered up to be ray cast alongside the others.
vtkWebGPUVolumeBrickSource * BrickSource
Where the coordinator asks for voxels, and whether they come back as bytes or floats.
vtkMTimeType BrickTime
When the voxels themselves last changed.
const std::vector< std::uint16_t > * Transfer2DTable
RGBA16Float texels, vtkWebGPUVolumeTransferFunction2DSize squared per component.
int PoolChannels
How many channels of a pool slot one voxel takes.
double GradientRange[4][2]
Range each component's gradient opacity function was tabulated over.
bool HasMask
Whether some voxels are hidden, and whether hiding one hides what interpolates through it.
const std::vector< std::uint16_t > * GradientTable
double ScalarRange[4][2]
Range each component's colour and opacity functions were tabulated over.
const std::vector< std::uint16_t > * ColorTable
RGBA16Float texels, vtkWebGPUVolumeTransferFunctionSize of each, one set per component.
int CellSize
Edge length and count of the acceleration cells, which say where the volume is empty.
const std::vector< std::uint16_t > * OpacityTable
std::uint32_t PropId
Index of this volume's prop in the renderer, which selection reports as the prop id.
int PrimaryComponent
The component the intensity blend modes and the acceleration structure look at.
int NumberOfComponents
How many components are rendered, at most four, and whether each carries its own transfer functions o...
vtkPlaneCollection * ClippingPlanes
Clipping planes of the mapper that owns this input, if any.
vtkMatrix4x4 * WorldMatrix
Placement of the prop that carries this input.
bool Transfer2D
Whether colour and opacity come from a two dimensional transfer function, and whether its second axis...
float ValueScale
Turns a raw texel back into a scalar: scalar = texel * ValueScale + ValueBias.
bool CellData
Whether the samples are the cells rather than the points, which puts them half a cell in from the edg...
const std::vector< std::uint16_t > * LabelTable
RGBA16Float texels, vtkWebGPUVolumeTransferFunctionSize per label, row zero unused.
vtkMatrix4x4 * IndexToPhysical
Index space to the input's own coordinates.
const std::vector< float > * CellClassification
Two floats per cell: the largest opacity it maps to, and how much it varies.
int MaximumLabel
A label map mask names a transfer function per label, and MaskBlendFactor says how far to go from the...
vtkMTimeType CellsTime
When cells were last classified on their own, as bricks of a streamed volume arrive.
vtkWebGPUVolumeRayCastMapper * Mapper
Who offered this input, and which of its ports it came from.
vtkMTimeType ContentTime
Bumped whenever any of the data above is rebuilt, so the coordinator can leave the layers and blocks ...
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:321
constexpr int vtkWebGPUVolumeTransferFunction2DSize
Edge length of a resampled two dimensional transfer function, in texels.
constexpr int vtkWebGPUVolumeTransferFunctionSize
Size of every tabulated transfer function, in texels.