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=========================================================================*/
42#ifndef vtkValuePass_h
43#define vtkValuePass_h
44
45#include "vtkOpenGLRenderPass.h"
46#include "vtkRenderingOpenGL2Module.h" // For export macro
47#include "vtkSmartPointer.h" //for ivar
48
50class vtkActor;
51class vtkDataArray;
52class vtkDataObject;
53class vtkFloatArray;
54class vtkMapper;
56class vtkProperty;
57class vtkRenderer;
58class vtkRenderWindow;
60
61class VTKRENDERINGOPENGL2_EXPORT vtkValuePass : public vtkOpenGLRenderPass
62{
63public:
64 enum Mode
65 {
66 INVERTIBLE_LUT = 1,
67 FLOATING_POINT = 2
68 };
69
70 static vtkValuePass* New();
72 void PrintSelf(ostream& os, vtkIndent indent) override;
73
74 void SetInputArrayToProcess(int fieldAssociation, const char* name);
75 void SetInputArrayToProcess(int fieldAssociation, int fieldId);
76 void SetInputComponentToProcess(int component);
77
82 void Render(const vtkRenderState* s) override;
83
90
96 void GetFloatImageData(int const format, int const width, int const height, void* data);
97
103
105
106protected:
108 ~vtkValuePass() override;
109
111
120 bool PostReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
121 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop) override;
127 vtkOpenGLVertexArrayObject* VAO = nullptr) override;
137
143
147 void EndPass();
148
154
159
164
169 void BeginMapperRender(vtkMapper* mapper, vtkDataArray* dataArray, vtkProperty* property);
170
174 void EndMapperRender(vtkMapper* mapper, vtkProperty* property);
175
177
181 bool UpdateShaders(std::string& VSSource, std::string& FSSource);
182
188
190
197
198 class vtkInternalsFloat;
199 vtkInternalsFloat* ImplFloat;
200
201 class vtkInternalsInvertible;
202 vtkInternalsInvertible* ImplInv;
203
204 struct Parameters;
205 Parameters* PassState;
206
208
209private:
210 vtkDataArray* GetCurrentArray(vtkMapper* mapper, Parameters* arrayPar);
211
212 vtkAbstractArray* GetArrayFromCompositeData(vtkMapper* mapper, Parameters* arrayPar);
213
214 vtkSmartPointer<vtkAbstractArray> MultiBlocksArray;
215
216 void PopulateCellCellMap(const vtkRenderState* s);
217
218 vtkValuePass(const vtkValuePass&) = delete;
219 void operator=(const vtkValuePass&) = delete;
220};
221
222#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:46
abstract superclass for arrays of numeric data
general representation of visualization data
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:34
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:82
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:51
represent surface properties of a geometric object
Definition vtkProperty.h:62
Context in which a vtkRenderPass will render.
create a window for renderers to draw into
abstract specification for renderers
Definition vtkRenderer.h:67
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.
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
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
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:39
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287