VTK
dox/Rendering/OpenGL/vtkLightingHelper.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkLightingHelper.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00031 #ifndef __vtkLightingHelper_h
00032 #define __vtkLightingHelper_h
00033 
00034 #include "vtkRenderingOpenGLModule.h" // For export macro
00035 #include "vtkObject.h"
00036 #include "vtkShader2.h" // for vtkShader2Type
00037 
00038 class vtkShaderProgram2;
00039 
00040 class VTKRENDERINGOPENGL_EXPORT vtkLightingHelper : public vtkObject
00041 {
00042 public:
00043   static vtkLightingHelper* New();
00044   vtkTypeMacro(vtkLightingHelper, vtkObject);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00047   enum {
00048     VTK_MAX_LIGHTS=8
00049   };
00050 
00052 
00056   void Initialize(vtkShaderProgram2 *shader, vtkShader2Type mode);
00057   vtkGetObjectMacro(Shader, vtkShaderProgram2);
00059 
00061 
00063   void EncodeLightState(){ this->PrepareForRendering(); }
00064   void PrepareForRendering();
00066 
00067 //BTX
00068 protected:
00069   vtkLightingHelper();
00070   ~vtkLightingHelper();
00071 
00072   void SetShader(vtkShaderProgram2 *shader);
00073   vtkShaderProgram2 *Shader;
00074 
00075 private:
00076   vtkLightingHelper(const vtkLightingHelper&); // Not implemented.
00077   void operator=(const vtkLightingHelper&); // Not implemented.
00078 //ETX
00079 };
00080 
00081 #endif