VTK
vtkLightingHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLightingHelper.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 =========================================================================*/
32 #ifndef vtkLightingHelper_h
33 #define vtkLightingHelper_h
34 
35 #include "vtkRenderingOpenGLModule.h" // For export macro
36 #include "vtkObject.h"
37 #include "vtkShader2.h" // for vtkShader2Type
38 
39 class vtkShaderProgram2;
40 
41 class VTKRENDERINGOPENGL_EXPORT vtkLightingHelper : public vtkObject
42 {
43 public:
44  static vtkLightingHelper* New();
45  vtkTypeMacro(vtkLightingHelper, vtkObject);
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
48  enum {
49  VTK_MAX_LIGHTS=8
50  };
51 
53 
59  void Initialize(vtkShaderProgram2 *shader, vtkShader2Type mode);
60  vtkGetObjectMacro(Shader, vtkShaderProgram2);
62 
66  void EncodeLightState(){ this->PrepareForRendering(); }
67  void PrepareForRendering();
68 
69 protected:
72 
73  void SetShader(vtkShaderProgram2 *shader);
75 
76 private:
77  vtkLightingHelper(const vtkLightingHelper&) VTK_DELETE_FUNCTION;
78  void operator=(const vtkLightingHelper&) VTK_DELETE_FUNCTION;
79 
80 };
81 
82 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkShader2Type
Definition: vtkShader2.h:50
helper to assist in simulating lighting similar to default OpenGL pipeline.
GLSL Program.
a simple class to control print indentation
Definition: vtkIndent.h:39
void EncodeLightState()
Encodes light state in diffuse component 3, where the shader looks for it.
vtkShaderProgram2 * Shader
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...