Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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&) = delete;
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 ~TGLLightSet() override {}
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 ClassDefOverride(TGLLightSet, 0) // A set of OpenGL lights.
65}; // endclass TGLLightSet
66
67
68#endif
bool Bool_t
Definition RtypesCore.h:63
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
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
TGLLightSet(const TGLLightSet &)=delete
Float_t GetSpecularPower() const
Definition TGLLightSet.h:56
Bool_t fUseSpecular
light states (on/off) mask
Definition TGLLightSet.h:37
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.
void ToggleLight(ELight light)
Toggle light on/off.
void SetSidePower(Float_t p)
Definition TGLLightSet.h:58
Float_t fSidePower
power of the front lamp
Definition TGLLightSet.h:40
TGLLightSet & operator=(const TGLLightSet &)=delete
TGLLightSet()
power of specular lamp
Float_t fSpecularPower
power of the side lamps
Definition TGLLightSet.h:41
void SetSpecularPower(Float_t p)
Definition TGLLightSet.h:59
void SetFrontPower(Float_t p)
Definition TGLLightSet.h:57
Float_t GetFrontPower() const
Definition TGLLightSet.h:54
~TGLLightSet() override
Definition TGLLightSet.h:45
void SetLight(ELight light, Bool_t on)
Set a light on/off.
UInt_t GetLightState()
Definition TGLLightSet.h:49
UInt_t fLightState
Definition TGLLightSet.h:36
Mother of all ROOT objects.
Definition TObject.h:41