VTK  9.4.20241222
vtkGLSLModifierBase.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
8#ifndef vtkGLSLModifierBase_h
9#define vtkGLSLModifierBase_h
10
11#include "vtkObject.h"
12
13#include "vtkRenderingOpenGL2Module.h" // for export macro
14
15VTK_ABI_NAMESPACE_BEGIN
17class vtkActor;
22
23class VTKRENDERINGOPENGL2_EXPORT vtkGLSLModifierBase : public vtkObject
24{
25public:
27 void PrintSelf(ostream& os, vtkIndent indent) override;
28
30 void SetPrimitiveType(unsigned int primType) { this->PrimitiveType = primType; }
31
33 virtual bool ReplaceShaderValues(vtkOpenGLRenderer* renderer, std::string& vertexShader,
34 std::string& tessControlShader, std::string& tessEvalShader, std::string& geometryShader,
35 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkActor* actor) = 0;
36 virtual bool SetShaderParameters(vtkOpenGLRenderer* renderer, vtkShaderProgram* program,
37 vtkAbstractMapper* mapper, vtkActor* actor, vtkOpenGLVertexArrayObject* VAO = nullptr) = 0;
38
43 virtual bool IsUpToDate(
44 vtkOpenGLRenderer* renderer, vtkAbstractMapper* mapper, vtkActor* actor) = 0;
45
51
52protected:
55
56 unsigned int PrimitiveType = 0;
57
58private:
60 void operator=(const vtkGLSLModifierBase&) = delete;
61};
62
63VTK_ABI_NAMESPACE_END
64#endif
abstract class specifies interface to map data
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
Abstract class that helps you develop modifier for VTK GLSL shaders.
static vtkInformationObjectBaseKey * GLSL_MODIFIERS()
if this key exists on the ShaderMods of vtkDrawTexturedElements, that mod will be applied before rend...
virtual bool SetShaderParameters(vtkOpenGLRenderer *renderer, vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkActor *actor, vtkOpenGLVertexArrayObject *VAO=nullptr)=0
virtual bool ReplaceShaderValues(vtkOpenGLRenderer *renderer, std::string &vertexShader, std::string &tessControlShader, std::string &tessEvalShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkActor *actor)=0
Abstract interfaces to replace shader values and apply parameters as uniform values.
void SetPrimitiveType(unsigned int primType)
The renderer will set primitive type.
~vtkGLSLModifierBase() override
virtual bool IsUpToDate(vtkOpenGLRenderer *renderer, vtkAbstractMapper *mapper, vtkActor *actor)=0
Whether mod needs to be re-applied.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition vtkIndent.h:108
Key for vtkObjectBase values.
abstract base class for most VTK objects
Definition vtkObject.h:162
OpenGL renderer.
The VertexArrayObject class uses, or emulates, vertex array objects.
The ShaderProgram uses one or more Shader objects.