VTK  9.2.6
vtkValuePass.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkValuePass.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
45#ifndef vtkValuePass_h
46#define vtkValuePass_h
47
48#include "vtkOpenGLRenderPass.h"
49#include "vtkRenderingOpenGL2Module.h" // For export macro
50#include "vtkSmartPointer.h" //for ivar
51
53class vtkActor;
54class vtkDataArray;
55class vtkDataObject;
56class vtkFloatArray;
57class vtkMapper;
59class vtkProperty;
60class vtkRenderer;
61class vtkRenderWindow;
63
64class VTKRENDERINGOPENGL2_EXPORT vtkValuePass : public vtkOpenGLRenderPass
65{
66public:
67 enum Mode
68 {
69 INVERTIBLE_LUT = 1,
70 FLOATING_POINT = 2
71 };
72
73 static vtkValuePass* New();
75 void PrintSelf(ostream& os, vtkIndent indent) override;
76
77 void SetInputArrayToProcess(int fieldAssociation, const char* name);
78 void SetInputArrayToProcess(int fieldAssociation, int fieldId);
79 void SetInputComponentToProcess(int component);
80
85 void Render(const vtkRenderState* s) override;
86
93
99 void GetFloatImageData(int const format, int const width, int const height, void* data);
100
106
108
109protected:
111 ~vtkValuePass() override;
112
114
123 bool PostReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
124 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop) override;
130 vtkOpenGLVertexArrayObject* VAO = nullptr) override;
140
146
150 void EndPass();
151
157
162
167
172 void BeginMapperRender(vtkMapper* mapper, vtkDataArray* dataArray, vtkProperty* property);
173
177 void EndMapperRender(vtkMapper* mapper, vtkProperty* property);
178
180
184 bool UpdateShaders(std::string& VSSource, std::string& FSSource);
185
191
193
200
201 class vtkInternalsFloat;
202 vtkInternalsFloat* ImplFloat;
203
204 class vtkInternalsInvertible;
205 vtkInternalsInvertible* ImplInv;
206
207 struct Parameters;
208 Parameters* PassState;
209
211
212private:
213 vtkDataArray* GetCurrentArray(vtkMapper* mapper, Parameters* arrayPar);
214
215 vtkAbstractArray* GetArrayFromCompositeData(vtkMapper* mapper, Parameters* arrayPar);
216
217 vtkSmartPointer<vtkAbstractArray> MultiBlocksArray;
218
219 void PopulateCellCellMap(const vtkRenderState* s);
220
221 vtkValuePass(const vtkValuePass&) = delete;
222 void operator=(const vtkValuePass&) = delete;
223};
224
225#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:52
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:56
general representation of visualization data
Definition: vtkDataObject.h:66
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:88
Abstract render pass with shader modifications.
The VertexArrayObject class uses, or emulates, vertex array objects.
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
represent surface properties of a geometric object
Definition: vtkProperty.h:68
Context in which a vtkRenderPass will render.
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:73
The ShaderProgram uses one or more Shader objects.
Hold a reference to a vtkObjectBase instance.
Renders geometry using the values of a field array as fragment colors.
Definition: vtkValuePass.h:65
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.
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
Definition: vtkValuePass.h:202
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 GetFloatImageData(int const format, int const width, int const height, void *data)
Interface to get the rendered image in FLOATING_POINT mode.
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
Definition: vtkValuePass.h:205
Parameters * PassState
Definition: vtkValuePass.h:208
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:39
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287