Logo ROOT   6.12/07
Reference Guide
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
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);
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; }
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
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition: TGLCamera.h:43
void SetLight(ELight light, Bool_t on)
Set a light on/off.
Definition: TGLLightSet.cxx:55
float Float_t
Definition: RtypesCore.h:53
void ToggleLight(ELight light)
Toggle light on/off.
Definition: TGLLightSet.cxx:40
virtual ~TGLLightSet()
Definition: TGLLightSet.h:45
Float_t GetSpecularPower() const
Definition: TGLLightSet.h:56
bool Bool_t
Definition: RtypesCore.h:59
UInt_t fLightState
Definition: TGLLightSet.h:36
Encapsulates a set of lights for OpenGL.
Definition: TGLLightSet.h:21
Float_t fFrontPower
Definition: TGLLightSet.h:39
TGLLightSet & operator=(const TGLLightSet &)
Float_t fSidePower
power of the front lamp
Definition: TGLLightSet.h:40
#define ClassDef(name, id)
Definition: Rtypes.h:320
Float_t GetFrontPower() const
Definition: TGLLightSet.h:54
void SetSpecularPower(Float_t p)
Definition: TGLLightSet.h:59
UInt_t GetLightState()
Definition: TGLLightSet.h:49
Bool_t fUseSpecular
light states (on/off) mask
Definition: TGLLightSet.h:37
unsigned int UInt_t
Definition: RtypesCore.h:42
Float_t GetSidePower() const
Definition: TGLLightSet.h:55
const Bool_t kFALSE
Definition: RtypesCore.h:88
void SetUseSpecular(Bool_t s)
Definition: TGLLightSet.h:52
static constexpr double s
void SetFrontPower(Float_t p)
Definition: TGLLightSet.h:57
Mother of all ROOT objects.
Definition: TObject.h:37
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
Bool_t GetUseSpecular() const
Definition: TGLLightSet.h:51
TGLLightSet()
power of specular lamp
Definition: TGLLightSet.cxx:26
void SetSidePower(Float_t p)
Definition: TGLLightSet.h:58
Float_t fSpecularPower
power of the side lamps
Definition: TGLLightSet.h:41
void StdSetupLights(const TGLBoundingBox &bbox, const TGLCamera &camera, Bool_t debug=kFALSE)
Setup lights for current given bounding box and camera.
Definition: TGLLightSet.cxx:76