VTK  9.7.1
vtkOpenGLRenderPass.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
3 
12 #ifndef vtkOpenGLRenderPass_h
13 #define vtkOpenGLRenderPass_h
14 
15 #include "vtkRenderPass.h"
16 #include "vtkRenderingOpenGL2Module.h" // For export macro
17 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
18 
19 #include <string> // For std::string
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkAbstractMapper;
24 class vtkProp;
25 class vtkShaderProgram;
27 
28 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLRenderPass : public vtkRenderPass
29 {
30 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
35 
40  virtual bool PreReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
41  std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop);
42  virtual bool PostReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
43  std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop);
45 
50  virtual bool SetShaderParameters(vtkShaderProgram* program, vtkAbstractMapper* mapper,
51  vtkProp* prop, vtkOpenGLVertexArrayObject* VAO = nullptr);
52 
60  virtual vtkMTimeType GetShaderStageMTime();
61 
66  static vtkInformationObjectBaseVectorKey* RenderPasses();
67 
71  vtkSetMacro(ActiveDrawBuffers, unsigned int);
72  vtkGetMacro(ActiveDrawBuffers, unsigned int);
73 
74 protected:
76  ~vtkOpenGLRenderPass() override;
77 
81  void PreRender(const vtkRenderState* s);
82 
87  virtual void PreRenderProp(vtkProp* prop);
88 
92  void PostRender(const vtkRenderState* s);
93 
98  virtual void PostRenderProp(vtkProp* prop);
99 
100  unsigned int ActiveDrawBuffers = 0;
101 
102 private:
103  vtkOpenGLRenderPass(const vtkOpenGLRenderPass&) = delete;
104  void operator=(const vtkOpenGLRenderPass&) = delete;
105 };
106 
107 VTK_ABI_NAMESPACE_END
108 #endif // vtkOpenGLRenderPass_h
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
Context in which a vtkRenderPass will render.
a simple class to control print indentation
Definition: vtkIndent.h:28
The VertexArrayObject class uses, or emulates, vertex array objects.
Key for vtkObjectBase vector values.
abstract class specifies interface to map data
#define VTK_MARSHALAUTO
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:49
Abstract render pass with shader modifications.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
The ShaderProgram uses one or more Shader objects.