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

Rendering/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 =========================================================================*/
00074 #ifndef __vtkLight_h
00075 #define __vtkLight_h
00076 
00077 #include "vtkObject.h"
00078 #include "vtkMatrix4x4.h"
00079 
00080 /* need for virtual function */
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&);  // Not implemented.
00254   void operator=(const vtkLight&);  // Not implemented.
00255 };
00256 
00257 #endif

Generated on Thu Mar 28 14:19:32 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001