Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
TEveRGBAPaletteOverlay.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Alja Mrak Tadel 2012
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, 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
13#include "TEveRGBAPalette.h"
14
15#include "TGLIncludes.h"
16#include "TGLAxis.h"
17#include "TGLRnrCtx.h"
18#include "TGLUtil.h"
19
20/** \class TEveRGBAPaletteOverlay
21\ingroup TEve
22Description of TEveRGBAPaletteOverlay
23*/
24
26
27////////////////////////////////////////////////////////////////////////////////
28/// Constructor.
29
45
46////////////////////////////////////////////////////////////////////////////////
47/// Render the overlay.
48
50{
53
54 // Uninitialized palette.
55 if (ca_min == ca_max) return;
56
58
60
66
67 // reset to [0,1] units
71 glOrtho(0, 1, 0, 1, 0, 1);
75
76 // position palette
78
79 // colored quads
80 {
82 glPolygonOffset(0.5f, 0.5f);
83
86 glVertex2f(0, 0);
89 Float_t x = xs;
90 for (Int_t i = fPalette->fCAMin + 1; i < fPalette->fCAMax; ++i)
91 {
93 glVertex2f(x, 0);
95 x += xs;
96 }
100 glEnd();
101 }
102
103 // axis
104 glPushMatrix();
105 Float_t sf = fWidth / (ca_max - ca_min);
106 glScalef(sf, 1, 1);
107 glTranslatef(-ca_min, 0, 0);
109 fAxisPainter.RefTMOff(0).Set(0, -1, 0);
111 glPopMatrix();
112
113 // frame around palette
115 glVertex2f(0, 0); glVertex2f(fWidth, 0);
117 glEnd();
118
120 glPopMatrix();
122 glPopMatrix();
123
124 glPopAttrib();
125}
#define GL_LINE_LOOP
Definition GL_glu.h:285
#define GL_QUAD_STRIP
Definition GL_glu.h:291
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
Definition TAttAxis.cxx:284
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
Definition TAttAxis.cxx:233
virtual void SetLimits(Double_t xmin, Double_t xmax)
Definition TAxis.h:164
Description of TEveRGBAPaletteOverlay.
void Render(TGLRnrCtx &rnrCtx) override
Render the overlay.
TEveRGBAPaletteOverlay(const TEveRGBAPaletteOverlay &)
A generic, speed-optimised mapping from value to RGBA color supporting different wrapping and range t...
Double_t GetCAMaxAsDouble() const
Double_t GetCAMinAsDouble() const
const UChar_t * ColorFromValue(Int_t val) const
void SetLabelAlign(TGLFont::ETextAlignH_e, TGLFont::ETextAlignV_e)
Set label align.
void SetUseAxisColors(Bool_t x)
void SetLabelPixelFontSize(Int_t fs)
TGLVector3 & RefTMOff(Int_t i)
void SetFontMode(TGLFont::EMode m)
void PaintAxis(TGLRnrCtx &ctx, TAxis *ax)
GL render TAxis.
An overlay element.
Definition TGLOverlay.h:23
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
static void Color4ubv(const UChar_t *rgba)
Wrapper for glColor4ubv.
Definition TGLUtil.cxx:1779
void Set(Double_t x, Double_t y, Double_t z)
Definition TGLUtil.h:210
Double_t x[n]
Definition legend1.C:17