VTK  9.7.20260916
vtkWebGPUActorInternals.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
3
4#ifndef vtkWebGPUActorInternals_h
5#define vtkWebGPUActorInternals_h
6
8#include "vtkMapper.h"
9#include "vtkMatrix3x3.h"
10#include "vtkMatrix4x4.h"
11#include "vtkNew.h"
12#include "vtkRenderingWebGPUModule.h"
13#include "vtkTransform.h"
15
16#include "vtk_wgpu.h"
17
18VTK_ABI_NAMESPACE_BEGIN
19
20class VTKRENDERINGWEBGPU_NO_EXPORT vtkWebGPUActorInternals
21{
23
24public:
26 {
28 {
29 vtkTypeFloat32 World[4][4] = {};
30 vtkTypeFloat32 Normal[3][4] = {};
31 } Transform;
32
34 {
35 // Point size in pixels - applicable when points are visible.
36 vtkTypeFloat32 PointSize = 0;
37 // Line width in pixels - applicable when lines/edges are visible.
38 vtkTypeFloat32 LineWidth = 0;
39 // Edge width in pixels - applicable when edges are visible and UseLineWidthForEdgeThickness
40 // is false.
41 vtkTypeFloat32 EdgeWidth = 0;
42 // Custom flags used to encode various integer/boolean properties.
43 vtkTypeUInt32 Flags = 0;
44 // Additional custom flags used to encode various integer/boolean properties.
45 vtkTypeUInt32 Flags2 = 0;
46 // Coincident topology polygon offset factor (for surface/triangle pipelines).
47 vtkTypeFloat32 CoinPolygonFactor = 0;
48 // Coincident topology polygon offset units (for surface/triangle pipelines).
49 vtkTypeFloat32 CoinPolygonOffset = 0;
50 // Coincident topology line offset factor (for wireframe/line pipelines).
51 vtkTypeFloat32 CoinLineFactor = 0;
52 // Coincident topology line offset units (for wireframe/line pipelines).
53 vtkTypeFloat32 CoinLineOffset = 0;
54 // Coincident topology point offset units (for point pipelines).
55 vtkTypeFloat32 CoinPointOffset = 0;
56 } RenderOpts;
57 vtkTypeUInt32 Pad[2];
58
60 {
61 // Material ambient color - applicable when shading type is global.
62 vtkTypeFloat32 AmbientColor[3] = {};
63 vtkTypeUInt32 Pad1 = 0;
64 // Material diffuse color - applicable when shading type is global.
65 vtkTypeFloat32 DiffuseColor[3] = {};
66 vtkTypeUInt32 Pad2 = 0;
67 // Material specular color - applicable when shading type is global.
68 vtkTypeFloat32 SpecularColor[3] = {};
69 vtkTypeUInt32 Pad3 = 0;
70 // Edge color
71 vtkTypeFloat32 EdgeColor[3] = {};
72 vtkTypeUInt32 Pad4 = 0;
73 // Vertex color
74 vtkTypeFloat32 VertexColor[3] = {};
75 // Material ambient color intensity.
76 vtkTypeFloat32 AmbientIntensity = 0;
77 // Material diffuse color intensity.
78 vtkTypeFloat32 DiffuseIntensity = 1;
79 // Material specular color intensity.
80 vtkTypeFloat32 SpecularIntensity = 0;
81 // Material specular power.
82 vtkTypeFloat32 SpecularPower = 0;
83 // Opacity level
84 vtkTypeFloat32 Opacity = 0;
85 // Interpolation type
86 vtkTypeUInt32 InterpolationType = VTK_FLAT;
87 // Id to color by
88 vtkTypeUInt32 Id = 0;
89 } ColorOpts;
90 };
91
93 {
94 bool Value = false;
95 vtkTimeStamp TimeStamp;
96
97 public:
101 void SetValue(bool newValue)
102 {
103 this->Value = newValue;
104 this->TimeStamp.Modified();
105 }
106
110 bool GetValue() const { return Value; }
111
115 bool IsOutdated(vtkMapper* mapper) const { return mapper->GetMTime() > this->TimeStamp; }
116 };
117
119
122
126
131
132 vtkWebGPU::BindGroupLayout ActorBindGroupLayout;
133 vtkWebGPU::BindGroup ActorBindGroup;
134 vtkWebGPU::Buffer ActorBuffer;
135
136 vtkTypeUInt32 Id = 0;
137
138 void PopulateBindgroupLayouts(std::vector<WGPUBindGroupLayout>& layouts)
139 {
140 layouts.emplace_back(this->ActorBindGroupLayout.Get());
141 }
142};
143
144VTK_ABI_NAMESPACE_END
145#endif
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:97
vtkMTimeType GetMTime() override
Overload standard modified time function.
Allocate and hold a VTK object.
Definition vtkNew.h:168
record modification and/or execution time
void Modified()
Set this objects time to the current time.
bool GetValue() const
Returns the cached Value.
void SetValue(bool newValue)
Update the cached value with the new value.
bool IsOutdated(vtkMapper *mapper) const
Returns true if the timestamp of the cached value is older than the mapper's MTime.
void PopulateBindgroupLayouts(std::vector< WGPUBindGroupLayout > &layouts)
vtkNew< vtkMatrix3x3 > NormalMatrix
MapperBooleanCache MapperHasTranslucentPolygonalGeometry
vtkNew< vtkTransform > NormalTransform
vtkNew< vtkMatrix4x4 > MCWCMatrix
vtkWebGPU::BindGroup ActorBindGroup
vtkWebGPU::BindGroupLayout ActorBindGroupLayout
MapperBooleanCache MapperHasOpaqueGeometry
#define VTK_FLAT
Reference-counted ownership for WebGPU C API handles.