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