VTK  9.3.20240712
vtkGLSLModCamera.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
11#ifndef vtkGLSLModCamera_h
12#define vtkGLSLModCamera_h
13
14#include "vtkGLSLModifierBase.h"
15
16#include "vtkMatrix3x3.h" // for ivar
17#include "vtkMatrix4x4.h" // for ivar
18#include "vtkRenderingOpenGL2Module.h" // for export macro
19#include "vtkSmartPointer.h" // for ivar
20
21#include <array> // for array
22
23VTK_ABI_NAMESPACE_BEGIN
24class vtkActor;
26
27class VTKRENDERINGOPENGL2_EXPORT vtkGLSLModCamera : public vtkGLSLModifierBase
28{
29public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
34 void EnableShiftScale(bool coordShiftAndScaleInUse, vtkMatrix4x4* ssMatrix);
36
37 // vtkGLSLModifierBase virtuals:
38 bool ReplaceShaderValues(vtkOpenGLRenderer* renderer, std::string& vertexShader,
39 std::string& tessControlShader, std::string& tessEvalShader, std::string& geometryShader,
40 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkActor* actor) override;
42 vtkAbstractMapper* mapper, vtkActor* actor, vtkOpenGLVertexArrayObject* VAO = nullptr) override;
43
44 bool IsUpToDate(vtkOpenGLRenderer* vtkNotUsed(renderer), vtkAbstractMapper* vtkNotUsed(mapper),
45 vtkActor* vtkNotUsed(actor)) override
46 {
47 // no replacements which depend upon any of renderer/mapper/actor were performed.
48 // shader is always up-to-date, as far as this mod is concerned.
49 return true;
50 }
51
52protected:
55
58
62
63private:
64 vtkGLSLModCamera(const vtkGLSLModCamera&) = delete;
65 void operator=(const vtkGLSLModCamera&) = delete;
66};
67
68VTK_ABI_NAMESPACE_END
69#endif
abstract class specifies interface to map data
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
Implement model-view-projection transforms in the OpenGL renderer.
bool IsUpToDate(vtkOpenGLRenderer *vtkNotUsed(renderer), vtkAbstractMapper *vtkNotUsed(mapper), vtkActor *vtkNotUsed(actor)) override
vtkNew< vtkMatrix3x3 > TempMatrix3
~vtkGLSLModCamera() override
bool SetShaderParameters(vtkOpenGLRenderer *renderer, vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkActor *actor, vtkOpenGLVertexArrayObject *VAO=nullptr) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void DisableShiftScale()
void EnableShiftScale(bool coordShiftAndScaleInUse, vtkMatrix4x4 *ssMatrix)
vtkNew< vtkMatrix4x4 > TempMatrix4
static vtkGLSLModCamera * New()
bool ReplaceShaderValues(vtkOpenGLRenderer *renderer, std::string &vertexShader, std::string &tessControlShader, std::string &tessEvalShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkActor *actor) override
Abstract interfaces to replace shader values and apply parameters as uniform values.
vtkSmartPointer< vtkMatrix4x4 > SSMatrix
Abstract class that helps you develop modifier for VTK GLSL shaders.
a simple class to control print indentation
Definition vtkIndent.h:108
Key for vtkObjectBase values.
represent and manipulate 4x4 transformation matrices
Allocate and hold a VTK object.
Definition vtkNew.h:160
OpenGL renderer.
The VertexArrayObject class uses, or emulates, vertex array objects.
The ShaderProgram uses one or more Shader objects.
Hold a reference to a vtkObjectBase instance.