VTK
vtkOpenGLLightMonitor.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOpenGLLightMonitor
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=========================================================================*/
33#ifndef vtkOpenGLLightMonitor_h
34#define vtkOpenGLLightMonitor_h
35
36#include "vtkRenderingOpenGLModule.h" // for export macro
37#include "vtkObject.h"
38
39class VTKRENDERINGOPENGL_EXPORT vtkOpenGLLightMonitor : public vtkObject
40{
41public:
43 static vtkOpenGLLightMonitor *New(int lightId);
45 void PrintSelf(ostream& os, vtkIndent indent);
46
48
52 vtkSetMacro(LightId, int);
53 vtkGetMacro(LightId, int);
55
64
69 void Update();
70
72
75 void SetEnabled(int val);
76 void SetAmbient(float *val);
77 void SetDiffuse(float *val);
78 void SetSpecular(float *val);
79 void SetPosition(float *val);
80 void SetSpotDirection(float *val);
81 void SetSpotExponent(float val);
82 void SetSpotCutoff(float val);
83 void SetAttenuation(float *val);
85
86private:
87 vtkOpenGLLightMonitor(int lightId) : LightId(lightId), UpTime(0)
88 { this->Initialize(); }
89
90 vtkOpenGLLightMonitor() : LightId(0), UpTime(0)
91 { this->Initialize(); }
92
94
95 void Initialize();
96
97private:
98 int LightId;
99 int Enabled;
100 float Ambient[4];
101 float Diffuse[4];
102 float Specular[4];
103 float Position[4];
104 float SpotDirection[3];
105 float SpotExponent;
106 float SpotCutoff;
107 float Attenuation[3];
108 long long UpTime;
109
110private:
111 vtkOpenGLLightMonitor(const vtkOpenGLLightMonitor &) VTK_DELETE_FUNCTION;
112 void operator=(const vtkOpenGLLightMonitor &) VTK_DELETE_FUNCTION;
113};
114
115#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
tracks state of OpenGL model-view and projection matrices.
void SetSpecular(float *val)
void SetAmbient(float *val)
static vtkOpenGLLightMonitor * New()
static vtkOpenGLLightMonitor * New(int lightId)
void SetPosition(float *val)
void Update()
Fetch and save OpenGL light state.
bool StateChanged()
Fetches the current GL state and updates the internal copies of the data.
void SetSpotDirection(float *val)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetSpotExponent(float val)
void SetAttenuation(float *val)
void SetSpotCutoff(float val)
void SetEnabled(int val)
Setters for internal state.
void SetDiffuse(float *val)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.