TGLLightSet.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLLightSet.h 28197 2009-04-14 13:59:27Z matevz $
00002 // Author:  Matevz Tadel, Feb 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGLLightSet_H
00013 #define ROOT_TGLLightSet_H
00014 
00015 #include <TObject.h>
00016 
00017 class TGLBoundingBox;
00018 class TGLCamera;
00019 
00020 
00021 class TGLLightSet : public TObject
00022 {
00023 public:
00024    enum ELight { kLightFront    = 0x0001,
00025                  kLightTop      = 0x0002,
00026                  kLightBottom   = 0x0004,
00027                  kLightLeft     = 0x0008,
00028                  kLightRight    = 0x0010,
00029                  kLightMask     = 0x001f,
00030                  kLightSpecular = 0x0100 };
00031 private:
00032    TGLLightSet(const TGLLightSet&);            // Not implemented
00033    TGLLightSet& operator=(const TGLLightSet&); // Not implemented
00034 
00035 protected:
00036    UInt_t        fLightState;   //! light states (on/off) mask
00037    Bool_t        fUseSpecular;  //!
00038 
00039    Float_t       fFrontPower;    //! power of the front lamp
00040    Float_t       fSidePower;     //! power of the side lamps
00041    Float_t       fSpecularPower; //! power of specular lamp
00042 
00043 public:
00044    TGLLightSet();
00045    virtual ~TGLLightSet() {}
00046 
00047    void    ToggleLight(ELight light);
00048    void    SetLight(ELight light, Bool_t on);
00049    UInt_t  GetLightState() { return fLightState; }
00050 
00051    Bool_t GetUseSpecular() const   { return fUseSpecular; }
00052    void   SetUseSpecular(Bool_t s) { fUseSpecular = s; }
00053 
00054    Float_t GetFrontPower()     const { return fFrontPower; }
00055    Float_t GetSidePower()      const { return fSidePower; }
00056    Float_t GetSpecularPower()  const { return fSpecularPower; }
00057    void SetFrontPower(Float_t  p)    { fFrontPower = p; }
00058    void SetSidePower(Float_t  p)     { fSidePower  = p; }
00059    void SetSpecularPower(Float_t  p) { fSpecularPower = p; }
00060 
00061    void StdSetupLights(const TGLBoundingBox& bbox, const TGLCamera& camera,
00062                        Bool_t debug=kFALSE);
00063 
00064    ClassDef(TGLLightSet, 0) // A set of OpenGL lights.
00065 }; // endclass TGLLightSet
00066 
00067 
00068 #endif

Generated on Tue Jul 5 14:16:46 2011 for ROOT_528-00b_version by  doxygen 1.5.1