00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00046
#ifndef __vtkLight_h
00047
#define __vtkLight_h
00048
00049
#include "vtkObject.h"
00050
00051
00052
class vtkRenderer;
00053
class vtkMatrix4x4;
00054
00055 #define VTK_LIGHT_TYPE_HEADLIGHT 1
00056 #define VTK_LIGHT_TYPE_CAMERA_LIGHT 2
00057 #define VTK_LIGHT_TYPE_SCENE_LIGHT 3
00058
00059 class VTK_RENDERING_EXPORT vtkLight :
public vtkObject
00060 {
00061
public:
00062 vtkTypeRevisionMacro(vtkLight,
vtkObject);
00063
void PrintSelf(ostream& os,
vtkIndent indent);
00064
00068
static vtkLight *
New();
00069
00074 virtual void Render(
vtkRenderer *,
int) {};
00075
00077
00081 vtkSetVector3Macro(AmbientColor,
double);
00082 vtkGetVectorMacro(AmbientColor,
double,3);
00083 vtkSetVector3Macro(DiffuseColor,
double);
00084 vtkGetVectorMacro(DiffuseColor,
double,3);
00085 vtkSetVector3Macro(SpecularColor,
double);
00086 vtkGetVectorMacro(SpecularColor,
double,3);
00087
void SetColor(
double,
double,
double);
00088 void SetColor(
double a[3]) { this->SetColor(a[0], a[1], a[2]); }
00089
void GetColor(
double rgb[3]);
00090
double *GetColor();
00092
00094
00098 vtkSetVector3Macro(Position,
double);
00099 vtkGetVectorMacro(Position,
double,3);
00100 void SetPosition(
float *a) {this->SetPosition(a[0],a[1],a[2]);};
00102
00104
00109 vtkSetVector3Macro(FocalPoint,
double);
00110 vtkGetVectorMacro(FocalPoint,
double,3);
00111 void SetFocalPoint(
float *a) {this->SetFocalPoint(a[0],a[1],a[2]);};
00113
00115
00116 vtkSetMacro(Intensity,
double);
00117 vtkGetMacro(Intensity,
double);
00119
00121
00122 vtkSetMacro(Switch,
int);
00123 vtkGetMacro(Switch,
int);
00124 vtkBooleanMacro(Switch,
int);
00126
00128
00129 vtkSetMacro(Positional,
int);
00130 vtkGetMacro(Positional,
int);
00131 vtkBooleanMacro(Positional,
int);
00133
00135
00136 vtkSetMacro(Exponent,
double);
00137 vtkGetMacro(Exponent,
double);
00139
00141
00144 vtkSetMacro(ConeAngle,
double);
00145 vtkGetMacro(ConeAngle,
double);
00147
00149
00151 vtkSetVector3Macro(AttenuationValues,
double);
00152 vtkGetVectorMacro(AttenuationValues,
double,3);
00154
00156
00159
virtual void SetTransformMatrix(
vtkMatrix4x4*);
00160 vtkGetObjectMacro(TransformMatrix,
vtkMatrix4x4);
00162
00164
00166
void GetTransformedPosition(
double &a0,
double &a1,
double &a2);
00167
void GetTransformedPosition(
double a[3]);
00168
double *GetTransformedPosition();
00170
00172
00174
void GetTransformedFocalPoint(
double &a0,
double &a1,
double &a2);
00175
void GetTransformedFocalPoint(
double a[3]);
00176
double *GetTransformedFocalPoint();
00178
00180
00184
void SetDirectionAngle(
double elevation,
double azimuth);
00185 void SetDirectionAngle(
double ang[2]) {
00186 this->SetDirectionAngle(ang[0], ang[1]); };
00188
00190
void DeepCopy(vtkLight *light);
00191
00193
00204 vtkSetMacro(LightType,
int);
00205 vtkGetMacro(LightType,
int);
00206 void SetLightTypeToHeadlight()
00207 {this->SetLightType(
VTK_LIGHT_TYPE_HEADLIGHT);}
00208 void SetLightTypeToSceneLight()
00209 {
00210 this->SetTransformMatrix(NULL);
00211 this->SetLightType(
VTK_LIGHT_TYPE_SCENE_LIGHT);
00212 }
00213 void SetLightTypeToCameraLight()
00214 {this->SetLightType(
VTK_LIGHT_TYPE_CAMERA_LIGHT);}
00216
00218
00219
int LightTypeIsHeadlight();
00220
int LightTypeIsSceneLight();
00221
int LightTypeIsCameraLight();
00223
00224
void ReadSelf(istream& is);
00225
void WriteSelf(ostream& os);
00226
00227
protected:
00228 vtkLight();
00229 ~vtkLight();
00230
00231 double FocalPoint[3];
00232 double Position[3];
00233 double Intensity;
00234 double AmbientColor[3];
00235 double DiffuseColor[3];
00236 double SpecularColor[3];
00237 int Switch;
00238 int Positional;
00239 double Exponent;
00240 double ConeAngle;
00241 double AttenuationValues[3];
00242 vtkMatrix4x4 *TransformMatrix;
00243 double TransformedFocalPointReturn[3];
00244 double TransformedPositionReturn[3];
00245 int LightType;
00246
00247
private:
00248 vtkLight(
const vtkLight&);
00249
void operator=(
const vtkLight&);
00250 };
00251
00252
#endif