32#include "TGLIncludes.h"
53 fPhysicalShapeColor(nullptr),
57 fXAxis(hist->GetXaxis()),
58 fYAxis(hist->GetYaxis()),
59 fZAxis(hist->GetZaxis()),
62 fUpdateSelection(
kTRUE),
68 fBackBox(xoy, xoz, yoz),
71 fSelectionBase(kTrueColorSelectionBase),
86 fPhysicalShapeColor(nullptr),
90 fXAxis(
data->GetXAxis()),
91 fYAxis(
data->GetYAxis()),
92 fZAxis(
data->GetZAxis()),
95 fUpdateSelection(
kTRUE),
104 fSelectionBase(kTrueColorSelectionBase),
118 : fPadColor(nullptr),
119 fPhysicalShapeColor(nullptr),
128 fUpdateSelection(
kTRUE),
137 fSelectionBase(kTrueColorSelectionBase),
158 glGetIntegerv(GL_VIEWPORT, vp);
166 glPushAttrib(GL_LIGHTING_BIT);
175 glClear(GL_DEPTH_BUFFER_BIT);
177 const Float_t pos[] = {0.f, 0.f, 0.f, 1.f};
178 glLightfv(GL_LIGHT0, GL_POSITION, pos);
196 glViewport(vp[0], vp[1], vp[2], vp[3]);
238 Error(
"TGLPlotPainter::PrintPlot",
"Could not (re)open ps file for GL output");
244 Int_t gl2psFormat = GL2PS_EPS;
245 Int_t gl2psSort = GL2PS_BSP_SORT;
247 Int_t state = GL2PS_OVERFLOW;
248 GLint gl2psoption = GL2PS_USE_CURRENT_VIEWPORT |
251 GL2PS_OCCLUSION_CULL |
254 while (state == GL2PS_OVERFLOW) {
255 buffsize += 1024*1024;
256 gl2psBeginPage (
"ROOT Scene Graph",
"ROOT",
nullptr,
257 gl2psFormat, gl2psSort, gl2psoption,
258 GL_RGBA, 0,
nullptr,0, 0, 0,
259 buffsize,
output,
nullptr);
261 state = gl2psEndPage();
276 glMatrixMode(GL_PROJECTION);
278 glMatrixMode(GL_MODELVIEW);
285 glClearColor(0.f, 0.f, 0.f, 0.f);
286 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
299 glDisable(GL_DEPTH_TEST);
302 glMatrixMode(GL_PROJECTION);
304 glMatrixMode(GL_MODELVIEW);
380 if (frontPoint == 2) {
383 }
else if (!frontPoint) {
386 }
else if (frontPoint == 1) {
389 }
else if (frontPoint == 3) {
394 if (frontPoint == 2) {
397 }
else if (!frontPoint) {
400 }
else if (frontPoint == 1) {
403 }
else if (frontPoint == 3) {
410 glGetDoublev(GL_MODELVIEW_MATRIX, mv);
412 glGetDoublev(GL_PROJECTION_MATRIX, pr);
414 glGetIntegerv(GL_VIEWPORT, vp);
418 gluProject(0., 0.,
fXOYSectionPos, mv, pr, vp, &winVertex[0], &winVertex[1], &winVertex[2]);
423 &winVertex[0], &winVertex[1], &winVertex[2]);
427 gluUnProject(winVertex[0], winVertex[1], winVertex[2], mv, pr, vp,
428 newPoint, newPoint + 1, newPoint + 2);
458 glEnable(GL_POLYGON_OFFSET_FILL);
459 glPolygonOffset(1.f, 1.f);
461 glDisable(GL_POLYGON_OFFSET_FILL);
469 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
475 glLineStipple(1, stipple);
477 glColor3d(0., 0., 0.);
501 glEnable(GL_POLYGON_OFFSET_FILL);
502 glPolygonOffset(1.f, 1.f);
504 glDisable(GL_POLYGON_OFFSET_FILL);
512 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
517 glLineStipple(1, 0x5555);
519 glColor3d(0., 0., 0.);
543 glEnable(GL_POLYGON_OFFSET_FILL);
544 glPolygonOffset(1.f, 1.f);
547 glDisable(GL_POLYGON_OFFSET_FILL);
555 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
588 glMatrixMode(GL_MODELVIEW);
596 glMatrixMode(GL_PROJECTION);
604 glMatrixMode(GL_MODELVIEW);
612 glMatrixMode(GL_PROJECTION);
909 if (!FindAxisRange(hist->
GetXaxis(),
fXLog, xBins, xRange)) {
910 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Cannot set X axis to log scale");
916 if (!FindAxisRange(hist->
GetYaxis(),
fYLog, yBins, yRange)) {
917 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Cannot set Y axis to log scale");
926 if (!FindAxisRange(hist->
GetZaxis(),
fZLog, zBins, zRange)) {
927 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Cannot set Z axis to log scale");
930 }
else if (!FindAxisRange(hist,
fZLog, xBins, yBins, zRange, factor, errors)) {
931 Error(
"TGLPlotCoordinates::SetRangesCartesian",
932 "Log scale is requested for Z, but maximum less or equal 0. (%f)", zRange.second);
937 const Double_t x = xRange.second - xRange.first;
938 const Double_t y = yRange.second - yRange.first;
939 const Double_t z = zRange.second - zRange.first;
941 if (!
x || !
y || !z) {
942 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Zero axis range.");
989 if (!FindAxisRange(hist,
fZLog, zRange))
993 const Double_t x = xRange.second - xRange.first;
994 const Double_t y = yRange.second - yRange.first;
995 const Double_t z = zRange.second - zRange.first;
997 if (!
x || !
y || !z) {
998 Error(
"TGLPlotCoordinates::SetRanges",
"Zero axis range.");
1031 FindAxisRange(xAxis,
kFALSE, xBins, xRange);
1036 FindAxisRange(yAxis,
kFALSE, yBins, yRange);
1042 FindAxisRange(zAxis,
kFALSE, zBins, zRange);
1045 const Double_t x = xRange.second - xRange.first;
1046 const Double_t y = yRange.second - yRange.first;
1047 const Double_t z = zRange.second - zRange.first;
1049 if (!
x || !
y || !z) {
1050 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Zero axis range.");
1087 FindAxisRange(xAxis,
kFALSE, xBins, phiRange);
1088 if (xBins.second - xBins.first + 1 > 360) {
1089 Error(
"TGLPlotCoordinates::SetRangesPolar",
"To many PHI sectors");
1096 FindAxisRange(yAxis,
kFALSE, yBins, roRange);
1100 if (!FindAxisRange(hist,
fZLog, xBins, yBins, zRange, factor,
kFALSE))
1102 Error(
"TGLPlotCoordinates::SetRangesPolar",
1103 "Log scale is requested for Z, but maximum less or equal 0. (%f)", zRange.second);
1107 const Double_t z = zRange.second - zRange.first;
1108 if (!z || !(phiRange.second - phiRange.first) || !(roRange.second - roRange.first)) {
1109 Error(
"TGLPlotCoordinates::SetRangesPolar",
"Zero axis range.");
1145 FindAxisRange(xAxis,
kFALSE, xBins, angleRange);
1146 if (xBins.second - xBins.first + 1 > 360) {
1147 Error(
"TGLPlotCoordinates::SetRangesCylindrical",
"To many PHI sectors");
1150 if (!FindAxisRange(yAxis,
fYLog, yBins, heightRange)) {
1151 Error(
"TGLPlotCoordinates::SetRangesCylindrical",
"Cannot set Y axis to log scale");
1154 FindAxisRange(hist,
kFALSE, xBins, yBins, radiusRange, factor,
kFALSE);
1156 const Double_t x = angleRange.second - angleRange.first;
1157 const Double_t y = heightRange.second - heightRange.first;
1158 const Double_t z = radiusRange.second - radiusRange.first;
1160 if (!
x || !
y || !z) {
1161 Error(
"TGLPlotCoordinates::SetRangesCylindrical",
"Zero axis range.");
1195 if (xBins.second - xBins.first + 1 > 360) {
1196 Error(
"TGLPlotCoordinates::SetRangesSpherical",
"To many PHI sectors");
1203 if (yBins.second - yBins.first + 1 > 180) {
1204 Error(
"TGLPlotCoordinates::SetRangesSpherical",
"To many THETA sectors");
1210 FindAxisRange(hist,
kFALSE, xBins, yBins, radiusRange, factor,
kFALSE);
1250 for (
const Int_t lastBin = axis->
GetLast(); currBin <= lastBin; ++currBin)
1273 if (range.second <= 0.)
1278 if (range.first <= 0.) {
1281 if (bin > bins.second)
1286 if (bin > bins.second)
1311 zRange.second = hist->
GetBinContent(hist->
GetBin(xBins.first, yBins.first)), zRange.first = zRange.second;
1314 for (
Int_t i = xBins.first; i <= xBins.second; ++i) {
1315 for (
Int_t j = yBins.first; j <= yBins.second; ++j) {
1317 if (val > 0. && errors)
1319 zRange.second =
TMath::Max(val, zRange.second);
1320 zRange.first =
TMath::Min(val, zRange.first);
1330 if (logZ && zRange.second <= 0.)
1333 if (zRange.first >= zRange.second)
1334 zRange.first = 0.001 * zRange.second;
1337 if (summ) factor /= summ;
1338 if (!factor) factor = 1.;
1340 Warning(
"TGLPlotPainter::ExtractAxisZInfo",
1341 "Negative factor, negative ranges - possible incorrect behavior");
1343 zRange.second *= factor;
1344 zRange.first *= factor;
1347 if (zRange.first <= 0.)
1348 zRange.first =
TMath::Min(1., 0.001 * zRange.second);
1359 zRange.second += margin * (zRange.second - zRange.first);
1362 zRange.first >= 0 ? zRange.first = 0. : zRange.first -= margin * (zRange.second - zRange.first);
1364 zRange.first >= 0 && zRange.first - margin * (zRange.second - zRange.first) <= 0 ?
1365 zRange.first = 0 : zRange.first -= margin * (zRange.second - zRange.first);
1378 Error(
"FindAxisRange",
"TH2Poly returned empty list of bins");
1385 if (zRange.first >= zRange.second)
1386 zRange.first = 0.001 * zRange.second;
1389 if (zRange.second < 1
e-20) {
1390 Error(
"FindAxisRange",
"Failed to switch Z axis to logarithmic scale");
1394 if (zRange.first <= 0.)
1395 zRange.first =
TMath::Min(1., 0.001 * zRange.second);
1406 zRange.second += margin * (zRange.second - zRange.first);
1408 zRange.first >= 0 ? zRange.first = 0. : zRange.first -= margin * (zRange.second - zRange.first);
1410 zRange.first >= 0 && zRange.first - margin * (zRange.second - zRange.first) <= 0 ?
1411 zRange.first = 0 : zRange.first -= margin * (zRange.second - zRange.first);
1476 (
box[0].Z() +
box[4].Z()) / 2);
1509 if (!selectionPass) {
1510 glDisable(GL_LIGHTING);
1532 glEnable(GL_LIGHTING);
1535 glGetBooleanv(GL_BLEND, &oldBlendState);
1540 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1543 const Float_t diffuseColor[] = {0.f, 0.f, 1.f, 0.1f};
1544 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuseColor);
1550 glDisable(GL_BLEND);
1589 glGetDoublev(GL_MODELVIEW_MATRIX, mv);
1591 glGetDoublev(GL_PROJECTION_MATRIX, pr);
1593 glGetIntegerv(GL_VIEWPORT, vp);
1598 gluProject(
fCenter.
X(), 0., 0., mv, pr, vp, &winVertex[0], &winVertex[1], &winVertex[2]);
1601 gluProject(0.,
fCenter.
Y(), 0., mv, pr, vp, &winVertex[0], &winVertex[1], &winVertex[2]);
1604 gluProject(0., 0.,
fCenter.
Z(), mv, pr, vp, &winVertex[0], &winVertex[1], &winVertex[2]);
1611 gluUnProject(winVertex[0], winVertex[1], winVertex[2], mv, pr, vp,
1612 newPoint, newPoint + 1, newPoint + 2);
1759 Int_t low = 1, up = 2;
1864 for (
Int_t level = low; level < up; ++ level)
1889 for (
Int_t level = low; level < up; ++ level)
1914 for (
Int_t level = low; level < up; ++ level)
1959 glVertex3d(xMin, pos, zMin);
1961 glVertex3d(xMin, pos, zMax);
1963 glVertex3d(xMax, pos, zMax);
1965 glVertex3d(xMax, pos, zMin);
1980 glVertex3d(pos, yMin, zMin);
1982 glVertex3d(pos, yMax, zMin);
1984 glVertex3d(pos, yMax, zMax);
1986 glVertex3d(pos, yMin, zMax);
2001 glVertex3d(xMax, yMin, pos);
2003 glVertex3d(xMax, yMax, pos);
2005 glVertex3d(xMin, yMax, pos);
2007 glVertex3d(xMin, yMin, pos);
2023 glVertex3d(xMin, yMin, zMin);
2024 glVertex3d(xMax, yMin, zMin);
2025 glVertex3d(xMax, yMax, zMin);
2026 glVertex3d(xMin, yMax, zMin);
2030 glVertex3d(xMin, yMin, zMax);
2031 glVertex3d(xMax, yMin, zMax);
2032 glVertex3d(xMax, yMax, zMax);
2033 glVertex3d(xMin, yMax, zMax);
2037 glVertex3d(xMin, yMin, zMin);
2038 glVertex3d(xMin, yMin, zMax);
2039 glVertex3d(xMax, yMin, zMin);
2040 glVertex3d(xMax, yMin, zMax);
2041 glVertex3d(xMax, yMax, zMin);
2042 glVertex3d(xMax, yMax, zMax);
2043 glVertex3d(xMin, yMax, zMin);
2044 glVertex3d(xMin, yMax, zMax);
2055 glColor3d(1., 0., 0.);
2060 DrawBoxOutline(
box[0].
X(),
box[1].
X(),
2072 DrawBoxOutline(
box[0].
X(),
box[1].
X(),
2089 (
box[0].Y() +
box[2].Y()) / 2,
2090 (
box[0].Z() +
box[4].Z()) / 2};
2093 glTranslated(-center[0], -center[1], -center[2]);
2120 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2122 glMatrixMode(GL_PROJECTION);
2126 glMatrixMode(GL_MODELVIEW);
2137 glColor4ub(color[0], color[1], color[2], 150);
2138 glVertex2d(leftX, margin + i *
h);
2139 glVertex2d(rightX, margin + i *
h);
2140 glVertex2d(rightX, margin + (i + 1) *
h);
2141 glVertex2d(leftX, margin + (i + 1) *
h);
2146 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
2147 glColor4d(0., 0., 0., 0.5);
2151 glVertex2d(leftX, margin + i *
h);
2152 glVertex2d(rightX, margin + i *
h);
2153 glVertex2d(rightX, margin + (i + 1) *
h);
2154 glVertex2d(leftX, margin + (i + 1) *
h);
2164 const std::vector<Double_t> & levels)
2170 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2172 glMatrixMode(GL_PROJECTION);
2176 glMatrixMode(GL_MODELVIEW);
2183 const Double_t range = levels.back() - levels.front();
2188 const Double_t yMin = margin + (levels[i] - levels.front()) / range *
h;
2189 const Double_t yMax = margin + (levels[i + 1] - levels.front()) / range *
h;
2192 glColor4ub(color[0], color[1], color[2], opacity);
2193 glVertex2d(leftX, yMin);
2194 glVertex2d(rightX, yMin);
2195 glVertex2d(rightX, yMax);
2196 glVertex2d(leftX, yMax);
2201 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
2202 glColor4d(0., 0., 0., 0.5);
2205 const Double_t yMin = (levels[i] - levels.front()) / range *
h;
2206 const Double_t yMax = (levels[i + 1] - levels.front()) / range *
h;
2209 glVertex2d(leftX, margin + yMin);
2210 glVertex2d(rightX, margin + yMin);
2211 glVertex2d(rightX, margin + yMax);
2212 glVertex2d(leftX, margin + yMax);
2228 pixelW =
UInt_t(pixelW / scale);
2229 pixelH =
UInt_t(pixelH / scale);
2234 +
gPad->GetYlowNDC() *
gPad->GetWh())));
2236 +
gPad->GetYlowNDC() *
gPad->GetWh())));
2252 TGaxis axisPainter(
x, yMin,
x, yMax, zMin, zMax, 510, logZ ?
"G" :
"");
2253 axisPainter.
Paint();
2255 gPad->SetLogx(logX);
2256 gPad->SetLogy(logY);
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TVirtualMutex * gROOTMutex
R__EXTERN TStyle * gStyle
#define R__LOCKGUARD(mutex)
R__EXTERN TVirtualPS * gVirtualPS
const TGLPlotPainter * fPainter
PlotTranslation(const TGLPlotPainter *painter)
Class to manage histogram axis.
Bool_t IsVariableBinSize() const
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Int_t FindFixBin(Double_t x) const
Find bin number corresponding to abscissa x.
Int_t GetLast() const
Return last bin on the axis i.e.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual Int_t GetEntries() const
The color creation and management class.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
A 3-Dim function with parameters.
Used by plot-painters to determine the area of the plot that is cut away.
void MoveBox(Int_t px, Int_t py, Int_t axisID)
Move box cut along selected direction.
void AdjustBox()
Box cut is limited by plot's sizes.
Bool_t IsInCut(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax) const
Check, if box defined by xmin/xmax etc. is in cut.
void DrawBox(Bool_t selectionPass, Int_t selected) const
Draw cut as a semi-transparent box.
void TurnOnOff()
Turn the box cut on/off.
const TGLPlotBox *const fPlotBox
void StartMovement(Int_t px, Int_t py)
Start cut's movement.
virtual ~TGLBoxCut()
Destructor.
void SetActive(Bool_t a)
Turn the box cut on/off.
void ResetBoxGeometry()
Set geometry using plot's back box.
TGLBoxCut(const TGLPlotBox *plotBox)
Constructor.
const UChar_t * GetColour(Double_t z) const
Get color.
Int_t GetPaletteSize() const
Get. Palette. Size.
void DisableTexture() const
Disable 1D texture.
Double_t GetTexCoord(Double_t z) const
Get tex coordinate.
Bool_t GeneratePalette(UInt_t paletteSize, const Rgl::Range_t &zRange, Bool_t checkSize=kTRUE)
Try to find colors for palette.
void EnableTexture(Int_t mode) const
Enable 1D texture.
static void CloseEmbeddedPS()
this function used by gl-in-pad Restore the gVirtualPS output stream
static void StartEmbeddedPS()
this function used by gl-in-pad
Implementation of a box around a histogram/function for plot-painters.
Int_t FindFrontPoint() const
Convert 3d points into window coordinate system and find the nearest.
const TGLVertex3 * Get3DBox() const
Get 3D box.
const TGLVertex3 * Get2DBox() const
Get 2D box.
void SetFrameColor(const TColor *color)
Back box color.
Int_t GetFrontPoint() const
The nearest point.
Camera for TGLPlotPainter and sub-classes.
Int_t GetY() const
viewport[1]
void Apply(Double_t phi, Double_t theta) const
Applies rotations and translations before drawing.
Int_t GetX() const
viewport[0]
void SetCamera() const
Viewport and projection.
Int_t GetWidth() const
viewport[2]
Int_t GetHeight() const
viewport[3]
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
Double_t GetZLength() const
Z length.
void SetXLog(Bool_t xLog)
If log changed, sections must be reset, set fModified.
Bool_t SetRanges(const TH1 *hist, Bool_t errors=kFALSE, Bool_t zBins=kFALSE)
Set bin ranges, ranges.
Double_t GetYScale() const
const Rgl::Range_t & GetXRangeScaled() const
Scaled range.
const Rgl::BinRange_t & GetZBins() const
Z bins range.
Rgl::Range_t fZRangeScaled
Bool_t GetXLog() const
Get X log.
Int_t GetFirstXBin() const
const Rgl::BinRange_t & GetXBins() const
X bins range.
Int_t GetFirstYBin() const
const Rgl::Range_t & GetZRange() const
Z range.
virtual ~TGLPlotCoordinates()
Destructor.
Bool_t SetRangesPolar(const TH1 *hist)
Set bin ranges, ranges, etc.
const Rgl::Range_t & GetYRangeScaled() const
Scaled range.
Bool_t SetRangesCartesian(const TH1 *hist, Bool_t errors=kFALSE, Bool_t zBins=kFALSE)
Set bin ranges, ranges, etc.
void SetCoordType(EGLCoordType type)
If coord type was changed, plot must reset sections (if any), set fModified.
void ResetModified()
Reset modified.
TGLPlotCoordinates()
Constructor.
Bool_t SetRangesCylindrical(const TH1 *hist)
Set ranges cylindrical.
Bool_t GetYLog() const
Get Y log.
Bool_t GetZLog() const
Get Z log.
Bool_t Modified() const
Modified.
Double_t GetXScale() const
Double_t GetZScale() const
Int_t GetLastZBin() const
Int_t GetNXBins() const
Number of X bins.
Int_t GetFirstZBin() const
const Rgl::Range_t & GetZRangeScaled() const
Scaled range.
const Rgl::Range_t & GetYRange() const
Y range.
Double_t GetXLength() const
X length.
void SetZLog(Bool_t zLog)
If log changed, sections must be reset, set fModified.
void SetYLog(Bool_t yLog)
If log changed, sections must be reset, set fModified.
Bool_t SetRangesSpherical(const TH1 *hist)
Set ranges spherical.
Int_t GetLastYBin() const
const Rgl::Range_t & GetXRange() const
X range.
Int_t GetNYBins() const
Number of Y bins.
Int_t GetLastXBin() const
Rgl::Range_t fYRangeScaled
EGLCoordType GetCoordType() const
Get coordinates type.
Rgl::Range_t fXRangeScaled
const Rgl::BinRange_t & GetYBins() const
Y bins range.
Int_t GetNZBins() const
Number of Z bins.
Double_t GetYLength() const
Y length.
Double_t GetFactor() const
Get factor.
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms,...
void InvalidateSelection()
Selection must be updated.
void DrawSections() const
Draw sections (if any).
TGLPlotPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord, Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable)
TGLPlotPainter's ctor.
std::vector< Double_t > fZLevels
virtual void SetFrameColor(const TColor *frameColor)
Set plot's back box color.
TGLSelectionBuffer fSelection
void RestoreModelviewMatrix() const
virtual void DrawPaletteAxis() const
Draw. Palette. Axis.
@ kTrueColorSelectionBase
@ kHighColorSelectionBase
void SetPadColor(const TColor *color)
Used in a pad.
const TColor * GetPadColor() const
Get pad color.
virtual void DrawPlot() const =0
void PrintPlot() const
Generate PS using gl2ps.
virtual void InitGL() const =0
TGLPlotCoordinates * fCoord
void Paint() override
Draw lego/surf/whatever you can.
virtual void DrawSectionXOY() const =0
Bool_t PlotSelected(Int_t px, Int_t py) override
Read color buffer content to find selected object.
void SaveProjectionMatrix() const
virtual void DrawSectionYOZ() const =0
void SaveModelviewMatrix() const
void MoveSection(Int_t px, Int_t py)
Create dynamic profile using selected plane.
virtual void DeInitGL() const =0
void RestoreProjectionMatrix() const
virtual void ClearBuffers() const
virtual void DrawSectionXOZ() const =0
const UChar_t * GetPixelColor(Int_t px, Int_t py) const
Get pixel color.
void ReadColorBuffer(Int_t width, Int_t height)
Read color buffer.
void FindMinMax(Int_t sliceBegin, Int_t sliceEnd) const
Find minimum and maximum for slice.
void DrawSliceFrame(Int_t low, Int_t up) const
Draw slice frame.
Bool_t PreparePalette() const
Initialize color palette.
const TGLPlotCoordinates * fCoord
void PrepareTexCoords(Double_t pos, Int_t sliceBegin, Int_t sliceEnd) const
Prepare TexCoords.
void DrawSlice(Double_t pos) const
Draw slice.
TGLTH3Slice(const TString &sliceName, const TH3 *hist, const TGLPlotCoordinates *coord, const TGLPlotBox *box, ESliceAxis axis)
Constructor.
void SetSliceWidth(Int_t width=1)
Set Slice width.
void DrawSliceTextured(Double_t pos) const
Draw slice textured.
TGL2DArray< Double_t > fTexCoords
static void InitializeIfNeeded()
Initialize globals that require other libraries to be initialized.
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
void Paint(Option_t *chopt="") override
Draw this axis with its current attributes.
@ kClipFrame
Clip to the frame boundary.
TH1 is the base class of all histogram classes in ROOT.
virtual Double_t GetMinimumStored() const
virtual Double_t GetNormFactor() const
virtual Int_t GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
virtual Double_t GetCellError(Int_t binx, Int_t biny) const
virtual Double_t GetMaximumStored() const
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
2D Histogram with Polygonal Bins
TList * GetBins()
Returns the TList of all bins in the histogram.
Double_t GetMinimum() const
Returns the minimum value of the histogram.
Double_t GetMaximum() const
Returns the maximum value of the histogram.
The 3-D histogram classes derived from the 1-D histogram classes.
Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const override
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Bool_t GetHistMinimumZero() const
Double_t GetHistTopMargin() const
Int_t GetNumberContours() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void DrawQuadFilled(const TGLVertex3 &v0, const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &normal)
Draw quad face.
const Float_t gNullEmission[]
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
const Float_t gBlueEmission[]
void DrawPalette(const TGLPlotCamera *camera, const TGLLevelPalette &palette)
Draw. Palette.
void DrawPaletteAxis(const TGLPlotCamera *camera, const Range_t &minMax, Bool_t logZ)
std::pair< Int_t, Int_t > BinRange_t
std::pair< Double_t, Double_t > Range_t
void DrawBoxFront(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Int_t fp)
Draws lego's bar as a 3d box.
const Double_t gH2PolyScaleXY
Int_t ColorToObjectID(const UChar_t *color, Bool_t highColor)
void DrawAxes(Int_t frontPoint, const Int_t *viewport, const TGLVertex3 *box2D, const TGLPlotCoordinates *plotCoord, TAxis *xAxis, TAxis *yAxis, TAxis *zAxis)
Using front point, find, where to draw axes and which labels to use for them gVirtualX->SelectWindow(...
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.