VTK  9.7.20261114
vtkWebGPUUniforms.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 vtkWebGPUUniforms_h
5#define vtkWebGPUUniforms_h
6
7#include "vtkRenderingWebGPUModule.h" // For export macro
8#include "vtkUniforms.h"
9
10#include <memory> // For std::unique_ptr
11#include <string> // For std::string
12#include <vector> // For std::vector
13
14VTK_ABI_NAMESPACE_BEGIN
16
17class VTKRENDERINGWEBGPU_EXPORT vtkWebGPUUniforms : public vtkUniforms
18{
19public:
24 void PrintSelf(ostream& os, vtkIndent indent) override;
25
27
28 void RemoveUniform(const char* name) override;
29 void RemoveAllUniforms() override;
30
31 void SetUniform(const char* name, vtkUniforms::TupleType tt, int nbComponents,
32 const std::vector<int>& value) override;
33 void SetUniform(const char* name, vtkUniforms::TupleType tt, int nbComponents,
34 const std::vector<float>& value) override;
35 bool GetUniform(const char* name, std::vector<int>& value) override;
36 bool GetUniform(const char* name, std::vector<float>& value) override;
37
38 void SetUniformi(const char* name, int v) override;
39 void SetUniformf(const char* name, float v) override;
40 void SetUniform2i(const char* name, const int v[2]) override;
41 void SetUniform2f(const char* name, const float v[2]) override;
42 void SetUniform3f(const char* name, const float v[3]) override;
43 void SetUniform4f(const char* name, const float v[4]) override;
44 void SetUniformMatrix3x3(const char* name, float* v) override;
45 void SetUniformMatrix4x4(const char* name, float* v) override;
46
47 void SetUniform1iv(const char* name, int count, const int* f) override;
48 void SetUniform1fv(const char* name, int count, const float* f) override;
49 void SetUniform2fv(const char* name, int count, const float (*f)[2]) override;
50 void SetUniform3fv(const char* name, int count, const float (*f)[3]) override;
51 void SetUniform4fv(const char* name, int count, const float (*f)[4]) override;
52 void SetUniformMatrix4x4v(const char* name, int count, float* v) override;
53
54 void SetUniform3f(const char* name, const double v[3]) override;
55 void SetUniform3uc(const char* name, const unsigned char v[3]) override;
56 void SetUniform4uc(const char* name, const unsigned char v[4]) override;
57 void SetUniformMatrix(const char* name, vtkMatrix3x3* v) override;
58 void SetUniformMatrix(const char* name, vtkMatrix4x4* v) override;
59
60 bool GetUniformi(const char* name, int& v) override;
61 bool GetUniformf(const char* name, float& v) override;
62 bool GetUniform2i(const char* name, int v[2]) override;
63 bool GetUniform2f(const char* name, float v[2]) override;
64 bool GetUniform3f(const char* name, float v[3]) override;
65 bool GetUniform4f(const char* name, float v[4]) override;
66 bool GetUniformMatrix3x3(const char* name, float* v) override;
67 bool GetUniformMatrix4x4(const char* name, float* v) override;
68
69 bool GetUniform3f(const char* name, double v[3]) override;
70 bool GetUniform3uc(const char* name, unsigned char v[3]) override;
71 bool GetUniform4uc(const char* name, unsigned char v[4]) override;
72 bool GetUniformMatrix(const char* name, vtkMatrix3x3* v) override;
73 bool GetUniformMatrix(const char* name, vtkMatrix4x4* v) override;
74
75 bool GetUniform1iv(const char* name, std::vector<int>& f) override;
76 bool GetUniform1fv(const char* name, std::vector<float>& f) override;
77 bool GetUniform2fv(const char* name, std::vector<float>& f) override;
78 bool GetUniform3fv(const char* name, std::vector<float>& f) override;
79 bool GetUniform4fv(const char* name, std::vector<float>& f) override;
80 bool GetUniformMatrix4x4v(const char* name, std::vector<float>& f) override;
81
82 int GetNumberOfUniforms() override;
83 const char* GetNthUniformName(vtkIdType uniformIndex) override;
84 int GetUniformScalarType(const char* name) override;
85 TupleType GetUniformTupleType(const char* name) override;
86 int GetUniformNumberOfComponents(const char* name) override;
87 int GetUniformNumberOfTuples(const char* name) override;
88
89protected:
92
93private:
94 vtkWebGPUUniforms(const vtkWebGPUUniforms&) = delete;
95 void operator=(const vtkWebGPUUniforms&) = delete;
96
97 struct Internals;
98 std::unique_ptr<Internals> Storage;
99};
100
101#define vtkWebGPUUniforms_OVERRIDE_ATTRIBUTES vtkWebGPUUniforms::CreateOverrideAttributes()
102VTK_ABI_NAMESPACE_END
103#endif
int count
Definition PyrGnBasis.h:1
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3x3 transformation matrices
represent and manipulate 4x4 transformation matrices
Attribute for vtkObjectFactory overrides.
TupleType
Types of tuples that can be stored : scalar, vector, matrix.
Definition vtkUniforms.h:47
vtkUniforms()=default
void SetUniform1iv(const char *name, int count, const int *f) override
Set the name uniform array to f with count elements.
bool GetUniform2i(const char *name, int v[2]) override
Get the name uniform value.
int GetNumberOfUniforms() override
Get number of all uniforms stored in this class.
void SetUniformMatrix3x3(const char *name, float *v) override
Set the name uniform value to v.
bool GetUniformMatrix(const char *name, vtkMatrix4x4 *v) override
Get the name uniform to v.
bool GetUniformMatrix4x4(const char *name, float *v) override
Get the name uniform value.
int GetUniformNumberOfComponents(const char *name) override
Get the number of components stored in each tuple of uniform name.
bool GetUniformMatrix4x4v(const char *name, std::vector< float > &f) override
Get the name uniform vector to f with.
bool GetUniformMatrix(const char *name, vtkMatrix3x3 *v) override
Get the name uniform to v.
void SetUniform2i(const char *name, const int v[2]) override
Set the name uniform value to v.
static vtkOverrideAttribute * CreateOverrideAttributes()
bool GetUniform1fv(const char *name, std::vector< float > &f) override
Get the name uniform vector to f with.
bool GetUniform4f(const char *name, float v[4]) override
Get the name uniform value.
bool GetUniformf(const char *name, float &v) override
Get the name uniform value.
bool GetUniform3uc(const char *name, unsigned char v[3]) override
Get the name uniform to v.
void SetUniform2fv(const char *name, int count, const float(*f)[2]) override
Set the name uniform array to f with count elements.
void SetUniformMatrix(const char *name, vtkMatrix4x4 *v) override
Set the name uniform to v.
bool GetUniformMatrix3x3(const char *name, float *v) override
Get the name uniform value.
bool GetUniform4uc(const char *name, unsigned char v[4]) override
Get the name uniform to v.
bool GetUniform(const char *name, std::vector< int > &value) override
Generic setters and getter.
void RemoveAllUniforms() override
Remove all uniform variables.
void SetUniform4fv(const char *name, int count, const float(*f)[4]) override
Set the name uniform array to f with count elements.
void SetUniform3f(const char *name, const double v[3]) override
Set the name uniform to v.
void SetUniform3fv(const char *name, int count, const float(*f)[3]) override
Set the name uniform array to f with count elements.
int GetUniformScalarType(const char *name) override
Get type of scalars stored in uniform name.
void SetUniform4f(const char *name, const float v[4]) override
Set the name uniform value to v.
bool GetUniform3fv(const char *name, std::vector< float > &f) override
Get the name uniform vector to f with.
void SetUniform(const char *name, vtkUniforms::TupleType tt, int nbComponents, const std::vector< float > &value) override
Generic setters and getter.
bool GetUniform(const char *name, std::vector< float > &value) override
Generic setters and getter.
bool GetUniformi(const char *name, int &v) override
Get the name uniform value.
void SetUniformMatrix(const char *name, vtkMatrix3x3 *v) override
Set the name uniform to v.
~vtkWebGPUUniforms() override
void SetUniformMatrix4x4(const char *name, float *v) override
Set the name uniform value to v.
int GetUniformNumberOfTuples(const char *name) override
Number of tuples of uniform name that contains a variable-size vector.
vtkMTimeType GetUniformListMTime() override
void RemoveUniform(const char *name) override
Remove uniform variable named name.
TupleType GetUniformTupleType(const char *name) override
Get the tuple type stored in uniform name.
bool GetUniform3f(const char *name, float v[3]) override
Get the name uniform value.
bool GetUniform1iv(const char *name, std::vector< int > &f) override
Get the name uniform vector to f with.
void SetUniform1fv(const char *name, int count, const float *f) override
Set the name uniform array to f with count elements.
void SetUniform3uc(const char *name, const unsigned char v[3]) override
Set the name uniform to v.
bool GetUniform4fv(const char *name, std::vector< float > &f) override
Get the name uniform vector to f with.
void SetUniformMatrix4x4v(const char *name, int count, float *v) override
Set the name uniform array to f with count elements.
const char * GetNthUniformName(vtkIdType uniformIndex) override
Get number of all uniforms stored in this class.
static vtkWebGPUUniforms * New()
bool GetUniform3f(const char *name, double v[3]) override
Get the name uniform to v.
void SetUniform2f(const char *name, const float v[2]) override
Set the name uniform value to v.
void SetUniform4uc(const char *name, const unsigned char v[4]) override
Set the name uniform to v.
bool GetUniform2f(const char *name, float v[2]) override
Get the name uniform value.
void SetUniform(const char *name, vtkUniforms::TupleType tt, int nbComponents, const std::vector< int > &value) override
Generic setters and getter.
void SetUniform3f(const char *name, const float v[3]) override
Set the name uniform value to v.
void SetUniformi(const char *name, int v) override
Set the name uniform value to v.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool GetUniform2fv(const char *name, std::vector< float > &f) override
Get the name uniform vector to f with.
void SetUniformf(const char *name, float v) override
Set the name uniform value to v.
int vtkIdType
Definition vtkType.h:366
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:321
#define VTK_NEWINSTANCE