VTK  9.4.20241103
vtkGLSLModPixelDebugger.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
61#ifndef vtkGLSLModPixelDebugger_h
62#define vtkGLSLModPixelDebugger_h
63
64#include "vtkGLSLModifierBase.h"
65
66#include "vtkOpenGLRenderer.h" // for ivar
67#include "vtkRenderingOpenGL2Module.h" // for export macro
68#include "vtkStringToken.h" // for ivar
69
70VTK_ABI_NAMESPACE_BEGIN
71class vtkActor;
74
75class VTKRENDERINGOPENGL2_EXPORT vtkGLSLModPixelDebugger : public vtkGLSLModifierBase
76{
77public:
80 void PrintSelf(ostream& os, vtkIndent indent) override;
81
84 inline void SetSubstitutionJSONFileName(const std::string& filename)
85 {
86 this->SubstitutionJSONFileName = filename;
87 }
88
89 // vtkGLSLModifierBase virtuals:
90 bool ReplaceShaderValues(vtkOpenGLRenderer* renderer, std::string& vertexShader,
91 std::string& tessControlShader, std::string& tessEvalShader, std::string& geometryShader,
92 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkActor* actor) override;
94 vtkAbstractMapper* mapper, vtkActor* actor, vtkOpenGLVertexArrayObject* VAO = nullptr) override;
95 bool IsUpToDate(vtkOpenGLRenderer* vtkNotUsed(renderer), vtkAbstractMapper* vtkNotUsed(mapper),
96 vtkActor* vtkNotUsed(actor)) override
97 {
98 return this->HashSubstitutionJSONFileContents() ==
99 this->LastSubstitutionJSONFileContentsToken &&
100 this->HashGLSLFilesContents() == this->LastGLSLFilesContentsToken;
101 }
102
103protected:
106
108
111
114
115private:
117 void operator=(const vtkGLSLModPixelDebugger&) = delete;
118};
119
120VTK_ABI_NAMESPACE_END
121#endif
abstract class specifies interface to map data
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
Allow live pixel debugging by overwriting gl_FragData[0] output.
vtkStringToken HashGLSLFilesContents()
bool IsUpToDate(vtkOpenGLRenderer *vtkNotUsed(renderer), vtkAbstractMapper *vtkNotUsed(mapper), vtkActor *vtkNotUsed(actor)) override
static vtkGLSLModPixelDebugger * New()
bool SetShaderParameters(vtkOpenGLRenderer *renderer, vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkActor *actor, vtkOpenGLVertexArrayObject *VAO=nullptr) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkGLSLModPixelDebugger() override
bool ReplaceShaderValues(vtkOpenGLRenderer *renderer, std::string &vertexShader, std::string &tessControlShader, std::string &tessEvalShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkActor *actor) override
Abstract interfaces to replace shader values and apply parameters as uniform values.
vtkStringToken HashSubstitutionJSONFileContents()
vtkStringToken LastSubstitutionJSONFileContentsToken
void SetSubstitutionJSONFileName(const std::string &filename)
Set this to a json file on your file system.
Abstract class that helps you develop modifier for VTK GLSL shaders.
a simple class to control print indentation
Definition vtkIndent.h:108
Key for vtkObjectBase values.
OpenGL renderer.
The VertexArrayObject class uses, or emulates, vertex array objects.
The ShaderProgram uses one or more Shader objects.
Represent a string by its integer hash.