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)
368 Set(1.0, 1.0, 1.0, 0.0);
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;
548 if (lineDir.
Mag() == 0.0) {
553 Dot(lineDir, lineDir);
569 return std::make_pair(
kTRUE, interVert);
590 plane.
B()*
line.Vector().Y() +
591 plane.
C()*
line.Vector().Z());
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);
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];
785 for (
UInt_t i=0; i < 16; i++) {
814 fVals[12] = translation[0];
815 fVals[13] = translation[1];
816 fVals[14] = translation[2];
832 fVals[12] += vect[0];
833 fVals[13] += vect[1];
834 fVals[14] += vect[2];
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) {
935 c[i1] = b1;
c[i2] = b2;
951 for(
int c=0;
c<4; ++
c,
C+=4) {
954 C[i1] = b1;
C[i2] = b2;
964 for (
UInt_t i = 0; i < 3; 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];
1143 if (ss < 0.8 || ss > 1.2)
return kTRUE;
1145 if (ss < 0.8 || ss > 1.2)
return kTRUE;
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;
1214 SetColor(color_index, transparency);
1309 UChar_t alpha = (255*(100 - transparency))/100;
1337 fRGBA[3] = (255*(100 - transparency))/100;
1381 for (
Int_t i = 0; i < 5; ++i)
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"
1468class TGLTesselatorWrap
1473 GLUtesselator *fTess;
1475 TGLTesselatorWrap(tessfuncptr_t vertex_func) : fTess(0)
1477 fTess = gluNewTess();
1479 throw std::bad_alloc();
1481#if defined(__GNUC__) && __GNUC__ >= 8
1482#pragma GCC diagnostic push
1483#pragma GCC diagnostic ignored "-Wcast-function-type"
1486 gluTessCallback(fTess, (GLenum)GLU_BEGIN, (tessfuncptr_t) glBegin);
1487 gluTessCallback(fTess, (GLenum)GLU_END, (tessfuncptr_t) glEnd);
1488 gluTessCallback(fTess, (GLenum)GLU_VERTEX, vertex_func);
1490#if defined(__GNUC__) && __GNUC__ >= 8
1491#pragma GCC diagnostic pop
1496 virtual ~TGLTesselatorWrap()
1499 gluDeleteTess(fTess);
1512#if defined(__GNUC__) && __GNUC__ >= 8
1513#pragma GCC diagnostic push
1514#pragma GCC diagnostic ignored "-Wcast-function-type"
1517 static TGLTesselatorWrap singleton((tessfuncptr_t) glVertex3fv);
1519#if defined(__GNUC__) && __GNUC__ >= 8
1520#pragma GCC diagnostic pop
1523 return singleton.fTess;
1533#if defined(__GNUC__) && __GNUC__ >= 8
1534#pragma GCC diagnostic push
1535#pragma GCC diagnostic ignored "-Wcast-function-type"
1538 static TGLTesselatorWrap singleton((tessfuncptr_t) glVertex4fv);
1540#if defined(__GNUC__) && __GNUC__ >= 8
1541#pragma GCC diagnostic pop
1544 return singleton.fTess;
1554#if defined(__GNUC__) && __GNUC__ >= 8
1555#pragma GCC diagnostic push
1556#pragma GCC diagnostic ignored "-Wcast-function-type"
1559 static TGLTesselatorWrap singleton((tessfuncptr_t) glVertex3dv);
1561#if defined(__GNUC__) && __GNUC__ >= 8
1562#pragma GCC diagnostic pop
1565 return singleton.fTess;
1575#if defined(__GNUC__) && __GNUC__ >= 8
1576#pragma GCC diagnostic push
1577#pragma GCC diagnostic ignored "-Wcast-function-type"
1580 static TGLTesselatorWrap singleton((tessfuncptr_t) glVertex4dv);
1582#if defined(__GNUC__) && __GNUC__ >= 8
1583#pragma GCC diagnostic pop
1586 return singleton.fTess;
1596 if (init_done)
return;
1601 if (strcmp(
gEnv->
GetValue(
"OpenGL.PointLineScalingFactor",
"native"),
"native") == 0)
1660 const GLubyte *errString;
1662 if ((errCode = glGetError()) != GL_NO_ERROR) {
1663 errString = gluErrorString(errCode);
1665 Error(loc,
"GL Error %s", (
const char *)errString);
1667 Error(
"TGLUtil::CheckError",
"GL Error %s", (
const char *)errString);
1693 Error(
"TGLUtil::UnlockColor",
"fgColorLockCount already 0.");
1741 if (color_index < 0)
1745 glColor4f(
c->GetRed(),
c->GetGreen(),
c->GetBlue(), alpha);
1755 if (color_index < 0)
1759 glColor4f(
c->GetRed(),
c->GetGreen(),
c->GetBlue(), 1.0f - 0.01f*transparency);
1967 glMatrixMode(GL_PROJECTION);
1970 glGetFloatv(GL_PROJECTION_MATRIX, pm);
1971 for (
Int_t i=0; i<=12; i+=4) {
1972 pm[i] *= scale; pm[i+1] *= scale;
1975 glMatrixMode(GL_MODELVIEW);
1982 glMatrixMode(GL_PROJECTION);
1984 glMatrixMode(GL_MODELVIEW);
1998 glPushAttrib(GL_ENABLE_BIT | GL_POINT_BIT | GL_LINE_BIT);
2000 glDisable(GL_LIGHTING);
2004 if (
s == 2 ||
s == 3 ||
s == 5 ||
s == 28)
2007 RenderPoints(marker, p,
n, pick_radius, selection, sec_selection);
2021 if (
s == 2 ||
s == 3 ||
s == 5 ||
s == 28)
2040 glEnable(GL_POINT_SMOOTH);
2043 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2044 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
2049 glDisable(GL_POINT_SMOOTH);
2050 if (
style == 1) size = 1;
2051 else if (
style == 6) size = 2;
2052 else if (
style == 7) size = 3;
2065 for (
Int_t i=0; i<
n; ++i, p+=3)
2076 glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
2077 glVertexPointer(3, GL_FLOAT, 0, p);
2078 glEnableClientState(GL_VERTEX_ARRAY);
2082 const Int_t maxChunk = 8192;
2083 while (nleft > maxChunk)
2085 glDrawArrays(GL_POINTS, ndone, maxChunk);
2089 glDrawArrays(GL_POINTS, ndone, nleft);
2091 glPopClientAttrib();
2109 glEnable(GL_POINT_SMOOTH);
2112 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2113 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
2118 glDisable(GL_POINT_SMOOTH);
2119 if (
style == 1) size = 1;
2120 else if (
style == 6) size = 2;
2121 else if (
style == 7) size = 3;
2126 glVertexPointer(3, GL_DOUBLE, 0, &
points[0]);
2127 glEnableClientState(GL_VERTEX_ARRAY);
2132 const Int_t maxChunk = 8192;
2133 while (nleft > maxChunk)
2135 glDrawArrays(GL_POINTS, ndone, maxChunk);
2141 glDrawArrays(GL_POINTS, ndone, nleft);
2143 glDisableClientState(GL_VERTEX_ARRAY);
2158 glEnable(GL_LINE_SMOOTH);
2163 glDisable(GL_LINE_SMOOTH);
2173 for (
Int_t i=0; i<
n; ++i, p+=3)
2177 glVertex3f(p[0]-
d, p[1], p[2]); glVertex3f(p[0]+
d, p[1], p[2]);
2178 glVertex3f(p[0], p[1]-
d, p[2]); glVertex3f(p[0], p[1]+
d, p[2]);
2179 glVertex3f(p[0], p[1], p[2]-
d); glVertex3f(p[0], p[1], p[2]+
d);
2187 for (
Int_t i=0; i<
n; ++i, p+=3)
2189 glVertex3f(p[0]-
d, p[1], p[2]); glVertex3f(p[0]+
d, p[1], p[2]);
2190 glVertex3f(p[0], p[1]-
d, p[2]); glVertex3f(p[0], p[1]+
d, p[2]);
2191 glVertex3f(p[0], p[1], p[2]-
d); glVertex3f(p[0], p[1], p[2]+
d);
2199 glDisable(GL_POINT_SMOOTH);
2202 glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
2203 glVertexPointer(3, GL_FLOAT, 0, op);
2204 glEnableClientState(GL_VERTEX_ARRAY);
2208 const Int_t maxChunk = 8192;
2209 while (nleft > maxChunk)
2211 glDrawArrays(GL_POINTS, ndone, maxChunk);
2215 glDrawArrays(GL_POINTS, ndone, nleft);
2217 glPopClientAttrib();
2231 glEnable(GL_LINE_SMOOTH);
2236 glDisable(GL_LINE_SMOOTH);
2240 typedef std::vector<Double_t>::size_type size_type;
2244 for (size_type i = 0; i <
points.size(); i += 3) {
2246 glVertex3f(p[0] - dX, p[1], p[2]); glVertex3f(p[0] + dX, p[1], p[2]);
2247 glVertex3f(p[0], p[1] - dY, p[2]); glVertex3f(p[0], p[1] + dY, p[2]);
2248 glVertex3f(p[0], p[1], p[2] - dZ); glVertex3f(p[0], p[1], p[2] + dZ);
2254 glDisable(GL_LINE_SMOOTH);
2255 glDisable(GL_BLEND);
2272 glBegin(GL_LINE_STRIP);
2273 for (
Int_t i=0; i<
n; ++i, tp+=3)
2286 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
2288 glDisable(GL_LIGHTING);
2296 case 2: pat = 0x3333;
break;
2297 case 3: pat = 0x5555;
break;
2298 case 4: pat = 0xf040;
break;
2299 case 5: pat = 0xf4f4;
break;
2300 case 6: pat = 0xf111;
break;
2301 case 7: pat = 0xf0f0;
break;
2302 case 8: pat = 0xff11;
break;
2303 case 9: pat = 0x3fff;
break;
2304 case 10: pat = 0x08ff;
break;
2307 glLineStipple(1, pat);
2308 glEnable(GL_LINE_STIPPLE);
2351 Float_t rgba[4] = {rgbai[0]/255.f, rgbai[1]/255.f, rgbai[2]/255.f, rgbai[3]/255.f};
2352 Float_t ambient[4] = {0.0, 0.0, 0.0, 1.0};
2353 Float_t specular[4] = {0.6, 0.6, 0.6, 1.0};
2354 Float_t emission[4] = {rgba[0]/4.f, rgba[1]/4.f, rgba[2]/4.f, rgba[3]};
2357 glMaterialfv(GL_FRONT, GL_DIFFUSE, rgba);
2358 glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
2359 glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
2360 glMaterialfv(GL_FRONT, GL_EMISSION, emission);
2361 glMaterialf(GL_FRONT, GL_SHININESS, 60.0);
2374 glTranslated(position.
X(), position.
Y(), position.
Z());
2403 glMultMatrixd(local.
CArr());
2409 headHeight = size*2.0;
2411 headHeight = size*1.4;
2415 gluCylinder(quad.
Get(), 0.25*size, 0.25*size, vector.
Mag() - headHeight,
fgDrawQuality, 1);
2416 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_INSIDE);
2419 glTranslated(0.0, 0.0, vector.
Mag() - headHeight);
2423 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_OUTSIDE);
2430 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_OUTSIDE);
2437 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_OUTSIDE);
2465 glMultMatrixd(local.
CArr());
2468 glTranslated(0.0, 0.0, -
width/2.0);
2475 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_INSIDE);
2477 glTranslated(0.0, 0.0,
width);
2478 gluQuadricOrientation(quad.
Get(), (GLenum)GLU_OUTSIDE);
2495 static const UChar_t defColor[4] = { 250, 110, 0, 255 };
2498 DrawSphere(pos, radius, rgba ? rgba : defColor);
2512 static const UChar_t axesColors[][4] = {
2521 static const UChar_t xyz[][8] = {
2522 {0x44, 0x44, 0x28, 0x10, 0x10, 0x28, 0x44, 0x44},
2523 {0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x44, 0x44},
2524 {0x7c, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x7c}
2535 for (
UInt_t i = 0; i < 3; i++) {
2541 start[(i+1)%3] = 0.0;
2542 start[(i+2)%3] = 0.0;
2545 start[(i+1)%3] = min[(i+1)%3];
2546 start[(i+2)%3] = min[(i+2)%3];
2548 vector[(i+1)%3] = 0.0;
2549 vector[(i+2)%3] = 0.0;
2559 vector[i] = min[i] - max[i];
2571 vector[i] = max[i] - min[i];
2582 for (
UInt_t j = 0; j < 3; j++) {
2583 if (min[j] <= 0.0 && max[j] >= 0.0) {
2586 zero[(j+1)%3] = min[(j+1)%3];
2587 zero[(j+2)%3] = min[(j+2)%3];
2588 DrawSphere(zero, pixelSize*2.0, axesColors[j*2 + 1]);
2593 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
2598 glDisable(GL_LIGHTING);
2599 for (
UInt_t k = 0; k < 3; k++) {
2603 minPos[(k+1)%3] = 0.0;
2604 minPos[(k+2)%3] = 0.0;
2606 minPos[(k+1)%3] = min[(k+1)%3];
2607 minPos[(k+2)%3] = min[(k+2)%3];
2618 if (axisViewport.
Mag() < 1) {
2623 padPixels*axisViewport.
Y()/axisViewport.
Mag());
2626 padPixels*axisViewport.
Y()/axisViewport.
Mag());
2634 padPixels*axisViewport.
Y()/axisViewport.
Mag());
2635 glRasterPos3dv(namePos.
CArr());
2636 glBitmap(8, 8, 0.0, 4.0, 0.0, 0.0, xyz[k]);
2649 static const UChar_t digits[][8] = {
2650 {0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38},
2651 {0x10, 0x10, 0x10, 0x10, 0x10, 0x70, 0x10, 0x10},
2652 {0x7c, 0x44, 0x20, 0x18, 0x04, 0x04, 0x44, 0x38},
2653 {0x38, 0x44, 0x04, 0x04, 0x18, 0x04, 0x44, 0x38},
2654 {0x04, 0x04, 0x04, 0x04, 0x7c, 0x44, 0x44, 0x44},
2655 {0x7c, 0x44, 0x04, 0x04, 0x7c, 0x40, 0x40, 0x7c},
2656 {0x7c, 0x44, 0x44, 0x44, 0x7c, 0x40, 0x40, 0x7c},
2657 {0x20, 0x20, 0x20, 0x10, 0x08, 0x04, 0x44, 0x7c},
2658 {0x38, 0x44, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38},
2659 {0x7c, 0x44, 0x04, 0x04, 0x7c, 0x44, 0x44, 0x7c},
2660 {0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
2661 {0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00},
2662 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
2668 xOffset = 3.5 * num.Length();
2672 glRasterPos3dv(pos.
CArr());
2673 for (
Ssiz_t i = 0,
e = num.Length(); i <
e; ++i) {
2674 if (num[i] ==
'.') {
2675 glBitmap(8, 8, xOffset, yOffset, 7.0, 0.0, digits[10]);
2676 }
else if (num[i] ==
'-') {
2677 glBitmap(8, 8, xOffset, yOffset, 7.0, 0.0, digits[11]);
2678 }
else if (num[i] ==
' ') {
2679 glBitmap(8, 8, xOffset, yOffset, 7.0, 0.0, digits[12]);
2680 }
else if (num[i] >=
'0' && num[i] <=
'9') {
2681 glBitmap(8, 8, xOffset, yOffset, 7.0, 0.0, digits[num[i] -
'0']);
2746 fWhat(what), fState(0), fFlip(
kFALSE), fFoo(foo)
2767 glEnable(GLenum(
fCap));
2775 glDisable(GLenum(
fCap));
2784 glDisable(GLenum(
fCap));
2792 glEnable(GLenum(
fCap));
2805 : fWidth(0), fHeight(0)
2824 glPixelStorei(GL_PACK_ALIGNMENT, 1);
2825 glReadPixels(0, 0, w,
h, GL_RGBA, GL_UNSIGNED_BYTE, &
fBuffer[0]);
2836 glPixelStorei(GL_PACK_ALIGNMENT, 1);
2837 glReadPixels(
x,
y, w,
h, GL_RGBA, GL_UNSIGNED_BYTE, &
fBuffer[0]);
2871 RGB_t gColorTriplets[] = {{{255, 0, 0}},
2881 if (lhs.fRGB[0] < rhs.fRGB[0])
2883 else if (lhs.fRGB[0] > rhs.fRGB[0])
2885 else if (lhs.fRGB[1] < rhs.fRGB[1])
2887 else if (lhs.fRGB[1] > rhs.fRGB[1])
2889 else if (lhs.fRGB[2] < rhs.fRGB[2])
2895 typedef std::map<Int_t, RGB_t> ColorLookupTable_t;
2896 typedef ColorLookupTable_t::const_iterator CLTCI_t;
2898 ColorLookupTable_t gObjectIDToColor;
2900 typedef std::map<RGB_t, Int_t> ObjectLookupTable_t;
2901 typedef ObjectLookupTable_t::const_iterator OLTCI_t;
2903 ObjectLookupTable_t gColorToObjectID;
2911 glColor3ub(objectID & 0xff, (objectID & 0xff00) >> 8, (objectID & 0xff0000) >> 16);
2913 if (!gObjectIDToColor.size()) {
2915 for (
Int_t i = 0,
id = 1; i <
Int_t(
sizeof gColorTriplets /
sizeof(RGB_t)); ++i, ++id)
2916 gObjectIDToColor[
id] = gColorTriplets[i];
2917 for (
Int_t i = 0,
id = 1; i <
Int_t(
sizeof gColorTriplets /
sizeof(RGB_t)); ++i, ++id)
2918 gColorToObjectID[gColorTriplets[i]] =
id;
2921 CLTCI_t it = gObjectIDToColor.find(objectID);
2923 if (it != gObjectIDToColor.end())
2924 glColor3ub(it->second.fRGB[0], it->second.fRGB[1], it->second.fRGB[2]);
2926 Error(
"ObjectIDToColor",
"No color for such object ID: %d", objectID);
2927 glColor3ub(0, 0, 0);
2937 return pixel[0] | (pixel[1] << 8) | (pixel[2] << 16);
2939 if (!gObjectIDToColor.size())
2942 RGB_t triplet = {{pixel[0], pixel[1], pixel[2]}};
2943 OLTCI_t it = gColorToObjectID.find(triplet);
2945 if (it != gColorToObjectID.end())
2959 glBegin(GL_LINE_LOOP);
2960 glVertex3dv(v1.
CArr());
2961 glVertex3dv(v2.
CArr());
2962 glVertex3dv(v3.
CArr());
2963 glVertex3dv(v4.
CArr());
2973 glBegin(GL_POLYGON);
2974 glNormal3dv(normal.
CArr());
2975 glVertex3dv(v0.
CArr());
2976 glVertex3dv(v1.
CArr());
2977 glVertex3dv(v2.
CArr());
2978 glVertex3dv(v3.
CArr());
2989 glNormal3dv(normal);
3003 glBegin(GL_POLYGON);
3004 glNormal3dv(norm1.
CArr());
3005 glVertex3dv(v1.
CArr());
3006 glNormal3dv(norm2.
CArr());
3007 glVertex3dv(v2.
CArr());
3008 glNormal3dv(norm3.
CArr());
3009 glVertex3dv(v3.
CArr());
3013const Int_t gBoxFrontQuads[][4] = {{0, 1, 2, 3}, {4, 0, 3, 5}, {4, 5, 6, 7}, {7, 6, 2, 1}};
3014const Double_t gBoxFrontNormals[][3] = {{-1., 0., 0.}, {0., -1., 0.}, {1., 0., 0.}, {0., 1., 0.}};
3017const Int_t gBoxBackQuads[][4] = {{7, 1, 2, 6}, {4, 7, 6, 5}, {0, 4, 5, 3}, {0, 3, 2, 1}};
3018const Double_t gBoxBackNormals[][3] = {{0., -1., 0.}, {-1., 0., 0.}, {0., 1., 0.}, {1., 0., 0.}};
3031 glBegin(GL_POLYGON);
3032 glNormal3d(0., 0., -1.);
3033 glVertex3d(xMax, yMin, zMin);
3034 glVertex3d(xMin, yMin, zMin);
3035 glVertex3d(xMin, yMax, zMin);
3036 glVertex3d(xMax, yMax, zMin);
3039 const Double_t box[][3] = {{xMin, yMin, zMax}, {xMin, yMax, zMax}, {xMin, yMax, zMin}, {xMin, yMin, zMin},
3040 {xMax, yMin, zMax}, {xMax, yMin, zMin}, {xMax, yMax, zMin}, {xMax, yMax, zMax}};
3043 glBegin(GL_POLYGON);
3045 glVertex3dv(
box[verts[0]]);
3046 glVertex3dv(
box[verts[1]]);
3047 glVertex3dv(
box[verts[2]]);
3048 glVertex3dv(
box[verts[3]]);
3053 glBegin(GL_POLYGON);
3055 glVertex3dv(
box[verts[0]]);
3056 glVertex3dv(
box[verts[1]]);
3057 glVertex3dv(
box[verts[2]]);
3058 glVertex3dv(
box[verts[3]]);
3062 glBegin(GL_POLYGON);
3063 glNormal3d(0., 0., 1.);
3064 glVertex3d(xMax, yMin, zMax);
3065 glVertex3d(xMax, yMax, zMax);
3066 glVertex3d(xMin, yMax, zMax);
3067 glVertex3d(xMin, yMin, zMax);
3084 glBegin(GL_POLYGON);
3085 glNormal3d(0., 0., -1.);
3086 glVertex3d(xMax, yMin, zMin);
3087 glVertex3d(xMin, yMin, zMin);
3088 glVertex3d(xMin, yMax, zMin);
3089 glVertex3d(xMax, yMax, zMin);
3092 const Double_t box[][3] = {{xMin, yMin, zMax}, {xMin, yMax, zMax}, {xMin, yMax, zMin}, {xMin, yMin, zMin},
3093 {xMax, yMin, zMax}, {xMax, yMin, zMin}, {xMax, yMax, zMin}, {xMax, yMax, zMax}};
3098 glBegin(GL_POLYGON);
3100 glVertex3dv(
box[verts[0]]);
3101 glVertex3dv(
box[verts[1]]);
3102 glVertex3dv(
box[verts[2]]);
3103 glVertex3dv(
box[verts[3]]);
3108 glBegin(GL_POLYGON);
3110 glVertex3dv(
box[verts[0]]);
3111 glVertex3dv(
box[verts[1]]);
3112 glVertex3dv(
box[verts[2]]);
3113 glVertex3dv(
box[verts[3]]);
3119 glBegin(GL_POLYGON);
3121 glVertex3dv(
box[verts[0]]);
3122 glVertex3dv(
box[verts[1]]);
3123 glVertex3dv(
box[verts[2]]);
3124 glVertex3dv(
box[verts[3]]);
3129 glBegin(GL_POLYGON);
3131 glVertex3dv(
box[verts[0]]);
3132 glVertex3dv(
box[verts[1]]);
3133 glVertex3dv(
box[verts[2]]);
3134 glVertex3dv(
box[verts[3]]);
3138 glBegin(GL_POLYGON);
3139 glNormal3d(0., 0., 1.);
3140 glVertex3d(xMax, yMin, zMax);
3141 glVertex3d(xMax, yMax, zMax);
3142 glVertex3d(xMin, yMax, zMax);
3143 glVertex3d(xMin, yMin, zMax);
3161 glBegin(GL_POLYGON);
3162 glNormal3d(0., 0., 1.);
3163 glTexCoord1d(texMax);
3164 glVertex3d(xMax, yMin, zMax);
3165 glVertex3d(xMax, yMax, zMax);
3166 glVertex3d(xMin, yMax, zMax);
3167 glVertex3d(xMin, yMin, zMax);
3170 glBegin(GL_POLYGON);
3171 glTexCoord1d(texMin);
3172 glNormal3d(0., 0., -1.);
3173 glVertex3d(xMax, yMin, zMin);
3174 glVertex3d(xMin, yMin, zMin);
3175 glVertex3d(xMin, yMax, zMin);
3176 glVertex3d(xMax, yMax, zMin);
3179 const Double_t box[][3] = {{xMin, yMin, zMax}, {xMin, yMax, zMax}, {xMin, yMax, zMin}, {xMin, yMin, zMin},
3180 {xMax, yMin, zMax}, {xMax, yMin, zMin}, {xMax, yMax, zMin}, {xMax, yMax, zMax}};
3182 const Double_t tex[] = {texMax, texMax, texMin, texMin, texMax, texMin, texMin, texMax};
3185 glBegin(GL_POLYGON);
3187 glTexCoord1d(tex[verts[0]]);
3188 glVertex3dv(
box[verts[0]]);
3189 glTexCoord1d(tex[verts[1]]);
3190 glVertex3dv(
box[verts[1]]);
3191 glTexCoord1d(tex[verts[2]]);
3192 glVertex3dv(
box[verts[2]]);
3193 glTexCoord1d(tex[verts[3]]);
3194 glVertex3dv(
box[verts[3]]);
3199 glBegin(GL_POLYGON);
3201 glTexCoord1d(tex[verts[0]]);
3202 glVertex3dv(
box[verts[0]]);
3203 glTexCoord1d(tex[verts[1]]);
3204 glVertex3dv(
box[verts[1]]);
3205 glTexCoord1d(tex[verts[2]]);
3206 glVertex3dv(
box[verts[2]]);
3207 glTexCoord1d(tex[verts[3]]);
3208 glVertex3dv(
box[verts[3]]);
3217 assert(rgba1 != 0 &&
"DrawBoxWithGradientFill, parameter 'rgba1' is null");
3218 assert(rgba2 != 0 &&
"DrawBoxWithGradientFill, parameter 'rgba2' is null");
3220 glBegin(GL_POLYGON);
3237 assert(nPoints != 0 &&
3238 "DrawQuadStripWithRadialGradientFill, invalid number of points");
3239 assert(inner != 0 &&
3240 "DrawQuadStripWithRadialGradientFill, parameter 'inner' is null");
3241 assert(innerRGBA != 0 &&
3242 "DrawQuadStripWithRadialGradientFill, parameter 'innerRGBA' is null");
3243 assert(outer != 0 &&
3244 "DrawQuadStripWithRadialGradientFill, parameter 'outer' is null");
3245 assert(outerRGBA != 0 &&
3246 "DrawQuadStripWithRadialGradientFill, parameter 'outerRGBA' is null");
3248 glBegin(GL_QUAD_STRIP);
3249 for (
UInt_t j = 0; j < nPoints; ++j) {
3250 glColor4dv(innerRGBA);
3251 glVertex2dv(inner + j * 2);
3252 glColor4dv(outerRGBA);
3253 glVertex2dv(outer + j * 2);
3264 GLUquadric *quad = quadric->
Get();
3269 const Double_t xCenter = xMin + (xMax - xMin) / 2;
3270 const Double_t yCenter = yMin + (yMax - yMin) / 2;
3274 glTranslated(xCenter, yCenter, zMin);
3275 gluCylinder(quad, radius, radius, zMax - zMin, 40, 1);
3278 glTranslated(xCenter, yCenter, zMax);
3279 gluDisk(quad, 0., radius, 40, 1);
3282 glTranslated(xCenter, yCenter, zMin);
3283 glRotated(180., 0., 1., 0.);
3284 gluDisk(quad, 0., radius, 40, 1);
3295 GLUquadric *quad = quadric->
Get();
3298 const Double_t xCenter = xMin + (xMax - xMin) / 2;
3299 const Double_t yCenter = yMin + (yMax - yMin) / 2;
3300 const Double_t zCenter = zMin + (zMax - zMin) / 2;
3303 TMath::Min((xMax - xMin) / 2, (yMax - yMin) / 2));
3306 glTranslated(xCenter, yCenter, zCenter);
3307 gluSphere(quad, radius, 10, 10);
3322 glVertex3d(xMin + xWid / 2, yMin + yWid / 2, zMin);
3323 glVertex3d(xMin + xWid / 2, yMin + yWid / 2, zMax);
3327 glVertex3d(xMin + xWid / 2, yMin, zMin);
3328 glVertex3d(xMin + xWid / 2, yMax, zMin);
3332 glVertex3d(xMin, yMin + yWid / 2, zMin);
3333 glVertex3d(xMax, yMin + yWid / 2, zMin);
3341 normal[0] =
v[0] /
n;
3342 normal[1] =
v[1] /
n;
3355 normal[0] = -
v[0] /
n;
3356 normal[1] = -
v[1] /
n;
3372 glBegin(GL_POLYGON);
3373 glNormal3d(0., 0., 1.);
3374 glVertex3d(ver[0][0], ver[0][1], zMax);
3375 glVertex3d(ver[1][0], ver[1][1], zMax);
3376 glVertex3d(ver[2][0], ver[2][1], zMax);
3377 glVertex3d(ver[3][0], ver[3][1], zMax);
3380 glBegin(GL_POLYGON);
3381 glNormal3d(0., 0., -1.);
3382 glVertex3d(ver[0][0], ver[0][1], zMin);
3383 glVertex3d(ver[3][0], ver[3][1], zMin);
3384 glVertex3d(ver[2][0], ver[2][1], zMin);
3385 glVertex3d(ver[1][0], ver[1][1], zMin);
3389 Double_t trapezoid[][3] = {{ver[0][0], ver[0][1], zMin}, {ver[1][0], ver[1][1], zMin},
3390 {ver[2][0], ver[2][1], zMin}, {ver[3][0], ver[3][1], zMin},
3391 {ver[0][0], ver[0][1], zMax}, {ver[1][0], ver[1][1], zMax},
3392 {ver[2][0], ver[2][1], zMax}, {ver[3][0], ver[3][1], zMax}};
3394 glBegin(GL_POLYGON);
3395 CylindricalNormal(trapezoid[1], normal), glNormal3dv(normal), glVertex3dv(trapezoid[1]);
3396 CylindricalNormal(trapezoid[2], normal), glNormal3dv(normal), glVertex3dv(trapezoid[2]);
3397 CylindricalNormal(trapezoid[6], normal), glNormal3dv(normal), glVertex3dv(trapezoid[6]);
3398 CylindricalNormal(trapezoid[5], normal), glNormal3dv(normal), glVertex3dv(trapezoid[5]);
3401 glBegin(GL_POLYGON);
3408 glBegin(GL_POLYGON);
3411 glNormal3dv(normal);
3413 glVertex3dv(trapezoid[0]);
3414 glVertex3dv(trapezoid[1]);
3415 glVertex3dv(trapezoid[5]);
3416 glVertex3dv(trapezoid[4]);
3419 glBegin(GL_POLYGON);
3422 glNormal3dv(normal);
3424 glVertex3dv(trapezoid[3]);
3425 glVertex3dv(trapezoid[7]);
3426 glVertex3dv(trapezoid[6]);
3427 glVertex3dv(trapezoid[2]);
3444 glBegin(GL_POLYGON);
3445 glNormal3d(0., 0., 1.);
3446 glTexCoord1d(texMax);
3447 glVertex3d(ver[0][0], ver[0][1], zMax);
3448 glVertex3d(ver[1][0], ver[1][1], zMax);
3449 glVertex3d(ver[2][0], ver[2][1], zMax);
3450 glVertex3d(ver[3][0], ver[3][1], zMax);
3453 glBegin(GL_POLYGON);
3454 glNormal3d(0., 0., -1.);
3455 glTexCoord1d(texMin);
3456 glVertex3d(ver[0][0], ver[0][1], zMin);
3457 glVertex3d(ver[3][0], ver[3][1], zMin);
3458 glVertex3d(ver[2][0], ver[2][1], zMin);
3459 glVertex3d(ver[1][0], ver[1][1], zMin);
3463 Double_t trapezoid[][3] = {{ver[0][0], ver[0][1], zMin}, {ver[1][0], ver[1][1], zMin},
3464 {ver[2][0], ver[2][1], zMin}, {ver[3][0], ver[3][1], zMin},
3465 {ver[0][0], ver[0][1], zMax}, {ver[1][0], ver[1][1], zMax},
3466 {ver[2][0], ver[2][1], zMax}, {ver[3][0], ver[3][1], zMax}};
3468 glBegin(GL_POLYGON);
3469 CylindricalNormal(trapezoid[1], normal), glNormal3dv(normal), glTexCoord1d(texMin), glVertex3dv(trapezoid[1]);
3470 CylindricalNormal(trapezoid[2], normal), glNormal3dv(normal), glTexCoord1d(texMin), glVertex3dv(trapezoid[2]);
3471 CylindricalNormal(trapezoid[6], normal), glNormal3dv(normal), glTexCoord1d(texMax), glVertex3dv(trapezoid[6]);
3472 CylindricalNormal(trapezoid[5], normal), glNormal3dv(normal), glTexCoord1d(texMax), glVertex3dv(trapezoid[5]);
3475 glBegin(GL_POLYGON);
3476 CylindricalNormalInv(trapezoid[0], normal), glNormal3dv(normal), glTexCoord1d(texMin), glVertex3dv(trapezoid[0]);
3477 CylindricalNormalInv(trapezoid[4], normal), glNormal3dv(normal), glTexCoord1d(texMax), glVertex3dv(trapezoid[4]);
3478 CylindricalNormalInv(trapezoid[7], normal), glNormal3dv(normal), glTexCoord1d(texMax), glVertex3dv(trapezoid[7]);
3479 CylindricalNormalInv(trapezoid[3], normal), glNormal3dv(normal), glTexCoord1d(texMin), glVertex3dv(trapezoid[3]);
3482 glBegin(GL_POLYGON);
3484 glNormal3dv(normal);
3485 glTexCoord1d(texMin);
3486 glVertex3dv(trapezoid[0]);
3487 glTexCoord1d(texMin);
3488 glVertex3dv(trapezoid[1]);
3489 glTexCoord1d(texMax);
3490 glVertex3dv(trapezoid[5]);
3491 glTexCoord1d(texMax);
3492 glVertex3dv(trapezoid[4]);
3495 glBegin(GL_POLYGON);
3497 glNormal3dv(normal);
3498 glTexCoord1d(texMin);
3499 glVertex3dv(trapezoid[3]);
3500 glTexCoord1d(texMax);
3501 glVertex3dv(trapezoid[7]);
3502 glTexCoord1d(texMax);
3503 glVertex3dv(trapezoid[6]);
3504 glTexCoord1d(texMin);
3505 glVertex3dv(trapezoid[2]);
3518 const Double_t trapezoid[][3] = {{ver[0][0], ver[0][1], zMin}, {ver[1][0], ver[1][1], zMin},
3519 {ver[2][0], ver[2][1], zMin}, {ver[3][0], ver[3][1], zMin},
3520 {ver[0][0], ver[0][1], zMax}, {ver[1][0], ver[1][1], zMax},
3521 {ver[2][0], ver[2][1], zMax}, {ver[3][0], ver[3][1], zMax}};
3522 const Double_t tex[] = {texMin, texMax, texMax, texMin, texMin, texMax, texMax, texMin};
3524 glBegin(GL_POLYGON);
3525 glNormal3d(0., 0., 1.);
3526 glTexCoord1d(tex[4]), glVertex3dv(trapezoid[4]);
3527 glTexCoord1d(tex[5]), glVertex3dv(trapezoid[5]);
3528 glTexCoord1d(tex[6]), glVertex3dv(trapezoid[6]);
3529 glTexCoord1d(tex[7]), glVertex3dv(trapezoid[7]);
3532 glBegin(GL_POLYGON);
3533 glNormal3d(0., 0., -1.);
3534 glTexCoord1d(tex[0]), glVertex3dv(trapezoid[0]);
3535 glTexCoord1d(tex[3]), glVertex3dv(trapezoid[3]);
3536 glTexCoord1d(tex[2]), glVertex3dv(trapezoid[2]);
3537 glTexCoord1d(tex[1]), glVertex3dv(trapezoid[1]);
3540 glBegin(GL_POLYGON);
3542 CylindricalNormal(trapezoid[1], normal), glNormal3dv(normal), glTexCoord1d(tex[1]), glVertex3dv(trapezoid[1]);
3543 CylindricalNormal(trapezoid[2], normal), glNormal3dv(normal), glTexCoord1d(tex[2]), glVertex3dv(trapezoid[2]);
3544 CylindricalNormal(trapezoid[6], normal), glNormal3dv(normal), glTexCoord1d(tex[6]), glVertex3dv(trapezoid[6]);
3545 CylindricalNormal(trapezoid[5], normal), glNormal3dv(normal), glTexCoord1d(tex[5]), glVertex3dv(trapezoid[5]);
3548 glBegin(GL_POLYGON);
3549 CylindricalNormalInv(trapezoid[0], normal), glNormal3dv(normal), glTexCoord1d(tex[0]), glVertex3dv(trapezoid[0]);
3550 CylindricalNormalInv(trapezoid[4], normal), glNormal3dv(normal), glTexCoord1d(tex[4]), glVertex3dv(trapezoid[4]);
3551 CylindricalNormalInv(trapezoid[7], normal), glNormal3dv(normal), glTexCoord1d(tex[7]), glVertex3dv(trapezoid[7]);
3552 CylindricalNormalInv(trapezoid[3], normal), glNormal3dv(normal), glTexCoord1d(tex[3]), glVertex3dv(trapezoid[3]);
3555 glBegin(GL_POLYGON);
3557 glNormal3dv(normal);
3558 glTexCoord1d(tex[0]), glVertex3dv(trapezoid[0]);
3559 glTexCoord1d(tex[1]), glVertex3dv(trapezoid[1]);
3560 glTexCoord1d(tex[5]), glVertex3dv(trapezoid[5]);
3561 glTexCoord1d(tex[4]), glVertex3dv(trapezoid[4]);
3564 glBegin(GL_POLYGON);
3566 glNormal3dv(normal);
3567 glTexCoord1d(tex[3]), glVertex3dv(trapezoid[3]);
3568 glTexCoord1d(tex[7]), glVertex3dv(trapezoid[7]);
3569 glTexCoord1d(tex[6]), glVertex3dv(trapezoid[6]);
3570 glTexCoord1d(tex[2]), glVertex3dv(trapezoid[2]);
3580 normal[0] =
v[0] /
n;
3581 normal[1] =
v[1] /
n;
3582 normal[2] =
v[2] /
n;
3596 normal[0] = -
v[0] /
n;
3597 normal[1] = -
v[1] /
n;
3598 normal[2] = -
v[2] /
n;
3612 glBegin(GL_POLYGON);
3614 glNormal3dv(normal);
3615 glVertex3dv(ver[0]);
3616 glVertex3dv(ver[1]);
3617 glVertex3dv(ver[2]);
3618 glVertex3dv(ver[3]);
3621 glBegin(GL_POLYGON);
3623 glNormal3dv(normal);
3624 glVertex3dv(ver[4]);
3625 glVertex3dv(ver[7]);
3626 glVertex3dv(ver[6]);
3627 glVertex3dv(ver[5]);
3631 glBegin(GL_POLYGON);
3633 glNormal3dv(normal);
3634 glVertex3dv(ver[0]);
3635 glVertex3dv(ver[3]);
3636 glVertex3dv(ver[7]);
3637 glVertex3dv(ver[4]);
3640 glBegin(GL_POLYGON);
3641 SphericalNormal(ver[3], normal), glNormal3dv(normal), glVertex3dv(ver[3]);
3642 SphericalNormal(ver[2], normal), glNormal3dv(normal), glVertex3dv(ver[2]);
3643 SphericalNormal(ver[6], normal), glNormal3dv(normal), glVertex3dv(ver[6]);
3644 SphericalNormal(ver[7], normal), glNormal3dv(normal), glVertex3dv(ver[7]);
3647 glBegin(GL_POLYGON);
3649 glNormal3dv(normal);
3650 glVertex3dv(ver[5]);
3651 glVertex3dv(ver[6]);
3652 glVertex3dv(ver[2]);
3653 glVertex3dv(ver[1]);
3656 glBegin(GL_POLYGON);
3669 if (texMin > texMax)
3672 const Double_t tex[] = {texMin, texMin, texMax, texMax, texMin, texMin, texMax, texMax};
3673 glBegin(GL_POLYGON);
3675 glNormal3dv(normal);
3676 glTexCoord1d(tex[0]), glVertex3dv(ver[0]);
3677 glTexCoord1d(tex[1]), glVertex3dv(ver[1]);
3678 glTexCoord1d(tex[2]), glVertex3dv(ver[2]);
3679 glTexCoord1d(tex[3]), glVertex3dv(ver[3]);
3681 glBegin(GL_POLYGON);
3683 glNormal3dv(normal);
3684 glTexCoord1d(tex[4]), glVertex3dv(ver[4]);
3685 glTexCoord1d(tex[7]), glVertex3dv(ver[7]);
3686 glTexCoord1d(tex[6]), glVertex3dv(ver[6]);
3687 glTexCoord1d(tex[5]), glVertex3dv(ver[5]);
3689 glBegin(GL_POLYGON);
3691 glNormal3dv(normal);
3692 glTexCoord1d(tex[0]), glVertex3dv(ver[0]);
3693 glTexCoord1d(tex[3]), glVertex3dv(ver[3]);
3694 glTexCoord1d(tex[7]), glVertex3dv(ver[7]);
3695 glTexCoord1d(tex[4]), glVertex3dv(ver[4]);
3697 glBegin(GL_POLYGON);
3698 SphericalNormal(ver[3], normal), glNormal3dv(normal), glTexCoord1d(tex[3]), glVertex3dv(ver[3]);
3699 SphericalNormal(ver[2], normal), glNormal3dv(normal), glTexCoord1d(tex[2]), glVertex3dv(ver[2]);
3700 SphericalNormal(ver[6], normal), glNormal3dv(normal), glTexCoord1d(tex[6]), glVertex3dv(ver[6]);
3701 SphericalNormal(ver[7], normal), glNormal3dv(normal), glTexCoord1d(tex[7]), glVertex3dv(ver[7]);
3703 glBegin(GL_POLYGON);
3705 glNormal3dv(normal);
3706 glTexCoord1d(tex[5]), glVertex3dv(ver[5]);
3707 glTexCoord1d(tex[6]), glVertex3dv(ver[6]);
3708 glTexCoord1d(tex[2]), glVertex3dv(ver[2]);
3709 glTexCoord1d(tex[1]), glVertex3dv(ver[1]);
3711 glBegin(GL_POLYGON);
3712 SphericalNormalInv(ver[0], normal), glNormal3dv(normal), glTexCoord1d(tex[0]), glVertex3dv(ver[0]);
3713 SphericalNormalInv(ver[4], normal), glNormal3dv(normal), glTexCoord1d(tex[4]), glVertex3dv(ver[4]);
3714 SphericalNormalInv(ver[5], normal), glNormal3dv(normal), glTexCoord1d(tex[5]), glVertex3dv(ver[5]);
3715 SphericalNormalInv(ver[1], normal), glNormal3dv(normal), glTexCoord1d(tex[1]), glVertex3dv(ver[1]);
3727 if (xMin > xMax || z) option +=
"SDH=+";
3728 else option +=
"SDH=-";
3730 if (
log) option +=
'G';
3742 static const Double_t zero = 0.001;
3763 axisPainter.
PaintAxis(xMin, yMin, xMax, yMax, min, max, nDiv, option.c_str());
3782 +
box[left].X() - vp[0]));
3784 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3785 *
gPad->GetWh() + vp[1]));
3787 +
box[fp].X() - vp[0]));
3789 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3790 *
gPad->GetWh() + vp[1]));
3792 *
gPad->GetWw() +
box[right].X() - vp[0]));
3794 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3795 *
gPad->GetWh() + vp[1]));
3807 if (xLeft - xMid || yLeft - yMid) {
3808 TAxis *axis = leftType ? yAxis : xAxis;
3809 if (leftLabel < leftMidLabel)
3810 Draw2DAxis(axis, xLeft, yLeft, xMid, yMid, leftLabel, leftMidLabel,
3813 Draw2DAxis(axis, xMid, yMid, xLeft, yLeft, leftMidLabel, leftLabel,
3817 if (xRight - xMid || yRight - yMid) {
3818 TAxis *axis = rightType ? yAxis : xAxis;
3820 if (rightMidLabel < rightLabel)
3821 Draw2DAxis(axis, xMid, yMid, xRight, yRight, rightMidLabel, rightLabel,
3824 Draw2DAxis(axis, xRight, yRight, xMid, yMid, rightLabel, rightMidLabel,
3829 +
box[left + 4].X() - vp[0]));
3831 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3832 *
gPad->GetWh() + vp[1]));
3838 Double_t zScale, std::vector<Double_t> &zLevels)
3842 Double_t binLow = 0., binHigh = 0., binWidth = 0.;
3844 zLevels.resize(nBins + 1);
3846 for (
Int_t i = 0; i < nBins + 1; ++i)
3847 zLevels[i] = (binLow + i * binWidth) * zScale;
3857 glBegin(GL_POLYGON);
3858 glNormal3dv(norm1.
CArr());
3860 glVertex3dv(v1.
CArr());
3861 glNormal3dv(norm2.
CArr());
3863 glVertex3dv(v2.
CArr());
3864 glNormal3dv(norm3.
CArr());
3866 glVertex3dv(v3.
CArr());
3877 glBegin(GL_POLYGON);
3878 glNormal3dv(normal.
CArr());
3880 glVertex3d(v1.
X(), v1.
Y(), z);
3882 glVertex3d(v2.
X(), v2.
Y(), z);
3884 glVertex3d(v3.
X(), v3.
Y(), z);
3915 if (
v < (vmin + 0.25 * dv)) {
3917 rgba[1] = 4 * (
v - vmin) / dv;
3919 }
else if (
v < (vmin + 0.5 * dv)) {
3922 rgba[2] = 1 + 4 * (vmin + 0.25 * dv -
v) / dv;
3923 }
else if (
v < (vmin + 0.75 * dv)) {
3924 rgba[0] = 4 * (
v - vmin - 0.5 * dv) / dv;
3929 rgba[1] = 1 + 4 * (vmin + 0.75 * dv -
v) / dv;
3934 rgba[0] = (
v - vmin) / dv;
3936 rgba[2] = (vmax -
v) / dv;
3939 rgba[0] = (
v - vmin) / dv;
3944 if (
v < (vmin + dv / 6.0)) {
3946 rgba[1] = 6 * (
v - vmin) / dv;
3948 }
else if (
v < (vmin + 2.0 * dv / 6.0)) {
3949 rgba[0] = 1 + 6 * (vmin + dv / 6.0 -
v) / dv;
3952 }
else if (
v < (vmin + 3.0 * dv / 6.0)) {
3955 rgba[2] = 6 * (
v - vmin - 2.0 * dv / 6.0) / dv;
3956 }
else if (
v < (vmin + 4.0 * dv / 6.0)) {
3958 rgba[1] = 1 + 6 * (vmin + 3.0 * dv / 6.0 -
v) / dv;
3960 }
else if (
v < (vmin + 5.0 * dv / 6.0)) {
3961 rgba[0] = 6 * (
v - vmin - 4.0 * dv / 6.0) / dv;
3967 rgba[2] = 1 + 6 * (vmin + 5.0 * dv / 6.0 -
v) / dv;
3971 rgba[0] = (
v - vmin) / (vmax - vmin);
3976 rgba[0] = (
v - vmin) / (vmax - vmin);
3977 rgba[1] = (vmax -
v) / (vmax - vmin);
3981 if (
v < (vmin + 0.25 * dv)) {
3983 rgba[1] = 4 * (
v - vmin) / dv;
3984 rgba[2] = 1 - rgba[1];
3985 }
else if (
v < (vmin + 0.5 * dv)) {
3986 rgba[0] = 4 * (
v - vmin - 0.25 * dv) / dv;
3987 rgba[1] = 1 - rgba[0];
3989 }
else if (
v < (vmin + 0.75 * dv)) {
3990 rgba[1] = 4 * (
v - vmin - 0.5 * dv) / dv;
3991 rgba[0] = 1 - rgba[1];
3995 rgba[2] = 4 * (
v - vmin - 0.75 * dv) / dv;
3996 rgba[1] = 1 - rgba[2];
4000 if (
v < (vmin + 0.5 * dv)) {
4001 rgba[0] = 2 * (
v - vmin) / dv;
4005 rgba[0] = 1 - 2 * (
v - vmin - 0.5 * dv) / dv;
4011 if (
v < (vmin + dv / 3)) {
4012 rgba[2] = 3 * (
v - vmin) / dv;
4014 rgba[0] = 1 - rgba[2];
4015 }
else if (
v < (vmin + 2 * dv / 3)) {
4017 rgba[1] = 3 * (
v - vmin - dv / 3) / dv;
4020 rgba[0] = 3 * (
v - vmin - 2 * dv / 3) / dv;
4021 rgba[1] = 1 - rgba[0];
4026 if (
v < (vmin + 0.2 * dv)) {
4028 rgba[1] = 5 * (
v - vmin) / dv;
4030 }
else if (
v < (vmin + 0.4 * dv)) {
4033 rgba[2] = 1 + 5 * (vmin + 0.2 * dv -
v) / dv;
4034 }
else if (
v < (vmin + 0.6 * dv)) {
4035 rgba[0] = 5 * (
v - vmin - 0.4 * dv) / dv;
4038 }
else if (
v < (vmin + 0.8 * dv)) {
4040 rgba[1] = 1 - 5 * (
v - vmin - 0.6 * dv) / dv;
4044 rgba[1] = 5 * (
v - vmin - 0.8 * dv) / dv;
4045 rgba[2] = 5 * (
v - vmin - 0.8 * dv) / dv;
4049 c1[0] = 200 / 255.0;
c1[1] = 60 / 255.0;
c1[2] = 0 / 255.0;
4050 c2[0] = 250 / 255.0;
c2[1] = 160 / 255.0;
c2[2] = 110 / 255.0;
4051 rgba[0] = (
c2[0] -
c1[0]) * (
v - vmin) / dv +
c1[0];
4052 rgba[1] = (
c2[1] -
c1[1]) * (
v - vmin) / dv +
c1[1];
4053 rgba[2] = (
c2[2] -
c1[2]) * (
v - vmin) / dv +
c1[2];
4056 c1[0] = 55 / 255.0;
c1[1] = 55 / 255.0;
c1[2] = 45 / 255.0;
4057 c2[0] = 200 / 255.0;
c2[1] = 60 / 255.0;
c2[2] = 0 / 255.0;
4058 c3[0] = 250 / 255.0;
c3[1] = 160 / 255.0;
c3[2] = 110 / 255.0;
4060 vmid = vmin + ratio * dv;
4062 rgba[0] = (
c2[0] -
c1[0]) * (
v - vmin) / (ratio*dv) +
c1[0];
4063 rgba[1] = (
c2[1] -
c1[1]) * (
v - vmin) / (ratio*dv) +
c1[1];
4064 rgba[2] = (
c2[2] -
c1[2]) * (
v - vmin) / (ratio*dv) +
c1[2];
4066 rgba[0] = (
c3[0] -
c2[0]) * (
v - vmid) / ((1-ratio)*dv) +
c2[0];
4067 rgba[1] = (
c3[1] -
c2[1]) * (
v - vmid) / ((1-ratio)*dv) +
c2[1];
4068 rgba[2] = (
c3[2] -
c2[2]) * (
v - vmid) / ((1-ratio)*dv) +
c2[2];
4072 c1[0] = 0 / 255.0;
c1[1] = 255 / 255.0;
c1[2] = 0 / 255.0;
4073 c2[0] = 255 / 255.0;
c2[1] = 150 / 255.0;
c2[2] = 0 / 255.0;
4074 c3[0] = 255 / 255.0;
c3[1] = 250 / 255.0;
c3[2] = 240 / 255.0;
4076 vmid = vmin + ratio * dv;
4078 rgba[0] = (
c2[0] -
c1[0]) * (
v - vmin) / (ratio*dv) +
c1[0];
4079 rgba[1] = (
c2[1] -
c1[1]) * (
v - vmin) / (ratio*dv) +
c1[1];
4080 rgba[2] = (
c2[2] -
c1[2]) * (
v - vmin) / (ratio*dv) +
c1[2];
4082 rgba[0] = (
c3[0] -
c2[0]) * (
v - vmid) / ((1-ratio)*dv) +
c2[0];
4083 rgba[1] = (
c3[1] -
c2[1]) * (
v - vmid) / ((1-ratio)*dv) +
c2[1];
4084 rgba[2] = (
c3[2] -
c2[2]) * (
v - vmid) / ((1-ratio)*dv) +
c2[2];
4089 rgba[1] = 1 - (
v - vmin) / dv;
4093 if (
v < (vmin + 0.25 * dv)) {
4095 rgba[1] = 4 * (
v - vmin) / dv;
4097 }
else if (
v < (vmin + 0.5 * dv)) {
4100 rgba[2] = 1 - 4 * (
v - vmin - 0.25 * dv) / dv;
4101 }
else if (
v < (vmin + 0.75 * dv)) {
4102 rgba[0] = 4 * (
v - vmin - 0.5 * dv) / dv;
4108 rgba[2] = 4 * (
v - vmin - 0.75 * dv) / dv;
4112 if (
v < (vmin + 0.5 * dv)) {
4114 rgba[1] = 2 * (
v - vmin) / dv;
4115 rgba[2] = 1 - 2 * (
v - vmin) / dv;
4117 rgba[0] = 2 * (
v - vmin - 0.5 * dv) / dv;
4118 rgba[1] = 1 - 2 * (
v - vmin - 0.5 * dv) / dv;
4123 if (
v < (vmin + 0.5 * dv)) {
4125 rgba[1] = 1 - 2 * (
v - vmin) / dv;
4126 rgba[2] = 2 * (
v - vmin) / dv;
4128 rgba[0] = 1 - 2 * (
v - vmin - 0.5 * dv) / dv;
4129 rgba[1] = 2 * (
v - vmin - 0.5 * dv) / dv;
4135 rgba[1] = (
v - vmin) / (vmax - vmin);
4139 rgba[0] = (
v - vmin) / (vmax - vmin);
4144 c1[0] = 0 / 255.0;
c1[1] = 160 / 255.0;
c1[2] = 0 / 255.0;
4145 c2[0] = 180 / 255.0;
c2[1] = 220 / 255.0;
c2[2] = 0 / 255.0;
4146 c3[0] = 250 / 255.0;
c3[1] = 220 / 255.0;
c3[2] = 170 / 255.0;
4148 vmid = vmin + ratio * dv;
4150 rgba[0] = (
c2[0] -
c1[0]) * (
v - vmin) / (ratio*dv) +
c1[0];
4151 rgba[1] = (
c2[1] -
c1[1]) * (
v - vmin) / (ratio*dv) +
c1[1];
4152 rgba[2] = (
c2[2] -
c1[2]) * (
v - vmin) / (ratio*dv) +
c1[2];
4154 rgba[0] = (
c3[0] -
c2[0]) * (
v - vmid) / ((1-ratio)*dv) +
c2[0];
4155 rgba[1] = (
c3[1] -
c2[1]) * (
v - vmid) / ((1-ratio)*dv) +
c2[1];
4156 rgba[2] = (
c3[2] -
c2[2]) * (
v - vmid) / ((1-ratio)*dv) +
c2[2];
4183 if (!(zRange.second - zRange.first))
4187 Error(
"TGLLevelPaletter::GeneratePalette",
4188 "Invalid palette size, must be a positive number");
4193 Error(
"TGLLevelPalette::GeneratePalette",
4194 "Number of contours %d is too big for GL 1D texture, try to reduce it to %d",
4200 while (nearestPow2 < paletteSize)
4203 fTexels.resize(4 * nearestPow2);
4211 for (
UInt_t i = 0; i < paletteSize; ++i) {
4213 if (paletteInd > nColors - 1)
4214 paletteInd = nColors - 1;
4219 c->GetRGB(rgb[0], rgb[1], rgb[2]);
4245 glEnable(GL_TEXTURE_1D);
4249 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
4250 glBindTexture(GL_TEXTURE_1D,
fTexture);
4251 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
4252 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
4253 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
4254 glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA,
fTexels.size() / 4, 0,
4255 GL_RGBA, GL_UNSIGNED_BYTE, &
fTexels[0]);
4256 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GLint(mode));
4265 glDisable(GL_TEXTURE_1D);
static double p3(double t, double a, double b, double c, double d)
static double p1(double t, double a, double b)
static double p2(double t, double a, double b, double c)
static const double x2[5]
static const double x1[5]
Bool_t operator<(const TDatime &d1, const TDatime &d2)
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,...)
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
virtual Int_t GetNdivisions() const
virtual Float_t GetLabelOffset() const
virtual Float_t GetTickLength() const
virtual Color_t GetLineColor() const
Return the line color.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual Style_t GetLineStyle() const
Return the line style.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
Class to manage histogram axis.
virtual Bool_t GetTimeDisplay() const
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...
virtual const char * GetTimeFormatOnly() const
Return only the time format from the string fTimeFormat.
virtual const char * GetTimeFormat() const
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
TGLVertex3 Center() const
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
TGLVector3 WorldDeltaToViewport(const TGLVertex3 &worldRef, const TGLVector3 &worldDelta) const
Convert a 3D vector worldDelta (shift) about vertex worldRef to a viewport (screen) '3D' vector.
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...
~TGLCapabilityEnabler()
Destructor - reset state if changed.
TGLCapabilityEnabler(const TGLCapabilityEnabler &)
TGLCapabilitySwitch(const TGLCapabilitySwitch &)
~TGLCapabilitySwitch()
Destructor - reset state if changed.
Class encapsulating a set of colors used throughout standard rendering.
void StdLightBackground()
Set defaults for light (white) background.
virtual ~TGLColorSet()
Destructor.
TGLColorSet & operator=(const TGLColorSet &s)
Assignment operator.
void StdDarkBackground()
Set defaults for dark (black) background.
TGLColorSet()
Constructor. Sets default for dark background.
Class encapsulating color information in preferred GL format - an array of four unsigned bytes.
void SetTransparency(Char_t transparency)
Set alpha from the transparency.
const UChar_t * CArr() const
Char_t GetTransparency() const
Returns transparency value.
void SetColor(Int_t r, Int_t g, Int_t b, Int_t a=255)
Set color with Int_t values.
TGLColor()
Default constructor. Color is initialized to black.
TString AsString() const
Return string describing the color.
TGLColor & operator=(const TGLColor &c)
Assignment operator.
virtual ~TGLColor()
Destructor.
Color_t GetColorIndex() const
Returns color-index representing the color.
~TGLDisableGuard()
TGLDisableGuard destructor.
TGLDisableGuard(Int_t cap)
TGLDisableGuard constructor.
~TGLEnableGuard()
TGLEnableGuard destructor.
TGLEnableGuard(Int_t cap)
TGLEnableGuard constructor.
TGLFloatHolder(const TGLFloatHolder &)
const UChar_t * GetColour(Double_t z) const
Get color.
const std::vector< Double_t > * fContours
Int_t GetPaletteSize() const
Get. Palette. Size.
void SetContours(const std::vector< Double_t > *contours)
Clear :)
std::vector< UChar_t > fTexels
void DisableTexture() const
Disable 1D texture.
Double_t GetTexCoord(Double_t z) const
Get tex coordinate.
Bool_t GeneratePalette(UInt_t paletteSize, const Rgl::Range_t &zRange, Bool_t checkSize=kTRUE)
Try to find colors for palette.
void EnableTexture(Int_t mode) const
Enable 1D texture.
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'.
TGLLine3(const TGLVertex3 &start, const TGLVertex3 &end)
Vector of line from fVertex.
virtual ~TGLLine3()
Destroy 3D line object.
const TGLVertex3 End() const
void Draw() const
Draw line in current basic GL color.
TGLVector3 fVector
Start vertex of line.
void Set(const TGLVertex3 &start, const TGLVertex3 &end)
Set 3D line running from 'start' to 'end'.
16 component (4x4) transform matrix - column MAJOR as per GL.
void MultLeft(const TGLMatrix &lhs)
Multiply with matrix lhs on left.
TGLVector3 Multiply(const TGLVector3 &v, Double_t w=1) const
Multiply vector.
void Scale(const TGLVector3 &scale)
Set matrix axis scales to 'scale'.
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'.
void RotateLF(Int_t i1, Int_t i2, Double_t amount)
Rotate in local frame.
Double_t Invert()
Invert the matrix, returns determinant.
void MoveLF(Int_t ai, Double_t amount)
Translate in local frame.
void SetIdentity()
Set matrix to identity.
void Transpose3x3()
Transpose the top left 3x3 matrix component along major diagonal Supported as currently incompatibili...
void RotatePF(Int_t i1, Int_t i2, Double_t amount)
Rotate in parent frame. Does optimised version of MultLeft.
void Move3LF(Double_t x, Double_t y, Double_t z)
Translate in local frame along all base vectors simultaneously.
const Double_t * CArr() const
void Rotate(const TGLVertex3 &pivot, const TGLVector3 &axis, Double_t angle)
Update matrix so resulting transform has been rotated about 'pivot' (in parent frame),...
virtual ~TGLMatrix()
Destroy matrix object.
TGLVector3 GetTranslation() const
Return the translation component of matrix.
void RotateIP(TGLVector3 &v) const
Rotate vector in-place. Translation is not applied.
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.
TGLVector3 GetScale() const
Get local axis scaling factors.
void MultRight(const TGLMatrix &rhs)
Multiply with matrix rhs on right.
void SetTranslation(Double_t x, Double_t y, Double_t z)
Set matrix translation components x,y,z.
void MultiplyIP(TGLVector3 &v, Double_t w=1) const
Multiply vector in-place.
void Translate(const TGLVector3 &vect)
Shift matrix translation components by 'vect' in parent frame.
void Dump() const
Output 16 matrix components to std::cout.
TGLMatrix()
Construct default identity matrix:
3D plane class - of format Ax + By + Cz + D = 0
void Set(const TGLPlane &other)
Assign from other.
void Negate()
Negate the plane.
TGLVertex3 NearestOn(const TGLVertex3 &point) const
Return nearest point on plane.
void Normalise()
Normalise the plane.
virtual ~TGLPlane()
Destroy plane object.
TGLPlane()
Construct a default plane of x + y + z = 0.
Double_t DistanceTo(const TGLVertex3 &vertex) const
Distance from plane to vertex.
void Dump() const
Output plane equation to std::out.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
Bool_t GetXLog() const
Get X log.
const Rgl::Range_t & GetZRange() const
Z range.
Bool_t GetYLog() const
Get Y log.
Bool_t GetZLog() const
Get Z log.
const Rgl::Range_t & GetYRange() const
Y range.
const Rgl::Range_t & GetXRange() const
X range.
Wrapper class for GLU quadric shape drawing object.
GLUquadric * Get()
Get the internal raw GLU quadric object. Created on first call.
Viewport (pixel base) 2D rectangle class.
TGLRect()
Positive width/height.
Int_t Diagonal() const
Return the diagonal of the rectangle.
Rgl::EOverlap Overlap(const TGLRect &other) const
Return overlap result (kInside, kOutside, kPartial) of this rect with 'other'.
virtual ~TGLRect()
Destroy rect object.
void Expand(Int_t x, Int_t y)
Expand the rect to encompass point (x,y)
const UChar_t * GetPixelColor(Int_t px, Int_t py) const
Get pixel color.
void ReadColorBuffer(Int_t width, Int_t height)
Read color buffer.
virtual ~TGLSelectionBuffer()
TGLSelectionBuffer destructor.
TGLSelectionBuffer()
TGLSelectionBuffer constructor.
std::vector< UChar_t > fBuffer
Wrapper class for various misc static functions - error checking, draw helpers etc.
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 void Color4ubv(const UChar_t *rgba)
Wrapper for glColor4ubv.
static UInt_t GetDrawQuality()
static: get draw quality
static Int_t fgPickingRadius
static const UChar_t fgWhite[4]
static UInt_t fgDefaultDrawQuality
static void SetDrawQuality(UInt_t dq)
static: set draw quality
static Float_t GetPointSizeScale()
Get global point-size scale.
static void Color3f(Float_t r, Float_t g, Float_t b)
Wrapper for glColor3f.
static Float_t fgPointSize
static Float_t fgLineWidth
static Float_t fgScreenScalingFactor
static void ResetDrawQuality()
static: reset draw quality
static Float_t fgPointSizeScale
static Bool_t IsColorLocked()
Returns true if color lock-count is greater than 0.
static void Color3fv(const Float_t *rgb)
Wrapper for glColor3fv.
static void SetLineWidthScale(Float_t scale)
Set global line-width scale.
static UInt_t LockColor()
Prevent further color changes.
static void Color4f(Float_t r, Float_t g, Float_t b, Float_t a)
Wrapper for glColor4f.
static void SetDrawColors(const UChar_t rgba[4])
Set basic draw colors from 4 component 'rgba' Used by other TGLUtil drawing routines.
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
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.
static const UChar_t fgRed[4]
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.
static UInt_t GetDefaultDrawQuality()
static: get default draw quality
static void BeginExtendPickRegion(Float_t scale)
static void InitializeIfNeeded()
Initialize globals that require other libraries to be initialized.
static Float_t GetLineWidthScale()
Returns global line-width scale.
static Float_t fgPointLineScalingFactor
static UInt_t UnlockColor()
Allow color changes.
static void EndAttLine(Int_t pick_radius=0, Bool_t selection=kFALSE)
Restore previous line drawing state.
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,...
static void Color(const TGLColor &color)
Set color from TGLColor.
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...
static void Color3ubv(const UChar_t *rgb)
Wrapper for glColor3ubv.
static Int_t CheckError(const char *loc)
Check current GL error state, outputting details via ROOT Error method if one.
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
static void ColorAlpha(const TGLColor &color, UChar_t alpha)
Set color from TGLColor and alpha value.
static Int_t GetPickingRadius()
Returns picking radius.
static void SetPointSizeScale(Float_t scale)
Set global point-size scale.
static void Color4fv(const Float_t *rgba)
Wrapper for glColor4fv.
static void Color3ub(UChar_t r, UChar_t g, UChar_t b)
Wrapper for glColor3ub.
static UInt_t fgDrawQuality
static GLUtesselator * GetDrawTesselator4dv()
Returns a tesselator for direct drawing when using 4-vertices with double precision.
static const UChar_t fgBlue[4]
static const UChar_t fgGrey[4]
static Float_t PointSize()
Get the point-size, taking the global scaling into account.
static void EndExtendPickRegion()
static GLUtesselator * GetDrawTesselator3dv()
Returns a tesselator for direct drawing when using 3-vertices with double precision.
static GLUtesselator * GetDrawTesselator4fv()
Returns a tesselator for direct drawing when using 4-vertices with single precision.
static const UChar_t fgGreen[4]
static UInt_t fgColorLockCount
static GLUtesselator * GetDrawTesselator3fv()
Returns a tesselator for direct drawing when using 3-vertices with single precision.
static void SetDefaultDrawQuality(UInt_t dq)
static: set default draw quality
static void PointToViewport(Int_t &x, Int_t &y)
Convert from point/screen coordinates to GL viewport coordinates.
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'.
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'.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
static Float_t fgLineWidthScale
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.
static void DrawSimpleAxes(const TGLCamera &camera, const TGLBoundingBox &bbox, Int_t axesType)
Draw simple xyz-axes for given bounding-box.
static const UChar_t fgYellow[4]
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 GetPointLineScalingFactor()
Return extra scaling factor for points and lines.
static void Color4ub(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
Wrapper for glColor4ub.
static void RenderCrosses(const TAttMarker &marker, Float_t *p, Int_t n, Bool_t sec_selection=kFALSE)
Render markers as crosses.
3 component (x/y/z) vector class.
~TGLVector3()
Destroy vector object.
TGLVector3()
Construct a default (0.0, 0.0, 0.0) vector.
3 component (x/y/z) vertex class.
void Dump() const
Output vertex component values to std::cout.
void Minimum(const TGLVertex3 &other)
void Maximum(const TGLVertex3 &other)
void Set(Double_t x, Double_t y, Double_t z)
TGLVertex3()
Construct a default (0.0, 0.0, 0.0) vertex.
void Shift(TGLVector3 &shift)
Offset a vertex by vector 'shift'.
const Double_t * CArr() const
~TGLVertex3()
Destroy vertex object.
void SetTimeFormat(const char *tformat)
Change the format used for time plotting.
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.
void SetLabelOffset(Float_t labeloffset)
virtual void ImportAxisAttributes(TAxis *axis)
Internal method to import TAxis attributes to this TGaxis.
void SetOption(Option_t *option="")
To set axis options.
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 TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void DrawTrapezoid(const Double_t ver[][2], Double_t zMin, Double_t zMax, Bool_t color=kTRUE)
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.
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 DrawQuadFilled(const TGLVertex3 &v0, const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &normal)
Draw quad face.
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.
const Float_t gNullEmission[]
const Int_t gFramePoints[][2]
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
const Float_t gBlueEmission[]
const Float_t gWhiteEmission[]
void SetZLevels(TAxis *zAxis, Double_t zMin, Double_t zMax, Double_t zScale, std::vector< Double_t > &zLevels)
void CylindricalNormalInv(const Double_t *v, Double_t *normal)
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.
const Int_t gBoxFrontQuads[][4]
const Float_t gGrayEmission[]
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.
const Int_t gBoxBackQuads[][4]
void SphericalNormal(const Double_t *v, Double_t *normal)
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.
const Int_t gAxisType[][2]
void DrawError(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
void SphericalNormalInv(const Double_t *v, Double_t *normal)
const Float_t gRedEmission[]
const Int_t gBoxBackPlanes[][2]
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.
std::pair< Double_t, Double_t > Range_t
void DrawBoxFront(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Int_t fp)
Draws lego's bar as a 3d box.
const Double_t gBoxFrontNormals[][3]
const Float_t gGreenEmission[]
void CylindricalNormal(const Double_t *v, Double_t *normal)
void DrawQuadOutline(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVertex3 &v4)
Draw quad outline.
void DrawBoxWithGradientFill(Double_t y1, Double_t y2, Double_t x1, Double_t x2, const Double_t *rgba1, const Double_t *rgba2)
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.
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.
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.
const Double_t gBoxBackNormals[][3]
const Float_t gOrangeEmission[]
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)
Int_t ColorToObjectID(const UChar_t *color, Bool_t highColor)
const Int_t gBoxFrontPlanes[][2]
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(...
static constexpr double s
T * Normal2Plane(const T v1[3], const T v2[3], const T v3[3], T normal[3])
Calculate a normal vector of a plane.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Short_t Min(Short_t a, Short_t b)
void swap(nlohmann::json &j1, nlohmann::json &j2) noexcept(is_nothrow_move_constructible< nlohmann::json >::value and is_nothrow_move_assignable< nlohmann::json >::value)
exchanges the values of two JSON objects