VTK  9.7.20261123
vtkWebGPUVolumeRayCastMapperInternals.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
18
19#ifndef vtkWebGPUVolumeRayCastMapperInternals_h
20#define vtkWebGPUVolumeRayCastMapperInternals_h
21
23
26
27#include "vtkImageData.h" // for the stream shell
28#include "vtkMatrix4x4.h" // for the per input index to physical transform
29#include "vtkNew.h"
30#include "vtkSmartPointer.h"
31#include "vtkTimeStamp.h"
32#include "vtk_wgpu.h"
33
34#include <array>
35#include <cstdint>
36#include <map>
37#include <vector>
38
39VTK_ABI_NAMESPACE_BEGIN
40
41class vtkAlgorithm;
42class vtkInformation;
43class vtkDataArray;
44class vtkImageData;
45class vtkVolume;
49
51{
52public:
54
56 : Self(self)
57 {
58 }
59
65 vtkWebGPUVolumeRayCastCoordinator* coordinator, vtkVolume* volume);
66
68
70 std::map<int, vtkSmartPointer<vtkVolumeProperty>> PortProperties;
71
76 struct Stream
77 {
78 bool Active = false;
79 vtkAlgorithm* Source = nullptr;
80 int SourcePort = 0;
81 int WholeExtent[6] = { 0, -1, 0, -1, 0, -1 };
88 bool HasRange = false;
89 double Range[2] = { 0.0, 1.0 };
93 bool Refused = false;
94 };
95
100 bool WantsStreaming(int port, vtkInformation* info);
101
107 bool UpdateStream(int port);
108 std::map<int, Stream> Streams;
109
110private:
112
113 bool CollectInputs(vtkVolume* volume);
114 void UpdateVolumeData(Input& input, int cellSize);
115 void UpdateHiddenVoxels(Input& input);
116 void UpdateTransferFunctions(Input& input);
117 void UpdateCellClassification(Input& input);
118
119 vtkWebGPUVolumeRayCastMapper* Self = nullptr;
120
122 std::map<int, Input> InputCache;
124 std::vector<int> ActivePorts;
125};
126
127VTK_ABI_NAMESPACE_END
128#endif
129// VTK-HeaderTest-Exclude: vtkWebGPUVolumeRayCastMapperInternals.h
topologically and geometrically regular array of data
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:168
Hold a reference to a vtkObjectBase instance.
represents the common properties for rendering a volume.
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:130
WebGPU rendering window.
Ray casts every WebGPU volume in a renderer in one pass.
bool WantsStreaming(int port, vtkInformation *info)
Whether port would be streamed, judged from its pipeline information alone.
bool UpdateStream(int port)
Whether port is streamed, bringing what is known of its source up to date.
void SyncDeviceResources(vtkWebGPURenderWindow *window, vtkWebGPUVolumeRayCastCoordinator *coordinator, vtkVolume *volume)
Bring every connected input up to date on the device and offer it to coordinator.
std::map< int, vtkSmartPointer< vtkVolumeProperty > > PortProperties
Per port appearance overrides, used when a port is not backed by its own vtkVolume.
One input of vtkWebGPUVolumeRayCastMapper, as the mapper prepares it.
What is known of a port that is read a brick at a time.
bool HasRange
The range the source publishes for that array, when it does.
vtkSmartPointer< vtkDataArray > Scalars
Type, components and name of the array read, and nothing else.
vtkNew< vtkImageData > Shell
The volume's geometry with no voxels in it, standing in for the data everywhere the whole volume woul...
bool Refused
The source could stream but what it produces cannot be, say because it is cell data.
#define vtkDataArray
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:321
constexpr int vtkWebGPUVolumeTransferFunctionSize
Size of every tabulated transfer function, in texels.
#define vtkAlgorithm