32#include "TGLIncludes.h"
157 glGetIntegerv(GL_VIEWPORT, vp);
161 glDepthMask(GL_TRUE);
165 glPushAttrib(GL_LIGHTING_BIT);
174 glClear(GL_DEPTH_BUFFER_BIT);
176 const Float_t pos[] = {0.f, 0.f, 0.f, 1.f};
177 glLightfv(GL_LIGHT0, GL_POSITION, pos);
195 glViewport(vp[0], vp[1], vp[2], vp[3]);
198 glDepthMask(GL_FALSE);
235 FILE *output = fopen(
gVirtualPS->GetName(),
"a");
237 Error(
"TGLPlotPainter::PrintPlot",
"Could not (re)open ps file for GL output");
243 Int_t gl2psFormat = GL2PS_EPS;
244 Int_t gl2psSort = GL2PS_BSP_SORT;
246 Int_t state = GL2PS_OVERFLOW;
247 GLint gl2psoption = GL2PS_USE_CURRENT_VIEWPORT |
250 GL2PS_OCCLUSION_CULL |
253 while (state == GL2PS_OVERFLOW) {
254 bufsize += 1024*1024;
255 gl2psBeginPage (
"ROOT Scene Graph",
"ROOT",
nullptr,
256 gl2psFormat, gl2psSort, gl2psoption,
257 GL_RGBA, 0,
nullptr,0, 0, 0,
258 bufsize, output,
nullptr);
260 state = gl2psEndPage();
275 glMatrixMode(GL_PROJECTION);
277 glMatrixMode(GL_MODELVIEW);
283 glDepthMask(GL_TRUE);
284 glClearColor(0.f, 0.f, 0.f, 0.f);
285 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
297 glDepthMask(GL_FALSE);
298 glDisable(GL_DEPTH_TEST);
301 glMatrixMode(GL_PROJECTION);
303 glMatrixMode(GL_MODELVIEW);
379 if (frontPoint == 2) {
382 }
else if (!frontPoint) {
385 }
else if (frontPoint == 1) {
388 }
else if (frontPoint == 3) {
393 if (frontPoint == 2) {
396 }
else if (!frontPoint) {
399 }
else if (frontPoint == 1) {
402 }
else if (frontPoint == 3) {
409 glGetDoublev(GL_MODELVIEW_MATRIX, mv);
411 glGetDoublev(GL_PROJECTION_MATRIX, pr);
413 glGetIntegerv(GL_VIEWPORT, vp);
417 gluProject(0., 0.,
fXOYSectionPos, mv, pr, vp, &winVertex[0], &winVertex[1], &winVertex[2]);
422 &winVertex[0], &winVertex[1], &winVertex[2]);
426 gluUnProject(winVertex[0], winVertex[1], winVertex[2], mv, pr, vp,
427 newPoint, newPoint + 1, newPoint + 2);
457 glEnable(GL_POLYGON_OFFSET_FILL);
458 glPolygonOffset(1.f, 1.f);
460 glDisable(GL_POLYGON_OFFSET_FILL);
468 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
469 glDepthMask(GL_FALSE);
474 glLineStipple(1, stipple);
476 glColor3d(0., 0., 0.);
483 glDepthMask(GL_TRUE);
500 glEnable(GL_POLYGON_OFFSET_FILL);
501 glPolygonOffset(1.f, 1.f);
503 glDisable(GL_POLYGON_OFFSET_FILL);
511 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
512 glDepthMask(GL_FALSE);
516 glLineStipple(1, 0x5555);
518 glColor3d(0., 0., 0.);
525 glDepthMask(GL_TRUE);
542 glEnable(GL_POLYGON_OFFSET_FILL);
543 glPolygonOffset(1.f, 1.f);
546 glDisable(GL_POLYGON_OFFSET_FILL);
554 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
555 glDepthMask(GL_FALSE);
557 glDepthMask(GL_TRUE);
587 glMatrixMode(GL_MODELVIEW);
595 glMatrixMode(GL_PROJECTION);
603 glMatrixMode(GL_MODELVIEW);
611 glMatrixMode(GL_PROJECTION);
907 if (!FindAxisRange(hist->
GetXaxis(),
fXLog, xBins, xRange)) {
908 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Cannot set X axis to log scale");
914 if (!FindAxisRange(hist->
GetYaxis(),
fYLog, yBins, yRange)) {
915 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Cannot set Y axis to log scale");
924 if (!FindAxisRange(hist->
GetZaxis(),
fZLog, zBins, zRange)) {
925 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Cannot set Z axis to log scale");
928 }
else if (!FindAxisRange(hist,
fZLog, xBins, yBins, zRange, factor, errors)) {
929 Error(
"TGLPlotCoordinates::SetRangesCartesian",
930 "Log scale is requested for Z, but maximum less or equal 0. (%f)", zRange.second);
935 const Double_t x = xRange.second - xRange.first;
936 const Double_t y = yRange.second - yRange.first;
937 const Double_t z = zRange.second - zRange.first;
939 if (!
x || !
y || !z) {
940 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Zero axis range.");
987 if (!FindAxisRange(hist,
fZLog, zRange))
991 const Double_t x = xRange.second - xRange.first;
992 const Double_t y = yRange.second - yRange.first;
993 const Double_t z = zRange.second - zRange.first;
995 if (!
x || !
y || !z) {
996 Error(
"TGLPlotCoordinates::SetRanges",
"Zero axis range.");
1029 FindAxisRange(xAxis,
kFALSE, xBins, xRange);
1034 FindAxisRange(yAxis,
kFALSE, yBins, yRange);
1040 FindAxisRange(zAxis,
kFALSE, zBins, zRange);
1043 const Double_t x = xRange.second - xRange.first;
1044 const Double_t y = yRange.second - yRange.first;
1045 const Double_t z = zRange.second - zRange.first;
1047 if (!
x || !
y || !z) {
1048 Error(
"TGLPlotCoordinates::SetRangesCartesian",
"Zero axis range.");
1085 FindAxisRange(xAxis,
kFALSE, xBins, phiRange);
1086 if (xBins.second - xBins.first + 1 > 360) {
1087 Error(
"TGLPlotCoordinates::SetRangesPolar",
"To many PHI sectors");
1094 FindAxisRange(yAxis,
kFALSE, yBins, roRange);
1098 if (!FindAxisRange(hist,
fZLog, xBins, yBins, zRange, factor,
kFALSE))
1100 Error(
"TGLPlotCoordinates::SetRangesPolar",
1101 "Log scale is requested for Z, but maximum less or equal 0. (%f)", zRange.second);
1105 const Double_t z = zRange.second - zRange.first;
1106 if (!z || !(phiRange.second - phiRange.first) || !(roRange.second - roRange.first)) {
1107 Error(
"TGLPlotCoordinates::SetRangesPolar",
"Zero axis range.");
1143 FindAxisRange(xAxis,
kFALSE, xBins, angleRange);
1144 if (xBins.second - xBins.first + 1 > 360) {
1145 Error(
"TGLPlotCoordinates::SetRangesCylindrical",
"To many PHI sectors");
1148 if (!FindAxisRange(yAxis,
fYLog, yBins, heightRange)) {
1149 Error(
"TGLPlotCoordinates::SetRangesCylindrical",
"Cannot set Y axis to log scale");
1152 FindAxisRange(hist,
kFALSE, xBins, yBins, radiusRange, factor,
kFALSE);
1154 const Double_t x = angleRange.second - angleRange.first;
1155 const Double_t y = heightRange.second - heightRange.first;
1156 const Double_t z = radiusRange.second - radiusRange.first;
1158 if (!
x || !
y || !z) {
1159 Error(
"TGLPlotCoordinates::SetRangesCylindrical",
"Zero axis range.");
1193 if (xBins.second - xBins.first + 1 > 360) {
1194 Error(
"TGLPlotCoordinates::SetRangesSpherical",
"To many PHI sectors");
1201 if (yBins.second - yBins.first + 1 > 180) {
1202 Error(
"TGLPlotCoordinates::SetRangesSpherical",
"To many THETA sectors");
1208 FindAxisRange(hist,
kFALSE, xBins, yBins, radiusRange, factor,
kFALSE);
1248 for (
const Int_t lastBin = axis->
GetLast(); currBin <= lastBin; ++currBin)
1271 if (range.second <= 0.)
1276 if (range.first <= 0.) {
1279 if (bin > bins.second)
1284 if (bin > bins.second)
1309 zRange.second = hist->
GetBinContent(hist->
GetBin(xBins.first, yBins.first)), zRange.first = zRange.second;
1312 for (
Int_t i = xBins.first; i <= xBins.second; ++i) {
1313 for (
Int_t j = yBins.first; j <= yBins.second; ++j) {
1315 if (val > 0. && errors)
1317 zRange.second =
TMath::Max(val, zRange.second);
1318 zRange.first =
TMath::Min(val, zRange.first);
1328 if (logZ && zRange.second <= 0.)
1331 if (zRange.first >= zRange.second)
1332 zRange.first = 0.001 * zRange.second;
1335 if (summ) factor /= summ;
1336 if (!factor) factor = 1.;
1338 Warning(
"TGLPlotPainter::ExtractAxisZInfo",
1339 "Negative factor, negative ranges - possible incorrect behavior");
1341 zRange.second *= factor;
1342 zRange.first *= factor;
1345 if (zRange.first <= 0.)
1346 zRange.first =
TMath::Min(1., 0.001 * zRange.second);
1357 zRange.second += margin * (zRange.second - zRange.first);
1359 if (
gStyle->GetHistMinimumZero())
1360 zRange.first >= 0 ? zRange.first = 0. : zRange.first -= margin * (zRange.second - zRange.first);
1362 zRange.first >= 0 && zRange.first - margin * (zRange.second - zRange.first) <= 0 ?
1363 zRange.first = 0 : zRange.first -= margin * (zRange.second - zRange.first);
1376 Error(
"FindAxisRange",
"TH2Poly returned empty list of bins");
1383 if (zRange.first >= zRange.second)
1384 zRange.first = 0.001 * zRange.second;
1387 if (zRange.second < 1
e-20) {
1388 Error(
"FindAxisRange",
"Failed to switch Z axis to logarithmic scale");
1392 if (zRange.first <= 0.)
1393 zRange.first =
TMath::Min(1., 0.001 * zRange.second);
1404 zRange.second += margin * (zRange.second - zRange.first);
1405 if (
gStyle->GetHistMinimumZero())
1406 zRange.first >= 0 ? zRange.first = 0. : zRange.first -= margin * (zRange.second - zRange.first);
1408 zRange.first >= 0 && zRange.first - margin * (zRange.second - zRange.first) <= 0 ?
1409 zRange.first = 0 : zRange.first -= margin * (zRange.second - zRange.first);
1473 (
box[0].Z() +
box[4].Z()) / 2);
1506 if (!selectionPass) {
1507 glDisable(GL_LIGHTING);
1529 glEnable(GL_LIGHTING);
1531 GLboolean oldBlendState =
kFALSE;
1532 glGetBooleanv(GL_BLEND, &oldBlendState);
1537 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1540 const Float_t diffuseColor[] = {0.f, 0.f, 1.f, 0.1f};
1541 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuseColor);
1547 glDisable(GL_BLEND);
1586 glGetDoublev(GL_MODELVIEW_MATRIX, mv);
1588 glGetDoublev(GL_PROJECTION_MATRIX, pr);
1590 glGetIntegerv(GL_VIEWPORT, vp);
1595 gluProject(
fCenter.X(), 0., 0., mv, pr, vp, &winVertex[0], &winVertex[1], &winVertex[2]);
1598 gluProject(0.,
fCenter.Y(), 0., mv, pr, vp, &winVertex[0], &winVertex[1], &winVertex[2]);
1601 gluProject(0., 0.,
fCenter.Z(), mv, pr, vp, &winVertex[0], &winVertex[1], &winVertex[2]);
1608 gluUnProject(winVertex[0], winVertex[1], winVertex[2], mv, pr, vp,
1609 newPoint, newPoint + 1, newPoint + 2);
1735 if (
fAxis->GetLast() -
fAxis->GetFirst() + 1 <= width)
1748 if (pos >=
fAxis->GetBinLowEdge(i) && pos <= fAxis->GetBinUpEdge(i)) {
1755 Int_t low = 1, up = 2;
1760 low =
fAxis->GetFirst();
1772 fPalette.EnableTexture(GL_REPLACE);
1840 if (!paletteSize && !(paletteSize =
gStyle->GetNumberContours()))
1857 for (
Int_t j =
fCoord->GetFirstZBin(), jt = 0, ej =
fCoord->GetLastZBin(); j <= ej; ++j, ++jt) {
1858 for (
Int_t i =
fCoord->GetFirstXBin(), it = 0, ei =
fCoord->GetLastXBin(); i <= ei; ++i, ++it) {
1860 for (
Int_t level = low; level < up; ++ level)
1861 val +=
fHist->GetBinContent(i, level, j);
1866 for (
Int_t j =
fCoord->GetFirstZBin(), jt = 0, ej =
fCoord->GetLastZBin(); j <= ej; ++j, ++jt) {
1867 for (
Int_t i =
fCoord->GetFirstXBin(), it = 0, ei =
fCoord->GetLastXBin(); i <= ei; ++i, ++it) {
1868 Double_t val =
fF3->Eval(
fHist->GetXaxis()->GetBinCenter(i), pos,
fHist->GetZaxis()->GetBinCenter(j));
1882 for (
Int_t j =
fCoord->GetFirstZBin(), jt = 0, ej =
fCoord->GetLastZBin(); j <= ej; ++j, ++jt) {
1883 for (
Int_t i =
fCoord->GetFirstYBin(), it = 0, ei =
fCoord->GetLastYBin(); i <= ei; ++i, ++it) {
1885 for (
Int_t level = low; level < up; ++ level)
1886 val +=
fHist->GetBinContent(level, i, j);
1891 for (
Int_t j =
fCoord->GetFirstZBin(), jt = 0, ej =
fCoord->GetLastZBin(); j <= ej; ++j, ++jt) {
1892 for (
Int_t i =
fCoord->GetFirstXBin(), it = 0, ei =
fCoord->GetLastXBin(); i <= ei; ++i, ++it) {
1893 Double_t val =
fF3->Eval(pos,
fHist->GetYaxis()->GetBinCenter(i),
fHist->GetZaxis()->GetBinCenter(j));
1907 for (
Int_t i =
fCoord->GetFirstXBin(), ir = 0, ei =
fCoord->GetLastXBin(); i <= ei; ++i, ++ir) {
1908 for (
Int_t j =
fCoord->GetFirstYBin(), jr = 0, ej =
fCoord->GetLastYBin(); j <= ej; ++j, ++jr) {
1910 for (
Int_t level = low; level < up; ++ level)
1911 val +=
fHist->GetBinContent(i, j, level);
1916 for (
Int_t i =
fCoord->GetFirstXBin(), it = 0, ei =
fCoord->GetLastXBin(); i <= ei; ++i, ++it) {
1917 for (
Int_t j =
fCoord->GetFirstYBin(), jt = 0, ej =
fCoord->GetLastYBin(); j <= ej; ++j, ++jt) {
1918 Double_t val =
fF3->Eval(
fHist->GetXaxis()->GetBinCenter(i),
fHist->GetYaxis()->GetBinCenter(j), pos);
1947 for (
Int_t j =
fCoord->GetFirstZBin(), jt = 0, ej =
fCoord->GetLastZBin(); j < ej; ++j, ++jt) {
1948 for (
Int_t i =
fCoord->GetFirstXBin(), it = 0, ei =
fCoord->GetLastXBin(); i < ei; ++i, ++it) {
1953 glBegin(GL_POLYGON);
1955 glVertex3d(xMin, pos, zMin);
1957 glVertex3d(xMin, pos, zMax);
1959 glVertex3d(xMax, pos, zMax);
1961 glVertex3d(xMax, pos, zMin);
1968 for (
Int_t j =
fCoord->GetFirstZBin(), jt = 0, ej =
fCoord->GetLastZBin(); j < ej; ++j, ++jt) {
1969 for (
Int_t i =
fCoord->GetFirstYBin(), it = 0, ei =
fCoord->GetLastYBin(); i < ei; ++i, ++it) {
1974 glBegin(GL_POLYGON);
1976 glVertex3d(pos, yMin, zMin);
1978 glVertex3d(pos, yMax, zMin);
1980 glVertex3d(pos, yMax, zMax);
1982 glVertex3d(pos, yMin, zMax);
1989 for (
Int_t j =
fCoord->GetFirstXBin(), jt = 0, ej =
fCoord->GetLastXBin(); j < ej; ++j, ++jt) {
1990 for (
Int_t i =
fCoord->GetFirstYBin(), it = 0, ei =
fCoord->GetLastYBin(); i < ei; ++i, ++it) {
1995 glBegin(GL_POLYGON);
1997 glVertex3d(xMax, yMin, pos);
1999 glVertex3d(xMax, yMax, pos);
2001 glVertex3d(xMin, yMax, pos);
2003 glVertex3d(xMin, yMin, pos);
2018 glBegin(GL_LINE_LOOP);
2019 glVertex3d(xMin, yMin, zMin);
2020 glVertex3d(xMax, yMin, zMin);
2021 glVertex3d(xMax, yMax, zMin);
2022 glVertex3d(xMin, yMax, zMin);
2025 glBegin(GL_LINE_LOOP);
2026 glVertex3d(xMin, yMin, zMax);
2027 glVertex3d(xMax, yMin, zMax);
2028 glVertex3d(xMax, yMax, zMax);
2029 glVertex3d(xMin, yMax, zMax);
2033 glVertex3d(xMin, yMin, zMin);
2034 glVertex3d(xMin, yMin, zMax);
2035 glVertex3d(xMax, yMin, zMin);
2036 glVertex3d(xMax, yMin, zMax);
2037 glVertex3d(xMax, yMax, zMin);
2038 glVertex3d(xMax, yMax, zMax);
2039 glVertex3d(xMin, yMax, zMin);
2040 glVertex3d(xMin, yMax, zMax);
2051 glColor3d(1., 0., 0.);
2056 DrawBoxOutline(
box[0].
X(),
box[1].
X(),
2058 fAxis->GetBinUpEdge(up - 1) *
fCoord->GetYScale(),
2062 DrawBoxOutline(
fAxis->GetBinLowEdge(low) *
fCoord->GetXScale(),
2063 fAxis->GetBinUpEdge(up - 1) *
fCoord->GetXScale(),
2068 DrawBoxOutline(
box[0].
X(),
box[1].
X(),
2071 fAxis->GetBinUpEdge(up - 1) *
fCoord->GetZScale());
2085 (
box[0].Y() +
box[2].Y()) / 2,
2086 (
box[0].Z() +
box[4].Z()) / 2};
2089 glTranslated(-center[0], -center[1], -center[2]);
2096 fPainter->RestoreModelviewMatrix();
2116 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2118 glMatrixMode(GL_PROJECTION);
2122 glMatrixMode(GL_MODELVIEW);
2131 glBegin(GL_POLYGON);
2133 glColor4ub(color[0], color[1], color[2], 150);
2134 glVertex2d(leftX, margin + i *
h);
2135 glVertex2d(rightX, margin + i *
h);
2136 glVertex2d(rightX, margin + (i + 1) *
h);
2137 glVertex2d(leftX, margin + (i + 1) *
h);
2142 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
2143 glColor4d(0., 0., 0., 0.5);
2146 glBegin(GL_LINE_LOOP);
2147 glVertex2d(leftX, margin + i *
h);
2148 glVertex2d(rightX, margin + i *
h);
2149 glVertex2d(rightX, margin + (i + 1) *
h);
2150 glVertex2d(leftX, margin + (i + 1) *
h);
2160 const std::vector<Double_t> & levels)
2166 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2168 glMatrixMode(GL_PROJECTION);
2172 glMatrixMode(GL_MODELVIEW);
2179 const Double_t range = levels.back() - levels.front();
2184 const Double_t yMin = margin + (levels[i] - levels.front()) / range *
h;
2185 const Double_t yMax = margin + (levels[i + 1] - levels.front()) / range *
h;
2186 glBegin(GL_POLYGON);
2188 glColor4ub(color[0], color[1], color[2], opacity);
2189 glVertex2d(leftX, yMin);
2190 glVertex2d(rightX, yMin);
2191 glVertex2d(rightX, yMax);
2192 glVertex2d(leftX, yMax);
2197 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
2198 glColor4d(0., 0., 0., 0.5);
2201 const Double_t yMin = (levels[i] - levels.front()) / range *
h;
2202 const Double_t yMax = (levels[i + 1] - levels.front()) / range *
h;
2204 glBegin(GL_LINE_LOOP);
2205 glVertex2d(leftX, margin + yMin);
2206 glVertex2d(rightX, margin + yMin);
2207 glVertex2d(rightX, margin + yMax);
2208 glVertex2d(leftX, margin + yMax);
2224 pixelW =
UInt_t(pixelW / scale);
2225 pixelH =
UInt_t(pixelH / scale);
2230 +
gPad->GetYlowNDC() *
gPad->GetWh())));
2232 +
gPad->GetYlowNDC() *
gPad->GetWh())));
2248 TGaxis axisPainter(
x, yMin,
x, yMax, zMin, zMax, 510, logZ ?
"G" :
"");
2249 axisPainter.
Paint();
2251 gPad->SetLogx(logX);
2252 gPad->SetLogy(logY);
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short).
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
externTVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
externTVirtualPS * 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
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.
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.
Camera for TGLPlotPainter and sub-classes.
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.
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.
const Rgl::BinRange_t & GetXBins() const
X bins range.
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.
Int_t GetNXBins() const
Number of X bins.
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.
const Rgl::Range_t & GetXRange() const
X range.
Int_t GetNYBins() const
Number of Y bins.
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).
const Float_t * fPhysicalShapeColor
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
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
This method must be overridden if a class wants to paint itself.
@ 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.
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.