00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00043 #ifndef __vtkLight_h
00044 #define __vtkLight_h
00045
00046 #include "vtkObject.h"
00047
00048
00049 class vtkRenderer;
00050 class vtkMatrix4x4;
00051
00052 #define VTK_LIGHT_TYPE_HEADLIGHT 1
00053 #define VTK_LIGHT_TYPE_CAMERA_LIGHT 2
00054 #define VTK_LIGHT_TYPE_SCENE_LIGHT 3
00055
00056 class VTK_RENDERING_EXPORT vtkLight : public vtkObject
00057 {
00058 public:
00059 vtkTypeRevisionMacro(vtkLight,vtkObject);
00060 void PrintSelf(ostream& os, vtkIndent indent);
00061
00068 static vtkLight *New();
00069
00074 virtual vtkLight *ShallowClone();
00075
00080 virtual void Render(vtkRenderer *, int) {};
00081
00083
00087 vtkSetVector3Macro(AmbientColor,double);
00088 vtkGetVectorMacro(AmbientColor,double,3);
00089 vtkSetVector3Macro(DiffuseColor,double);
00090 vtkGetVectorMacro(DiffuseColor,double,3);
00091 vtkSetVector3Macro(SpecularColor,double);
00092 vtkGetVectorMacro(SpecularColor,double,3);
00093 void SetColor(double, double, double);
00094 void SetColor(double a[3]) { this->SetColor(a[0], a[1], a[2]); }
00095 void GetColor(double rgb[3]);
00096 double *GetColor();
00098
00100
00104 vtkSetVector3Macro(Position,double);
00105 vtkGetVectorMacro(Position,double,3);
00106 void SetPosition(float *a) {this->SetPosition(a[0],a[1],a[2]);};
00108
00110
00115 vtkSetVector3Macro(FocalPoint,double);
00116 vtkGetVectorMacro(FocalPoint,double,3);
00117 void SetFocalPoint(float *a) {this->SetFocalPoint(a[0],a[1],a[2]);};
00119
00121
00122 vtkSetMacro(Intensity,double);
00123 vtkGetMacro(Intensity,double);
00125
00127
00128 vtkSetMacro(Switch,int);
00129 vtkGetMacro(Switch,int);
00130 vtkBooleanMacro(Switch,int);
00132
00134
00135 vtkSetMacro(Positional,int);
00136 vtkGetMacro(Positional,int);
00137 vtkBooleanMacro(Positional,int);
00139
00141
00142 vtkSetClampMacro(Exponent,double,0.0,128.0);
00143 vtkGetMacro(Exponent,double);
00145
00147
00151 vtkSetMacro(ConeAngle,double);
00152 vtkGetMacro(ConeAngle,double);
00154
00156
00158 vtkSetVector3Macro(AttenuationValues,double);
00159 vtkGetVectorMacro(AttenuationValues,double,3);
00161
00163
00166 virtual void SetTransformMatrix(vtkMatrix4x4*);
00167 vtkGetObjectMacro(TransformMatrix,vtkMatrix4x4);
00169
00171
00173 void GetTransformedPosition(double &a0, double &a1, double &a2);
00174 void GetTransformedPosition(double a[3]);
00175 double *GetTransformedPosition();
00177
00179
00181 void GetTransformedFocalPoint(double &a0, double &a1, double &a2);
00182 void GetTransformedFocalPoint(double a[3]);
00183 double *GetTransformedFocalPoint();
00185
00187
00191 void SetDirectionAngle(double elevation, double azimuth);
00192 void SetDirectionAngle(double ang[2]) {
00193 this->SetDirectionAngle(ang[0], ang[1]); };
00195
00197 void DeepCopy(vtkLight *light);
00198
00200
00211 vtkSetMacro(LightType, int);
00212 vtkGetMacro(LightType, int);
00213 void SetLightTypeToHeadlight()
00214 {this->SetLightType(VTK_LIGHT_TYPE_HEADLIGHT);}
00215 void SetLightTypeToSceneLight()
00216 {
00217 this->SetTransformMatrix(NULL);
00218 this->SetLightType(VTK_LIGHT_TYPE_SCENE_LIGHT);
00219 }
00220 void SetLightTypeToCameraLight()
00221 {this->SetLightType(VTK_LIGHT_TYPE_CAMERA_LIGHT);}
00223
00225
00226 int LightTypeIsHeadlight();
00227 int LightTypeIsSceneLight();
00228 int LightTypeIsCameraLight();
00230
00231 void ReadSelf(istream& is);
00232 void WriteSelf(ostream& os);
00233
00234 protected:
00235 vtkLight();
00236 ~vtkLight();
00237
00238 double FocalPoint[3];
00239 double Position[3];
00240 double Intensity;
00241 double AmbientColor[3];
00242 double DiffuseColor[3];
00243 double SpecularColor[3];
00244 int Switch;
00245 int Positional;
00246 double Exponent;
00247 double ConeAngle;
00248 double AttenuationValues[3];
00249 vtkMatrix4x4 *TransformMatrix;
00250 double TransformedFocalPointReturn[3];
00251 double TransformedPositionReturn[3];
00252 int LightType;
00253
00254 private:
00255 vtkLight(const vtkLight&);
00256 void operator=(const vtkLight&);
00257 };
00258
00259 #endif