forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkExternalLight.cxx
151 lines (128 loc) · 5.35 KB
/
vtkExternalLight.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*=========================================================================
Program: Visualization Toolkit
Module: vtkExternalLight.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkExternalLight.h"
#include "vtkObjectFactory.h"
#include "vtkOpenGL.h"
//-----------------------------------------------------------------------------
vtkStandardNewMacro(vtkExternalLight);
//-----------------------------------------------------------------------------
vtkExternalLight::vtkExternalLight()
{
this->LightIndex = GL_LIGHT0;
this->ReplaceMode = INDIVIDUAL_PARAMS;
// By default, nothing is set by user
this->PositionSet = false;
this->FocalPointSet = false;
this->AmbientColorSet = false;
this->DiffuseColorSet = false;
this->SpecularColorSet = false;
this->IntensitySet = false;
this->ConeAngleSet = false;
this->AttenuationValuesSet = false;
this->ExponentSet = false;
this->PositionalSet = false;
// Set the default light type to headlight
this->LightType = VTK_LIGHT_TYPE_HEADLIGHT;
}
//-----------------------------------------------------------------------------
vtkExternalLight::~vtkExternalLight()
{
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetPosition(double position1,
double position2,
double position3)
{
this->Superclass::SetPosition(position1, position2, position3);
this->PositionSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetFocalPoint(double focalpoint1,
double focalpoint2,
double focalpoint3)
{
this->Superclass::SetFocalPoint(focalpoint1, focalpoint2, focalpoint3);
this->FocalPointSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetAmbientColor(double color1,
double color2,
double color3)
{
this->Superclass::SetAmbientColor(color1, color2, color3);
this->AmbientColorSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetDiffuseColor(double color1,
double color2,
double color3)
{
this->Superclass::SetDiffuseColor(color1, color2, color3);
this->DiffuseColorSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetSpecularColor(double color1,
double color2,
double color3)
{
this->Superclass::SetSpecularColor(color1, color2, color3);
this->SpecularColorSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetIntensity(double intensity)
{
this->Superclass::SetIntensity(intensity);
this->IntensitySet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetConeAngle(double angle)
{
this->Superclass::SetConeAngle(angle);
this->ConeAngleSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetAttenuationValues(double value1,
double value2,
double value3)
{
this->Superclass::SetAttenuationValues(value1, value2, value3);
this->AttenuationValuesSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetExponent(double exp)
{
this->Superclass::SetExponent(exp);
this->ExponentSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::SetPositional(int p)
{
this->Superclass::SetPositional(p);
this->PositionalSet = true;
}
//-----------------------------------------------------------------------------
void vtkExternalLight::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "LightIndex: " << this->LightIndex << "\n";
os << indent << "ReplaceMode: " << this->ReplaceMode << "\n";
os << indent << "PositionSet: " << this->PositionSet << "\n";
os << indent << "FocalPointSet: " << this->FocalPointSet << "\n";
os << indent << "AmbientColorSet: " << this->AmbientColorSet << "\n";
os << indent << "DiffuseColorSet: " << this->DiffuseColorSet << "\n";
os << indent << "SpecularColorSet: " << this->SpecularColorSet << "\n";
os << indent << "IntensitySet: " << this->IntensitySet << "\n";
os << indent << "ConeAngleSet: " << this->ConeAngleSet << "\n";
os << indent << "AttenuationValuesSet: " <<
this->AttenuationValuesSet << "\n";
os << indent << "ExponentSet: " << this->ExponentSet << "\n";
os << indent << "PositionalSet: " << this->PositionalSet << "\n";
}