Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGLLightSet.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Matevz Tadel, Feb 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGLLightSet_H
13 #define ROOT_TGLLightSet_H
14 
15 #include <TObject.h>
16 
17 class TGLBoundingBox;
18 class TGLCamera;
19 
20 
21 class TGLLightSet : public TObject
22 {
23 public:
24  enum ELight { kLightFront = 0x0001,
25  kLightTop = 0x0002,
26  kLightBottom = 0x0004,
27  kLightLeft = 0x0008,
28  kLightRight = 0x0010,
29  kLightMask = 0x001f,
30  kLightSpecular = 0x0100 };
31 private:
32  TGLLightSet(const TGLLightSet&); // Not implemented
33  TGLLightSet& operator=(const TGLLightSet&); // Not implemented
34 
35 protected:
36  UInt_t fLightState; //! light states (on/off) mask
37  Bool_t fUseSpecular; //!
38 
39  Float_t fFrontPower; //! power of the front lamp
40  Float_t fSidePower; //! power of the side lamps
41  Float_t fSpecularPower; //! power of specular lamp
42 
43 public:
44  TGLLightSet();
45  virtual ~TGLLightSet() {}
46 
47  void ToggleLight(ELight light);
48  void SetLight(ELight light, Bool_t on);
49  UInt_t GetLightState() { return fLightState; }
50 
51  Bool_t GetUseSpecular() const { return fUseSpecular; }
52  void SetUseSpecular(Bool_t s) { fUseSpecular = s; }
53 
54  Float_t GetFrontPower() const { return fFrontPower; }
55  Float_t GetSidePower() const { return fSidePower; }
56  Float_t GetSpecularPower() const { return fSpecularPower; }
57  void SetFrontPower(Float_t p) { fFrontPower = p; }
58  void SetSidePower(Float_t p) { fSidePower = p; }
59  void SetSpecularPower(Float_t p) { fSpecularPower = p; }
60 
61  void StdSetupLights(const TGLBoundingBox& bbox, const TGLCamera& camera,
62  Bool_t debug=kFALSE);
63 
64  ClassDef(TGLLightSet, 0) // A set of OpenGL lights.
65 }; // endclass TGLLightSet
66 
67 
68 #endif