VTK  9.6.1
vtkValuePass.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
33#ifndef vtkValuePass_h
34#define vtkValuePass_h
35
36#include "vtkOpenGLRenderPass.h"
37#include "vtkRenderingOpenGL2Module.h" // For export macro
38#include "vtkSmartPointer.h" //for ivar
39#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
40
41VTK_ABI_NAMESPACE_BEGIN
43class vtkActor;
44class vtkDataArray;
45class vtkDataObject;
46class vtkFloatArray;
47class vtkMapper;
49class vtkProperty;
50class vtkRenderer;
51class vtkRenderWindow;
53
54class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkValuePass : public vtkOpenGLRenderPass
55{
56public:
57 enum Mode
58 {
61 };
62
63 static vtkValuePass* New();
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
67 void SetInputArrayToProcess(int fieldAssociation, const char* name);
68 void SetInputArrayToProcess(int fieldAssociation, int fieldId);
69 void SetInputComponentToProcess(int component);
70
75 void Render(const vtkRenderState* s) override;
76
83
89 void GetFloatImageData(int format, int width, int height, void* data);
90
96
98
99protected:
101 ~vtkValuePass() override;
102
104
107
113 bool PostReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
114 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop) override;
120 vtkOpenGLVertexArrayObject* VAO = nullptr) override;
130
136
140 void EndPass();
141
147
152
157
162 void BeginMapperRender(vtkMapper* mapper, vtkDataArray* dataArray, vtkProperty* property);
163
167 void EndMapperRender(vtkMapper* mapper, vtkProperty* property);
168
170
174 bool UpdateShaders(std::string& VSSource, std::string& FSSource);
175
181
183
190
191 class vtkInternalsFloat;
192 vtkInternalsFloat* ImplFloat;
193
194 class vtkInternalsInvertible;
195 vtkInternalsInvertible* ImplInv;
196
197 struct Parameters;
198 Parameters* PassState;
199
201
202private:
203 vtkDataArray* GetCurrentArray(vtkMapper* mapper, Parameters* arrayPar);
204
205 vtkAbstractArray* GetArrayFromCompositeData(vtkMapper* mapper, Parameters* arrayPar);
206
207 vtkSmartPointer<vtkAbstractArray> MultiBlocksArray;
208
209 void PopulateCellCellMap(const vtkRenderState* s);
210
211 vtkValuePass(const vtkValuePass&) = delete;
212 void operator=(const vtkValuePass&) = delete;
213};
214
215VTK_ABI_NAMESPACE_END
216#endif
Abstract superclass for all arrays.
abstract class specifies interface to map data
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
general representation of visualization data
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:29
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:79
The VertexArrayObject class uses, or emulates, vertex array objects.
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:50
represent surface properties of a geometric object
Definition vtkProperty.h:60
Context in which a vtkRenderPass will render.
create a window for renderers to draw into
abstract specification for renderers
Definition vtkRenderer.h:64
The ShaderProgram uses one or more Shader objects.
Hold a reference to a vtkObjectBase instance.
void ReleaseGraphicsResources(vtkWindow *win) override
Release graphics resources and ask components to release their own resources.
void BindUniforms(vtkShaderProgram *prog)
void ReleaseFBO(vtkWindow *win)
Methods managing graphics resources required during FLOATING_POINT mode.
void RenderOpaqueGeometry(const vtkRenderState *s)
Opaque pass with key checking.
bool InitializeFBO(vtkRenderer *ren)
Methods managing graphics resources required during FLOATING_POINT mode.
void RenderPieceFinish()
Unbind textures, etc.
void BindAttributes(vtkShaderProgram *prog, vtkOpenGLVertexArrayObject *VAO)
Bind shader variables.
bool HasWindowSizeChanged(vtkRenderer *ren)
Methods managing graphics resources required during FLOATING_POINT mode.
static vtkValuePass * New()
void RenderPieceStart(vtkDataArray *dataArr, vtkMapper *m)
Upload new data if necessary, bind textures, etc.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InitializeBuffers(vtkRenderer *ren)
void EndPass()
Unbinds internal FBO when FLOATING_POINT mode is enabled.
bool PostReplaceShaderValues(std::string &vertexShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkProp *prop) override
vtkOpenGLRenderPass API.
void Render(const vtkRenderState *s) override
Perform rendering according to a render state s.
void GetFloatImageData(int format, int width, int height, void *data)
Interface to get the rendered image in FLOATING_POINT mode.
int * GetFloatImageExtents()
Interface to get the rendered image in FLOATING_POINT mode.
bool SetShaderParameters(vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkProp *prop, vtkOpenGLVertexArrayObject *VAO=nullptr) override
Update the uniforms of the shader program.
vtkInternalsFloat * ImplFloat
void EndMapperRender(vtkMapper *mapper, vtkProperty *property)
Revert any changes made in BeginMapperRender.
vtkFloatArray * GetFloatImageDataArray(vtkRenderer *ren)
Interface to get the rendered image in FLOATING_POINT mode.
bool UpdateShaders(std::string &VSSource, std::string &FSSource)
Add necessary shader definitions.
void SetInputArrayToProcess(int fieldAssociation, int fieldId)
~vtkValuePass() override
void SetInputArrayToProcess(int fieldAssociation, const char *name)
void BeginPass(vtkRenderer *ren)
Manages graphics resources depending on the rendering mode.
vtkInternalsInvertible * ImplInv
Parameters * PassState
void BeginMapperRender(vtkMapper *mapper, vtkDataArray *dataArray, vtkProperty *property)
Setup the mapper state, buffer objects or property variables necessary to render the active rendering...
vtkMTimeType GetShaderStageMTime() override
For multi-stage render passes that need to change shader code during a single pass,...
void SetInputComponentToProcess(int component)
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
#define vtkDataArray
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:323
#define VTK_MARSHALAUTO