VTK  9.3.20240424
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
110#ifndef vtkShaderProperty_h
111#define vtkShaderProperty_h
112
113#include "vtkNew.h" // For iVars
114#include "vtkObject.h"
115#include "vtkRenderingCoreModule.h" // For export macro
116#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
117
118VTK_ABI_NAMESPACE_BEGIN
119class vtkUniforms;
120
121class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkShaderProperty : public vtkObject
122{
123public:
125 void PrintSelf(ostream& os, vtkIndent indent) override;
126
131
136
148
150
161 vtkSetStringMacro(VertexShaderCode);
162 vtkGetStringMacro(VertexShaderCode);
163 vtkSetStringMacro(FragmentShaderCode);
164 vtkGetStringMacro(FragmentShaderCode);
165 vtkSetStringMacro(GeometryShaderCode);
166 vtkGetStringMacro(GeometryShaderCode);
167 vtkSetStringMacro(TessControlShaderCode);
168 vtkGetStringMacro(TessControlShaderCode);
169 vtkSetStringMacro(TessEvaluationShaderCode);
170 vtkGetStringMacro(TessEvaluationShaderCode);
172
174
178 vtkGetObjectMacro(FragmentCustomUniforms, vtkUniforms);
179 vtkGetObjectMacro(VertexCustomUniforms, vtkUniforms);
180 vtkGetObjectMacro(GeometryCustomUniforms, vtkUniforms);
181 vtkGetObjectMacro(TessControlCustomUniforms, vtkUniforms);
182 vtkGetObjectMacro(TessEvaluationCustomUniforms, vtkUniforms);
184
186
193 virtual void AddVertexShaderReplacement(const std::string& originalValue,
194 bool replaceFirst, // do this replacement before the default
195 const std::string& replacementValue, bool replaceAll) = 0;
196 virtual void AddFragmentShaderReplacement(const std::string& originalValue,
197 bool replaceFirst, // do this replacement before the default
198 const std::string& replacementValue, bool replaceAll) = 0;
199 virtual void AddGeometryShaderReplacement(const std::string& originalValue,
200 bool replaceFirst, // do this replacement before the default
201 const std::string& replacementValue, bool replaceAll) = 0;
202 virtual void AddTessControlShaderReplacement(const std::string& originalValue,
203 bool replaceFirst, // do this replacement before the default
204 const std::string& replacementValue, bool replaceAll) = 0;
205 virtual void AddTessEvaluationShaderReplacement(const std::string& originalValue,
206 bool replaceFirst, // do this replacement before the default
207 const std::string& replacementValue, bool replaceAll) = 0;
209 virtual std::string GetNthShaderReplacementTypeAsString(vtkIdType index) = 0;
210 virtual void GetNthShaderReplacement(vtkIdType index, std::string& name, bool& replaceFirst,
211 std::string& replacementValue, bool& replaceAll) = 0;
213 const std::string& originalValue, bool replaceFirst) = 0;
215 const std::string& originalValue, bool replaceFirst) = 0;
217 const std::string& originalValue, bool replaceFirst) = 0;
219 const std::string& originalValue, bool replaceFirst) = 0;
221 const std::string& originalValue, bool replaceFirst) = 0;
227 virtual void ClearAllShaderReplacements() = 0;
229
230protected:
233
239
245
246private:
247 vtkShaderProperty(const vtkShaderProperty&) = delete;
248 void operator=(const vtkShaderProperty&) = delete;
249};
250
251VTK_ABI_NAMESPACE_END
252#endif
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:160
abstract base class for most VTK objects
Definition vtkObject.h:162
represent GPU shader properties
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