Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

graphics/vtkLight.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkLight.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00071 #ifndef __vtkLight_h
00072 #define __vtkLight_h
00073 
00074 #include "vtkObject.h"
00075 #include "vtkMatrix4x4.h"
00076 
00077 /* need for virtual function */
00078 class vtkRenderer;
00079 
00080 #define VTK_LIGHT_TYPE_HEADLIGHT    1
00081 #define VTK_LIGHT_TYPE_CAMERA_LIGHT 2
00082 #define VTK_LIGHT_TYPE_SCENE_LIGHT  3
00083 
00084 class VTK_EXPORT vtkLight : public vtkObject
00085 {
00086 public:
00087   vtkTypeMacro(vtkLight,vtkObject);
00088   void PrintSelf(ostream& os, vtkIndent indent);
00089 
00093   static vtkLight *New();
00094 
00099   virtual void Render(vtkRenderer *, int) {};
00100 
00102   vtkSetVector3Macro(Color,float);
00103   vtkGetVectorMacro(Color,float,3);
00104 
00109   vtkSetVector3Macro(Position,float);
00110   vtkGetVectorMacro(Position,float,3);
00111   void SetPosition(double *a) {this->SetPosition(a[0],a[1],a[2]);};
00112   
00118   vtkSetVector3Macro(FocalPoint,float);
00119   vtkGetVectorMacro(FocalPoint,float,3);
00120   void SetFocalPoint(double *a) {this->SetFocalPoint(a[0],a[1],a[2]);};
00121 
00123   vtkSetMacro(Intensity,float);
00124   vtkGetMacro(Intensity,float);
00125 
00127   vtkSetMacro(Switch,int);
00128   vtkGetMacro(Switch,int);
00129   vtkBooleanMacro(Switch,int);
00130 
00132   vtkSetMacro(Positional,int);
00133   vtkGetMacro(Positional,int);
00134   vtkBooleanMacro(Positional,int);
00135 
00137   vtkSetMacro(Exponent,float);
00138   vtkGetMacro(Exponent,float);
00139 
00143   vtkSetMacro(ConeAngle,float);
00144   vtkGetMacro(ConeAngle,float);
00145 
00148   vtkSetVector3Macro(AttenuationValues,float);
00149   vtkGetVectorMacro(AttenuationValues,float,3);
00150 
00154   vtkSetObjectMacro(TransformMatrix,vtkMatrix4x4);
00155   vtkGetObjectMacro(TransformMatrix,vtkMatrix4x4);
00156 
00159   void GetTransformedPosition(float &a0, float &a1, float &a2);
00160   void GetTransformedPosition(float a[3]);
00161   float *GetTransformedPosition();
00162 
00165   void GetTransformedFocalPoint(float &a0, float &a1, float &a2);
00166   void GetTransformedFocalPoint(float a[3]);
00167   float *GetTransformedFocalPoint();
00168 
00173   void SetDirectionAngle(float elevation, float azimuth);
00174   void SetDirectionAngle(float ang[2]) { this->SetDirectionAngle(ang[0], ang[1]); };
00175 
00177   void DeepCopy(vtkLight *light);
00178 
00189   vtkSetMacro(LightType, int);
00190   vtkGetMacro(LightType, int);
00191 
00192   void SetLightTypeToHeadlight();
00193   void SetLightTypeToSceneLight();
00194   void SetLightTypeToCameraLight();
00195 
00197   int LightTypeIsHeadlight();
00198   int LightTypeIsSceneLight();
00199   int LightTypeIsCameraLight();
00200 
00201   void ReadSelf(istream& is);
00202   void WriteSelf(ostream& os);
00203   
00204 protected:
00205   vtkLight();
00206   ~vtkLight();
00207   vtkLight(const vtkLight&) {};
00208   void operator=(const vtkLight&) {};
00209 
00210   float FocalPoint[3];
00211   float Position[3];
00212   float Intensity;
00213   float Color[3];
00214   int   Switch;
00215   int   Positional;
00216   float Exponent;
00217   float ConeAngle;
00218   float AttenuationValues[3];
00219   vtkMatrix4x4 *TransformMatrix;
00220   float TransformedFocalPointReturn[3];
00221   float TransformedPositionReturn[3];
00222   int LightType;
00223 };
00224 
00225 #endif

Generated on Wed Nov 21 12:27:00 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001