VTK  9.6.20260201
vtkOpenGLShaderProperty.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
17
18#ifndef vtkOpenGLShaderProperty_h
19#define vtkOpenGLShaderProperty_h
20
21#include "vtkRenderingOpenGL2Module.h" // For export macro
22#include "vtkShader.h" // For methods (shader types)
23#include "vtkShaderProperty.h"
24#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25#include <map> // used for ivar
26
27VTK_ABI_NAMESPACE_BEGIN
30
31class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLShaderProperty : public vtkShaderProperty
32{
33public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
44
45 void AddVertexShaderReplacement(const std::string& originalValue,
46 bool replaceFirst, // do this replacement before the default
47 const std::string& replacementValue, bool replaceAll) override;
48 void AddFragmentShaderReplacement(const std::string& originalValue,
49 bool replaceFirst, // do this replacement before the default
50 const std::string& replacementValue, bool replaceAll) override;
51 void AddGeometryShaderReplacement(const std::string& originalValue,
52 bool replaceFirst, // do this replacement before the default
53 const std::string& replacementValue, bool replaceAll) override;
54 void AddTessControlShaderReplacement(const std::string& originalValue,
55 bool replaceFirst, // do this replacement before the default
56 const std::string& replacementValue, bool replaceAll) override;
57 void AddTessEvaluationShaderReplacement(const std::string& originalValue,
58 bool replaceFirst, // do this replacement before the default
59 const std::string& replacementValue, bool replaceAll) override;
60
63 void GetNthShaderReplacement(vtkIdType index, std::string& name, bool& replaceFirst,
64 std::string& replacementValue, bool& replaceAll) override;
65
66 void ClearVertexShaderReplacement(const std::string& originalValue, bool replaceFirst) override;
67 void ClearFragmentShaderReplacement(const std::string& originalValue, bool replaceFirst) override;
68 void ClearGeometryShaderReplacement(const std::string& originalValue, bool replaceFirst) override;
70 const std::string& originalValue, bool replaceFirst) override;
72 const std::string& originalValue, bool replaceFirst) override;
79
81
88 void AddShaderReplacement(vtkShader::Type shaderType, // vertex, fragment, etc
89 const std::string& originalValue,
90 bool replaceFirst, // do this replacement before the default
91 const std::string& replacementValue, bool replaceAll);
92 void ClearShaderReplacement(vtkShader::Type shaderType, // vertex, fragment, etc
93 const std::string& originalValue, bool replaceFirst);
96
97 typedef std::map<vtkShader::ReplacementSpec, vtkShader::ReplacementValue> ReplacementMap;
105
106protected:
109
111
112private:
114 void operator=(const vtkOpenGLShaderProperty&) = delete;
115};
116
117#define vtkOpenGLShaderProperty_OVERRIDE_ATTRIBUTES \
118 vtkOpenGLShaderProperty::CreateOverrideAttributes()
119VTK_ABI_NAMESPACE_END
120#endif
a simple class to control print indentation
Definition vtkIndent.h:108
void ClearVertexShaderReplacement(const std::string &originalValue, bool replaceFirst) override
This function enables you to apply your own substitutions to the shader creation process.
void DeepCopy(vtkOpenGLShaderProperty *p)
Assign one property to another.
void GetNthShaderReplacement(vtkIdType index, std::string &name, bool &replaceFirst, std::string &replacementValue, bool &replaceAll) override
This function enables you to apply your own substitutions to the shader creation process.
void ClearAllTessEvalShaderReplacements() override
This function enables you to apply your own substitutions to the shader creation process.
void ClearShaderReplacement(vtkShader::Type shaderType, const std::string &originalValue, bool replaceFirst)
This function enables you to apply your own substitutions to the shader creation process.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const ReplacementMap & GetAllShaderReplacements()
GetAllShaderReplacements returns all user-specified shader replacements.
void AddShaderReplacement(vtkShader::Type shaderType, const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll)
This function enables you to apply your own substitutions to the shader creation process.
void AddVertexShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll) override
This function enables you to apply your own substitutions to the shader creation process.
void ClearAllFragmentShaderReplacements() override
This function enables you to apply your own substitutions to the shader creation process.
void ClearTessEvaluationShaderReplacement(const std::string &originalValue, bool replaceFirst) override
This function enables you to apply your own substitutions to the shader creation process.
void ClearGeometryShaderReplacement(const std::string &originalValue, bool replaceFirst) override
This function enables you to apply your own substitutions to the shader creation process.
void AddFragmentShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll) override
This function enables you to apply your own substitutions to the shader creation process.
std::string GetNthShaderReplacementTypeAsString(vtkIdType index) override
This function enables you to apply your own substitutions to the shader creation process.
std::map< vtkShader::ReplacementSpec, vtkShader::ReplacementValue > ReplacementMap
void ClearTessControlShaderReplacement(const std::string &originalValue, bool replaceFirst) override
This function enables you to apply your own substitutions to the shader creation process.
void ClearAllVertexShaderReplacements() override
This function enables you to apply your own substitutions to the shader creation process.
static vtkOverrideAttribute * CreateOverrideAttributes()
void ClearFragmentShaderReplacement(const std::string &originalValue, bool replaceFirst) override
This function enables you to apply your own substitutions to the shader creation process.
void ClearAllShaderReplacements() override
This function enables you to apply your own substitutions to the shader creation process.
void AddGeometryShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll) override
This function enables you to apply your own substitutions to the shader creation process.
~vtkOpenGLShaderProperty() override
static vtkOpenGLShaderProperty * New()
void ClearAllTessControlShaderReplacements() override
This function enables you to apply your own substitutions to the shader creation process.
void ClearAllGeometryShaderReplacements() override
This function enables you to apply your own substitutions to the shader creation process.
int GetNumberOfShaderReplacements() override
This function enables you to apply your own substitutions to the shader creation process.
void ClearAllShaderReplacements(vtkShader::Type shaderType)
This function enables you to apply your own substitutions to the shader creation process.
void AddTessEvaluationShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll) override
This function enables you to apply your own substitutions to the shader creation process.
void AddTessControlShaderReplacement(const std::string &originalValue, bool replaceFirst, const std::string &replacementValue, bool replaceAll) override
This function enables you to apply your own substitutions to the shader creation process.
helper class to set custom uniform variables in GLSL shaders.
Attribute for vtkObjectFactory overrides.
Type
Available shader types.
Definition vtkShader.h:128
int vtkIdType
Definition vtkType.h:354
#define VTK_MARSHALAUTO
#define VTK_NEWINSTANCE