VTK  9.7.1
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 
15 VTK_ABI_NAMESPACE_BEGIN
16 class vtkAbstractMapper;
17 class vtkActor;
20 class vtkOpenGLRenderer;
21 class vtkShaderProgram;
22 
23 class VTKRENDERINGOPENGL2_EXPORT vtkGLSLModifierBase : public vtkObject
24 {
25 public:
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  static vtkInformationObjectBaseKey* GLSL_MODIFIERS();
52 
53 protected:
55  ~vtkGLSLModifierBase() override;
56 
57  unsigned int PrimitiveType = 0;
58 
59 private:
61  void operator=(const vtkGLSLModifierBase&) = delete;
62 };
63 
64 VTK_ABI_NAMESPACE_END
65 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:28
The VertexArrayObject class uses, or emulates, vertex array objects.
Key for vtkObjectBase values.
abstract class specifies interface to map data
void SetPrimitiveType(unsigned int primType)
The renderer will set primitive type.
Abstract class that helps you develop modifier for VTK GLSL shaders.
OpenGL renderer.
The ShaderProgram uses one or more Shader objects.