Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGLLightSet.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gl:$Id$
0002 // Author:  Matevz Tadel, Feb 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGLLightSet_H
0013 #define ROOT_TGLLightSet_H
0014 
0015 #include <TObject.h>
0016 
0017 class TGLBoundingBox;
0018 class TGLCamera;
0019 
0020 
0021 class TGLLightSet : public TObject
0022 {
0023 public:
0024    enum ELight { kLightFront    = 0x0001,
0025                  kLightTop      = 0x0002,
0026                  kLightBottom   = 0x0004,
0027                  kLightLeft     = 0x0008,
0028                  kLightRight    = 0x0010,
0029                  kLightMask     = 0x001f,
0030                  kLightSpecular = 0x0100 };
0031 private:
0032    TGLLightSet(const TGLLightSet&) = delete;
0033    TGLLightSet& operator=(const TGLLightSet&) = delete;
0034 
0035 protected:
0036    UInt_t        fLightState;   //! light states (on/off) mask
0037    Bool_t        fUseSpecular;  //!
0038 
0039    Float_t       fFrontPower;    //! power of the front lamp
0040    Float_t       fSidePower;     //! power of the side lamps
0041    Float_t       fSpecularPower; //! power of specular lamp
0042 
0043 public:
0044    TGLLightSet();
0045    ~TGLLightSet() override {}
0046 
0047    void    ToggleLight(ELight light);
0048    void    SetLight(ELight light, Bool_t on);
0049    UInt_t  GetLightState() { return fLightState; }
0050 
0051    Bool_t GetUseSpecular() const   { return fUseSpecular; }
0052    void   SetUseSpecular(Bool_t s) { fUseSpecular = s; }
0053 
0054    Float_t GetFrontPower()     const { return fFrontPower; }
0055    Float_t GetSidePower()      const { return fSidePower; }
0056    Float_t GetSpecularPower()  const { return fSpecularPower; }
0057    void SetFrontPower(Float_t  p)    { fFrontPower = p; }
0058    void SetSidePower(Float_t  p)     { fSidePower  = p; }
0059    void SetSpecularPower(Float_t  p) { fSpecularPower = p; }
0060 
0061    void StdSetupLights(const TGLBoundingBox& bbox, const TGLCamera& camera,
0062                        Bool_t debug=kFALSE);
0063 
0064    ClassDefOverride(TGLLightSet, 0) // A set of OpenGL lights.
0065 }; // endclass TGLLightSet
0066 
0067 
0068 #endif