VTK  9.7.20261123
vtkWebGPUVolumeRayCastMapperInput.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 vtkWebGPUVolumeRayCastMapperInput_h
14#define vtkWebGPUVolumeRayCastMapperInput_h
15
17
18#include "vtkMatrix4x4.h" // for the index to physical transform
19#include "vtkNew.h"
20#include "vtkSmartPointer.h"
21#include "vtkTimeStamp.h"
22
23#include <array>
24#include <cstdint>
25#include <vector>
26
27VTK_ABI_NAMESPACE_BEGIN
28
29class vtkAlgorithm;
30class vtkDataArray;
31class vtkImageData;
33
35{
36 int Port = 0;
38 vtkImageData* Data = nullptr;
41
42 bool FetchBrick(const int brick[3], int slotSize, void* voxels) override;
43 bool FetchMask(const int brick[3], int slotSize, unsigned char* voxels) override;
44
47 std::vector<unsigned char> Hidden;
50 int MaximumLabel = 0;
53 vtkImageData* Mask = nullptr;
55 int MaskType = -1;
56 std::vector<std::uint16_t> LabelTable;
58 bool MaskHidesNeighbours = false;
59
69 bool Transfer2D = false;
70 bool CellData = false;
74
76 bool BytePool = false;
77 int PoolChannels = 1;
78
79 int Dimensions[3] = { 0, 0, 0 };
80 float ValueScale = 1.0f;
81 float ValueBias = 0.0f;
82
87
88 double DataRange[4][2] = { { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 } };
90 double ScalarRange[4][2] = { { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 } };
92 double GradientRange[4][2] = { { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 }, { 0.0, 1.0 } };
93
95 int CellDimensions[3] = { 0, 0, 0 };
96 int CellSize = 0;
97 std::vector<float> CellMinimum[4];
98 std::vector<float> CellMaximum[4];
101 std::vector<float> CellClassification;
102
105 std::vector<std::uint16_t> ColorTable;
106 std::vector<std::uint16_t> OpacityTable;
107 std::vector<std::uint16_t> GradientTable;
109 std::vector<std::uint16_t> Transfer2DTable;
110
113 std::array<std::array<float, vtkWebGPUVolumeTransferFunctionSize>, 4> OpacityCurve = {};
116
125
128 bool Streaming = false;
130 int SourcePort = 0;
131 int WholeExtent[6] = { 0, -1, 0, -1, 0, -1 };
133 bool RangeFromFunctions = false;
135 std::vector<std::size_t> PendingCells;
136 bool FetchStreamedBrick(const int brick[3], int slotSize, void* voxels);
137
142 static vtkImageData* ReadExtent(vtkAlgorithm* source, int sourcePort, const int extent[6]);
143};
144
145VTK_ABI_NAMESPACE_END
146#endif
147// VTK-HeaderTest-Exclude: vtkWebGPUVolumeRayCastMapperInput.h
topologically and geometrically regular array of data
represent and manipulate 4x4 transformation matrices
Allocate and hold a VTK object.
Definition vtkNew.h:168
Hold a reference to a vtkObjectBase instance.
record modification and/or execution time
represents the common properties for rendering a volume.
GPU ray cast volume mapper for the WebGPU backend.
Where the coordinator gets the voxels of a brick from.
One input of vtkWebGPUVolumeRayCastMapper, as the mapper prepares it.
bool FetchMask(const int brick[3], int slotSize, unsigned char *voxels) override
Fill voxels with one byte per voxel of the same brick, non zero where the voxel is not to be drawn.
bool Streaming
Read a brick at a time from Source, whose index space starts at WholeExtent.
std::vector< std::uint16_t > Transfer2DTable
The two dimensional transfer function, resampled to a fixed size, one per component.
vtkDataArray * YAxisScalars
The array that gives the second axis of a two dimensional transfer function, if one was named.
static vtkImageData * ReadExtent(vtkAlgorithm *source, int sourcePort, const int extent[6])
Read extent, in the source's own index space, from source through the pipeline.
double GradientRange[4][2]
Range each component's gradient opacity function is tabulated over.
std::vector< std::uint16_t > ColorTable
RGBA16Float texels ready to be dropped into a layer of the shared arrays, one set of tables per compo...
std::vector< std::size_t > PendingCells
Cells measured as their bricks arrived, waiting to be classified.
vtkTimeStamp CellsTime
Bumped when cells are classified piecemeal, without the rest of the input changing.
vtkSmartPointer< vtkDataArray > AOSScalars
Both of them in the contiguous layout the bricks are cut from: the arrays themselves when they alread...
bool FetchStreamedBrick(const int brick[3], int slotSize, void *voxels)
int CellDimensions[3]
Geometry of the acceleration cells, and the scalar extremes of each, per component.
bool BytePool
Whether the scalars go to the device as bytes rather than floats.
std::vector< float > CellClassification
Two floats per cell: largest opacity the transfer functions map it to, and how much it varies.
int PrimaryComponent
Which component that is: the one the intensity modes and the classification look at.
bool FetchBrick(const int brick[3], int slotSize, void *voxels) override
Copy the brick at brick, with a one voxel apron from its neighbours, into voxels, which holds slotSiz...
int MaximumLabel
Labels of a label map mask, and the transfer functions each of them asks for.
vtkNew< vtkMatrix4x4 > IndexToPhysical
Index space to the input's own coordinates, shifted by half a voxel for cell data so that a cell is s...
vtkDataArray * Scalars
The array the mapper was told to render, which is not always the active point scalars.
bool MaskHidesNeighbours
Whether hiding a voxel should also hide what interpolates through it.
std::array< std::array< float, vtkWebGPUVolumeTransferFunctionSize >, 4 > OpacityCurve
Every component's opacity table again, unpacked, so cells can be classified without asking the transf...
int NumberOfComponents
How many components of the array are rendered, at most four, and whether each carries its own transfe...
vtkTimeStamp ContentTime
Bumped whenever anything above is rebuilt.
std::vector< unsigned char > Hidden
Two bytes per voxel: the first non zero where the voxel is not to be drawn, the second its label.
vtkTimeStamp BrickTime
Bumped only when the voxels change, which is all that makes a resident brick stale.
bool RangeFromFunctions
No range was published, so the transfer functions' own range stands in for the data's.
vtkImageData * Mask
What the mask looked like when the hidden voxels were last worked out, so that a mask arriving or cha...
double ScalarRange[4][2]
Range each component's colour and opacity functions are tabulated over.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define vtkDataArray
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:321
#define vtkAlgorithm