Logo ROOT  
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
17class TGLBoundingBox;
18class TGLCamera;
19
20
21class TGLLightSet : public TObject
22{
23public:
24 enum ELight { kLightFront = 0x0001,
25 kLightTop = 0x0002,
26 kLightBottom = 0x0004,
27 kLightLeft = 0x0008,
28 kLightRight = 0x0010,
29 kLightMask = 0x001f,
30 kLightSpecular = 0x0100 };
31private:
32 TGLLightSet(const TGLLightSet&); // Not implemented
33 TGLLightSet& operator=(const TGLLightSet&); // Not implemented
34
35protected:
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
43public:
45 virtual ~TGLLightSet() {}
46
47 void ToggleLight(ELight light);
48 void SetLight(ELight light, Bool_t on);
50
53
54 Float_t GetFrontPower() const { return fFrontPower; }
55 Float_t GetSidePower() const { return fSidePower; }
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
unsigned int UInt_t
Definition: RtypesCore.h:46
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
float Float_t
Definition: RtypesCore.h:57
#define ClassDef(name, id)
Definition: Rtypes.h:325
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition: TGLCamera.h:44
Encapsulates a set of lights for OpenGL.
Definition: TGLLightSet.h:22
Float_t GetSpecularPower() const
Definition: TGLLightSet.h:56
Bool_t fUseSpecular
light states (on/off) mask
Definition: TGLLightSet.h:37
TGLLightSet & operator=(const TGLLightSet &)
Float_t fFrontPower
Definition: TGLLightSet.h:39
Float_t GetSidePower() const
Definition: TGLLightSet.h:55
Bool_t GetUseSpecular() const
Definition: TGLLightSet.h:51
void SetUseSpecular(Bool_t s)
Definition: TGLLightSet.h:52
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
void ToggleLight(ELight light)
Toggle light on/off.
Definition: TGLLightSet.cxx:40
void SetSidePower(Float_t p)
Definition: TGLLightSet.h:58
Float_t fSidePower
power of the front lamp
Definition: TGLLightSet.h:40
TGLLightSet()
power of specular lamp
Definition: TGLLightSet.cxx:26
Float_t fSpecularPower
power of the side lamps
Definition: TGLLightSet.h:41
void SetSpecularPower(Float_t p)
Definition: TGLLightSet.h:59
TGLLightSet(const TGLLightSet &)
void SetFrontPower(Float_t p)
Definition: TGLLightSet.h:57
Float_t GetFrontPower() const
Definition: TGLLightSet.h:54
void SetLight(ELight light, Bool_t on)
Set a light on/off.
Definition: TGLLightSet.cxx:55
virtual ~TGLLightSet()
Definition: TGLLightSet.h:45
UInt_t GetLightState()
Definition: TGLLightSet.h:49
UInt_t fLightState
Definition: TGLLightSet.h:36
Mother of all ROOT objects.
Definition: TObject.h:37
static constexpr double s