VTK  9.4.20251007
vtkShaderProperty.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
20
21#ifndef vtkShaderProperty_h
22#define vtkShaderProperty_h
23
24#include "vtkNew.h" // For iVars
25#include "vtkObject.h"
26#include "vtkRenderingCoreModule.h" // For export macro
27#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkUniforms;
31
32class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkShaderProperty : public vtkObject
33{
34public:
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
42
47
59
61
72 vtkSetStringMacro(VertexShaderCode);
73 vtkGetStringMacro(VertexShaderCode);
74 vtkSetStringMacro(FragmentShaderCode);
75 vtkGetStringMacro(FragmentShaderCode);
76 vtkSetStringMacro(GeometryShaderCode);
77 vtkGetStringMacro(GeometryShaderCode);
78 vtkSetStringMacro(TessControlShaderCode);
79 vtkGetStringMacro(TessControlShaderCode);
80 vtkSetStringMacro(TessEvaluationShaderCode);
81 vtkGetStringMacro(TessEvaluationShaderCode);
83
85
90 vtkGetObjectMacro(VertexCustomUniforms, vtkUniforms);
95
97
104 virtual void AddVertexShaderReplacement(const std::string& originalValue,
105 bool replaceFirst, // do this replacement before the default
106 const std::string& replacementValue, bool replaceAll) = 0;
107 virtual void AddFragmentShaderReplacement(const std::string& originalValue,
108 bool replaceFirst, // do this replacement before the default
109 const std::string& replacementValue, bool replaceAll) = 0;
110 virtual void AddGeometryShaderReplacement(const std::string& originalValue,
111 bool replaceFirst, // do this replacement before the default
112 const std::string& replacementValue, bool replaceAll) = 0;
113 virtual void AddTessControlShaderReplacement(const std::string& originalValue,
114 bool replaceFirst, // do this replacement before the default
115 const std::string& replacementValue, bool replaceAll) = 0;
116 virtual void AddTessEvaluationShaderReplacement(const std::string& originalValue,
117 bool replaceFirst, // do this replacement before the default
118 const std::string& replacementValue, bool replaceAll) = 0;
120 virtual std::string GetNthShaderReplacementTypeAsString(vtkIdType index) = 0;
121 virtual void GetNthShaderReplacement(vtkIdType index, std::string& name, bool& replaceFirst,
122 std::string& replacementValue, bool& replaceAll) = 0;
124 const std::string& originalValue, bool replaceFirst) = 0;
126 const std::string& originalValue, bool replaceFirst) = 0;
128 const std::string& originalValue, bool replaceFirst) = 0;
130 const std::string& originalValue, bool replaceFirst) = 0;
132 const std::string& originalValue, bool replaceFirst) = 0;
138 virtual void ClearAllShaderReplacements() = 0;
140
141protected:
144
150
156
157private:
158 vtkShaderProperty(const vtkShaderProperty&) = delete;
159 void operator=(const vtkShaderProperty&) = delete;
160};
161
162VTK_ABI_NAMESPACE_END
163#endif
a simple class to control print indentation
Definition vtkIndent.h:29
Allocate and hold a VTK object.
Definition vtkNew.h:58
bool HasTessControlShaderCode()
Allow the program to set the shader codes used directly instead of using the built in templates.
bool HasFragmentShaderCode()
Allow the program to set the shader codes used directly instead of using the built in templates.
void DeepCopy(vtkShaderProperty *p)
Assign one property to another.
virtual int GetNumberOfShaderReplacements()=0
This function enables you to apply your own substitutions to the shader creation process.
~vtkShaderProperty() override
vtkMTimeType GetShaderMTime()
GetShaderMTime returns the last time a modification was made that affected the code of the shader (ei...
virtual void ClearGeometryShaderReplacement(const std::string &originalValue, bool replaceFirst)=0
This function enables you to apply your own substitutions to the shader creation process.
vtkNew< vtkUniforms > TessEvaluationCustomUniforms
virtual void ClearTessControlShaderReplacement(const std::string &originalValue, bool replaceFirst)=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void ClearAllGeometryShaderReplacements()=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void ClearAllFragmentShaderReplacements()=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void ClearTessEvaluationShaderReplacement(const std::string &originalValue, bool replaceFirst)=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void ClearAllTessEvalShaderReplacements()=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void AddTessControlShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll)=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void ClearAllVertexShaderReplacements()=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void AddVertexShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll)=0
This function enables you to apply your own substitutions to the shader creation process.
bool HasGeometryShaderCode()
Allow the program to set the shader codes used directly instead of using the built in templates.
virtual void AddGeometryShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll)=0
This function enables you to apply your own substitutions to the shader creation process.
vtkNew< vtkUniforms > GeometryCustomUniforms
bool HasVertexShaderCode()
Allow the program to set the shader codes used directly instead of using the built in templates.
virtual void ClearAllTessControlShaderReplacements()=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void ClearAllShaderReplacements()=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void ClearFragmentShaderReplacement(const std::string &originalValue, bool replaceFirst)=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void AddTessEvaluationShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll)=0
This function enables you to apply your own substitutions to the shader creation process.
vtkNew< vtkUniforms > FragmentCustomUniforms
virtual void GetNthShaderReplacement(vtkIdType index, std::string &name, bool &replaceFirst, std::string &replacementValue, bool &replaceAll)=0
This function enables you to apply your own substitutions to the shader creation process.
virtual std::string GetNthShaderReplacementTypeAsString(vtkIdType index)=0
This function enables you to apply your own substitutions to the shader creation process.
virtual void AddFragmentShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll)=0
This function enables you to apply your own substitutions to the shader creation process.
vtkNew< vtkUniforms > VertexCustomUniforms
static vtkShaderProperty * New()
Construct object with no shader replacements.
vtkNew< vtkUniforms > TessControlCustomUniforms
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool HasTessEvalShaderCode()
Allow the program to set the shader codes used directly instead of using the built in templates.
virtual void ClearVertexShaderReplacement(const std::string &originalValue, bool replaceFirst)=0
This function enables you to apply your own substitutions to the shader creation process.
helper class to set custom uniform variables in GPU shaders.
Definition vtkUniforms.h:33
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_MARSHALAUTO