27#include "TGLIncludes.h"
36bool IsGradientFill(
Color_t fillColorIndex)
304 Int_t px = 0, py = 0;
306 pad->XYtoAbsPixel(pad->GetX1(), pad->GetY1(), px, py);
308 py =
gPad->GetWh() - py;
313 glViewport(
GLint(px * scale),
GLint(py * scale),
314 GLsizei(
gPad->GetWw() * pad->GetAbsWNDC() * scale),
315 GLsizei(
gPad->GetWh() * pad->GetAbsHNDC() * scale));
317 glMatrixMode(GL_PROJECTION);
319 glOrtho(pad->GetX1(), pad->GetX2(), pad->GetY1(), pad->GetY2(), -10., 10.);
321 glMatrixMode(GL_MODELVIEW);
323 glTranslated(0., 0., -1.);
325 ::Error(
"TGLPadPainter::SelectDrawable",
326 "function was called not from TPad or TCanvas code\n");
327 throw std::runtime_error(
"");
343 glDisable(GL_DEPTH_TEST);
344 glDisable(GL_CULL_FACE);
345 glDisable(GL_LIGHTING);
351 glClearColor(1.,1.,1.,1.);
352 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
355 glMatrixMode(GL_PROJECTION);
358 glOrtho(
gPad->GetX1(),
gPad->GetX2(),
gPad->GetY1(),
gPad->GetY2(), -10., 10.);
360 glMatrixMode(GL_MODELVIEW);
362 glTranslated(0., 0., -1.);
375 glMatrixMode(GL_PROJECTION);
378 glOrtho(
gPad->GetX1(),
gPad->GetX2(),
gPad->GetY1(),
gPad->GetY2(), -10., 10.);
380 glMatrixMode(GL_MODELVIEW);
415 gPad->XtoAbsPixel(
x2),
gPad->YtoAbsPixel(y2));
432 glPointSize((
GLfloat)pointSize);
434 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
458 glVertex2d(
gPad->GetX1() + u1 * xRange,
gPad->GetY1() +
v1 * yRange);
459 glVertex2d(
gPad->GetX1() + u2 * xRange,
gPad->GetY1() +
v2 * yRange);
470 if (IsGradientFill(
gVirtualX->GetFillColor())) {
480 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
481 glRectd(
x1, y1,
x2, y2);
482 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
486 glRectd(
x1, y1,
x2, y2);
495 assert(
x != 0 &&
"DrawFillArea, parameter 'x' is null");
496 assert(
y != 0 &&
"DrawFillArea, parameter 'y' is null");
502 ::Error(
"TGLPadPainter::DrawFillArea",
503 "invalid number of points in a polygon");
507 if (IsGradientFill(
gVirtualX->GetFillColor()))
534 for (
Int_t i = 0; i <
n; ++i) {
536 fVs[i * 3 + 1] =
y[i];
545 for (
Int_t i = 0; i <
n; ++i)
563 for (
Int_t i = 0; i <
n; ++i)
564 glVertex2d(
x[i],
y[i]);
567 glVertex2d(
x[0],
y[0]);
576 glPointSize((
GLfloat)pointSize);
578 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
581 for (
Int_t i = 0; i <
n; ++i)
582 glVertex2d(
x[i],
y[i]);
600 for (
Int_t i = 0; i <
n; ++i)
601 glVertex2f(
x[i],
y[i]);
604 glVertex2f(
x[0],
y[0]);
625 for (
Int_t i = 0; i <
n; ++i)
626 glVertex2d(
x1 + u[i] * xRange, y1 +
v[i] * yRange);
634template<
class ValueType>
635void ConvertMarkerPoints(
Int_t n,
const ValueType *
x,
const ValueType *
y, std::vector<TPoint> & dst);
646 ConvertMarkerPoints(
n,
x,
y,
fPoly);
657 ConvertMarkerPoints(
n,
x,
y,
fPoly);
671 glOrtho(0,
gPad->GetAbsWNDC() *
gPad->GetWw(), 0,
gPad->GetAbsHNDC() *
gPad->GetWh(), -10., 10.);
673 glMatrixMode(GL_MODELVIEW);
679 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
688 switch (markerStyle) {
726 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
728 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
731 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
733 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
804 glMatrixMode(GL_MODELVIEW);
817 glOrtho(0,
gPad->GetAbsWNDC() *
gPad->GetWw(), 0,
gPad->GetAbsHNDC() *
gPad->GetWh(), -10., 10.);
819 glMatrixMode(GL_MODELVIEW);
832 fontIndex = 20 + shift * 10;
834 fontIndex += shift * 10;
847 glMatrixMode(GL_MODELVIEW);
919 glMatrixMode(GL_PROJECTION);
930 glMatrixMode(GL_PROJECTION);
941 glMatrixMode(GL_MODELVIEW);
952 glMatrixMode(GL_MODELVIEW);
961 glGetIntegerv(GL_VIEWPORT,
fVp);
983 std::vector<unsigned> buff(canvas->
GetWw() * canvas->
GetWh());
984 glPixelStorei(GL_PACK_ALIGNMENT, 1);
985 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
988 glReadPixels(0, 0, canvas->
GetWw(), canvas->
GetWh(), GL_RGBA, GL_UNSIGNED_BYTE, (
char *)&buff[0]);
992 ::Error(
"TGLPadPainter::SaveImage",
"TImage creation failed");
996 image->DrawRectangle(0, 0, canvas->
GetWw(), canvas->
GetWh());
997 UInt_t *argb = image->GetArgbArray();
1000 ::Error(
"TGLPadPainter::SaveImage",
"null argb array in TImage object");
1007 for (
Int_t i = 0; i < nLines; ++i) {
1008 Int_t base = (nLines - 1 - i) * nPixels;
1009 for (
Int_t j = 0; j < nPixels; ++j, ++base) {
1012 const UInt_t pix = buff[base];
1013 const UInt_t bgra = ((pix & 0xff) << 16) | (pix & 0xff00) |
1014 ((pix & 0xff0000) >> 16) | (pix & 0xff000000);
1017 argb[i * nPixels + j] = bgra;
1034 ::Error(
"TGLPadPainter::DrawPixels",
"pixel data is null");
1038 if (std::numeric_limits<UInt_t>::digits >= 32) {
1047 ::Error(
"TGLPadPainter::DrawPixels",
"invalid width");
1053 ::Error(
"TGLPadPainter::DrawPixels",
"invalid height");
1062 const Double_t rasterX =
Double_t(dstX) / (pad->GetAbsWNDC() * pad->GetWw()) *
1063 (pad->GetX2() - pad->GetX1()) + pad->GetX1();
1065 const Double_t yRange = pad->GetY2() - pad->GetY1();
1066 const Double_t rasterY = yRange -
Double_t(dstY + height) / (pad->GetAbsHNDC() * pad->GetWh()) * yRange +
1071 glGetDoublev(GL_CURRENT_RASTER_POSITION, oldPos);
1073 glRasterPos2d(rasterX, rasterY);
1075 std::vector<unsigned char> upsideDownImage(4 *
width * height);
1076 const unsigned char *srcLine = pixelData + 4 *
width * (height - 1);
1077 unsigned char *dstLine = &upsideDownImage[0];
1078 for (
UInt_t i = 0; i < height; ++i, srcLine -= 4 *
width, dstLine += 4 *
width)
1079 std::copy(srcLine, srcLine + 4 *
width, dstLine);
1081 if (enableBlending) {
1083 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1086 glDrawPixels(
width, height,
GL_BGRA, GL_UNSIGNED_BYTE, &upsideDownImage[0]);
1089 glDisable(GL_BLEND);
1092 glRasterPos2d(oldPos[0], oldPos[1]);
1094 ::Error(
"TGLPadPainter::DrawPixels",
"no pad found to draw");
1106 assert(
n > 2 &&
"DrawPolygonWithGradient, invalid number of points");
1107 assert(
x != 0 &&
"DrawPolygonWithGradient, parameter 'x' is null");
1108 assert(
y != 0 &&
"DrawPolygonWithGradient, parameter 'y' is null");
1111 "DrawPolygonWithGradient, the current fill color is not a gradient fill");
1126 glStencilFunc(GL_NEVER, 1, 0xFF);
1127 glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);
1129 glStencilMask(0xFF);
1130 glClear(GL_STENCIL_BUFFER_BIT);
1136 glStencilMask(0x00);
1138 glStencilFunc(GL_EQUAL, 0, 0xFF);
1140 glStencilFunc(GL_EQUAL, 1, 0xFF);
1151 assert(lGrad != 0 &&
"DrawPolygonWithGradient, unknown gradient type");
1161 assert(grad != 0 &&
"DrawGradient, parameter 'grad' is null");
1162 assert(nPoints > 2 &&
"DrawGradient, invalid number of points");
1163 assert(xs != 0 &&
"DrawGradient, parameter 'xs' is null");
1164 assert(ys != 0 &&
"DrawGradient, parameter 'ys' is null");
1167 ::Warning(
"TGLPadPainter::DrawGradient",
1168 "extended radial gradient is not supported");
1179 radius *=
TMath::Max(bbox.fWidth, bbox.fHeight);
1180 center.fX = bbox.fWidth * center.fX + bbox.fXMin;
1181 center.fY = bbox.fHeight * center.fY + bbox.fYMin;
1183 const auto w =
gPad->GetX2() -
gPad->GetX1();
1184 const auto h =
gPad->GetY2() -
gPad->GetY1();
1191 const auto pixelW =
gPad->GetAbsWNDC() *
gPad->GetWw();
1192 const auto pixelH =
gPad->GetAbsHNDC() *
gPad->GetWh();
1197 glMatrixMode(GL_PROJECTION);
1200 glOrtho(0., pixelW, 0., pixelH, -10., 10.);
1203 center.fX =
gPad->XtoPixel(center.fX);
1204 center.fY = pixelH -
gPad->YtoPixel(center.fY);
1210 const Double_t yMin = pixelH -
gPad->YtoPixel(bbox.fYMin);
1211 const Double_t yMax = pixelH -
gPad->YtoPixel(bbox.fYMax);
1218 maxR =
TMath::Sqrt(maxDistX * maxDistX + maxDistY * maxDistY);
1223 const Bool_t solidFillAfter = maxR > radius;
1226 const UInt_t nSlices = 500;
1231 const auto nCircles = nColors + 1 + solidFillAfter;
1237 std::vector<Double_t> circles(nSlices * nCircles * 2);
1241 for (
UInt_t i = 0; i < nColors; ++i) {
1242 const auto circle = &circles[i * nSlices * 2];
1244 const auto r = radius * locations[i];
1245 for (
UInt_t j = 0,
e = nSlices * 2 - 2; j <
e; j += 2) {
1246 circle[j] = center.fX +
r *
TMath::Cos(angle * j);
1247 circle[j + 1] = center.fY +
r *
TMath::Sin(angle * j);
1250 circle[(nSlices - 1) * 2] = circle[0];
1251 circle[(nSlices - 1) * 2 + 1] = circle[1];
1256 const auto circle = &circles[nColors * nSlices * 2];
1257 for (
UInt_t j = 0,
e = nSlices * 2 - 2; j <
e; j += 2) {
1258 circle[j] = center.fX + radius *
TMath::Cos(angle * j);
1259 circle[j + 1] = center.fY + radius *
TMath::Sin(angle * j);
1262 circle[(nSlices - 1) * 2] = circle[0];
1263 circle[(nSlices - 1) * 2 + 1] = circle[1];
1266 if (solidFillAfter) {
1268 const auto circle = &circles[(nCircles - 1) * nSlices * 2];
1269 for (
UInt_t j = 0,
e = nSlices * 2 - 2; j <
e; j += 2) {
1270 circle[j] = center.fX + maxR *
TMath::Cos(angle * j);
1271 circle[j + 1] = center.fY + maxR *
TMath::Sin(angle * j);
1274 circle[(nSlices - 1) * 2] = circle[0];
1275 circle[(nSlices - 1) * 2 + 1] = circle[1];
1290 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1295 glVertex2d(center.fX, center.fY);
1297 for (
UInt_t i = 0,
e = nSlices * 2; i <
e; i += 2)
1298 glVertex2dv(&circles[i]);
1303 for (
UInt_t i = 0; i < nColors - 1; ++i) {
1304 const Double_t *
const inner = &circles[i * nSlices * 2];
1305 const auto innerRGBA = rgba + i * 4;
1306 const auto outerRGBA = rgba + (i + 1) * 4;
1307 const Double_t *
const outer = &circles[(i + 1) * nSlices * 2];
1315 const Double_t *
const inner = &circles[nSlices * (nColors - 1) * 2];
1316 const auto solidRGBA = rgba + (nColors - 1) * 4;
1317 const Double_t *
const outer = &circles[nSlices * nColors * 2];
1322 if (solidFillAfter) {
1324 const Double_t *
const inner = &circles[nSlices * nColors * 2];
1325 const auto solidRGBA = rgba + (nColors - 1) * 4;
1326 const Double_t *
const outer = &circles[nSlices * (nColors + 1) * 2];
1340 assert(grad != 0 &&
"DrawGradient, parameter 'grad' is null");
1341 assert(
n > 2 &&
"DrawGradient, invalid number of points");
1342 assert(
x != 0 &&
"DrawGradient, parameter 'x' is null");
1343 assert(
y != 0 &&
"DrawGradient, parameter 'y' is null");
1359 glMatrixMode(GL_PROJECTION);
1364 glOrtho(0., pixelW, 0., pixelH, -10., 10.);
1367 glMatrixMode(GL_MODELVIEW);
1379 start.
fX = start.
fX * w;
1380 start.
fY = start.
fY *
h;
1381 end.
fX = end.
fX * w;
1382 end.
fY = end.
fY *
h;
1384 start.
fX = start.
fX * bbox.fWidth + bbox.fXMin;
1385 start.
fY = start.
fY * bbox.fHeight + bbox.fYMin;
1386 end.
fX = end.
fX * bbox.fWidth + bbox.fXMin;
1387 end.
fY = end.
fY * bbox.fHeight + bbox.fYMin;
1394 start.
fX =
gPad->XtoPixel(start.
fX);
1395 start.
fY = pixelH -
gPad->YtoPixel(start.
fY);
1397 end.
fY = pixelH -
gPad->YtoPixel(end.
fY);
1400 const Double_t yMin = pixelH -
gPad->YtoPixel(bbox.fYMin);
1401 const Double_t yMax = pixelH -
gPad->YtoPixel(bbox.fYMax);
1411 (end.
fY - start.
fY) * (end.
fY - start.
fY));
1418 gradBoxes[0] = start.
fY -
h;
1420 gradBoxes[i] = startEndLength * colorPositions[i - 1] + start.
fY;
1427 if (end.
fX > start.
fX)
1430 glTranslated(start.
fX, start.
fY, 0.);
1431 glRotated(angle, 0., 0., 1.);
1432 glTranslated(-start.
fX, -start.
fY, 0.);
1436 const unsigned nEdges = gradBoxes.size();
1442 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1446 rgba + (nColors - 1) * 4, rgba + (nColors - 1) * 4);
1448 for (
unsigned i = 1; i < nEdges - 2; ++i)
1450 xRight, rgba + (i - 1) * 4, rgba + i * 4);
1460 assert(
n > 2 &&
"DrawTesselation, invalid number of points");
1461 assert(
x != 0 &&
"DrawTesselation, parameter 'x' is null");
1462 assert(
y != 0 &&
"DrawTesselation, parameter 'y' is null");
1467 for (
Int_t i = 0; i <
n; ++i) {
1469 fVs[i * 3 + 1] =
y[i];
1470 fVs[i * 3 + 2] = 0.;
1479 for (
Int_t i = 0; i <
n; ++i)
1489template<
class ValueType>
1490void ConvertMarkerPoints(
Int_t n,
const ValueType *
x,
const ValueType *
y, std::vector<TPoint> & dst)
1495 for (
Int_t i = 0; i <
n; ++i) {
1496 dst[i].fX =
gPad->XtoPixel(
x[i]);
1497 dst[i].fY = padH -
gPad->YtoPixel(
y[i]);
GLAPI void GLAPIENTRY gluBeginPolygon(GLUtesselator *tess)
GLAPI void GLAPIENTRY gluNextContour(GLUtesselator *tess, GLenum type)
GLAPI void GLAPIENTRY gluEndPolygon(GLUtesselator *tess)
GLAPI void GLAPIENTRY gluTessVertex(GLUtesselator *tess, GLdouble *location, GLvoid *data)
static const double x2[5]
static const double x1[5]
include TDocParser_001 C image html pict1_TDocParser_001 png width
void Error(const char *location, const char *msgfmt,...)
void Warning(const char *location, const char *msgfmt,...)
const Double_t lineWidthTS
char * Form(const char *fmt,...)
Double_t GetMaxLineWidth() const
Double_t GetMaxPointSize() const
void DrawOpenThreeTriangles(UInt_t n, const TPoint *xy) const
void DrawFullCrossX(UInt_t n, const TPoint *xy) const
void DrawFullDotSmall(UInt_t n, const TPoint *xy) const
void DrawOpenSquareDiagonal(UInt_t n, const TPoint *xy) const
void DrawOpenDoubleDiamond(UInt_t n, const TPoint *xy) const
void DrawFullFourTrianglesX(UInt_t n, const TPoint *xy) const
void DrawFullDotLarge(UInt_t n, const TPoint *xy) const
void DrawFullThreeTriangles(UInt_t n, const TPoint *xy) const
void DrawCircle(UInt_t n, const TPoint *xy) const
void DrawFullFourTrianglesPlus(UInt_t n, const TPoint *xy) const
void DrawOpenCross(UInt_t n, const TPoint *xy) const
void DrawFullCross(UInt_t n, const TPoint *xy) const
void DrawFullTrianlgeDown(UInt_t n, const TPoint *xy) const
void DrawOpenStar(UInt_t n, const TPoint *xy) const
Full star pentagone.
void DrawX(UInt_t n, const TPoint *xy) const
void DrawPlus(UInt_t n, const TPoint *xy) const
void DrawFullTrianlgeUp(UInt_t n, const TPoint *xy) const
void DrawFullSquare(UInt_t n, const TPoint *xy) const
void DrawOpenFourTrianglesPlus(UInt_t n, const TPoint *xy) const
void DrawStar(UInt_t n, const TPoint *xy) const
void DrawFullDoubleDiamond(UInt_t n, const TPoint *xy) const
void DrawOpenCrossX(UInt_t n, const TPoint *xy) const
void DrawDot(UInt_t n, const TPoint *xy) const
Simple 1-pixel dots.
void DrawOctagonCross(UInt_t n, const TPoint *xy) const
void DrawFourSquaresX(UInt_t n, const TPoint *xy) const
void DrawFourSquaresPlus(UInt_t n, const TPoint *xy) const
void DrawFullDotMedium(UInt_t n, const TPoint *xy) const
void DrawDiamond(UInt_t n, const TPoint *xy) const
void DrawFullStar(UInt_t n, const TPoint *xy) const
Full star pentagone.
void DrawOpenTrianlgeDown(UInt_t n, const TPoint *xy) const
void DrawFullDiamond(UInt_t n, const TPoint *xy) const
void DrawOpenFourTrianglesX(UInt_t n, const TPoint *xy) const
void DrawOpenDiamondCross(UInt_t n, const TPoint *xy) const
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
TColorGradient extends basic TColor.
const Double_t * GetColors() const
Get colors.
SizeType_t GetNumberOfSteps() const
Get number of steps.
ECoordinateMode GetCoordinateMode() const
Get coordinate mode.
const Double_t * GetColorPositions() const
Get color positions.
void RegisterFont(Int_t size, Int_t file, TGLFont::EMode mode, TGLFont &out)
Provide font with given size, file and FTGL class.
static Int_t GetExtendedFontStartIndex()
static const char * GetFontNameFromId(Int_t)
Get font name from TAttAxis font id.
static TObjArray * GetFontFileArray()
Get id to file name map.
void Render(const char *txt, Double_t x, Double_t y, Double_t angle, Double_t mgn) const
virtual void PostRender() const
Reset GL state after FTFont rendering.
virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) const
Set-up GL state before FTFont rendering.
"Delegating" part of TGLPadPainter.
Float_t GetTextMagnitude() const
Delegate to gVirtualX.
Color_t GetFillColor() const
Delegate to gVirtualX.
Color_t GetLineColor() const
Delegate to gVirtualX.
Font_t GetTextFont() const
Delegate to gVirtualX.
Style_t GetLineStyle() const
Delegate to gVirtualX.
void SetTextSize(Float_t tsize)
Delegate to gVirtualX.
void DrawTextNDC(Double_t x, Double_t y, const char *text, ETextMode mode)
Draw text in NDC.
void SetTextSizePixels(Int_t npixels)
Delegate to gVirtualX.
void DrawGradient(const TLinearGradient *gradient, Int_t n, const Double_t *x, const Double_t *y)
Rgl::Pad::Tesselator fTess
void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)
Draw line segment in NDC coordinates.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode)
Draw filled or hollow box.
std::vector< TPoint > fPoly
void DrawTextHelper(Double_t x, Double_t y, const Char_t *text, ETextMode mode)
void SetLineColor(Color_t lcolor)
Delegate to gVirtualX.
Int_t CreateDrawable(UInt_t w, UInt_t h)
Not required at the moment.
void DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v)
Poly line in NDC.
void DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y)
Draw poly-line in user coordinates.
void DrawPolygonWithGradient(Int_t n, const Double_t *x, const Double_t *y)
At the moment I assume both linear and radial gradients will work the same way - using a stencil buff...
void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw line segment.
void SetFillColor(Color_t fcolor)
Delegate to gVirtualX.
void SetTextFont(Font_t tfont)
Delegate to gVirtualX.
void SetTextAlign(Short_t align)
Delegate to gVirtualX.
Rgl::Pad::GLLimits fLimits
Float_t GetTextSize() const
Delegate to gVirtualX.
void DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height, Int_t dstX, Int_t dstY, Bool_t enableBlending)
Rgl::Pad::PolygonStippleSet fSSet
Rgl::Pad::MarkerPainter fMarker
void SetLineStyle(Style_t lstyle)
Delegate to gVirtualX.
void DrawPolyMarker()
Poly-marker.
void SaveViewport()
Extract and save the current viewport.
Width_t GetLineWidth() const
Delegate to gVirtualX.
void LockPainter()
Locked state of painter means, that GL context can be invalid, so no GL calls can be executed.
void SetFillStyle(Style_t fstyle)
Delegate to gVirtualX.
void ClearDrawable()
Not required at the moment.
Short_t GetTextAlign() const
Delegate to gVirtualX.
Bool_t IsTransparent() const
Delegate to gVirtualX.
void SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const
Using TImage save frame-buffer contents as a picture.
void SetOpacity(Int_t percent)
Delegate to gVirtualX.
Style_t GetFillStyle() const
Delegate to gVirtualX.
void RestoreProjectionMatrix() const
Restore the projection matrix.
void SetLineWidth(Width_t lwidth)
Delegate to gVirtualX.
void SetTextColor(Color_t tcolor)
Delegate to gVirtualX.
Float_t GetTextAngle() const
Delegate to gVirtualX.
void DrawFillArea(Int_t n, const Double_t *x, const Double_t *y)
Draw tesselated polygon (probably, outline only).
void DrawText(Double_t x, Double_t y, const char *text, ETextMode mode)
Draw text.
void CopyDrawable(Int_t device, Int_t px, Int_t py)
Not required at the moment.
void DrawTesselation(Int_t n, const Double_t *x, const Double_t *y)
void SelectDrawable(Int_t device)
For gVirtualX this means select pixmap (or window) and all subsequent drawings will go into this pixm...
void InitPainter()
Init gl-pad painter:
Color_t GetTextColor() const
Delegate to gVirtualX.
void DestroyDrawable(Int_t device)
Not required at the moment.
void InvalidateCS()
When TPad::Range for gPad is called, projection must be changed in OpenGL.
void RestoreModelviewMatrix() const
Restore the modelview matrix.
std::vector< Double_t > fVs
void SaveProjectionMatrix() const
Save the projection matrix.
void SetTextAngle(Float_t tangle)
Delegate to gVirtualX.
void SaveModelviewMatrix() const
Save the modelview matrix.
void RestoreViewport()
Restore the saved viewport.
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.
static TImage * Create()
Create an image.
Define a linear color gradient.
const Point & GetEnd() const
Get end.
const Point & GetStart() const
Get start.
The most important graphics class in the ROOT system.
Define a radial color gradient.
Double_t GetRadius() const
Get radius.
const Point & GetCenter() const
Get center.
EGradientType GetGradientType() const
Get gradient type.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual UInt_t GetWh() const =0
virtual UInt_t GetWw() const =0
virtual TCanvas * GetCanvas() const =0
BoundingRect< ValueType > FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys)
void ExtractRGBA(Color_t colorIndex, Float_t *rgba)
void DrawQuadStripWithRadialGradientFill(unsigned nPoints, const Double_t *inner, const Double_t *innerRGBA, const Double_t *outer, const Double_t *outerRGBA)
TODO: is it possible to use GLdouble to avoid problems with Double_t/GLdouble if they are not the sam...
void DrawBoxWithGradientFill(Double_t y1, Double_t y2, Double_t x1, Double_t x2, const Double_t *rgba1, const Double_t *rgba2)
Short_t Max(Short_t a, Short_t b)
Double_t Sqrt(Double_t x)
constexpr Double_t RadToDeg()
Conversion from radian to degree:
constexpr Double_t TwoPi()