00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00074 #ifndef __vtkLight_h
00075 #define __vtkLight_h
00076
00077 #include "vtkObject.h"
00078 #include "vtkMatrix4x4.h"
00079
00080
00081 class vtkRenderer;
00082
00083 #define VTK_LIGHT_TYPE_HEADLIGHT 1
00084 #define VTK_LIGHT_TYPE_CAMERA_LIGHT 2
00085 #define VTK_LIGHT_TYPE_SCENE_LIGHT 3
00086
00087 class VTK_RENDERING_EXPORT vtkLight : public vtkObject
00088 {
00089 public:
00090 vtkTypeMacro(vtkLight,vtkObject);
00091 void PrintSelf(ostream& os, vtkIndent indent);
00092
00096 static vtkLight *New();
00097
00102 virtual void Render(vtkRenderer *, int) {};
00103
00105
00106 vtkSetVector3Macro(Color,float);
00107 vtkGetVectorMacro(Color,float,3);
00109
00111
00115 vtkSetVector3Macro(Position,float);
00116 vtkGetVectorMacro(Position,float,3);
00117 void SetPosition(double *a) {this->SetPosition(a[0],a[1],a[2]);};
00119
00121
00126 vtkSetVector3Macro(FocalPoint,float);
00127 vtkGetVectorMacro(FocalPoint,float,3);
00128 void SetFocalPoint(double *a) {this->SetFocalPoint(a[0],a[1],a[2]);};
00130
00132
00133 vtkSetMacro(Intensity,float);
00134 vtkGetMacro(Intensity,float);
00136
00138
00139 vtkSetMacro(Switch,int);
00140 vtkGetMacro(Switch,int);
00141 vtkBooleanMacro(Switch,int);
00143
00145
00146 vtkSetMacro(Positional,int);
00147 vtkGetMacro(Positional,int);
00148 vtkBooleanMacro(Positional,int);
00150
00152
00153 vtkSetMacro(Exponent,float);
00154 vtkGetMacro(Exponent,float);
00156
00158
00161 vtkSetMacro(ConeAngle,float);
00162 vtkGetMacro(ConeAngle,float);
00164
00166
00168 vtkSetVector3Macro(AttenuationValues,float);
00169 vtkGetVectorMacro(AttenuationValues,float,3);
00171
00173
00176 vtkSetObjectMacro(TransformMatrix,vtkMatrix4x4);
00177 vtkGetObjectMacro(TransformMatrix,vtkMatrix4x4);
00179
00181
00183 void GetTransformedPosition(float &a0, float &a1, float &a2);
00184 void GetTransformedPosition(float a[3]);
00185 float *GetTransformedPosition();
00187
00189
00191 void GetTransformedFocalPoint(float &a0, float &a1, float &a2);
00192 void GetTransformedFocalPoint(float a[3]);
00193 float *GetTransformedFocalPoint();
00195
00197
00201 void SetDirectionAngle(float elevation, float azimuth);
00202 void SetDirectionAngle(float ang[2]) { this->SetDirectionAngle(ang[0], ang[1]); };
00204
00206 void DeepCopy(vtkLight *light);
00207
00218 vtkSetMacro(LightType, int);
00219 vtkGetMacro(LightType, int);
00220
00221 void SetLightTypeToHeadlight();
00222 void SetLightTypeToSceneLight();
00223 void SetLightTypeToCameraLight();
00224
00226
00227 int LightTypeIsHeadlight();
00228 int LightTypeIsSceneLight();
00229 int LightTypeIsCameraLight();
00231
00232 void ReadSelf(istream& is);
00233 void WriteSelf(ostream& os);
00234
00235 protected:
00236 vtkLight();
00237 ~vtkLight();
00238
00239 float FocalPoint[3];
00240 float Position[3];
00241 float Intensity;
00242 float Color[3];
00243 int Switch;
00244 int Positional;
00245 float Exponent;
00246 float ConeAngle;
00247 float AttenuationValues[3];
00248 vtkMatrix4x4 *TransformMatrix;
00249 float TransformedFocalPointReturn[3];
00250 float TransformedPositionReturn[3];
00251 int LightType;
00252 private:
00253 vtkLight(const vtkLight&);
00254 void operator=(const vtkLight&);
00255 };
00256
00257 #endif