72 Set(v[0], v[1], v[2]);
133 std::cout <<
"(" <<
fVals[0] <<
"," <<
fVals[1] <<
"," <<
fVals[2] <<
")" << std::endl;
169 TGLVertex3(other.fVals[0], other.fVals[1], other.fVals[2])
200 fVertex(start), fVector(end - start)
208 fVertex(start), fVector(vect)
243 glBegin(GL_LINE_LOOP);
245 glVertex3dv(
End().CArr());
260 fX(0), fY(0), fWidth(0), fHeight(0)
268 fX(x), fY(y), fWidth(width), fHeight(height)
276 fX(x), fY(y), fWidth(width), fHeight(height)
336 else if ((
fX >= other.
fX + static_cast<Int_t>(other.
fWidth)) ||
337 (
fX + static_cast<Int_t>(
fWidth) <= other.
fX) ||
338 (
fY >= other.
fY + static_cast<Int_t>(other.
fHeight)) ||
368 Set(1.0, 1.0, 1.0, 0.0);
428 Double_t mag =
sqrt(fVals[0]*fVals[0] + fVals[1]*fVals[1] + fVals[2]*fVals[2]);
431 Error(
"TGLPlane::Normalise",
"trying to normalise plane with zero magnitude normal");
446 std::cout.precision(6);
447 std::cout <<
"Plane : " << fVals[0] <<
"x + " << fVals[1] <<
"y + " << fVals[2] <<
"z + " << fVals[3] << std::endl;
455 fVals[0] = other.
fVals[0];
456 fVals[1] = other.
fVals[1];
457 fVals[2] = other.
fVals[2];
458 fVals[3] = other.
fVals[3];
493 fVals[3] = -(fVals[0]*point[0] + fVals[1]*point[1] + fVals[2]*point[2]);
511 fVals[0] = -fVals[0];
512 fVals[1] = -fVals[1];
513 fVals[2] = -fVals[2];
514 fVals[3] = -fVals[3];
522 return (fVals[0]*vertex[0] + fVals[1]*vertex[1] + fVals[2]*vertex[2] + fVals[3]);
548 if (lineDir.
Mag() == 0.0) {
553 Dot(lineDir, lineDir);
569 return std::make_pair(
kTRUE, interVert);
598 plane.
C()*line.
Start().
Z() + plane.
D();
602 if (!extend && (factor < 0.0 || factor > 1.0)) {
607 return std::make_pair(
kTRUE, line.
Start() + toPlane);
650 SetTranslation(x, y, z);
664 SetTranslation(translation);
681 arbAxis.
Set(1.0, 0.0, 0.0);
683 arbAxis.
Set(0.0, 1.0, 0.0);
685 arbAxis.
Set(0.0, 0.0, 1.0);
688 Set(origin, zAxis,
Cross(zAxisInt, arbAxis));
699 Set(origin, zAxis, xAxis);
734 for(
int r=0;
r<4; ++
r, ++
C)
737 for(
int c=0;
c<4; ++
c, T+=4)
738 B[
c] = C[0]*T[0] + C[4]*T[1] + C[8]*T[2] + C[12]*T[3];
739 C[0] = B[0]; C[4] = B[1]; C[8] = B[2]; C[12] = B[3];
750 for (
int c=0;
c<4; ++
c, C+=4)
753 for(
int r=0;
r<4; ++
r, ++
T)
754 B[
r] = T[0]*C[0] + T[4]*C[1] + T[8]*C[2] + T[12]*C[3];
755 C[0] = B[0]; C[1] = B[1]; C[2] = B[2]; C[3] = B[3];
773 fVals[0] = xAxisInt.
X(); fVals[4] = yAxisInt.
X(); fVals[8 ] = zAxisInt.
X(); fVals[12] = origin.
X();
774 fVals[1] = xAxisInt.
Y(); fVals[5] = yAxisInt.
Y(); fVals[9 ] = zAxisInt.
Y(); fVals[13] = origin.
Y();
775 fVals[2] = xAxisInt.
Z(); fVals[6] = yAxisInt.
Z(); fVals[10] = zAxisInt.
Z(); fVals[14] = origin.
Z();
776 fVals[3] = 0.0; fVals[7] = 0.0; fVals[11] = 0.0; fVals[15] = 1.0;
785 for (
UInt_t i=0; i < 16; i++) {
795 fVals[0] = 1.0; fVals[4] = 0.0; fVals[8 ] = 0.0; fVals[12] = 0.0;
796 fVals[1] = 0.0; fVals[5] = 1.0; fVals[9 ] = 0.0; fVals[13] = 0.0;
797 fVals[2] = 0.0; fVals[6] = 0.0; fVals[10] = 1.0; fVals[14] = 0.0;
798 fVals[3] = 0.0; fVals[7] = 0.0; fVals[11] = 0.0; fVals[15] = 1.0;
814 fVals[12] = translation[0];
815 fVals[13] = translation[1];
816 fVals[14] = translation[2];
824 return TGLVector3(fVals[12], fVals[13], fVals[14]);
832 fVals[12] += vect[0];
833 fVals[13] += vect[1];
834 fVals[14] += vect[2];
844 fVals[12] += amount*C[0]; fVals[13] += amount*C[1]; fVals[14] += amount*C[2];
852 fVals[12] += x*fVals[0] + y*fVals[4] + z*fVals[8];
853 fVals[13] += x*fVals[1] + y*fVals[5] + z*fVals[9];
854 fVals[14] += x*fVals[2] + y*fVals[6] + z*fVals[10];
867 if (currentScale[0] != 0.0) {
868 fVals[0] *= scale[0]/currentScale[0];
869 fVals[1] *= scale[0]/currentScale[0];
870 fVals[2] *= scale[0]/currentScale[0];
872 Error(
"TGLMatrix::Scale()",
"zero scale div by zero");
875 if (currentScale[1] != 0.0) {
876 fVals[4] *= scale[1]/currentScale[1];
877 fVals[5] *= scale[1]/currentScale[1];
878 fVals[6] *= scale[1]/currentScale[1];
880 Error(
"TGLMatrix::Scale()",
"zero scale div by zero");
883 if (currentScale[2] != 0.0) {
884 fVals[8] *= scale[2]/currentScale[2];
885 fVals[9] *= scale[2]/currentScale[2];
886 fVals[10] *= scale[2]/currentScale[2];
888 Error(
"TGLMatrix::Scale()",
"zero scale div by zero");
910 rotMat[ 0] = x*x*(1-
c) + c; rotMat[ 4] = x*y*(1-
c) - z*s; rotMat[ 8] = x*z*(1-
c) + y*s; rotMat[12] = pivot[0];
911 rotMat[ 1] = y*x*(1-
c) + z*s; rotMat[ 5] = y*y*(1-
c) + c; rotMat[ 9] = y*z*(1-
c) - x*s; rotMat[13] = pivot[1];
912 rotMat[ 2] = x*z*(1-
c) - y*s; rotMat[ 6] = y*z*(1-
c) + x*s; rotMat[10] = z*z*(1-
c) + c; rotMat[14] = pivot[2];
913 rotMat[ 3] = 0.0; rotMat[ 7] = 0.0; rotMat[11] = 0.0; rotMat[15] = 1.0;
918 *
this = rotMat * localToWorld * (*this);
931 --i1 <<= 2; --i2 <<= 2;
932 for(
int r=0;
r<4; ++
r, ++
c) {
933 b1 = cos*c[i1] +
sin*c[i2];
934 b2 = cos*c[i2] -
sin*c[i1];
935 c[i1] = b1; c[i2] = b2;
951 for(
int c=0;
c<4; ++
c, C+=4) {
952 b1 = cos*C[i1] -
sin*C[i2];
953 b2 = cos*C[i2] +
sin*C[i1];
954 C[i1] = b1; C[i2] = b2;
964 for (
UInt_t i = 0; i < 3; i++) {
965 vertex[i] = orig[0] * fVals[0+i] + orig[1] * fVals[4+i] +
966 orig[2] * fVals[8+i] + fVals[12+i];
1003 const Double_t det2_12_01 = M[1]*M[6] - M[5]*M[2];
1004 const Double_t det2_12_02 = M[1]*M[10] - M[9]*M[2];
1005 const Double_t det2_12_03 = M[1]*M[14] - M[13]*M[2];
1006 const Double_t det2_12_13 = M[5]*M[14] - M[13]*M[6];
1007 const Double_t det2_12_23 = M[9]*M[14] - M[13]*M[10];
1008 const Double_t det2_12_12 = M[5]*M[10] - M[9]*M[6];
1009 const Double_t det2_13_01 = M[1]*M[7] - M[5]*M[3];
1010 const Double_t det2_13_02 = M[1]*M[11] - M[9]*M[3];
1011 const Double_t det2_13_03 = M[1]*M[15] - M[13]*M[3];
1012 const Double_t det2_13_12 = M[5]*M[11] - M[9]*M[7];
1013 const Double_t det2_13_13 = M[5]*M[15] - M[13]*M[7];
1014 const Double_t det2_13_23 = M[9]*M[15] - M[13]*M[11];
1015 const Double_t det2_23_01 = M[2]*M[7] - M[6]*M[3];
1016 const Double_t det2_23_02 = M[2]*M[11] - M[10]*M[3];
1017 const Double_t det2_23_03 = M[2]*M[15] - M[14]*M[3];
1018 const Double_t det2_23_12 = M[6]*M[11] - M[10]*M[7];
1019 const Double_t det2_23_13 = M[6]*M[15] - M[14]*M[7];
1020 const Double_t det2_23_23 = M[10]*M[15] - M[14]*M[11];
1023 const Double_t det3_012_012 = M[0]*det2_12_12 - M[4]*det2_12_02 + M[8]*det2_12_01;
1024 const Double_t det3_012_013 = M[0]*det2_12_13 - M[4]*det2_12_03 + M[12]*det2_12_01;
1025 const Double_t det3_012_023 = M[0]*det2_12_23 - M[8]*det2_12_03 + M[12]*det2_12_02;
1026 const Double_t det3_012_123 = M[4]*det2_12_23 - M[8]*det2_12_13 + M[12]*det2_12_12;
1027 const Double_t det3_013_012 = M[0]*det2_13_12 - M[4]*det2_13_02 + M[8]*det2_13_01;
1028 const Double_t det3_013_013 = M[0]*det2_13_13 - M[4]*det2_13_03 + M[12]*det2_13_01;
1029 const Double_t det3_013_023 = M[0]*det2_13_23 - M[8]*det2_13_03 + M[12]*det2_13_02;
1030 const Double_t det3_013_123 = M[4]*det2_13_23 - M[8]*det2_13_13 + M[12]*det2_13_12;
1031 const Double_t det3_023_012 = M[0]*det2_23_12 - M[4]*det2_23_02 + M[8]*det2_23_01;
1032 const Double_t det3_023_013 = M[0]*det2_23_13 - M[4]*det2_23_03 + M[12]*det2_23_01;
1033 const Double_t det3_023_023 = M[0]*det2_23_23 - M[8]*det2_23_03 + M[12]*det2_23_02;
1034 const Double_t det3_023_123 = M[4]*det2_23_23 - M[8]*det2_23_13 + M[12]*det2_23_12;
1035 const Double_t det3_123_012 = M[1]*det2_23_12 - M[5]*det2_23_02 + M[9]*det2_23_01;
1036 const Double_t det3_123_013 = M[1]*det2_23_13 - M[5]*det2_23_03 + M[13]*det2_23_01;
1037 const Double_t det3_123_023 = M[1]*det2_23_23 - M[9]*det2_23_03 + M[13]*det2_23_02;
1038 const Double_t det3_123_123 = M[5]*det2_23_23 - M[9]*det2_23_13 + M[13]*det2_23_12;
1040 const Double_t det = M[0]*det3_123_123 - M[4]*det3_123_023 +
1041 M[8]*det3_123_013 - M[12]*det3_123_012;
1044 Warning(
"TGLMatrix::Invert",
"matrix is singular.");
1048 const Double_t oneOverDet = 1.0/det;
1049 const Double_t mn1OverDet = - oneOverDet;
1051 M[0] = det3_123_123 * oneOverDet;
1052 M[4] = det3_023_123 * mn1OverDet;
1053 M[8] = det3_013_123 * oneOverDet;
1054 M[12] = det3_012_123 * mn1OverDet;
1056 M[1] = det3_123_023 * mn1OverDet;
1057 M[5] = det3_023_023 * oneOverDet;
1058 M[9] = det3_013_023 * mn1OverDet;
1059 M[13] = det3_012_023 * oneOverDet;
1061 M[2] = det3_123_013 * oneOverDet;
1062 M[6] = det3_023_013 * mn1OverDet;
1063 M[10] = det3_013_013 * oneOverDet;
1064 M[14] = det3_012_013 * mn1OverDet;
1066 M[3] = det3_123_012 * mn1OverDet;
1067 M[7] = det3_023_012 * oneOverDet;
1068 M[11] = det3_013_012 * mn1OverDet;
1069 M[15] = det3_012_012 * oneOverDet;
1081 r.
X() = M[0]*v[0] + M[4]*v[1] + M[8]*v[2] + M[12]*w;
1082 r.
Y() = M[1]*v[0] + M[5]*v[1] + M[9]*v[2] + M[13]*w;
1083 r.
Z() = M[2]*v[0] + M[6]*v[1] + M[10]*v[2] + M[14]*w;
1094 r.
X() = M[0]*v[0] + M[4]*v[1] + M[8]*v[2];
1095 r.
Y() = M[1]*v[0] + M[5]*v[1] + M[9]*v[2];
1096 r.
Z() = M[2]*v[0] + M[6]*v[1] + M[10]*v[2];
1107 v.
X() = M[0]*r[0] + M[4]*r[1] + M[8]*r[2] + M[12]*w;
1108 v.
Y() = M[1]*r[0] + M[5]*r[1] + M[9]*r[2] + M[13]*w;
1109 v.
Z() = M[2]*r[0] + M[6]*r[1] + M[10]*r[2] + M[14]*w;
1119 v.
X() = M[0]*r[0] + M[4]*r[1] + M[8]*r[2];
1120 v.
Y() = M[1]*r[0] + M[5]*r[1] + M[9]*r[2];
1121 v.
Z() = M[2]*r[0] + M[6]*r[1] + M[10]*r[2];
1142 ss = fVals[0]*fVals[0] + fVals[1]*fVals[1] + fVals[2]*fVals[2];
1143 if (ss < 0.8 || ss > 1.2)
return kTRUE;
1144 ss = fVals[4]*fVals[4] + fVals[5]*fVals[5] + fVals[6]*fVals[6];
1145 if (ss < 0.8 || ss > 1.2)
return kTRUE;
1146 ss = fVals[8]*fVals[8] + fVals[9]*fVals[9] + fVals[10]*fVals[10];
1147 if (ss < 0.8 || ss > 1.2)
return kTRUE;
1162 std::cout.precision(6);
1166 std::cout << fVals[
y*4 +
x] <<
" ";
1168 std::cout <<
"]" << std::endl;
1188 fRGBA[0] = fRGBA[1] = fRGBA[2] = 0;
1198 SetColor(r, g, b, a);
1206 SetColor(r, g, b, a);
1214 SetColor(color_index, transparency);
1229 fRGBA[0] = c.
fRGBA[0];
1230 fRGBA[1] = c.
fRGBA[1];
1231 fRGBA[2] = c.
fRGBA[2];
1232 fRGBA[3] = c.
fRGBA[3];
1291 fIndex = color_index;
1309 UChar_t alpha = (255*(100 - transparency))/100;
1318 fIndex = color_index;
1337 fRGBA[3] = (255*(100 - transparency))/100;
1346 fRGBA[0], fRGBA[1], fRGBA[2], fRGBA[3]);
1362 StdDarkBackground();
1381 for (
Int_t i = 0; i < 5; ++i)
1391 fBackground .SetColor(0, 0, 0);
1392 fForeground .SetColor(255, 255, 255);
1393 fOutline .SetColor(240, 255, 240);
1394 fMarkup .SetColor(200, 200, 200);
1396 fSelection[0].SetColor( 0, 0, 0);
1397 fSelection[1].SetColor(255, 220, 220);
1398 fSelection[2].SetColor(255, 220, 220);
1399 fSelection[3].SetColor(200, 200, 255);
1400 fSelection[4].SetColor(200, 200, 255);
1408 fBackground .SetColor(255, 255, 255);
1409 fForeground .SetColor(0, 0, 0);
1410 fOutline .SetColor(0, 0, 0);
1411 fMarkup .SetColor(55, 55, 55);
1413 fSelection[0].SetColor(0, 0, 0);
1414 fSelection[1].SetColor(200, 100, 100);
1415 fSelection[2].SetColor(200, 100, 100);
1416 fSelection[3].SetColor(100, 100, 200);
1417 fSelection[4].SetColor(100, 100, 200);
1454 #if defined(__APPLE_CC__) && __APPLE_CC__ > 4000 && __APPLE_CC__ < 5450 && !defined(__INTEL_COMPILER)
1455 typedef GLvoid (*tessfuncptr_t)(...);
1456 #elif defined(__linux__) || defined(__FreeBSD__) || defined( __OpenBSD__ ) || defined(__sun) || defined (__CYGWIN__) || defined (__APPLE__)
1457 typedef GLvoid (*tessfuncptr_t)();
1458 #elif defined (WIN32)
1459 typedef GLvoid (
CALLBACK *tessfuncptr_t)();
1461 #error "Error - need to define type tessfuncptr_t for this platform/compiler"
1468 class TGLTesselatorWrap
1473 GLUtesselator *fTess;
1475 TGLTesselatorWrap(tessfuncptr_t vertex_func) : fTess(0)
1477 fTess = gluNewTess();
1479 throw std::bad_alloc();
1481 gluTessCallback(fTess, (GLenum)GLU_BEGIN, (tessfuncptr_t) glBegin);
1482 gluTessCallback(fTess, (GLenum)GLU_END, (tessfuncptr_t) glEnd);
1483 gluTessCallback(fTess, (GLenum)GLU_VERTEX, vertex_func);
1486 virtual ~TGLTesselatorWrap()
1489 gluDeleteTess(fTess);
1501 static TGLTesselatorWrap singleton((tessfuncptr_t) glVertex3fv);
1503 return singleton.fTess;
1512 static TGLTesselatorWrap singleton((tessfuncptr_t) glVertex4fv);
1514 return singleton.fTess;
1523 static TGLTesselatorWrap singleton((tessfuncptr_t) glVertex3dv);
1525 return singleton.fTess;
1534 static TGLTesselatorWrap singleton((tessfuncptr_t) glVertex4dv);
1536 return singleton.fTess;
1546 if (init_done)
return;
1549 fgScreenScalingFactor =
gVirtualX->GetOpenGLScalingFactor();
1551 if (strcmp(
gEnv->
GetValue(
"OpenGL.PointLineScalingFactor",
"native"),
"native") == 0)
1553 fgPointLineScalingFactor = fgScreenScalingFactor;
1557 fgPointLineScalingFactor =
gEnv->
GetValue(
"OpenGL.PointLineScalingFactor", 1.0);
1568 return fgDrawQuality;
1584 fgDrawQuality = fgDefaultDrawQuality;
1592 return fgDefaultDrawQuality;
1600 fgDefaultDrawQuality = dq;
1610 const GLubyte *errString;
1612 if ((errCode = glGetError()) != GL_NO_ERROR) {
1613 errString = gluErrorString(errCode);
1615 Error(loc,
"GL Error %s", (
const char *)errString);
1617 Error(
"TGLUtil::CheckError",
"GL Error %s", (
const char *)errString);
1632 return ++fgColorLockCount;
1640 if (fgColorLockCount)
1643 Error(
"TGLUtil::UnlockColor",
"fgColorLockCount already 0.");
1644 return fgColorLockCount;
1652 return fgColorLockCount > 0;
1660 if (fgColorLockCount == 0) glColor4ubv(color.
CArr());
1668 if (fgColorLockCount == 0)
1679 if (fgColorLockCount == 0)
1690 if (fgColorLockCount == 0) {
1691 if (color_index < 0)
1704 if (fgColorLockCount == 0) {
1705 if (color_index < 0)
1718 if (fgColorLockCount == 0) glColor3ub(r, g, b);
1726 if (fgColorLockCount == 0) glColor4ub(r, g, b, a);
1734 if (fgColorLockCount == 0) glColor3ubv(rgb);
1742 if (fgColorLockCount == 0) glColor4ubv(rgba);
1750 if (fgColorLockCount == 0) glColor3f(r, g, b);
1758 if (fgColorLockCount == 0) glColor4f(r, g, b, a);
1766 if (fgColorLockCount == 0) glColor3fv(rgb);
1774 if (fgColorLockCount == 0) glColor4fv(rgba);
1786 if (fgScreenScalingFactor != 1.0)
1798 if (fgScreenScalingFactor != 1.0)
1815 return fgScreenScalingFactor;
1826 return fgPointLineScalingFactor;
1834 return fgPickingRadius;
1846 return fgPointSizeScale;
1854 fgPointSizeScale = scale;
1862 return fgLineWidthScale;
1870 fgLineWidthScale = scale;
1879 fgPointSize = point_size * fgPointSizeScale * fgPointLineScalingFactor;
1880 glPointSize(fgPointSize);
1889 fgLineWidth = line_width * fgLineWidthScale * fgPointLineScalingFactor;
1890 glLineWidth(fgLineWidth);
1917 glMatrixMode(GL_PROJECTION);
1920 glGetFloatv(GL_PROJECTION_MATRIX, pm);
1921 for (
Int_t i=0; i<=12; i+=4) {
1922 pm[i] *= scale; pm[i+1] *= scale;
1925 glMatrixMode(GL_MODELVIEW);
1932 glMatrixMode(GL_PROJECTION);
1934 glMatrixMode(GL_MODELVIEW);
1948 glPushAttrib(GL_ENABLE_BIT | GL_POINT_BIT | GL_LINE_BIT);
1950 glDisable(GL_LIGHTING);
1954 if (s == 2 || s == 3 || s == 5 || s == 28)
1955 RenderCrosses(marker, p, n, sec_selection);
1957 RenderPoints(marker, p, n, pick_radius, selection, sec_selection);
1971 if (s == 2 || s == 3 || s == 5 || s == 28)
1972 RenderCrosses(marker, points, dX, dY, dZ);
1974 RenderPoints(marker, points);
1988 if (style == 4 || style == 20 || style == 24)
1990 glEnable(GL_POINT_SMOOTH);
1991 if (style == 4 || style == 24) {
1993 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1994 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
1999 glDisable(GL_POINT_SMOOTH);
2000 if (style == 1) size = 1;
2001 else if (style == 6) size = 2;
2002 else if (style == 7) size = 3;
2007 Bool_t changePM = selection && PointSize() > pick_radius;
2009 BeginExtendPickRegion((
Float_t) pick_radius / PointSize());
2015 for (
Int_t i=0; i<
n; ++i, p+=3)
2026 glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
2027 glVertexPointer(3, GL_FLOAT, 0, p);
2028 glEnableClientState(GL_VERTEX_ARRAY);
2032 const Int_t maxChunk = 8192;
2033 while (nleft > maxChunk)
2035 glDrawArrays(GL_POINTS, ndone, maxChunk);
2039 glDrawArrays(GL_POINTS, ndone, nleft);
2041 glPopClientAttrib();
2045 EndExtendPickRegion();
2057 if (style == 4 || style == 20 || style == 24)
2059 glEnable(GL_POINT_SMOOTH);
2060 if (style == 4 || style == 24) {
2062 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2063 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
2068 glDisable(GL_POINT_SMOOTH);
2069 if (style == 1) size = 1;
2070 else if (style == 6) size = 2;
2071 else if (style == 7) size = 3;
2076 glVertexPointer(3, GL_DOUBLE, 0, &points[0]);
2077 glEnableClientState(GL_VERTEX_ARRAY);
2080 Int_t nleft = points.size() / 3;
2082 const Int_t maxChunk = 8192;
2083 while (nleft > maxChunk)
2085 glDrawArrays(GL_POINTS, ndone, maxChunk);
2091 glDrawArrays(GL_POINTS, ndone, nleft);
2093 glDisableClientState(GL_VERTEX_ARRAY);
2108 glEnable(GL_LINE_SMOOTH);
2113 glDisable(GL_LINE_SMOOTH);
2123 for (
Int_t i=0; i<
n; ++i, p+=3)
2127 glVertex3f(p[0]-d, p[1], p[2]); glVertex3f(p[0]+d, p[1], p[2]);
2128 glVertex3f(p[0], p[1]-d, p[2]); glVertex3f(p[0], p[1]+d, p[2]);
2129 glVertex3f(p[0], p[1], p[2]-d); glVertex3f(p[0], p[1], p[2]+d);
2137 for (
Int_t i=0; i<
n; ++i, p+=3)
2139 glVertex3f(p[0]-d, p[1], p[2]); glVertex3f(p[0]+d, p[1], p[2]);
2140 glVertex3f(p[0], p[1]-d, p[2]); glVertex3f(p[0], p[1]+d, p[2]);
2141 glVertex3f(p[0], p[1], p[2]-d); glVertex3f(p[0], p[1], p[2]+d);
2149 glDisable(GL_POINT_SMOOTH);
2152 glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
2153 glVertexPointer(3, GL_FLOAT, 0, op);
2154 glEnableClientState(GL_VERTEX_ARRAY);
2158 const Int_t maxChunk = 8192;
2159 while (nleft > maxChunk)
2161 glDrawArrays(GL_POINTS, ndone, maxChunk);
2165 glDrawArrays(GL_POINTS, ndone, nleft);
2167 glPopClientAttrib();
2181 glEnable(GL_LINE_SMOOTH);
2186 glDisable(GL_LINE_SMOOTH);
2190 typedef std::vector<Double_t>::size_type size_type;
2194 for (size_type i = 0; i < points.size(); i += 3) {
2196 glVertex3f(p[0] - dX, p[1], p[2]); glVertex3f(p[0] + dX, p[1], p[2]);
2197 glVertex3f(p[0], p[1] - dY, p[2]); glVertex3f(p[0], p[1] + dY, p[2]);
2198 glVertex3f(p[0], p[1], p[2] - dZ); glVertex3f(p[0], p[1], p[2] + dZ);
2204 glDisable(GL_LINE_SMOOTH);
2205 glDisable(GL_BLEND);
2219 BeginAttLine(aline, transp, pick_radius, selection);
2222 glBegin(GL_LINE_STRIP);
2223 for (
Int_t i=0; i<
n; ++i, tp+=3)
2227 EndAttLine(pick_radius, selection);
2236 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
2238 glDisable(GL_LIGHTING);
2246 case 2: pat = 0x3333;
break;
2247 case 3: pat = 0x5555;
break;
2248 case 4: pat = 0xf040;
break;
2249 case 5: pat = 0xf4f4;
break;
2250 case 6: pat = 0xf111;
break;
2251 case 7: pat = 0xf0f0;
break;
2252 case 8: pat = 0xff11;
break;
2253 case 9: pat = 0x3fff;
break;
2254 case 10: pat = 0x08ff;
break;
2257 glLineStipple(1, pat);
2258 glEnable(GL_LINE_STIPPLE);
2272 EndExtendPickRegion();
2301 Float_t rgba[4] = {rgbai[0]/255.f, rgbai[1]/255.f, rgbai[2]/255.f, rgbai[3]/255.f};
2302 Float_t ambient[4] = {0.0, 0.0, 0.0, 1.0};
2303 Float_t specular[4] = {0.6, 0.6, 0.6, 1.0};
2304 Float_t emission[4] = {rgba[0]/4.f, rgba[1]/4.f, rgba[2]/4.f, rgba[3]};
2307 glMaterialfv(GL_FRONT, GL_DIFFUSE, rgba);
2308 glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
2309 glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
2310 glMaterialfv(GL_FRONT, GL_EMISSION, emission);
2311 glMaterialf(GL_FRONT, GL_SHININESS, 60.0);
2322 SetDrawColors(rgba);
2324 glTranslated(position.
X(), position.
Y(), position.
Z());
2325 gluSphere(quad.
Get(), radius, fgDrawQuality, fgDrawQuality);
2350 SetDrawColors(rgba);
2353 glMultMatrixd(local.
CArr());
2356 if (head == kLineHeadNone) {
2358 }
else if (head == kLineHeadArrow) {
2359 headHeight = size*2.0;
2360 }
else if (head == kLineHeadBox) {
2361 headHeight = size*1.4;
2365 gluCylinder(quad.
Get(), 0.25*size, 0.25*size, vector.
Mag() - headHeight, fgDrawQuality, 1);
2366 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_INSIDE);
2367 gluDisk(quad.
Get(), 0.0, 0.25*size, fgDrawQuality, 1);
2369 glTranslated(0.0, 0.0, vector.
Mag() - headHeight);
2371 if (head == kLineHeadNone) {
2373 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_OUTSIDE);
2374 gluDisk(quad.
Get(), 0.0, size/4.0, fgDrawQuality, 1);
2376 else if (head == kLineHeadArrow) {
2378 gluDisk(quad.
Get(), 0.0, size, fgDrawQuality, 1);
2380 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_OUTSIDE);
2381 gluCylinder(quad.
Get(), size, 0.0, headHeight, fgDrawQuality, 1);
2382 }
else if (head == kLineHeadBox) {
2387 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_OUTSIDE);
2415 glMultMatrixd(local.
CArr());
2418 glTranslated(0.0, 0.0, -width/2.0);
2421 gluCylinder(quad.
Get(), inner, inner, width, fgDrawQuality, 1);
2422 gluCylinder(quad.
Get(), outer, outer, width, fgDrawQuality, 1);
2425 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_INSIDE);
2426 gluDisk(quad.
Get(), inner, outer, fgDrawQuality, 1);
2427 glTranslated(0.0, 0.0, width);
2428 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_OUTSIDE);
2429 gluDisk(quad.
Get(), inner, outer, fgDrawQuality, 1);
2445 static const UChar_t defColor[4] = { 250, 110, 0, 255 };
2448 DrawSphere(pos, radius, rgba ? rgba : defColor);
2459 if (axesType == kAxesNone)
2462 static const UChar_t axesColors[][4] = {
2471 static const UChar_t xyz[][8] = {
2472 {0x44, 0x44, 0x28, 0x10, 0x10, 0x28, 0x44, 0x44},
2473 {0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x44, 0x44},
2474 {0x7c, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x7c}
2485 for (
UInt_t i = 0; i < 3; i++) {
2489 if (axesType == kAxesOrigin) {
2491 start[(i+1)%3] = 0.0;
2492 start[(i+2)%3] = 0.0;
2495 start[(i+1)%3] = min[(i+1)%3];
2496 start[(i+2)%3] = min[(i+2)%3];
2498 vector[(i+1)%3] = 0.0;
2499 vector[(i+2)%3] = 0.0;
2509 vector[i] = min[i] - max[i];
2511 DrawLine(start, vector, kLineHeadNone, pixelSize*2.5, axesColors[i*2]);
2521 vector[i] = max[i] - min[i];
2523 DrawLine(start, vector, kLineHeadNone, pixelSize*2.5, axesColors[i*2 + 1]);
2528 if (axesType == kAxesOrigin) {
2532 for (
UInt_t j = 0; j < 3; j++) {
2533 if (min[j] <= 0.0 && max[j] >= 0.0) {
2536 zero[(j+1)%3] = min[(j+1)%3];
2537 zero[(j+2)%3] = min[(j+2)%3];
2538 DrawSphere(zero, pixelSize*2.0, axesColors[j*2 + 1]);
2543 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
2548 glDisable(GL_LIGHTING);
2549 for (
UInt_t k = 0; k < 3; k++) {
2550 SetDrawColors(axesColors[k*2+1]);
2552 if (axesType == kAxesOrigin) {
2553 minPos[(k+1)%3] = 0.0;
2554 minPos[(k+2)%3] = 0.0;
2556 minPos[(k+1)%3] = min[(k+1)%3];
2557 minPos[(k+2)%3] = min[(k+2)%3];
2568 if (axisViewport.
Mag() < 1) {
2573 padPixels*axisViewport.
Y()/axisViewport.
Mag());
2576 padPixels*axisViewport.
Y()/axisViewport.
Mag());
2578 DrawNumber(
Form(
"%.0f", min[k]), minPos,
kTRUE);
2579 DrawNumber(
Form(
"%.0f", max[k]), maxPos,
kTRUE);
2584 padPixels*axisViewport.
Y()/axisViewport.
Mag());
2585 glRasterPos3dv(namePos.
CArr());
2586 glBitmap(8, 8, 0.0, 4.0, 0.0, 0.0, xyz[k]);
2599 static const UChar_t digits[][8] = {
2600 {0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38},
2601 {0x10, 0x10, 0x10, 0x10, 0x10, 0x70, 0x10, 0x10},
2602 {0x7c, 0x44, 0x20, 0x18, 0x04, 0x04, 0x44, 0x38},
2603 {0x38, 0x44, 0x04, 0x04, 0x18, 0x04, 0x44, 0x38},
2604 {0x04, 0x04, 0x04, 0x04, 0x7c, 0x44, 0x44, 0x44},
2605 {0x7c, 0x44, 0x04, 0x04, 0x7c, 0x40, 0x40, 0x7c},
2606 {0x7c, 0x44, 0x44, 0x44, 0x7c, 0x40, 0x40, 0x7c},
2607 {0x20, 0x20, 0x20, 0x10, 0x08, 0x04, 0x44, 0x7c},
2608 {0x38, 0x44, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38},
2609 {0x7c, 0x44, 0x04, 0x04, 0x7c, 0x44, 0x44, 0x7c},
2610 {0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
2611 {0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00},
2612 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
2618 xOffset = 3.5 * num.
Length();
2622 glRasterPos3dv(pos.
CArr());
2624 if (num[i] ==
'.') {
2625 glBitmap(8, 8, xOffset, yOffset, 7.0, 0.0, digits[10]);
2626 }
else if (num[i] ==
'-') {
2627 glBitmap(8, 8, xOffset, yOffset, 7.0, 0.0, digits[11]);
2628 }
else if (num[i] ==
' ') {
2629 glBitmap(8, 8, xOffset, yOffset, 7.0, 0.0, digits[12]);
2630 }
else if (num[i] >=
'0' && num[i] <=
'9') {
2631 glBitmap(8, 8, xOffset, yOffset, 7.0, 0.0, digits[num[i] -
'0']);
2696 fWhat(what), fState(0), fFlip(
kFALSE), fFoo(foo)
2717 glEnable(GLenum(
fCap));
2725 glDisable(GLenum(
fCap));
2734 glDisable(GLenum(
fCap));
2742 glEnable(GLenum(
fCap));
2755 : fWidth(0), fHeight(0)
2774 glPixelStorei(GL_PACK_ALIGNMENT, 1);
2775 glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, &
fBuffer[0]);
2786 glPixelStorei(GL_PACK_ALIGNMENT, 1);
2787 glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, &
fBuffer[0]);
2808 const Float_t gRedEmission[] = {1.f, 0.f, 0.f, 1.f};
2809 const Float_t gGreenEmission[] = {0.f, 1.f, 0.f, 1.f};
2810 const Float_t gBlueEmission[] = {0.f, 0.f, 1.f, 1.f};
2811 const Float_t gOrangeEmission[] = {1.f, 0.4f, 0.f, 1.f};
2812 const Float_t gWhiteEmission[] = {1.f, 1.f, 1.f, 1.f};
2813 const Float_t gGrayEmission[] = {0.3f,0.3f, 0.3f,1.f};
2814 const Float_t gNullEmission[] = {0.f, 0.f, 0.f, 1.f};
2821 RGB_t gColorTriplets[] = {{{255, 0, 0}},
2831 if (lhs.fRGB[0] < rhs.fRGB[0])
2833 else if (lhs.fRGB[0] > rhs.fRGB[0])
2835 else if (lhs.fRGB[1] < rhs.fRGB[1])
2837 else if (lhs.fRGB[1] > rhs.fRGB[1])
2839 else if (lhs.fRGB[2] < rhs.fRGB[2])
2845 typedef std::map<Int_t, RGB_t> ColorLookupTable_t;
2846 typedef ColorLookupTable_t::const_iterator CLTCI_t;
2848 ColorLookupTable_t gObjectIDToColor;
2850 typedef std::map<RGB_t, Int_t> ObjectLookupTable_t;
2851 typedef ObjectLookupTable_t::const_iterator OLTCI_t;
2853 ObjectLookupTable_t gColorToObjectID;
2861 glColor3ub(objectID & 0xff, (objectID & 0xff00) >> 8, (objectID & 0xff0000) >> 16);
2863 if (!gObjectIDToColor.size()) {
2865 for (
Int_t i = 0,
id = 1; i <
Int_t(
sizeof gColorTriplets /
sizeof(RGB_t)); ++i, ++
id)
2866 gObjectIDToColor[
id] = gColorTriplets[i];
2867 for (Int_t i = 0,
id = 1; i <
Int_t(
sizeof gColorTriplets /
sizeof(RGB_t)); ++i, ++
id)
2868 gColorToObjectID[gColorTriplets[i]] =
id;
2871 CLTCI_t it = gObjectIDToColor.find(objectID);
2873 if (it != gObjectIDToColor.end())
2874 glColor3ub(it->second.fRGB[0], it->second.fRGB[1], it->second.fRGB[2]);
2876 Error(
"ObjectIDToColor",
"No color for such object ID: %d", objectID);
2877 glColor3ub(0, 0, 0);
2887 return pixel[0] | (pixel[1] << 8) | (pixel[2] << 16);
2889 if (!gObjectIDToColor.size())
2892 RGB_t triplet = {{pixel[0], pixel[1], pixel[2]}};
2893 OLTCI_t it = gColorToObjectID.find(triplet);
2895 if (it != gColorToObjectID.end())
2909 glBegin(GL_LINE_LOOP);
2910 glVertex3dv(v1.
CArr());
2911 glVertex3dv(v2.
CArr());
2912 glVertex3dv(v3.
CArr());
2913 glVertex3dv(v4.
CArr());
2923 glBegin(GL_POLYGON);
2924 glNormal3dv(normal.
CArr());
2925 glVertex3dv(v0.
CArr());
2926 glVertex3dv(v1.
CArr());
2927 glVertex3dv(v2.
CArr());
2928 glVertex3dv(v3.
CArr());
2939 glNormal3dv(normal);
2953 glBegin(GL_POLYGON);
2954 glNormal3dv(norm1.
CArr());
2955 glVertex3dv(v1.
CArr());
2956 glNormal3dv(norm2.
CArr());
2957 glVertex3dv(v2.
CArr());
2958 glNormal3dv(norm3.
CArr());
2959 glVertex3dv(v3.
CArr());
2963 const Int_t gBoxFrontQuads[][4] = {{0, 1, 2, 3}, {4, 0, 3, 5}, {4, 5, 6, 7}, {7, 6, 2, 1}};
2964 const Double_t gBoxFrontNormals[][3] = {{-1., 0., 0.}, {0., -1., 0.}, {1., 0., 0.}, {0., 1., 0.}};
2967 const Int_t gBoxBackQuads[][4] = {{7, 1, 2, 6}, {4, 7, 6, 5}, {0, 4, 5, 3}, {0, 3, 2, 1}};
2968 const Double_t gBoxBackNormals[][3] = {{0., -1., 0.}, {-1., 0., 0.}, {0., 1., 0.}, {1., 0., 0.}};
2981 glBegin(GL_POLYGON);
2982 glNormal3d(0., 0., -1.);
2983 glVertex3d(xMax, yMin, zMin);
2984 glVertex3d(xMin, yMin, zMin);
2985 glVertex3d(xMin, yMax, zMin);
2986 glVertex3d(xMax, yMax, zMin);
2989 const Double_t box[][3] = {{xMin, yMin, zMax}, {xMin, yMax, zMax}, {xMin, yMax, zMin}, {xMin, yMin, zMin},
2990 {xMax, yMin, zMax}, {xMax, yMin, zMin}, {xMax, yMax, zMin}, {xMax, yMax, zMax}};
2991 const Int_t *verts = gBoxFrontQuads[gBoxFrontPlanes[fp][0]];
2993 glBegin(GL_POLYGON);
2994 glNormal3dv(gBoxFrontNormals[gBoxFrontPlanes[fp][0]]);
2995 glVertex3dv(box[verts[0]]);
2996 glVertex3dv(box[verts[1]]);
2997 glVertex3dv(box[verts[2]]);
2998 glVertex3dv(box[verts[3]]);
3001 verts = gBoxFrontQuads[gBoxFrontPlanes[fp][1]];
3003 glBegin(GL_POLYGON);
3004 glNormal3dv(gBoxFrontNormals[gBoxFrontPlanes[fp][1]]);
3005 glVertex3dv(box[verts[0]]);
3006 glVertex3dv(box[verts[1]]);
3007 glVertex3dv(box[verts[2]]);
3008 glVertex3dv(box[verts[3]]);
3012 glBegin(GL_POLYGON);
3013 glNormal3d(0., 0., 1.);
3014 glVertex3d(xMax, yMin, zMax);
3015 glVertex3d(xMax, yMax, zMax);
3016 glVertex3d(xMin, yMax, zMax);
3017 glVertex3d(xMin, yMin, zMax);
3034 glBegin(GL_POLYGON);
3035 glNormal3d(0., 0., -1.);
3036 glVertex3d(xMax, yMin, zMin);
3037 glVertex3d(xMin, yMin, zMin);
3038 glVertex3d(xMin, yMax, zMin);
3039 glVertex3d(xMax, yMax, zMin);
3042 const Double_t box[][3] = {{xMin, yMin, zMax}, {xMin, yMax, zMax}, {xMin, yMax, zMin}, {xMin, yMin, zMin},
3043 {xMax, yMin, zMax}, {xMax, yMin, zMin}, {xMax, yMax, zMin}, {xMax, yMax, zMax}};
3046 const Int_t *verts = gBoxBackQuads[gBoxBackPlanes[fp][0]];
3048 glBegin(GL_POLYGON);
3049 glNormal3dv(gBoxBackNormals[gBoxBackPlanes[fp][0]]);
3050 glVertex3dv(box[verts[0]]);
3051 glVertex3dv(box[verts[1]]);
3052 glVertex3dv(box[verts[2]]);
3053 glVertex3dv(box[verts[3]]);
3056 verts = gBoxBackQuads[gBoxBackPlanes[fp][1]];
3058 glBegin(GL_POLYGON);
3059 glNormal3dv(gBoxBackNormals[gBoxBackPlanes[fp][1]]);
3060 glVertex3dv(box[verts[0]]);
3061 glVertex3dv(box[verts[1]]);
3062 glVertex3dv(box[verts[2]]);
3063 glVertex3dv(box[verts[3]]);
3067 verts = gBoxFrontQuads[gBoxFrontPlanes[fp][0]];
3069 glBegin(GL_POLYGON);
3070 glNormal3dv(gBoxFrontNormals[gBoxFrontPlanes[fp][0]]);
3071 glVertex3dv(box[verts[0]]);
3072 glVertex3dv(box[verts[1]]);
3073 glVertex3dv(box[verts[2]]);
3074 glVertex3dv(box[verts[3]]);
3077 verts = gBoxFrontQuads[gBoxFrontPlanes[fp][1]];
3079 glBegin(GL_POLYGON);
3080 glNormal3dv(gBoxFrontNormals[gBoxFrontPlanes[fp][1]]);
3081 glVertex3dv(box[verts[0]]);
3082 glVertex3dv(box[verts[1]]);
3083 glVertex3dv(box[verts[2]]);
3084 glVertex3dv(box[verts[3]]);
3088 glBegin(GL_POLYGON);
3089 glNormal3d(0., 0., 1.);
3090 glVertex3d(xMax, yMin, zMax);
3091 glVertex3d(xMax, yMax, zMax);
3092 glVertex3d(xMin, yMax, zMax);
3093 glVertex3d(xMin, yMin, zMax);
3111 glBegin(GL_POLYGON);
3112 glNormal3d(0., 0., 1.);
3113 glTexCoord1d(texMax);
3114 glVertex3d(xMax, yMin, zMax);
3115 glVertex3d(xMax, yMax, zMax);
3116 glVertex3d(xMin, yMax, zMax);
3117 glVertex3d(xMin, yMin, zMax);
3120 glBegin(GL_POLYGON);
3121 glTexCoord1d(texMin);
3122 glNormal3d(0., 0., -1.);
3123 glVertex3d(xMax, yMin, zMin);
3124 glVertex3d(xMin, yMin, zMin);
3125 glVertex3d(xMin, yMax, zMin);
3126 glVertex3d(xMax, yMax, zMin);
3129 const Double_t box[][3] = {{xMin, yMin, zMax}, {xMin, yMax, zMax}, {xMin, yMax, zMin}, {xMin, yMin, zMin},
3130 {xMax, yMin, zMax}, {xMax, yMin, zMin}, {xMax, yMax, zMin}, {xMax, yMax, zMax}};
3132 const Double_t tex[] = {texMax, texMax, texMin, texMin, texMax, texMin, texMin, texMax};
3133 const Int_t *verts = gBoxFrontQuads[gBoxFrontPlanes[fp][0]];
3135 glBegin(GL_POLYGON);
3136 glNormal3dv(gBoxFrontNormals[gBoxFrontPlanes[fp][0]]);
3137 glTexCoord1d(tex[verts[0]]);
3138 glVertex3dv(box[verts[0]]);
3139 glTexCoord1d(tex[verts[1]]);
3140 glVertex3dv(box[verts[1]]);
3141 glTexCoord1d(tex[verts[2]]);
3142 glVertex3dv(box[verts[2]]);
3143 glTexCoord1d(tex[verts[3]]);
3144 glVertex3dv(box[verts[3]]);
3147 verts = gBoxFrontQuads[gBoxFrontPlanes[fp][1]];
3149 glBegin(GL_POLYGON);
3150 glNormal3dv(gBoxFrontNormals[gBoxFrontPlanes[fp][1]]);
3151 glTexCoord1d(tex[verts[0]]);
3152 glVertex3dv(box[verts[0]]);
3153 glTexCoord1d(tex[verts[1]]);
3154 glVertex3dv(box[verts[1]]);
3155 glTexCoord1d(tex[verts[2]]);
3156 glVertex3dv(box[verts[2]]);
3157 glTexCoord1d(tex[verts[3]]);
3158 glVertex3dv(box[verts[3]]);
3167 assert(rgba1 != 0 &&
"DrawBoxWithGradientFill, parameter 'rgba1' is null");
3168 assert(rgba2 != 0 &&
"DrawBoxWithGradientFill, parameter 'rgba2' is null");
3170 glBegin(GL_POLYGON);
3188 "DrawQuadStripWithRadialGradientFill, invalid number of points");
3190 "DrawQuadStripWithRadialGradientFill, parameter 'inner' is null");
3192 "DrawQuadStripWithRadialGradientFill, parameter 'innerRGBA' is null");
3194 "DrawQuadStripWithRadialGradientFill, parameter 'outer' is null");
3196 "DrawQuadStripWithRadialGradientFill, parameter 'outerRGBA' is null");
3198 glBegin(GL_QUAD_STRIP);
3199 for (
UInt_t j = 0; j < nPoints; ++j) {
3200 glColor4dv(innerRGBA);
3201 glVertex2dv(inner + j * 2);
3202 glColor4dv(outerRGBA);
3203 glVertex2dv(outer + j * 2);
3214 GLUquadric *quad = quadric->
Get();
3219 const Double_t xCenter = xMin + (xMax - xMin) / 2;
3220 const Double_t yCenter = yMin + (yMax - yMin) / 2;
3224 glTranslated(xCenter, yCenter, zMin);
3225 gluCylinder(quad, radius, radius, zMax - zMin, 40, 1);
3228 glTranslated(xCenter, yCenter, zMax);
3229 gluDisk(quad, 0., radius, 40, 1);
3232 glTranslated(xCenter, yCenter, zMin);
3233 glRotated(180., 0., 1., 0.);
3234 gluDisk(quad, 0., radius, 40, 1);
3245 GLUquadric *quad = quadric->
Get();
3248 const Double_t xCenter = xMin + (xMax - xMin) / 2;
3249 const Double_t yCenter = yMin + (yMax - yMin) / 2;
3250 const Double_t zCenter = zMin + (zMax - zMin) / 2;
3253 TMath::Min((xMax - xMin) / 2, (yMax - yMin) / 2));
3256 glTranslated(xCenter, yCenter, zCenter);
3257 gluSphere(quad, radius, 10, 10);
3272 glVertex3d(xMin + xWid / 2, yMin + yWid / 2, zMin);
3273 glVertex3d(xMin + xWid / 2, yMin + yWid / 2, zMax);
3277 glVertex3d(xMin + xWid / 2, yMin, zMin);
3278 glVertex3d(xMin + xWid / 2, yMax, zMin);
3282 glVertex3d(xMin, yMin + yWid / 2, zMin);
3283 glVertex3d(xMax, yMin + yWid / 2, zMin);
3291 normal[0] = v[0] /
n;
3292 normal[1] = v[1] /
n;
3305 normal[0] = -v[0] /
n;
3306 normal[1] = -v[1] /
n;
3322 glBegin(GL_POLYGON);
3323 glNormal3d(0., 0., 1.);
3324 glVertex3d(ver[0][0], ver[0][1], zMax);
3325 glVertex3d(ver[1][0], ver[1][1], zMax);
3326 glVertex3d(ver[2][0], ver[2][1], zMax);
3327 glVertex3d(ver[3][0], ver[3][1], zMax);
3330 glBegin(GL_POLYGON);
3331 glNormal3d(0., 0., -1.);
3332 glVertex3d(ver[0][0], ver[0][1], zMin);
3333 glVertex3d(ver[3][0], ver[3][1], zMin);
3334 glVertex3d(ver[2][0], ver[2][1], zMin);
3335 glVertex3d(ver[1][0], ver[1][1], zMin);
3339 Double_t trapezoid[][3] = {{ver[0][0], ver[0][1], zMin}, {ver[1][0], ver[1][1], zMin},
3340 {ver[2][0], ver[2][1], zMin}, {ver[3][0], ver[3][1], zMin},
3341 {ver[0][0], ver[0][1], zMax}, {ver[1][0], ver[1][1], zMax},
3342 {ver[2][0], ver[2][1], zMax}, {ver[3][0], ver[3][1], zMax}};
3344 glBegin(GL_POLYGON);
3345 CylindricalNormal(trapezoid[1], normal), glNormal3dv(normal), glVertex3dv(trapezoid[1]);
3346 CylindricalNormal(trapezoid[2], normal), glNormal3dv(normal), glVertex3dv(trapezoid[2]);
3347 CylindricalNormal(trapezoid[6], normal), glNormal3dv(normal), glVertex3dv(trapezoid[6]);
3348 CylindricalNormal(trapezoid[5], normal), glNormal3dv(normal), glVertex3dv(trapezoid[5]);
3351 glBegin(GL_POLYGON);
3358 glBegin(GL_POLYGON);
3361 glNormal3dv(normal);
3363 glVertex3dv(trapezoid[0]);
3364 glVertex3dv(trapezoid[1]);
3365 glVertex3dv(trapezoid[5]);
3366 glVertex3dv(trapezoid[4]);
3369 glBegin(GL_POLYGON);
3372 glNormal3dv(normal);
3374 glVertex3dv(trapezoid[3]);
3375 glVertex3dv(trapezoid[7]);
3376 glVertex3dv(trapezoid[6]);
3377 glVertex3dv(trapezoid[2]);
3394 glBegin(GL_POLYGON);
3395 glNormal3d(0., 0., 1.);
3396 glTexCoord1d(texMax);
3397 glVertex3d(ver[0][0], ver[0][1], zMax);
3398 glVertex3d(ver[1][0], ver[1][1], zMax);
3399 glVertex3d(ver[2][0], ver[2][1], zMax);
3400 glVertex3d(ver[3][0], ver[3][1], zMax);
3403 glBegin(GL_POLYGON);
3404 glNormal3d(0., 0., -1.);
3405 glTexCoord1d(texMin);
3406 glVertex3d(ver[0][0], ver[0][1], zMin);
3407 glVertex3d(ver[3][0], ver[3][1], zMin);
3408 glVertex3d(ver[2][0], ver[2][1], zMin);
3409 glVertex3d(ver[1][0], ver[1][1], zMin);
3413 Double_t trapezoid[][3] = {{ver[0][0], ver[0][1], zMin}, {ver[1][0], ver[1][1], zMin},
3414 {ver[2][0], ver[2][1], zMin}, {ver[3][0], ver[3][1], zMin},
3415 {ver[0][0], ver[0][1], zMax}, {ver[1][0], ver[1][1], zMax},
3416 {ver[2][0], ver[2][1], zMax}, {ver[3][0], ver[3][1], zMax}};
3418 glBegin(GL_POLYGON);
3419 CylindricalNormal(trapezoid[1], normal), glNormal3dv(normal), glTexCoord1d(texMin), glVertex3dv(trapezoid[1]);
3420 CylindricalNormal(trapezoid[2], normal), glNormal3dv(normal), glTexCoord1d(texMin), glVertex3dv(trapezoid[2]);
3421 CylindricalNormal(trapezoid[6], normal), glNormal3dv(normal), glTexCoord1d(texMax), glVertex3dv(trapezoid[6]);
3422 CylindricalNormal(trapezoid[5], normal), glNormal3dv(normal), glTexCoord1d(texMax), glVertex3dv(trapezoid[5]);
3425 glBegin(GL_POLYGON);
3426 CylindricalNormalInv(trapezoid[0], normal), glNormal3dv(normal), glTexCoord1d(texMin), glVertex3dv(trapezoid[0]);
3427 CylindricalNormalInv(trapezoid[4], normal), glNormal3dv(normal), glTexCoord1d(texMax), glVertex3dv(trapezoid[4]);
3428 CylindricalNormalInv(trapezoid[7], normal), glNormal3dv(normal), glTexCoord1d(texMax), glVertex3dv(trapezoid[7]);
3429 CylindricalNormalInv(trapezoid[3], normal), glNormal3dv(normal), glTexCoord1d(texMin), glVertex3dv(trapezoid[3]);
3432 glBegin(GL_POLYGON);
3434 glNormal3dv(normal);
3435 glTexCoord1d(texMin);
3436 glVertex3dv(trapezoid[0]);
3437 glTexCoord1d(texMin);
3438 glVertex3dv(trapezoid[1]);
3439 glTexCoord1d(texMax);
3440 glVertex3dv(trapezoid[5]);
3441 glTexCoord1d(texMax);
3442 glVertex3dv(trapezoid[4]);
3445 glBegin(GL_POLYGON);
3447 glNormal3dv(normal);
3448 glTexCoord1d(texMin);
3449 glVertex3dv(trapezoid[3]);
3450 glTexCoord1d(texMax);
3451 glVertex3dv(trapezoid[7]);
3452 glTexCoord1d(texMax);
3453 glVertex3dv(trapezoid[6]);
3454 glTexCoord1d(texMin);
3455 glVertex3dv(trapezoid[2]);
3468 const Double_t trapezoid[][3] = {{ver[0][0], ver[0][1], zMin}, {ver[1][0], ver[1][1], zMin},
3469 {ver[2][0], ver[2][1], zMin}, {ver[3][0], ver[3][1], zMin},
3470 {ver[0][0], ver[0][1], zMax}, {ver[1][0], ver[1][1], zMax},
3471 {ver[2][0], ver[2][1], zMax}, {ver[3][0], ver[3][1], zMax}};
3472 const Double_t tex[] = {texMin, texMax, texMax, texMin, texMin, texMax, texMax, texMin};
3474 glBegin(GL_POLYGON);
3475 glNormal3d(0., 0., 1.);
3476 glTexCoord1d(tex[4]), glVertex3dv(trapezoid[4]);
3477 glTexCoord1d(tex[5]), glVertex3dv(trapezoid[5]);
3478 glTexCoord1d(tex[6]), glVertex3dv(trapezoid[6]);
3479 glTexCoord1d(tex[7]), glVertex3dv(trapezoid[7]);
3482 glBegin(GL_POLYGON);
3483 glNormal3d(0., 0., -1.);
3484 glTexCoord1d(tex[0]), glVertex3dv(trapezoid[0]);
3485 glTexCoord1d(tex[3]), glVertex3dv(trapezoid[3]);
3486 glTexCoord1d(tex[2]), glVertex3dv(trapezoid[2]);
3487 glTexCoord1d(tex[1]), glVertex3dv(trapezoid[1]);
3490 glBegin(GL_POLYGON);
3492 CylindricalNormal(trapezoid[1], normal), glNormal3dv(normal), glTexCoord1d(tex[1]), glVertex3dv(trapezoid[1]);
3493 CylindricalNormal(trapezoid[2], normal), glNormal3dv(normal), glTexCoord1d(tex[2]), glVertex3dv(trapezoid[2]);
3494 CylindricalNormal(trapezoid[6], normal), glNormal3dv(normal), glTexCoord1d(tex[6]), glVertex3dv(trapezoid[6]);
3495 CylindricalNormal(trapezoid[5], normal), glNormal3dv(normal), glTexCoord1d(tex[5]), glVertex3dv(trapezoid[5]);
3498 glBegin(GL_POLYGON);
3499 CylindricalNormalInv(trapezoid[0], normal), glNormal3dv(normal), glTexCoord1d(tex[0]), glVertex3dv(trapezoid[0]);
3500 CylindricalNormalInv(trapezoid[4], normal), glNormal3dv(normal), glTexCoord1d(tex[4]), glVertex3dv(trapezoid[4]);
3501 CylindricalNormalInv(trapezoid[7], normal), glNormal3dv(normal), glTexCoord1d(tex[7]), glVertex3dv(trapezoid[7]);
3502 CylindricalNormalInv(trapezoid[3], normal), glNormal3dv(normal), glTexCoord1d(tex[3]), glVertex3dv(trapezoid[3]);
3505 glBegin(GL_POLYGON);
3507 glNormal3dv(normal);
3508 glTexCoord1d(tex[0]), glVertex3dv(trapezoid[0]);
3509 glTexCoord1d(tex[1]), glVertex3dv(trapezoid[1]);
3510 glTexCoord1d(tex[5]), glVertex3dv(trapezoid[5]);
3511 glTexCoord1d(tex[4]), glVertex3dv(trapezoid[4]);
3514 glBegin(GL_POLYGON);
3516 glNormal3dv(normal);
3517 glTexCoord1d(tex[3]), glVertex3dv(trapezoid[3]);
3518 glTexCoord1d(tex[7]), glVertex3dv(trapezoid[7]);
3519 glTexCoord1d(tex[6]), glVertex3dv(trapezoid[6]);
3520 glTexCoord1d(tex[2]), glVertex3dv(trapezoid[2]);
3530 normal[0] = v[0] /
n;
3531 normal[1] = v[1] /
n;
3532 normal[2] = v[2] /
n;
3546 normal[0] = -v[0] /
n;
3547 normal[1] = -v[1] /
n;
3548 normal[2] = -v[2] /
n;
3562 glBegin(GL_POLYGON);
3564 glNormal3dv(normal);
3565 glVertex3dv(ver[0]);
3566 glVertex3dv(ver[1]);
3567 glVertex3dv(ver[2]);
3568 glVertex3dv(ver[3]);
3571 glBegin(GL_POLYGON);
3573 glNormal3dv(normal);
3574 glVertex3dv(ver[4]);
3575 glVertex3dv(ver[7]);
3576 glVertex3dv(ver[6]);
3577 glVertex3dv(ver[5]);
3581 glBegin(GL_POLYGON);
3583 glNormal3dv(normal);
3584 glVertex3dv(ver[0]);
3585 glVertex3dv(ver[3]);
3586 glVertex3dv(ver[7]);
3587 glVertex3dv(ver[4]);
3590 glBegin(GL_POLYGON);
3591 SphericalNormal(ver[3], normal), glNormal3dv(normal), glVertex3dv(ver[3]);
3592 SphericalNormal(ver[2], normal), glNormal3dv(normal), glVertex3dv(ver[2]);
3593 SphericalNormal(ver[6], normal), glNormal3dv(normal), glVertex3dv(ver[6]);
3594 SphericalNormal(ver[7], normal), glNormal3dv(normal), glVertex3dv(ver[7]);
3597 glBegin(GL_POLYGON);
3599 glNormal3dv(normal);
3600 glVertex3dv(ver[5]);
3601 glVertex3dv(ver[6]);
3602 glVertex3dv(ver[2]);
3603 glVertex3dv(ver[1]);
3606 glBegin(GL_POLYGON);
3619 if (texMin > texMax)
3622 const Double_t tex[] = {texMin, texMin, texMax, texMax, texMin, texMin, texMax, texMax};
3623 glBegin(GL_POLYGON);
3625 glNormal3dv(normal);
3626 glTexCoord1d(tex[0]), glVertex3dv(ver[0]);
3627 glTexCoord1d(tex[1]), glVertex3dv(ver[1]);
3628 glTexCoord1d(tex[2]), glVertex3dv(ver[2]);
3629 glTexCoord1d(tex[3]), glVertex3dv(ver[3]);
3631 glBegin(GL_POLYGON);
3633 glNormal3dv(normal);
3634 glTexCoord1d(tex[4]), glVertex3dv(ver[4]);
3635 glTexCoord1d(tex[7]), glVertex3dv(ver[7]);
3636 glTexCoord1d(tex[6]), glVertex3dv(ver[6]);
3637 glTexCoord1d(tex[5]), glVertex3dv(ver[5]);
3639 glBegin(GL_POLYGON);
3641 glNormal3dv(normal);
3642 glTexCoord1d(tex[0]), glVertex3dv(ver[0]);
3643 glTexCoord1d(tex[3]), glVertex3dv(ver[3]);
3644 glTexCoord1d(tex[7]), glVertex3dv(ver[7]);
3645 glTexCoord1d(tex[4]), glVertex3dv(ver[4]);
3647 glBegin(GL_POLYGON);
3648 SphericalNormal(ver[3], normal), glNormal3dv(normal), glTexCoord1d(tex[3]), glVertex3dv(ver[3]);
3649 SphericalNormal(ver[2], normal), glNormal3dv(normal), glTexCoord1d(tex[2]), glVertex3dv(ver[2]);
3650 SphericalNormal(ver[6], normal), glNormal3dv(normal), glTexCoord1d(tex[6]), glVertex3dv(ver[6]);
3651 SphericalNormal(ver[7], normal), glNormal3dv(normal), glTexCoord1d(tex[7]), glVertex3dv(ver[7]);
3653 glBegin(GL_POLYGON);
3655 glNormal3dv(normal);
3656 glTexCoord1d(tex[5]), glVertex3dv(ver[5]);
3657 glTexCoord1d(tex[6]), glVertex3dv(ver[6]);
3658 glTexCoord1d(tex[2]), glVertex3dv(ver[2]);
3659 glTexCoord1d(tex[1]), glVertex3dv(ver[1]);
3661 glBegin(GL_POLYGON);
3662 SphericalNormalInv(ver[0], normal), glNormal3dv(normal), glTexCoord1d(tex[0]), glVertex3dv(ver[0]);
3663 SphericalNormalInv(ver[4], normal), glNormal3dv(normal), glTexCoord1d(tex[4]), glVertex3dv(ver[4]);
3664 SphericalNormalInv(ver[5], normal), glNormal3dv(normal), glTexCoord1d(tex[5]), glVertex3dv(ver[5]);
3665 SphericalNormalInv(ver[1], normal), glNormal3dv(normal), glTexCoord1d(tex[1]), glVertex3dv(ver[1]);
3677 if (xMin > xMax || z) option +=
"SDH=+";
3678 else option +=
"SDH=-";
3680 if (log) option +=
'G';
3692 static const Double_t zero = 0.001;
3713 axisPainter.
PaintAxis(xMin, yMin, xMax, yMax, min, max, nDiv, option.c_str());
3729 const Int_t left = gFramePoints[fp][0];
3730 const Int_t right = gFramePoints[fp][1];
3732 + box[left].
X() - vp[0]));
3734 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3735 *
gPad->GetWh() + vp[1]));
3737 + box[fp].
X() - vp[0]));
3739 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3740 *
gPad->GetWh() + vp[1]));
3742 *
gPad->GetWw() + box[right].
X() - vp[0]));
3744 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3745 *
gPad->GetWh() + vp[1]));
3750 const Int_t leftType = gAxisType[fp][0];
3751 const Int_t rightType = gAxisType[fp][1];
3752 const Double_t leftLabel = points[left][leftType];
3753 const Double_t leftMidLabel = points[fp][leftType];
3754 const Double_t rightMidLabel = points[fp][rightType];
3755 const Double_t rightLabel = points[right][rightType];
3757 if (xLeft - xMid || yLeft - yMid) {
3758 TAxis *axis = leftType ? yAxis : xAxis;
3759 if (leftLabel < leftMidLabel)
3760 Draw2DAxis(axis, xLeft, yLeft, xMid, yMid, leftLabel, leftMidLabel,
3763 Draw2DAxis(axis, xMid, yMid, xLeft, yLeft, leftMidLabel, leftLabel,
3767 if (xRight - xMid || yRight - yMid) {
3768 TAxis *axis = rightType ? yAxis : xAxis;
3770 if (rightMidLabel < rightLabel)
3771 Draw2DAxis(axis, xMid, yMid, xRight, yRight, rightMidLabel, rightLabel,
3774 Draw2DAxis(axis, xRight, yRight, xMid, yMid, rightLabel, rightMidLabel,
3779 + box[left + 4].
X() - vp[0]));
3781 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3782 *
gPad->GetWh() + vp[1]));
3788 Double_t zScale, std::vector<Double_t> &zLevels)
3792 Double_t binLow = 0., binHigh = 0., binWidth = 0.;
3794 zLevels.resize(nBins + 1);
3796 for (
Int_t i = 0; i < nBins + 1; ++i)
3797 zLevels[i] = (binLow + i * binWidth) * zScale;
3807 glBegin(GL_POLYGON);
3808 glNormal3dv(norm1.
CArr());
3810 glVertex3dv(v1.
CArr());
3811 glNormal3dv(norm2.
CArr());
3813 glVertex3dv(v2.
CArr());
3814 glNormal3dv(norm3.
CArr());
3816 glVertex3dv(v3.
CArr());
3827 glBegin(GL_POLYGON);
3828 glNormal3dv(normal.
CArr());
3830 glVertex3d(v1.
X(), v1.
Y(), z);
3832 glVertex3d(v2.
X(), v2.
Y(), z);
3834 glVertex3d(v3.
X(), v3.
Y(), z);
3865 if (v < (vmin + 0.25 * dv)) {
3867 rgba[1] = 4 * (v - vmin) / dv;
3869 }
else if (v < (vmin + 0.5 * dv)) {
3872 rgba[2] = 1 + 4 * (vmin + 0.25 * dv -
v) / dv;
3873 }
else if (v < (vmin + 0.75 * dv)) {
3874 rgba[0] = 4 * (v - vmin - 0.5 * dv) / dv;
3879 rgba[1] = 1 + 4 * (vmin + 0.75 * dv -
v) / dv;
3884 rgba[0] = (v - vmin) / dv;
3886 rgba[2] = (vmax -
v) / dv;
3889 rgba[0] = (v - vmin) / dv;
3894 if (v < (vmin + dv / 6.0)) {
3896 rgba[1] = 6 * (v - vmin) / dv;
3898 }
else if (v < (vmin + 2.0 * dv / 6.0)) {
3899 rgba[0] = 1 + 6 * (vmin + dv / 6.0 -
v) / dv;
3902 }
else if (v < (vmin + 3.0 * dv / 6.0)) {
3905 rgba[2] = 6 * (v - vmin - 2.0 * dv / 6.0) / dv;
3906 }
else if (v < (vmin + 4.0 * dv / 6.0)) {
3908 rgba[1] = 1 + 6 * (vmin + 3.0 * dv / 6.0 -
v) / dv;
3910 }
else if (v < (vmin + 5.0 * dv / 6.0)) {
3911 rgba[0] = 6 * (v - vmin - 4.0 * dv / 6.0) / dv;
3917 rgba[2] = 1 + 6 * (vmin + 5.0 * dv / 6.0 -
v) / dv;
3921 rgba[0] = (v - vmin) / (vmax - vmin);
3926 rgba[0] = (v - vmin) / (vmax - vmin);
3927 rgba[1] = (vmax -
v) / (vmax - vmin);
3931 if (v < (vmin + 0.25 * dv)) {
3933 rgba[1] = 4 * (v - vmin) / dv;
3934 rgba[2] = 1 - rgba[1];
3935 }
else if (v < (vmin + 0.5 * dv)) {
3936 rgba[0] = 4 * (v - vmin - 0.25 * dv) / dv;
3937 rgba[1] = 1 - rgba[0];
3939 }
else if (v < (vmin + 0.75 * dv)) {
3940 rgba[1] = 4 * (v - vmin - 0.5 * dv) / dv;
3941 rgba[0] = 1 - rgba[1];
3945 rgba[2] = 4 * (v - vmin - 0.75 * dv) / dv;
3946 rgba[1] = 1 - rgba[2];
3950 if (v < (vmin + 0.5 * dv)) {
3951 rgba[0] = 2 * (v - vmin) / dv;
3955 rgba[0] = 1 - 2 * (v - vmin - 0.5 * dv) / dv;
3961 if (v < (vmin + dv / 3)) {
3962 rgba[2] = 3 * (v - vmin) / dv;
3964 rgba[0] = 1 - rgba[2];
3965 }
else if (v < (vmin + 2 * dv / 3)) {
3967 rgba[1] = 3 * (v - vmin - dv / 3) / dv;
3970 rgba[0] = 3 * (v - vmin - 2 * dv / 3) / dv;
3971 rgba[1] = 1 - rgba[0];
3976 if (v < (vmin + 0.2 * dv)) {
3978 rgba[1] = 5 * (v - vmin) / dv;
3980 }
else if (v < (vmin + 0.4 * dv)) {
3983 rgba[2] = 1 + 5 * (vmin + 0.2 * dv -
v) / dv;
3984 }
else if (v < (vmin + 0.6 * dv)) {
3985 rgba[0] = 5 * (v - vmin - 0.4 * dv) / dv;
3988 }
else if (v < (vmin + 0.8 * dv)) {
3990 rgba[1] = 1 - 5 * (v - vmin - 0.6 * dv) / dv;
3994 rgba[1] = 5 * (v - vmin - 0.8 * dv) / dv;
3995 rgba[2] = 5 * (v - vmin - 0.8 * dv) / dv;
3999 c1[0] = 200 / 255.0; c1[1] = 60 / 255.0; c1[2] = 0 / 255.0;
4000 c2[0] = 250 / 255.0;
c2[1] = 160 / 255.0;
c2[2] = 110 / 255.0;
4001 rgba[0] = (
c2[0] - c1[0]) * (v - vmin) / dv + c1[0];
4002 rgba[1] = (
c2[1] - c1[1]) * (v - vmin) / dv + c1[1];
4003 rgba[2] = (
c2[2] - c1[2]) * (v - vmin) / dv + c1[2];
4006 c1[0] = 55 / 255.0; c1[1] = 55 / 255.0; c1[2] = 45 / 255.0;
4007 c2[0] = 200 / 255.0;
c2[1] = 60 / 255.0;
c2[2] = 0 / 255.0;
4008 c3[0] = 250 / 255.0;
c3[1] = 160 / 255.0;
c3[2] = 110 / 255.0;
4010 vmid = vmin + ratio * dv;
4012 rgba[0] = (
c2[0] - c1[0]) * (v - vmin) / (ratio*dv) + c1[0];
4013 rgba[1] = (
c2[1] - c1[1]) * (v - vmin) / (ratio*dv) + c1[1];
4014 rgba[2] = (
c2[2] - c1[2]) * (v - vmin) / (ratio*dv) + c1[2];
4016 rgba[0] = (
c3[0] -
c2[0]) * (v - vmid) / ((1-ratio)*dv) +
c2[0];
4017 rgba[1] = (
c3[1] -
c2[1]) * (v - vmid) / ((1-ratio)*dv) +
c2[1];
4018 rgba[2] = (
c3[2] -
c2[2]) * (v - vmid) / ((1-ratio)*dv) +
c2[2];
4022 c1[0] = 0 / 255.0; c1[1] = 255 / 255.0; c1[2] = 0 / 255.0;
4023 c2[0] = 255 / 255.0;
c2[1] = 150 / 255.0;
c2[2] = 0 / 255.0;
4024 c3[0] = 255 / 255.0;
c3[1] = 250 / 255.0;
c3[2] = 240 / 255.0;
4026 vmid = vmin + ratio * dv;
4028 rgba[0] = (
c2[0] - c1[0]) * (v - vmin) / (ratio*dv) + c1[0];
4029 rgba[1] = (
c2[1] - c1[1]) * (v - vmin) / (ratio*dv) + c1[1];
4030 rgba[2] = (
c2[2] - c1[2]) * (v - vmin) / (ratio*dv) + c1[2];
4032 rgba[0] = (
c3[0] -
c2[0]) * (v - vmid) / ((1-ratio)*dv) +
c2[0];
4033 rgba[1] = (
c3[1] -
c2[1]) * (v - vmid) / ((1-ratio)*dv) +
c2[1];
4034 rgba[2] = (
c3[2] -
c2[2]) * (v - vmid) / ((1-ratio)*dv) +
c2[2];
4039 rgba[1] = 1 - (v - vmin) / dv;
4043 if (v < (vmin + 0.25 * dv)) {
4045 rgba[1] = 4 * (v - vmin) / dv;
4047 }
else if (v < (vmin + 0.5 * dv)) {
4050 rgba[2] = 1 - 4 * (v - vmin - 0.25 * dv) / dv;
4051 }
else if (v < (vmin + 0.75 * dv)) {
4052 rgba[0] = 4 * (v - vmin - 0.5 * dv) / dv;
4058 rgba[2] = 4 * (v - vmin - 0.75 * dv) / dv;
4062 if (v < (vmin + 0.5 * dv)) {
4064 rgba[1] = 2 * (v - vmin) / dv;
4065 rgba[2] = 1 - 2 * (v - vmin) / dv;
4067 rgba[0] = 2 * (v - vmin - 0.5 * dv) / dv;
4068 rgba[1] = 1 - 2 * (v - vmin - 0.5 * dv) / dv;
4073 if (v < (vmin + 0.5 * dv)) {
4075 rgba[1] = 1 - 2 * (v - vmin) / dv;
4076 rgba[2] = 2 * (v - vmin) / dv;
4078 rgba[0] = 1 - 2 * (v - vmin - 0.5 * dv) / dv;
4079 rgba[1] = 2 * (v - vmin - 0.5 * dv) / dv;
4085 rgba[1] = (v - vmin) / (vmax - vmin);
4089 rgba[0] = (v - vmin) / (vmax - vmin);
4094 c1[0] = 0 / 255.0; c1[1] = 160 / 255.0; c1[2] = 0 / 255.0;
4095 c2[0] = 180 / 255.0;
c2[1] = 220 / 255.0;
c2[2] = 0 / 255.0;
4096 c3[0] = 250 / 255.0;
c3[1] = 220 / 255.0;
c3[2] = 170 / 255.0;
4098 vmid = vmin + ratio * dv;
4100 rgba[0] = (
c2[0] - c1[0]) * (v - vmin) / (ratio*dv) + c1[0];
4101 rgba[1] = (
c2[1] - c1[1]) * (v - vmin) / (ratio*dv) + c1[1];
4102 rgba[2] = (
c2[2] - c1[2]) * (v - vmin) / (ratio*dv) + c1[2];
4104 rgba[0] = (
c3[0] -
c2[0]) * (v - vmid) / ((1-ratio)*dv) +
c2[0];
4105 rgba[1] = (
c3[1] -
c2[1]) * (v - vmid) / ((1-ratio)*dv) +
c2[1];
4106 rgba[2] = (
c3[2] -
c2[2]) * (v - vmid) / ((1-ratio)*dv) +
c2[2];
4133 if (!(zRange.second - zRange.first))
4137 Error(
"TGLLevelPaletter::GeneratePalette",
4138 "Invalid palette size, must be a positive number");
4143 Error(
"TGLLevelPalette::GeneratePalette",
4144 "Number of contours %d is too big for GL 1D texture, try to reduce it to %d",
4150 while (nearestPow2 < paletteSize)
4153 fTexels.resize(4 * nearestPow2);
4161 for (
UInt_t i = 0; i < paletteSize; ++i) {
4163 if (paletteInd > nColors - 1)
4164 paletteInd = nColors - 1;
4169 c->GetRGB(rgb[0], rgb[1], rgb[2]);
4195 glEnable(GL_TEXTURE_1D);
4199 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
4200 glBindTexture(GL_TEXTURE_1D,
fTexture);
4201 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
4202 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
4203 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
4204 glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA,
fTexels.size() / 4, 0,
4205 GL_RGBA, GL_UNSIGNED_BYTE, &
fTexels[0]);
4206 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GLint(mode));
4215 glDisable(GL_TEXTURE_1D);
virtual ~TGLColor()
Destructor.
static UInt_t fgDefaultDrawQuality
virtual Style_t GetLineStyle() const
static void DrawRing(const TGLVertex3 ¢er, const TGLVector3 &normal, Double_t radius, const UChar_t *rgba)
Draw ring, centered on 'center', lying on plane defined by 'center' & 'normal' of outer radius 'radiu...
virtual void SetLineWidth(Width_t lwidth)
void SetZLevels(TAxis *zAxis, Double_t zMin, Double_t zMax, Double_t zScale, std::vector< Double_t > &zLevels)
std::vector< UChar_t > fTexels
const UChar_t * CArr() const
Class encapsulating a set of colors used throughout standard rendering.
Bool_t operator<(const TDatime &d1, const TDatime &d2)
static GLUtesselator * GetDrawTesselator3fv()
Returns a tesselator for direct drawing when using 3-vertices with single precision.
const Int_t gBoxBackPlanes[][2]
static UInt_t fgColorLockCount
void DrawFaceTextured(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, Double_t t1, Double_t t2, Double_t t3, const TGLVector3 &norm1, const TGLVector3 &norm2, const TGLVector3 &norm3)
Draw textured triangle.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
void ReadColorBuffer(Int_t width, Int_t height)
Read color buffer.
void DrawQuadFilled(const TGLVertex3 &v0, const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &normal)
Draw quad face.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
static void Color(const TGLColor &color)
Set color from TGLColor.
void MultiplyIP(TGLVector3 &v, Double_t w=1) const
Multiply vector in-place.
static double p3(double t, double a, double b, double c, double d)
Wrapper class for various misc static functions - error checking, draw helpers etc.
void SetTranslation(Double_t x, Double_t y, Double_t z)
Set matrix translation components x,y,z.
void StdLightBackground()
Set defaults for light (white) background.
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
static const UChar_t fgYellow[4]
Bool_t IsScalingForRender() const
Return true if matrix is to be considered a scaling matrix for rendering.
void TransformVertex(TGLVertex3 &vertex) const
Transform passed 'vertex' by this matrix - converts local frame to parent.
Double_t Invert()
Invert the matrix, returns determinant.
virtual ~TGLLine3()
Destroy 3D line object.
static void DrawReferenceMarker(const TGLCamera &camera, const TGLVertex3 &pos, Float_t radius=3, const UChar_t *rgba=0)
Draw a sphere- marker on world-coordinate 'pos' with pixel radius 'radius'.
TGLVector3 GetTranslation() const
Return the translation component of matrix.
std::pair< Double_t, Double_t > Range_t
16 component (4x4) transform matrix - column MAJOR as per GL.
GLUquadric * Get()
Get the internal raw GLU quadric object. Created on first call.
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...
R__EXTERN TStyle * gStyle
Class encapsulating color information in preferred GL format - an array of four unsigned bytes...
void RotateIP(TGLVector3 &v) const
Rotate vector in-place. Translation is not applied.
static void DrawLine(const TGLLine3 &line, ELineHeadShape head, Double_t size, const UChar_t rgba[4])
Draw thick line (tube) defined by 'line', with head at end shape 'head' - box/arrow/none, (head) size 'size', color 'rgba'.
const Double_t * CArr() const
const Double_t gBoxBackNormals[][3]
void Expand(Int_t x, Int_t y)
Expand the rect to encompass point (x,y)
static void DrawSimpleAxes(const TGLCamera &camera, const TGLBoundingBox &bbox, Int_t axesType)
Draw simple xyz-axes for given bounding-box.
static void BeginAttLine(const TAttLine &aline, Char_t transp, Int_t pick_radius=0, Bool_t selection=kFALSE)
Setup drawing parameters according to passed TAttLine.
virtual Bool_t GetTimeDisplay() const
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
static function to compute reasonable axis limits
static void Color3fv(const Float_t *rgb)
Wrapper for glColor3fv.
void Dump() const
Output vertex component values to std::cout.
static UInt_t GetDrawQuality()
static: get draw quality
void swap(ROOT::THist< DIMENSIONS, PRECISION > &a, ROOT::THist< DIMENSIONS, PRECISION > &b) noexcept
Swap two histograms.
static void RenderPoints(const TAttMarker &marker, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE)
Render markers as circular or square points.
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
TGLRect()
Positive width/height.
void Transpose3x3()
Transpose the top left 3x3 matrix component along major diagonal Supported as currently incompatibili...
TGLVector3 ViewportDeltaToWorld(const TGLVertex3 &worldRef, Double_t viewportXDelta, Double_t viewportYDelta, TGLMatrix *modviewMat=0) const
Apply a 2D viewport delta (shift) to the projection of worldRef onto viewport, returning the resultan...
void StdDarkBackground()
Set defaults for dark (black) background.
TGLVertex3 Center() const
void Set(const TGLVertex3 &start, const TGLVertex3 &end)
Set 3D line running from 'start' to 'end'.
static const UChar_t fgGrey[4]
virtual void ImportAxisAttributes(TAxis *axis)
Internal method to import TAxis attributes to this TGaxis.
Short_t Min(Short_t a, Short_t b)
virtual ~TGLPlane()
Destroy plane object.
static void PointToViewport(Int_t &x, Int_t &y)
Convert from point/screen coordinates to GL viewport coordinates.
void DrawBoxWithGradientFill(Double_t y1, Double_t y2, Double_t x1, Double_t x2, const Double_t *rgba1, const Double_t *rgba2)
static void RenderPolyMarkers(const TAttMarker &marker, Char_t transp, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE)
Render polymarkers at points specified by p-array.
void SetTransparency(Char_t transparency)
Set alpha from the transparency.
TGLEnableGuard(Int_t cap)
TGLEnableGuard constructor.
Wrapper class for GLU quadric shape drawing object.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
~TGLCapabilitySwitch()
Destructor - reset state if changed.
void Set(Double_t x, Double_t y, Double_t z)
TGLColor & operator=(const TGLColor &c)
Assignment operator.
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(...
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
static const UChar_t fgRed[4]
TGLMatrix()
Construct default identity matrix:
TGLVertex3()
Construct a default (0.0, 0.0, 0.0) vertex.
T * Normal2Plane(const T v1[3], const T v2[3], const T v3[3], T normal[3])
Rgl::EOverlap Overlap(const TGLRect &other) const
Return overlap result (kInside, kOutside, kPartial) of this rect with 'other'.
void DrawQuadOutline(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVertex3 &v4)
Draw quad outline.
Char_t GetTransparency() const
Returns transparency value.
void Dump() const
Output 16 matrix components to std::cout.
void EnableTexture(Int_t mode) const
Enable 1D texture.
static const double x2[5]
void Translate(const TGLVector3 &vect)
Shift matrix translation components by 'vect' in parent frame.
const Int_t gBoxFrontQuads[][4]
Double_t DistanceTo(const TGLVertex3 &vertex) const
Distance from plane to vertex.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
void DisableTexture() const
Disable 1D texture.
void Move3LF(Double_t x, Double_t y, Double_t z)
Translate in local frame along all base vectors simultaneously.
void Set(const TGLVertex3 &origin, const TGLVector3 &zAxis, const TGLVector3 &xAxis=0)
Set matrix which when applied puts local origin at 'origin' and the local Z axis in direction 'z'...
static void Color3ub(UChar_t r, UChar_t g, UChar_t b)
Wrapper for glColor3ub.
TGLVector3 fVector
Start vertex of line.
3 component (x/y/z) vertex class.
void Dump() const
Output plane equation to std::out.
~TGLCapabilityEnabler()
Destructor - reset state if changed.
static void DrawSphere(const TGLVertex3 &position, Double_t radius, const UChar_t rgba[4])
Draw sphere, centered on vertex 'position', with radius 'radius', color 'rgba'.
static GLUtesselator * GetDrawTesselator4dv()
Returns a tesselator for direct drawing when using 4-vertices with double precision.
static Float_t GetPointSizeScale()
Get global point-size scale.
static void Color4ub(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
Wrapper for glColor4ub.
void RotateLF(Int_t i1, Int_t i2, Double_t amount)
Rotate in local frame.
void DrawTrapezoidTextured2(const Double_t ver[][2], Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax)
In polar coordinates, box became trapezoid.
void RotatePF(Int_t i1, Int_t i2, Double_t amount)
Rotate in parent frame. Does optimised version of MultLeft.
static double p2(double t, double a, double b, double c)
void SetOption(Option_t *option="")
To set axis options.
const Rgl::Range_t & GetXRange() const
X range.
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
static Int_t fgPickingRadius
void Draw2DAxis(TAxis *axis, Double_t xMin, Double_t yMin, Double_t xMax, Double_t yMax, Double_t min, Double_t max, Bool_t log, Bool_t z=kFALSE)
void SetTimeFormat(const char *tformat)
Change the format used for time plotting.
Viewport (pixel base) 2D rectangle class.
std::vector< UChar_t > fBuffer
3 component (x/y/z) vector class.
static UInt_t fgDrawQuality
static Bool_t IsColorLocked()
Returns true if color lock-count is greater than 0.
void Draw(Bool_t solid=kFALSE) const
Draw the bounding box as either wireframe (default) of solid using current GL color.
static UInt_t LockColor()
Prevent further color changes.
static UInt_t UnlockColor()
Allow color changes.
TGLSelectionBuffer()
TGLSelectionBuffer constructor.
TGLVector3 Multiply(const TGLVector3 &v, Double_t w=1) const
Multiply vector.
void SetIdentity()
Set matrix to identity.
void Error(const char *location, const char *msgfmt,...)
void MultLeft(const TGLMatrix &lhs)
Multiply with matrix lhs on left.
static void SetDefaultDrawQuality(UInt_t dq)
static: set default draw quality
Int_t ColorToObjectID(const UChar_t *color, Bool_t highColor)
virtual const char * GetTimeFormat() const
static void SetPointSizeScale(Float_t scale)
Set global point-size scale.
void SphericalNormalInv(const Double_t *v, Double_t *normal)
void SetContours(const std::vector< Double_t > *contours)
Clear :)
virtual const char * GetTimeFormatOnly() const
Return only the time format from the string fTimeFormat.
Bool_t GetZLog() const
Get Z log.
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
static const UChar_t fgBlue[4]
TGLColorSet & operator=(const TGLColorSet &s)
Assignment operator.
const UChar_t * GetColour(Double_t z) const
Get color.
static Float_t fgLineWidth
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.
static Float_t fgPointSizeScale
virtual Size_t GetMarkerSize() const
void DrawError(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Bool_t GetYLog() const
Get Y log.
static void EndAttLine(Int_t pick_radius=0, Bool_t selection=kFALSE)
Restore previous line drawing state.
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
TGLFloatHolder(const TGLFloatHolder &)
const char * ChooseTimeFormat(Double_t axislength=0)
Choose a reasonable time format from the coordinates in the active pad and the number of divisions in...
static void SetLineWidthScale(Float_t scale)
Set global line-width scale.
void DrawSmoothFace(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &norm1, const TGLVector3 &norm2, const TGLVector3 &norm3)
Draws triangle face, each vertex has its own averaged normal.
Class to manage histogram axis.
static void InitializeIfNeeded()
Initialize globals that require other libraries to be initialized.
static const UChar_t fgWhite[4]
static GLUtesselator * GetDrawTesselator4fv()
Returns a tesselator for direct drawing when using 4-vertices with single precision.
Double_t GetTexCoord(Double_t z) const
Get tex coordinate.
TGLColorSet()
Constructor. Sets default for dark background.
const TGLVertex3 & Start() const
static void Color4f(Float_t r, Float_t g, Float_t b, Float_t a)
Wrapper for glColor4f.
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
void Minimum(const TGLVertex3 &other)
static void DrawNumber(const TString &num, const TGLVertex3 &pos, Bool_t center=kFALSE)
Draw number in string 'num' via internal 8x8-pixel bitmap on vertex 'pos'.
void CylindricalNormal(const Double_t *v, Double_t *normal)
char * Form(const char *fmt,...)
const Int_t gBoxBackQuads[][4]
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb"...
static void Color4fv(const Float_t *rgba)
Wrapper for glColor4fv.
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'...
static Float_t PointSize()
Get the point-size, taking the global scaling into account.
const Double_t gBoxFrontNormals[][3]
static double p1(double t, double a, double b)
~TGLDisableGuard()
TGLDisableGuard destructor.
TGLPlane()
Construct a default plane of x + y + z = 0.
void DrawTransparentBox(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.
TString AsString() const
Return string describing the color.
void Warning(const char *location, const char *msgfmt,...)
virtual Color_t GetLineColor() const
TGLColor()
Default constructor. Color is initialized to black.
lv DrawLine(0.33, 0.0, 0.33, 1.0)
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
TGLVertex3 NearestOn(const TGLVertex3 &point) const
Return nearest point on plane.
static const UChar_t fgGreen[4]
static void Color3f(Float_t r, Float_t g, Float_t b)
Wrapper for glColor3f.
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
static Float_t fgPointLineScalingFactor
void SetLabelOffset(Float_t labeloffset)
const TGLVertex3 End() const
static const double x1[5]
void CylindricalNormalInv(const Double_t *v, Double_t *normal)
static Float_t fgScreenScalingFactor
void Negate()
Negate the plane.
const Int_t gFramePoints[][2]
TGLCapabilitySwitch(const TGLCapabilitySwitch &)
void DrawTrapezoidTextured(const Double_t ver[][2], Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax)
In polar coordinates, box became trapezoid.
void Rotate(const TGLVertex3 &pivot, const TGLVector3 &axis, Double_t angle)
Update matrix so resulting transform has been rotated about 'pivot' (in parent frame), round vector 'axis', through 'angle' (radians) Equivalent to glRotate function, but with addition of translation and compounded on top of existing.
virtual Int_t GetNdivisions() const
void MultRight(const TGLMatrix &rhs)
Multiply with matrix rhs on right.
static void BeginExtendPickRegion(Float_t scale)
static void RenderPolyLine(const TAttLine &aline, Char_t transp, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE)
Render poly-line as specified by the p-array.
The color creation and management class.
static void EndExtendPickRegion()
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Int_t GetPaletteSize() const
Get. Palette. Size.
void DrawTrapezoid(const Double_t ver[][2], Double_t zMin, Double_t zMax, Bool_t color=kTRUE)
void DrawSphere(TGLQuadric *quadric, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Cylinder for lego3.
static Float_t GetPointLineScalingFactor()
Return extra scaling factor for points and lines.
static Int_t CheckError(const char *loc)
Check current GL error state, outputting details via ROOT Error method if one.
const TGLVector3 & Vector() const
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
void GetColor(Float_t v, Float_t vmin, Float_t vmax, Int_t type, Float_t *rgba)
This function creates color for parametric surface's vertex, using its 'u' value. ...
virtual ~TGLMatrix()
Destroy matrix object.
TGLVector3 GetScale() const
Get local axis scaling factors.
Int_t Diagonal() const
Return the diagonal of the rectangle.
static void ResetDrawQuality()
static: reset draw quality
const Rgl::Range_t & GetYRange() const
Y range.
const UChar_t * GetPixelColor(Int_t px, Int_t py) const
Get pixel color.
virtual Color_t GetMarkerColor() const
static Float_t GetLineWidthScale()
Returns global line-width scale.
TGLLine3(const TGLVertex3 &start, const TGLVertex3 &end)
Vector of line from fVertex.
Color_t GetColorIndex() const
Returns color-index representing the color.
~TGLEnableGuard()
TGLEnableGuard destructor.
TGLDisableGuard(Int_t cap)
TGLDisableGuard constructor.
Bool_t GetXLog() const
Get X log.
static void RenderCrosses(const TAttMarker &marker, Float_t *p, Int_t n, Bool_t sec_selection=kFALSE)
Render markers as crosses.
TGLCapabilityEnabler(const TGLCapabilityEnabler &)
static Float_t fgLineWidthScale
static GLUtesselator * GetDrawTesselator3dv()
Returns a tesselator for direct drawing when using 3-vertices with double precision.
void Maximum(const TGLVertex3 &other)
Short_t Max(Short_t a, Short_t b)
virtual ~TGLSelectionBuffer()
TGLSelectionBuffer destructor.
void Scale(const TGLVector3 &scale)
Set matrix axis scales to 'scale'.
static Int_t GetPickingRadius()
Returns picking radius.
static void SetDrawQuality(UInt_t dq)
static: set draw quality
virtual ~TGLRect()
Destroy rect object.
virtual ~TGLVertex3()
Destroy vertex object.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
void DrawCylinder(TGLQuadric *quadric, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Cylinder for lego3.
Double_t Sqrt(Double_t x)
const Int_t gBoxFrontPlanes[][2]
static Float_t fgPointSize
void Normalise()
Normalise the plane.
void Shift(TGLVector3 &shift)
Offset a vertex by vector 'shift'.
void DrawBoxFrontTextured(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax, Int_t front)
Draws lego's bar as a 3d box LULULULU.
virtual Style_t GetMarkerStyle() const
TGLVector3 WorldDeltaToViewport(const TGLVertex3 &worldRef, const TGLVector3 &worldDelta) const
Convert a 3D vector worldDelta (shift) about vertex worldRef to a viewport (screen) '3D' vector...
void SetColor(Int_t r, Int_t g, Int_t b, Int_t a=255)
Set color with Int_t values.
virtual Width_t GetLineWidth() const
virtual Float_t GetTickLength() const
Bool_t GeneratePalette(UInt_t paletteSize, const Rgl::Range_t &zRange, Bool_t checkSize=kTRUE)
Try to find colors for palette.
virtual ~TGLColorSet()
Destructor.
static void ColorAlpha(const TGLColor &color, UChar_t alpha)
Set color from TGLColor and alpha value.
double norm(double *x, double *p)
3D plane class - of format Ax + By + Cz + D = 0
virtual ~TGLVector3()
Destroy vector object.
void Draw() const
Draw line in current basic GL color.
static void SetDrawColors(const UChar_t rgba[4])
Set basic draw colors from 4 component 'rgba' Used by other TGLUtil drawing routines.
void SphericalNormal(const Double_t *v, Double_t *normal)
const Double_t * CArr() const
TGLVector3()
Construct a default (0.0, 0.0, 0.0) vector.
static void Color4ubv(const UChar_t *rgba)
Wrapper for glColor4ubv.
void MoveLF(Int_t ai, Double_t amount)
Translate in local frame.
const Rgl::Range_t & GetZRange() const
Z range.
void Set(Int_t x, Int_t y, Int_t width, Int_t height)
static void Color3ubv(const UChar_t *rgb)
Wrapper for glColor3ubv.
static UInt_t GetDefaultDrawQuality()
static: get default draw quality
void Set(const TGLPlane &other)
Assign from other.
const std::vector< Double_t > * fContours
const Int_t gAxisType[][2]
virtual Float_t GetLabelOffset() const