VTK  9.5.20251125
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
7#include "vtkMapper.h"
8#include "vtkMatrix3x3.h"
9#include "vtkMatrix4x4.h"
10#include "vtkNew.h"
11#include "vtkRenderingWebGPUModule.h"
12#include "vtkTransform.h"
14
15#include <vtk_wgpu.h>
16
17VTK_ABI_NAMESPACE_BEGIN
18
19class VTKRENDERINGWEBGPU_NO_EXPORT vtkWebGPUActorInternals
20{
22
23public:
25 {
27 {
28 vtkTypeFloat32 World[4][4] = {};
29 vtkTypeFloat32 Normal[3][4] = {};
30 } Transform;
31
33 {
34 // Point size in pixels - applicable when points are visible.
35 vtkTypeFloat32 PointSize = 0;
36 // Line width in pixels - applicable when lines/edges are visible.
37 vtkTypeFloat32 LineWidth = 0;
38 // Edge width in pixels - applicable when edges are visible and UseLineWidthForEdgeThickness
39 // is false.
40 vtkTypeFloat32 EdgeWidth = 0;
41 // Custom flags used to encode various integer/boolean properties.
42 vtkTypeUInt32 Flags = 0;
43 } RenderOpts;
44
46 {
47 // Material ambient color - applicable when shading type is global.
48 vtkTypeFloat32 AmbientColor[3] = {};
49 vtkTypeUInt32 Pad1 = 0;
50 // Material diffuse color - applicable when shading type is global.
51 vtkTypeFloat32 DiffuseColor[3] = {};
52 vtkTypeUInt32 Pad2 = 0;
53 // Material specular color - applicable when shading type is global.
54 vtkTypeFloat32 SpecularColor[3] = {};
55 vtkTypeUInt32 Pad3 = 0;
56 // Edge color
57 vtkTypeFloat32 EdgeColor[3] = {};
58 vtkTypeUInt32 Pad4 = 0;
59 // Vertex color
60 vtkTypeFloat32 VertexColor[3] = {};
61 // Material ambient color intensity.
62 vtkTypeFloat32 AmbientIntensity = 0;
63 // Material diffuse color intensity.
64 vtkTypeFloat32 DiffuseIntensity = 1;
65 // Material specular color intensity.
66 vtkTypeFloat32 SpecularIntensity = 0;
67 // Material specular power.
68 vtkTypeFloat32 SpecularPower = 0;
69 // Opacity level
70 vtkTypeFloat32 Opacity = 0;
71 // Interpolation type
72 vtkTypeUInt32 InterpolationType = VTK_FLAT;
73 // Id to color by
74 vtkTypeUInt32 Id = 0;
75 } ColorOpts;
76 };
77
79 {
80 bool Value = false;
81 vtkTimeStamp TimeStamp;
82
83 public:
87 void SetValue(bool newValue)
88 {
89 this->Value = newValue;
90 this->TimeStamp.Modified();
91 }
92
96 bool GetValue() const { return Value; }
97
101 bool IsOutdated(vtkMapper* mapper) const { return mapper->GetMTime() > this->TimeStamp; }
102 };
103
105
108
112
117
118 wgpu::BindGroupLayout ActorBindGroupLayout;
119 wgpu::BindGroup ActorBindGroup;
120 wgpu::Buffer ActorBuffer;
121
122 vtkTypeUInt32 Id = 0;
123
124 void PopulateBindgroupLayouts(std::vector<wgpu::BindGroupLayout>& layouts)
125 {
126 layouts.emplace_back(this->ActorBindGroupLayout);
127 }
128};
129
130VTK_ABI_NAMESPACE_END
131#endif
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:98
vtkMTimeType GetMTime() override
Overload standard modified time function.
Allocate and hold a VTK object.
Definition vtkNew.h:167
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.
vtkNew< vtkMatrix3x3 > NormalMatrix
MapperBooleanCache MapperHasTranslucentPolygonalGeometry
wgpu::BindGroupLayout ActorBindGroupLayout
vtkNew< vtkTransform > NormalTransform
vtkNew< vtkMatrix4x4 > MCWCMatrix
void PopulateBindgroupLayouts(std::vector< wgpu::BindGroupLayout > &layouts)
MapperBooleanCache MapperHasOpaqueGeometry
#define VTK_FLAT