76 TList *stack =
nullptr;
86 for (i=0;i<3;i++) {
fRmin[i] = 0;
fRmax[i] = 1; }
87 for (i=0;i<4;i++) {
fYls[i] = 0; }
89 for (i=0;i<30;i++) {
fJmask[i] = 0; }
91 for (i=0;i<465;i++) {
fMask[i] = 0; }
93 for (i=0;i<1200;i++) {
fPlines[i] = 0.; }
94 for (i=0;i<200;i++) {
fT[i] = 0.; }
96 for (i=0;i<12;i++) {
fVls[i] = 0.; }
97 for (i=0;i<257;i++) {
fFunLevel[i] = 0.; }
98 for (i=0;i<8;i++) {
fF8[i] = 0.; }
161 for (i=0;i<4;i++) {
fYls[i] = 0; }
163 for (i=0;i<30;i++) {
fJmask[i] = 0; }
165 for (i=0;i<465;i++) {
fMask[i] = 0; }
167 for (i=0;i<1200;i++) {
fPlines[i] = 0.; }
168 for (i=0;i<200;i++) {
fT[i] = 0.; }
170 for (i=0;i<12;i++) {
fVls[i] = 0.; }
171 for (i=0;i<257;i++) {
fFunLevel[i] = 0.; }
172 for (i=0;i<8;i++) {
fF8[i] = 0.; }
225 Error(
"BackBox",
"no TView in current pad");
235 for (
Int_t i = 0; i < 8; ++i) {
236 r[i*3 + 0] =
av[i*3 + 0] +
av[i*3 + 1]*
cosa;
238 r[i*3 + 2] =
av[i*3 + 2];
268 Error(
"FrontBox",
"no TView in current pad");
278 for (
Int_t i = 0; i < 8; ++i) {
279 r[i*3 + 0] =
av[i*3 + 0] +
av[i*3 + 1]*
cosa;
281 r[i*3 + 2] =
av[i*3 + 2];
290 for (
Int_t i = 0; i < 4; ++i) {
295 gPad->PaintPolyLine(4,
x,
y);
296 for (
Int_t i = 0; i < 4; ++i) {
301 gPad->PaintPolyLine(4,
x,
y);
325 static const char *
where =
"ColorFunction";
340 for (
Int_t i = 1; i <
nl; ++i) {
341 if (fl[i] <= fl[i - 1]) {
348 for (
Int_t i = 0; i <
nl; ++i) {
370 Error(
"GridLevels",
"no TView in current pad");
376 Double_t binLow = 0, binHigh = 0, binWidth = 0;
382 binLow, binHigh, nbins, binWidth,
" ");
387 binWidth = (binHigh - binLow)/nbins;
414 for (
Int_t i = 0; i <
np; ++i) {
416 if (k < 0) { k = -k;
ifneg =
true; }
418 x[i] =
p3[0];
y[i] =
p3[1];
424 for (
Int_t i = 0; i <
np; ++i) {
425 z +=
y[i]*
x[i+1] -
x[i]*
y[i+1];
438 for (
Int_t i = 0; i <
np; ++i) {
439 if (
iface[i] > 0)
gPad->PaintPolyLine(2, &
x[i], &
y[i]);
462 for (
Int_t i = 0; i <
np; ++i) {
465 x[i] =
p3[i*3+0];
y[i] =
p3[i*3+1];
475 Double_t ttt[5] = { t[0], t[1], t[2], t[3], t[0] };
476 for (
Int_t i = 0; i<3; ++i) {
p3[3*4+i] =
p3[i]; }
489 x[1] =
x[2];
y[1] =
y[2];
490 gPad->PaintPolyLine(2, &
x[0], &
y[0]);
517 for (
Int_t i = 0; i <
np; ++i) {
520 x[i] =
p3[0];
y[i] =
p3[1];
564 for (
Int_t i = 0; i <
np; ++i) {
566 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
567 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
568 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
591 for (
Int_t it = 0; it <
fNT; ++it) {
596 gPad->PaintPolyLine(2,
x,
y);
611 for (
Int_t i = 0; i <
np; ++i) {
619 for (
Int_t it = 0; it <
fNT; ++it) {
624 gPad->PaintPolyLine(2,
x,
y);
629 for (
Int_t i = 0; i <
np; ++i) {
652 for (
Int_t i = 0; i <
np; ++i) {
654 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
655 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
656 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
671 for (
Int_t i = 0; i <
np; ++i) {
679 for (
Int_t it = 0; it <
fNT; ++it) {
684 gPad->PaintPolyLine(2,
x,
y);
689 for (
Int_t i = 0; i <
np; ++i) {
725 for (
Int_t i = 0; i <
np; ++i) {
727 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
728 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
729 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
746 for (
Int_t kpol = 0; kpol < 2; ++kpol) {
747 if (
npol[kpol] == 0)
continue;
761 for (
Int_t it = 0; it <
fNT; ++it) {
766 gPad->PaintPolyLine(2,
x,
y);
772 for (
Int_t i = 0; i <
np; ++i) {
808 for (
Int_t i = 0; i <
np; ++i) {
810 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
811 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
812 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
829 for (
Int_t kpol = 0; kpol < 2; ++kpol) {
830 if (
npol[kpol] == 0)
continue;
841 x[0] =
p1[0];
y[0] =
p1[1];
842 x[1] =
p2[0];
y[1] =
p2[1];
843 gPad->PaintPolyLine(2,
x,
y);
864 for (
Int_t i = 0; i <
np; ++i) {
867 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
868 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
869 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
896 for (
Int_t it = 0; it <
fNT; ++it) {
901 gPad->PaintPolyLine(2,
x,
y);
916 for (
Int_t i = 0; i <
np; ++i) {
917 if (
iface[i] < 0)
continue;
923 for (
Int_t it = 0; it <
fNT; ++it) {
928 gPad->PaintPolyLine(2,
x,
y);
952 for (
Int_t i = 0; i <
np; ++i) {
966 for (
Int_t i = 0; i <
np; ++i) {
967 if (
iface[i] < 0)
continue;
973 for (
Int_t it = 0; it <
fNT; ++it) {
978 gPad->PaintPolyLine(2,
x,
y);
1010 Error(
"FillPolygon",
"illegal number of vertices in polygon (%d)",
n);
1023 for (i = 2; i <=
np; ++i) {
1040 if (
fmin > f2)
continue;
1043 for (i = 1; i <=
np; ++i) {
1046 if (i ==
np)
i2 = 1;
1050 if (k < 3)
continue;
1051 for (i = 1; i <= k; ++i) {
1064 gPad->PaintFillArea(k,
x,
y);
1079 ib,
nb,
dx,
dy,
iw,
nx,
xx,
yy,
signdx,
nstart,
xx1,
xx2,
nxa,
nxb;
1090 for (i = 1; i <=
n; ++i) {
1101 for (i = 1; i <=
n; ++i) {
1104 if (
y1[i - 1] <=
y1[i]) {
x2[i - 1] =
x1[i];
y2[i - 1] =
y1[i];}
1106 x2[i - 1] =
x1[i - 1];
1107 y2[i - 1] =
y1[i - 1];
1113 if (
ymax < 0)
return;
1117 for (i = 1; i <
n; ++i) {
1118 if (
y1[i] >=
y1[i - 1])
continue;
1121 for (
j = i - 1;
j >= 1; --
j) {
1122 if (
y <
y1[
j - 1])
continue;
1129 for (
j = i;
j >= k; --
j) {
1142 for (i = 1; i <=
n; ++i) {
1144 dy =
y2[i - 1] -
y1[i - 1];
1145 dx =
x2[i - 1] -
x1[i - 1];
1150 t = -(
dy + 1) / 2 +
dx;
1158 }
else if (
dy != 0) {
1159 step = (
dx - 1) / (
dy +
dy) + 1;
1171 for (i =
nstart; i <=
n; ++i) {
1175 if (
y2[i - 1] !=
yscan)
continue;
1177 if (
x2[i - 1] >=
xcur[i - 1]) {
1190 dy =
y2[i - 1] -
y1[i - 1];
1191 dx =
x2[i - 1] -
x1[i - 1];
1211 if (
test[i - 1] < 0)
continue;
1217 t =
test[i - 1] + step*
dy;
1229 if (
yscan < 0)
continue;
1232 for (i = 1; i <
nxa; ++i) {
1233 for (
j = i;
j >= 1; --
j) {
1243 for (i = 1; i <=
nxa; i += 2) {
1315 for (
Int_t i = 1; i <
np; ++i) {
1316 if (t[i] < tmin) tmin = t[i];
1317 if (t[i] > tmax) tmax = t[i];
1330 for (
Int_t i = 0; i <
np; ++i) {
1335 if (
d1 == 0)
d1 = 1
e-99;
1336 if (
d2 == 0)
d2 = 1
e-99;
1337 if (
d1*
d2 > 0)
continue;
1349 Error(
"FindLevelLines",
"number of points for line not equal 2");
1391 kk = (
k1 + 2)*5 + (
k2 + 2) + 1;
1426 pp[
kpp*3 + 1] =
p1[1];
1427 pp[
kpp*3 + 2] =
p1[2];
1428 pp[
kpp*3 + 3] =
p1[3];
1454 pp[
kpp*3 + 1] =
p1[1];
1455 pp[
kpp*3 + 2] =
p1[2];
1456 pp[
kpp*3 + 3] =
p1[3];
1468 pp[
kpp*3 + 1] =
p1[1];
1469 pp[
kpp*3 + 2] =
p1[2];
1470 pp[
kpp*3 + 3] =
p1[3];
1541 Error(
"FindVisibleDraw",
"invalid TView in current pad");
1545 Error(
"FindVisibleDraw",
"no TView in current pad");
1574 for (i =
i1; i <=
i2 - 1; ++i) {
1628 if (
fNT + 1 >= 100)
break;
1630 if (
iv > 0)
fT[2*
fNT - 1] = 1;
1638 if (
y2 ==
y1) {
fNT = 0;
return;}
1648 if (dd >
fD[2*
i1 - 3]) dd =
fD[2*
i1 - 3];
1652 if (
y1 >= dd &&
y2 <=
uu) {
fNT = 0;
return;}
1668 if (
fNT == 0)
return;
1669 for (i = 1; i <=
fNT; ++i) {
1670 fT[2*i - 2] = 1 -
fT[2*i - 2];
1671 fT[2*i - 1] = 1 -
fT[2*i - 1];
1689 Int_t i,
incrx,
ivis,
x1,
y1,
x2,
y2,
ib,
kb,
dx,
dy,
iw, ix, iy,
ifinve,
dx2,
dy2;
1723 if (
x1 < 0 &&
x2 < 0)
return;
1753 if (iy < 0)
goto L110;
1755 if (ix < 0)
goto L110;
1760 if (
ivis > 0)
continue;
1766 if (
ivis == 0)
continue;
1783 for (iy =
y1; iy <=
y2; ++iy) {
1792 if (iy < 0)
goto L210;
1793 if (ix < 0)
goto L210;
1798 if (
ivis > 0)
continue;
1804 if (
ivis == 0)
continue;
1813 if (
nt == 0)
return;
1815 if (t[3] <=
dt) t[3] = 0;
1816 if (t[2*
nt + 2] >= 1 -
dt) t[2*
nt + 2] = 1;
1818 for (i = 1; i <=
nt; ++i) {
1821 t[2*i + 1] = 1 -
t2;
1822 t[2*i + 2] = 1 -
t1;
1872 for (
j = 1;
j <= 3; ++
j) {
1873 for (i = 1; i <= 3; ++i) {
1881 for (k = 1; k <= 4; ++k) {
1882 for (i = 1; i <= 3; ++i) {
1883 face[i + k*3] =
f[i + (k + 32)*3 - 52];
1888 for (
j = 1;
j <= 3; ++
j) {
1889 for (i = 1; i <= 3; ++i) {
1890 for (k = 1; k <= 4; ++k) {
1892 phi =
f[
iphi + (k + ((i +
j*3) << 2))*3 - 52]*rad;
1893 r =
f[3 -
iphi + (k + ((i +
j*3) << 2))*3 - 52];
1896 z[k + ((i +
j*3) << 2) - 17] =
f[(k + ((i +
j*3) << 2))*3 - 49];
1898 phi =
f[
iphi + (k + ((i +
j*3) << 2))*3 - 52]*rad;
1899 r =
f[(k + ((i +
j*3) << 2))*3 - 49];
1902 z[k + ((i +
j*3) << 2) - 17] =
f[3 -
iphi + (k + ((i +
j*3) << 2))*3 - 52];
1904 phi =
f[
iphi + (k + ((i +
j*3) << 2))*3 - 52]*rad;
1905 th =
f[3 -
iphi + (k + ((i +
j*3) << 2))*3 - 52]*rad;
1906 r =
f[(k + ((i +
j*3) << 2))*3 - 49];
1911 phi =
f[
iphi + (k + ((i +
j*3) << 2))*3 - 52]*rad;
1912 th =
f[3 -
iphi + (k + ((i +
j*3) << 2))*3 - 52]*rad;
1913 r =
f[(k + ((i +
j*3) << 2))*3 - 49];
1918 x[k + ((i +
j*3) << 2) - 17] =
f[(k + ((i +
j*3) << 2))*3 - 51];
1919 y[k + ((i +
j*3) << 2) - 17] =
f[(k + ((i +
j*3) << 2))*3 - 50];
1920 z[k + ((i +
j*3) << 2) - 17] =
f[(k + ((i +
j*3) << 2))*3 - 49];
1923 x1 =
x[((i +
j*3) << 2) - 14] -
x[((i +
j*3) << 2) - 16];
1924 x2 =
x[((i +
j*3) << 2) - 13] -
x[((i +
j*3) << 2) - 15];
1925 y1 =
y[((i +
j*3) << 2) - 14] -
y[((i +
j*3) << 2) - 16];
1926 y2 =
y[((i +
j*3) << 2) - 13] -
y[((i +
j*3) << 2) - 15];
1927 z1 = z[((i +
j*3) << 2) - 14] - z[((i +
j*3) << 2) - 16];
1928 z2 = z[((i +
j*3) << 2) - 13] - z[((i +
j*3) << 2) - 15];
1933 (i +
j*3)*3 - 11]*
an[(i +
j*3)*3 - 11] +
an[(i
1934 +
j*3)*3 - 10]*
an[(i +
j*3)*3 - 10]);
1936 an[(i +
j*3)*3 - 12] /= s;
1937 an[(i +
j*3)*3 - 11] /= s;
1938 an[(i +
j*3)*3 - 10] /= s;
1943 for (
j = 1;
j <= 2; ++
j) {
1944 for (i = 1; i <= 2; ++i) {
1945 for (k = 1; k <= 3; ++k) {
1946 bn[k + (i + 2*
j)*3 - 10] =
an[k + (i +
j*3)*3 - 13]
1947 +
an[k + (i + 1 +
j*3)*3 - 13] +
an[k + (i + 1 +
1948 (
j + 1)*3)*3 - 13] +
an[k + (i + (
j + 1)*3)*3 - 13];
2009 for (i = 1; i <= 30; ++i) {
2016 for (
nb = 2;
nb <= 30; ++
nb) {
2017 for (
ib = 1;
ib <= 30 -
nb + 1; ++
ib) {
2019 for (i =
ib; i <=
ib +
nb - 1; ++i) k = k |
fMask[i - 1];
2146 for (i = 2; i <=
nids + 1; ++i) {
2155 for (i = 2; i <=
nv; ++i) {
2171 if (
vv[i] <
vv[i - 1]) {
2183 for (i = 1; i <=
nv; ++i) {
2189 for (i = 1; i <=
nv; ++i) {
2190 for (
j = 1;
j <= 4; ++
j) t[
j + (i << 2)] =
vv[i];
2213 Error(
"LegoCartesian",
"no TView in current pad");
2252 if (!
painter->IsInside(ix,iy))
continue;
2262 for (
Int_t i = 1; i <= 4; ++i) {
2263 xyz[i*3 - 3] =
xy[2*i - 2];
2264 xyz[i*3 - 2] =
xy[2*i - 1];
2265 xyz[(i + 4)*3 - 3] = xyz[i*3 - 3];
2266 xyz[(i + 4)*3 - 2] = xyz[i*3 - 2];
2271 for (
Int_t i = 1; i <= 4; ++i) {
2272 xyz[i*3 - 1] =
v[
iv - 1];
2273 xyz[(i + 4)*3 - 1] =
v[
iv];
2275 if (
v[
iv - 1] ==
v[
iv])
continue;
2277 for (
Int_t i = 1; i <= 4; ++i) {
2278 if (
ivis[i - 1] == 0)
continue;
2300 for (
Int_t i = 1; i <= 4; ++i) {
2301 xyz[i*3 - 1] =
v[0];
2302 iface[i - 1] = 5 - i;
2316 for (
Int_t i = 1; i <= 4; ++i) {
2317 iface[i - 1] = i + 4;
2323 if (
nv > 2 && (
v[
nv-1] ==
v[
nv-2])) {
2325 if (
v[
nv-1] ==
v[
iv-1]) {
2353 Int_t iphi,
jphi,
kphi,
incr,
nphi,
ivis[6],
iopt,
iphi1,
iphi2,
iface[4], i,
j;
2364 Error(
"LegoPolar",
"no TView in current pad");
2383 if (
fAphi.empty()) {
2384 Error(
"LegoPolar",
"failed to allocate array fAphi[%d]",
fNaphi);
2401 for (i = 1; i <=
nphi; ++i) {
2413 for (i = 1; i <=
nphi; ++i) {
2444 for (i = 1; i <= 4; ++i) {
2446 if (
iordr != 0 && i == 2)
j = 4;
2447 if (
iordr != 0 && i == 4)
j = 2;
2450 xyz[(
j + 4)*3 - 3] = xyz[
j*3 - 3];
2451 xyz[(
j + 4)*3 - 2] = xyz[
j*3 - 2];
2456 for (i = 1; i <= 4; ++i) {
2457 xyz[i*3 - 1] =
v[
iv - 1];
2458 xyz[(i + 4)*3 - 1] =
v[
iv];
2460 if (
v[
iv - 1] >=
v[
iv])
continue;
2462 for (i = 1; i <= 4; ++i) {
2463 if (
ivis[i - 1] == 0)
continue;
2467 if (xyz[
k1*3 - 3] == xyz[
k2*3 - 3] && xyz[
k1*3 - 2] ==
2468 xyz[
k2*3 - 2])
continue;
2487 for (i = 1; i <= 4; ++i) {
2488 xyz[i*3 - 1] =
v[0];
2489 iface[i - 1] = 5 - i;
2503 for (i = 1; i <= 4; ++i) {
2504 iface[i - 1] = i + 4;
2510 if (
nv > 2 && (
v[
nv-1] ==
v[
nv-2])) {
2512 if (
v[
nv-1] ==
v[
iv-1]) {
2555 Int_t iphi,
jphi,
kphi,
incr,
nphi,
ivis[6],
iopt,
iphi1,
iphi2,
iface[4], i,
j;
2568 Error(
"LegoCylindrical",
"no TView in current pad");
2587 if (
fAphi.empty()) {
2588 Error(
"LegoCylindrical",
"failed to allocate array fAphi[%d]",
fNaphi);
2605 for (i = 1; i <=
nphi; ++i) {
2617 for (i = 1; i <=
nphi; ++i) {
2628 if ((z <= 0 &&
iopt == 1) || (z > 0 &&
iopt == 2)) {
2649 for (i = 1; i <= 4; ++i) {
2651 if (
iordr != 0 && i == 2)
j = 4;
2652 if (
iordr != 0 && i == 4)
j = 2;
2655 xyz[
j*3 - 1] =
ab[
jz + 2*i - 3];
2656 xyz[(
j + 4)*3 - 1] =
ab[
jz + 2*i - 3];
2661 for (i = 1; i <= 4; ++i) {
2664 xyz[(i + 4)*3 - 3] =
v[
iv]*
cosphi[i - 1];
2665 xyz[(i + 4)*3 - 2] =
v[
iv]*
sinphi[i - 1];
2667 if (
v[
iv - 1] >=
v[
iv])
continue;
2669 for (i = 1; i <= 4; ++i) {
2670 if (
ivis[i - 1] == 0)
continue;
2689 if (
ivis[4] != 0 &&
v[0] > 0) {
2692 for (i = 1; i <= 4; ++i) {
2693 xyz[i*3 - 3] =
v[0]*
cosphi[i - 1];
2694 xyz[i*3 - 2] =
v[0]*
sinphi[i - 1];
2706 if (
ivis[5] != 0 &&
v[
nv - 1] > 0) {
2709 for (i = 1; i <= 4; ++i) {
2710 iface[i - 1] = 5 - i + 4;
2711 tface[i - 1] =
tt[5 - i + (
nv << 2) - 5];
2716 if (
nv > 2 && (
v[
nv-1] ==
v[
nv-2])) {
2718 if (
v[
nv-1] ==
v[
iv-1]) {
2760 Int_t iphi,
jphi,
kphi,
incr,
nphi,
ivis[6],
iopt,
iphi1,
iphi2,
iface[4], i,
j;
2763 Int_t k1,
k2,
ia,
ib,
incrth,
ith,
jth,
kth,
nth,
mth,
ith1,
ith2,
nv;
2776 Error(
"LegoSpherical",
"no TView in current pad");
2795 if (
fAphi.empty()) {
2796 Error(
"LegoSpherical",
"failed to allocate array fAphi[%d]",
fNaphi);
2815 for (i = 1; i <=
nphi; ++i) {
2828 for (i = 1; i <=
nth; ++i) {
2861 for (i = 1; i <= 6; ++i)
ivis[i - 1] = 0;
2876 th = (
th1 +
th2) / (
float)2.;
2885 for (i = 1; i <= 4; ++i) {
2887 if (
iordr != 0 && i == 2)
j = 4;
2888 if (
iordr != 0 && i == 4)
j = 2;
2897 for (i = 1; i <= 4; ++i) {
2901 xyz[(i + 4)*3 - 3] =
v[
iv]*
cosphi[i - 1];
2902 xyz[(i + 4)*3 - 2] =
v[
iv]*
sinphi[i - 1];
2906 for (i = 1; i <= 4; ++i) {
2909 xyz[i*3 - 1] =
v[
iv - 1]*
costh[i - 1];
2912 xyz[(i + 4)*3 - 1] =
v[
iv]*
costh[i - 1];
2915 if (
v[
iv - 1] >=
v[
iv])
continue;
2917 for (i = 1; i <= 4; ++i) {
2918 if (
ivis[i - 1] == 0)
continue;
2937 if (
ivis[4] != 0 &&
v[0] > 0) {
2940 for (i = 1; i <= 4; ++i) {
2942 xyz[i*3 - 3] =
v[0]*
cosphi[i - 1];
2943 xyz[i*3 - 2] =
v[0]*
sinphi[i - 1];
2948 xyz[i*3 - 1] =
v[0]*
costh[i - 1];
2950 iface[i - 1] = 5 - i;
2961 if (
ivis[5] != 0 &&
v[
nv - 1] > 0) {
2964 for (i = 1; i <= 4; ++i) {
2965 iface[i - 1] = i + 4;
2971 if (
nv > 2 && (
v[
nv-1] ==
v[
nv-2])) {
2973 if (
v[
nv-1] ==
v[
iv-1]) {
3033 else if (
nl == 0)
goto L200;
3040 for (i = 1; i <= 4; ++i) {
3047 Error(
"LightSource",
"negative light intensity");
3055 if (
nl > 4 ||
yl < 0) {
3056 Error(
"LightSource",
"illegal light source number (nl=%d, yl=%f)",
nl,
yl);
3062 Error(
"LightSource",
"light source is placed at origin");
3073 if (
fYdl != 0)
return;
3074 for (i = 1; i <= 4; ++i) {
3075 if (
fYls[i - 1] != 0)
return;
3092 if (!view ||
fLoff)
return;
3109 for (i = 1; i <= 4; ++i) {
3110 if (
fYls[i - 1] <= 0)
continue;
3115 if (
cosn < 0)
continue;
3149 Error(
"ModifyScreen",
"invalid TView in current pad");
3153 Error(
"ModifyScreen",
"no TView in current pad");
3167 if (
i1 ==
i2)
return;
3171 for (i =
i1; i <=
i2 - 1; ++i) {
3250 for (i = 1; i <= 6; ++i) {
3253 if (k < num)
continue;
3258 if (k == 1)
ir = -1;
3284 Error(
"SideVisibilityEncode",
"no TView in current pad");
3289 if (
zn > 0) k += 64;
3290 if (
zn < 0) k += 32;
3292 if (
zn > 0) k += 16;
3299 if ((
zn <= 0 &&
iopt == 1) || (
zn > 0 &&
iopt == 2)) ++k;
3316 static const char *
where =
"Spectrum";
3337 Error(
where,
"initial color index is negative");
3342 Error(
where,
"color index increment must be positive");
3350 for (i = 1; i <=
nl+1; ++i) {
3378 Error(
"SurfaceCartesian",
"no TView in current pad");
3399 if (!
painter->IsInside(ix,iy))
continue;
3401 for (
Int_t i = 0; i < 4; ++i) {
3402 xyz[i*3 + 0] =
f[i*3 + 0];
3403 xyz[i*3 + 1] =
f[i*3 + 1];
3404 xyz[i*3 + 2] =
f[i*3 + 2];
3483 for (i = 1; i <= 4; ++i) {
3536 t[i] =
f[i * 3 + 3];
3541 for (i = 1; i <= 4; ++i)
f[i * 3 + 3] =
fRmax[2];
3545 for (i = 1; i <= 4; ++i) {
3570 Error(
"SurfacePolar",
"no TView in current pad");
3598 if (
fAphi.empty()) {
3599 Error(
"SurfacePolar",
"failed to allocate array fAphi[%d]",
fNaphi);
3611 for (i = 1; i <=
nphi; ++i) {
3638 if ((z <= 0 &&
iopt == 1) || (z > 0 &&
iopt == 2)) {
3649 for (i = 1; i <= 4; ++i) {
3651 if (
iordr != 0 && i == 2)
j = 4;
3652 if (
iordr != 0 && i == 4)
j = 2;
3655 xyz[
j*3 - 1] =
f[i*3 - 1];
3668 if (
incr == 0)
return;
3707 Error(
"SurfaceCylindrical",
"no TView in current pad");
3726 if (
fAphi.empty()) {
3727 Error(
"SurfaceCylindrical",
"failed to allocate array fAphi[%d]",
fNaphi);
3739 for (i = 1; i <=
nphi; ++i) {
3753 if ((z <= 0 &&
iopt == 1) || (z > 0 &&
iopt == 2)) {
3770 for (i = 1; i <= 4; ++i) {
3772 if (
iordr == 0 && i == 2)
j = 4;
3773 if (
iordr == 0 && i == 4)
j = 2;
3776 xyz[
j*3 - 1] =
f[
jz + i*3 - 4];
3789 if (
incr == 0)
return;
3827 Error(
"SurfaceSpherical",
"no TView in current pad");
3846 if (
fAphi.empty()) {
3847 Error(
"SurfaceSpherical",
"failed to allocate array fAphi[%d]",
fNaphi);
3861 for (i = 1; i <=
nphi; ++i) {
3874 for (i = 1; i <=
nth; ++i) {
3898 phi = (
f[
jphi - 1] +
f[
jphi + 5]) / (
float)2.;
3909 for (i = 1; i <= 4; ++i) {
3911 if (
iordr != 0 && i == 2)
j = 4;
3912 if (
iordr != 0 && i == 4)
j = 2;
3920 for (i = 1; i <= 4; ++i) {
3922 if (
iordr != 0 && i == 2)
j = 4;
3923 if (
iordr != 0 && i == 4)
j = 2;
3953 if (
incr == 0)
return;
3979 Error(
"SurfaceProperty",
"error in coefficients");
4008 Error(
"ImplicitFunction",
"no TF3 function provided");
4027 Error(
"ImplicitFunction",
"no TView in current pad");
4256 for ( i=1 ; i<=
nnod ; i++ ) {
4309 static Int_t irota[24][8] = { { 1,2,3,4,5,6,7,8 }, { 2,3,4,1,6,7,8,5 },
4310 { 3,4,1,2,7,8,5,6 }, { 4,1,2,3,8,5,6,7 },
4311 { 6,5,8,7,2,1,4,3 }, { 5,8,7,6,1,4,3,2 },
4312 { 8,7,6,5,4,3,2,1 }, { 7,6,5,8,3,2,1,4 },
4313 { 2,6,7,3,1,5,8,4 }, { 6,7,3,2,5,8,4,1 },
4314 { 7,3,2,6,8,4,1,5 }, { 3,2,6,7,4,1,5,8 },
4315 { 5,1,4,8,6,2,3,7 }, { 1,4,8,5,2,3,7,6 },
4316 { 4,8,5,1,3,7,6,2 }, { 8,5,1,4,7,6,2,3 },
4317 { 5,6,2,1,8,7,3,4 }, { 6,2,1,5,7,3,4,8 },
4318 { 2,1,5,6,3,4,8,7 }, { 1,5,6,2,4,8,7,3 },
4319 { 4,3,7,8,1,2,6,5 }, { 3,7,8,4,2,6,5,1 },
4320 { 7,8,4,3,6,5,1,2 }, { 8,4,3,7,5,1,2,6 } };
4322 static Int_t iwhat[21] = { 1,3,5,65,50,67,74,51,177,105,113,58,165,178,
4323 254,252,250,190,205,188,181 };
4324 Int_t j, i,
i1,
i2,
i3,
ir,
irt=0, k,
k1,
k2,
incr,
icase=0,
n;
4331 for ( i=1; i<=8 ; i++) {
4334 for (
ir=1 ;
ir<=24 ;
ir++ ) {
4337 for ( i=1 ; i<=8 ; i++ ) {
4341 if (k==0 || k==255)
return;
4342 for ( i=1 ; i<=21 ; i++ ) {
4343 if (k !=
iwhat[i-1])
continue;
4352 for ( i=1 ; i<=8 ; i++ ) {
4355 fP8[i-1][0] =
p[k-1][0];
4356 fP8[i-1][1] =
p[k-1][1];
4357 fP8[i-1][2] =
p[k-1][2];
4358 fG8[i-1][0] =
g[k-1][0];
4359 fG8[i-1][1] =
g[k-1][1];
4360 fG8[i-1][2] =
g[k-1][2];
4365 switch ((
int)
icase) {
4368 MarchingCubeCase00(1, 4, 9, 0, 0, 0,
nnod,
ntria, xyz, grad,
itria);
4372 MarchingCubeCase00(2, 4, 9, 10, 0, 0,
nnod,
ntria, xyz, grad,
itria);
4384 MarchingCubeCase00(6, 2, 1, 9, 8, 0,
nnod,
ntria, xyz, grad,
itria);
4395 MarchingCubeCase00(2, 4, 8, 6, 0, 0,
nnod,
ntria, xyz, grad,
itria);
4398 MarchingCubeCase00(1, 4, 12, 7, 6, 10,
nnod,
ntria, xyz, grad,
itria);
4404 MarchingCubeCase00(1, 4, 8, 7, 11, 10,
nnod,
ntria, xyz, grad,
itria);
4413 MarchingCubeCase00(1, 9, 12, 7, 6, 2,
nnod,
ntria, xyz, grad,
itria);
4419 if (
ntria == 0)
return;
4421 for ( i=1; i<=
ntria ; i++ ) {
4438 for ( i=1 ; i<=3 ; i++ ) {
4441 if (
i2 == 4)
i2 = 1;
4448 if (
i3 == 0)
i3 = 3;
4455 for ( i=1 ; i<=3 ; i++ ) {
4460 if (
ntria == 0)
return;
4464 if (
itr[
i2-1] < 0) {
4468 if (
itr[
i3-1] < 0) {
4473 for ( i=1 ; i<=3 ; i++ ) {
4474 if (
itria[
j-1][i-1] !=
k2)
continue;
4503 static Int_t it[4][4][3] = { { { 1,2, 3 }, { 0,0, 0 }, { 0,0, 0 }, { 0,0, 0 } },
4504 { { 1,2,-3 }, {-1,3, 4 }, { 0,0, 0 }, { 0,0, 0 } },
4505 { { 1,2,-3 }, {-1,3,-4 }, {-1,4, 5 }, { 0,0, 0 } },
4506 { { 1,2,-3 }, {-1,3,-4 }, {-4,6,-1 }, { 4,5,-6 } }
4520 if (
ie[5] == 0)
nnod = 5;
4521 if (
ie[4] == 0)
nnod = 4;
4522 if (
ie[3] == 0)
nnod = 3;
4528 for ( i=0; i<3 ; i++) {
4529 for (
j=0;
j<4 ;
j++) {
4543 static Int_t ie[6] = { 4,9,1, 2,11,3 };
4544 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4545 static Int_t it2[4][3] = { { 1,2,-5 }, { -1,5,6 }, { 5,-2,4 }, { -4,2,3 } };
4572 static Int_t ie[6] = { 4,9,1, 7,11,6 };
4573 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4574 static Int_t it2[6][3] = { { 1,2,4 }, { 2,3,6 }, { 3,1,5 },
4575 { 4,5,1 }, { 5,6,3 }, { 6,4,2 } };
4602 static Int_t ie[7] = { 2,4,9,10, 6,7,11 };
4603 static Int_t it1[5][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 } };
4604 static Int_t it2[3][3] = { { 1,2,-3 }, { -1,3,4 }, { 5,6,7 } };
4605 static Int_t it3[7][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 },
4606 { 1,7,-5 }, { -1,5,4 } };
4644 static Int_t ie[9] = { 3,12,4, 1,10,2, 11,6,7 };
4645 static Int_t it[9][9][3] = {
4646 {{ 1,2,3}, { 4,5,6}, { 7,8,9}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4647 {{ 1,2,3}, { 4,9,-7}, { -4,7,6}, { 9,4,-5}, { -9,5,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4648 {{ 4,5,6}, { 8,3,-1}, { -8,1,7}, { 3,8,-9}, { -3,9,2}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4649 {{-10,2,3}, {10,3,-1}, {-10,1,7}, {10,7,-6}, {-10,6,4}, {10,4,-5}, {-10,5,8}, { 10,8,9}, {10,9,-2}},
4650 {{ 7,8,9}, { 2,5,-6}, { -2,6,1}, { 5,2,-3}, { -5,3,4}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4651 {{-10,1,2}, {10,2,-3}, {-10,3,4}, { 10,4,5}, {10,5,-8}, {-10,8,9}, {10,9,-7}, {-10,7,6}, {10,6,-1}},
4652 {{ 10,2,3}, {10,3,-4}, {-10,4,5}, {10,5,-6}, {-10,6,1}, {10,1,-7}, {-10,7,8}, {10,8,-9}, {-10,9,2}},
4653 {{ 1,7,6}, { -4,2,3}, {-4,9,-2}, {-9,4,-5}, { -9,5,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4654 {{ -1,9,2}, { 1,2,3}, { 1,3,-4}, { 6,-1,4}, { 6,4,5}, { 6,-5,7}, { -7,5,8}, { 7,8,9}, { 7,-9,1}}
4676 switch ((
int)
icase) {
4697 for ( i=0; i<3 ; i++) {
4698 for (
j=0;
j<9 ;
j++) {
4716 for ( i=0; i<3 ; i++) {
4717 for (
j=0;
j<9 ;
j++) {
4732 static Int_t ie[8] = { 1,3,12,9, 5,7,11,10 };
4733 static Int_t it[6][8][3] = {
4734 {{1,2,-3}, {-1,3,4}, {5,6,-7}, {-5,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4735 {{ 9,1,2}, { 9,2,3}, { 9,3,4}, { 9,4,5}, { 9,5,6}, { 9,6,7}, { 9,7,8}, { 9,8,1}},
4736 {{ 9,1,2}, { 9,4,1}, { 9,3,4}, { 9,6,3}, { 9,5,6}, { 9,8,5}, { 9,7,8}, { 9,2,7}},
4737 {{1,2,-7}, {-1,7,8}, {5,6,-3}, {-5,3,4}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4738 {{1,2,-7}, {-1,7,8}, {2,3,-6}, {-2,6,7}, {3,4,-5}, {-3,5,6}, {4,1,-8}, {-4,8,5}},
4739 {{1,2,-3}, {-1,3,4}, {2,7,-6}, {-2,6,3}, {7,8,-5}, {-7,5,6}, {8,1,-4}, {-8,4,5}}
4759 for ( i=0; i<3 ; i++) {
4760 for (
j=0;
j<8 ;
j++) {
4781 for ( i=0; i<3 ; i++) {
4782 for (
j=0;
j<8 ;
j++) {
4797 static Int_t ie[8] = { 3,12,4, 1,9,8,6,2 };
4798 static Int_t it[6][8][3] = {
4799 {{ 1,2,3}, {4,5,-6}, {-4,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4800 {{-9,1,2}, {9,2,-3}, {-9,3,4}, {9,4,-5}, {-9,5,6}, {9,6,-7}, {-9,7,8}, {9,8,-1}},
4801 {{9,1,-2}, {-9,2,6}, {9,6,-7}, {-9,7,8}, {9,8,-4}, {-9,4,5}, {9,5,-3}, {-9,3,1}},
4802 {{ 3,4,5}, {1,2,-6}, {-1,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4803 {{ 7,8,6}, {6,8,-1}, {-6,1,2}, {3,1,-8}, {-3,8,4}, { 3,4,5}, {3,5,-6}, {-3,6,2}},
4804 {{ 7,8,6}, {6,8,-4}, {-6,4,5}, {3,4,-8}, {-3,8,1}, { 3,1,2}, {3,2,-6}, {-3,6,5}}
4824 for ( i=0; i<3 ; i++) {
4825 for (
j=0;
j<8 ;
j++) {
4846 for ( i=0; i<3 ; i++) {
4847 for (
j=0;
j<8 ;
j++) {
4864 {1,2,3,4,5,6,7,8}, {1,5,6,2,4,8,7,3}, {1,4,8,5,2,3,7,6},
4865 {3,7,8,4,2,6,5,1}, {3,2,6,7,4,1,5,8}, {3,4,1,2,7,8,5,6},
4866 {6,7,3,2,5,8,4,1}, {6,5,8,7,2,1,4,3}, {6,2,1,5,7,3,4,8},
4867 {8,4,3,7,5,1,2,6}, {8,5,1,4,7,6,2,3}, {8,7,6,5,4,3,2,1} };
4868 static Int_t iwhat[8] = { 63,62,54,26,50,9,1,0 };
4869 static Int_t ie[12] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
4871 {1,2,3,4}, {5,6,7,8}, {1,2,6,5}, {2,6,7,3}, {4,3,7,8}, {1,5,8,4} };
4872 static Int_t it1[4][3] = { {1,2,10}, {9,5,8}, {6,11,7}, {3,4,12} };
4873 static Int_t it2[4][3] = { {5,6,10}, {1,4,9}, {2,11,3}, {7,8,12} };
4874 static Int_t it3[6][3] = { {10,12,-3}, {-10,3,2}, {12,10,-1}, {-12,1,4},
4875 {9,5,8}, {6,11,7} };
4876 static Int_t it4[6][3] = { {11,9,-1}, {-11,1,2}, {9,11,-3}, {-9,3,4},
4877 {5,6,10}, {7,8,12} };
4878 static Int_t it5[10][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
4879 {13,10,1}, {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2}, {5,8,9} };
4880 static Int_t it6[10][3] = { {13,2,-10}, {-13,10,5}, {13,5,-6}, {-13,6,11},
4881 {13,11,3}, {13,3,-4}, {-13,4,9}, {13,9,-1}, {-13,1,2}, {12,7,8} };
4882 static Int_t it7[12][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
4883 {13,10,-5}, {-13,5,8}, {13,8,-9}, {-13,9,1},
4884 {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2} };
4885 static Int_t it8[6][3] = { {3,8,12}, {3,-2,-8}, {-2,5,-8}, {2,10,-5},
4886 {7,6,11}, {1,4,9} };
4887 static Int_t it9[10][3] = { {7,12,-3}, {-7,3,11}, {11,3,2}, {6,11,-2}, {-6,2,10},
4888 {6,10,5}, {7,6,-5}, {-7,5,8}, {7,8,12}, {1,4,9} };
4889 static Int_t it10[10][3] = { {9,1,-10}, {-9,10,5}, {9,5,8}, {4,9,-8}, {-4,8,12},
4890 {4,12,3}, {1,4,-3}, {-1,3,2}, {1,2,10}, {7,6,11} };
4896 for (
nr=1 ;
nr<=12 ;
nr++ ) {
4899 for (
nf=1 ;
nf<=6 ;
nf++ ) {
4904 if ((
f1*f3-f2*f4)/(
f1+f3-f2-f4) >= 0.) k = k +
incr;
4907 for ( i=1 ; i<=8 ; i++ ) {
4908 if (k !=
iwhat[i-1])
continue;
4914 Error(
"MarchingCubeCase13",
"configuration is not found");
4920 for (
n=1 ;
n<=8 ;
n++) {
4923 for ( i=1 ; i<=3 ; i++ ) {
4924 xyz[
n-1][i-1] =
fP8[k-1][i-1];
4925 grad[
n-1][i-1] =
fG8[k-1][i-1];
4928 for (
n=1 ;
n<=8 ;
n++ ) {
4930 for ( i=1 ; i<=3 ; i++ ) {
4931 fP8[
n-1][i-1] = xyz[
n-1][i-1];
4932 fG8[
n-1][i-1] = grad[
n-1][i-1];
4942 switch ((
int)
icase) {
4963 &xyz[
nnod-1][0], &grad[
nnod-1][0]);
4970 &xyz[
nnod-1][0], &grad[
nnod-1][0]);
4977 &xyz[
nnod-1][0], &grad[
nnod-1][0]);
4984 switch ((
int)(
irep+1)) {
5014 for ( i=1 ; i<=3 ; i++ ) {
5040 for ( i=1 ; i<=3 ; i++ ) {
5047 for ( i=1 ; i<=3 ; i++ ) {
5048 p[i-1] =
p[i-1] + xyz[k-1][i-1];
5049 g[i-1] =
g[i-1] + grad[k-1][i-1];
5052 for ( i=1 ; i<=3 ; i++ ) {
5077 if (
a == 0.)
return;
5081 if (
d <= 0.)
return;
5084 s1 = (-
b+
d) / (2*
a);
5087 s2 = (-
b-
d) / (2*
a);
5145 {1,2}, {2,3}, {3,4}, {4,1}, {5,6}, {6,7}, {7,8}, {8,5}, {1,5}, {2,6}, {3,7}, {4,8} };
5153 for ( i=1 ; i<=3 ; i++ ) {
5176 Int_t n,
nf,
i1,
i2,
i3, i,
icur, k,
itst,
kface,
kf,
irep;
5210 for ( i=1 ; i<=3 ; i++ ) {
5221 for ( i=1 ; i<=3 ; i++ ) {
5222 v[0][i-1] = xyz[
i2-1][i-1] - xyz[
i1-1][i-1];
5223 v[1][i-1] = xyz[
i3-1][i-1] - xyz[
i2-1][i-1];
5225 a = (
v[0][1]*
v[1][2] -
v[0][2]*
v[1][1]);
5226 b = (
v[0][2]*
v[1][0] -
v[0][0]*
v[1][2]);
5227 c = (
v[0][0]*
v[1][1] -
v[0][1]*
v[1][0]);
5236 abcd[
n-1][3] =-(
a*xyz[
i1-1][0] +
b*xyz[
i1-1][1] +
c*xyz[
i1-1][2]);
5239 if (
nf <= 1)
return;
5269 for ( k=
kface-1 ; k>=1 ; k-- ) {
5301 if (
abcdk[0]*xyz[nn[0]-1][0]+
abcdk[1]*xyz[nn[0]-1][1]+
5303 if (
abcdk[0]*xyz[nn[1]-1][0]+
abcdk[1]*xyz[nn[1]-1][1]+
5305 if (
abcdk[0]*xyz[nn[2]-1][0]+
abcdk[1]*xyz[nn[2]-1][1]+
5312 for ( i=1 ; i<=3 ; i++ ) {
5315 if (i != 3)
i2 =
kk[i];
5318 if (
irep==0 )
continue;
5322 for ( i=1 ; i<=3 ; i++ ) {
5325 if (i != 3)
i2 = nn[i];
5328 if (
irep==0 )
continue;
5336 for ( i=k+1 ; i<=
kface ; i++ ) {
5369 Double_t a,
b,
c,
d1,
d2, dd,
xy, tmin, tmax,
tmid,
x,
y, z;
5375 delta[0] = xyz[
i2-1][0] - xyz[
i1-1][0];
5376 delta[1] = xyz[
i2-1][1] - xyz[
i1-1][1];
5377 delta[2] = xyz[
i2-1][2] - xyz[
i1-1][2];
5383 c =-(
a*xyz[
i1-1][0] +
b*xyz[
i1-1][1]);
5388 for ( i=1 ; i<=3 ; i++ ) {
5392 if (
d[
k1-1]>=0. &&
d[
k2-1]>=0.)
continue;
5393 if (
d[
k1-1] <0. &&
d[
k2-1] <0.)
continue;
5398 t[k-1] = (
xy-xyz[
i1-1][
ixy-1]) / delta[
ixy-1];
5399 if (k == 2)
goto L200;
5407 if (tmin>1. || tmax<0)
return;
5408 if (tmin < 0.) tmin = 0.;
5409 if (tmax > 1.) tmax = 1.;
5410 tmid = (tmin + tmax) / 2.;
5411 x = delta[0]*
tmid + xyz[
i1-1][0];
5412 y = delta[1]*
tmid + xyz[
i1-1][1];
5413 z = delta[2]*
tmid + xyz[
i1-1][2];
5414 dd = abcd[0]*
x + abcd[1]*
y + abcd[2]*z + abcd[3];
5451 Int_t i,
i1,
i2,
j,
ibase,
nnod,
knod,
ntria,
ktria,
iopt,
iready;
5453 Int_t ix,
ix1=0,
ix2=0, iy,
iy1=0,
iy2=0, iz,
iz1=0,
iz2=0, k,
kx,
ky,
kz,
isurf,
nsurf;
5459 static Int_t ind[8][3] = { { 0,0,0 }, { 1,0,0 }, { 1,0,1 }, { 0,0,1 },
5460 { 0,1,0 }, { 1,1,0 }, { 1,1,1 }, { 0,1,1 } };
5469 Error(
"ImplicitFunction",
"no TView in current pad");
5475 Warning(
"IsoSurface",
"Number of iso-surfaces too large. Increase kNiso");
5593 for ( i=1 ; i<=8 ; i++ ) {
5594 kx = ix +
ind[i-1][0];
5595 ky = iy +
ind[i-1][1];
5596 kz = iz +
ind[i-1][2];
5597 p[i-1][0] =
x[
kx-1];
5598 p[i-1][1] =
y[
ky-1];
5599 p[i-1][2] = z[
kz-1];
5606 }
else if (
kx ==
nx) {
5630 }
else if (
ky ==
ny) {
5654 }
else if (
kz ==
nz) {
5698 for (
j=1 ;
j<=3 ;
j++ ){
5710 if (
ntria == 0)
continue;
5711 for ( i=1 ; i<=
nnod ; i++ ) {
5717 if (
ntria == 0)
continue;
5757 Error(
"ImplicitFunction",
"no TView in current pad");
5764 for ( i=1 ; i<=
np ; i++) {
5767 view->
WCtoNDC(&xyz[k-1][0], &
p3[i-1][0]);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
winID h TVirtualViewer3D TVirtualGLPainter p
winID h TVirtualViewer3D vv
Option_t Option_t SetLineWidth
Option_t Option_t SetFillStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t SetLineColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char FillPolygon
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TH1 * gCurrentHist
R__EXTERN Hoption_t Hoption
const Int_t kF3FillColor2
const Int_t kF3FillColor1
R__EXTERN TStyle * gStyle
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual void Modify()
Change current fill area attributes if necessary.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void Modify()
Change current line attributes if necessary.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
The color creation and management class.
static void RGBtoHLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
static void HLStoRGB(Float_t h, Float_t l, Float_t s, Float_t &r, Float_t &g, Float_t &b)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
A 3-Dim function with parameters.
virtual const Double_t * GetClippingBox() const
TH1 is the base class of all histogram classes in ROOT.
TVirtualHistPainter * GetPainter(Option_t *option="")
Return pointer to painter.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
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.
The histogram painter class.
static Int_t ProjectSinusoidal2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function code for sinusoidal projection from Ernst-Jan Buis Source https://en....
static Int_t ProjectMollweide2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
static Int_t ProjectAitoff2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
static Int_t ProjectParabolic2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function code for parabolic projection from Ernst-Jan Buis.
static Int_t ProjectMercator2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
std::vector< Int_t > fColorMain
void MarchingCubeCase06(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 6.
Int_t fSystem
Coordinate system.
void DrawFaceMove3(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 3rd variant for "MOVING SCREEN" algorithm (draw level lines only)
void SetDrawFace(DrawFaceFunc_t pointer)
Store pointer to current algorithm to draw faces.
void MarchingCubeSetTriangles(Int_t ntria, Int_t it[][3], Int_t itria[48][3])
Set triangles (if parameter IALL=1, all edges will be visible)
void IsoSurface(Int_t ns, Double_t *s, Int_t nx, Int_t ny, Int_t nz, Double_t *x, Double_t *y, Double_t *z, const char *chopt)
Draw set of iso-surfaces for a scalar function defined on a grid.
Double_t fRmax[3]
Upper limits of lego.
std::vector< Int_t > fRaster
Pointer to raster buffer.
void DrawLevelLines(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw level lines without hidden line removal.
void ClearRaster()
Clear screen.
std::vector< Int_t > fColorDark
void MarchingCubeFindNodes(Int_t nnod, Int_t *ie, Double_t xyz[52][3], Double_t grad[52][3])
Find nodes and normales.
DrawFaceFunc_t fDrawFace
Pointer to face drawing function.
void SetLegoFunction(LegoFunc_t pointer)
Store pointer to current lego function.
void SurfaceCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in cylindrical coordinates.
void MarchingCubeMiddlePoint(Int_t nnod, Double_t xyz[52][3], Double_t grad[52][3], Int_t it[][3], Double_t *pxyz, Double_t *pgrad)
Find middle point of a polygon.
Double_t fFunLevel[NumOfColorLevels+1]
std::vector< Int_t > fEdgeStyle
void SurfaceFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t)
Service function for Surfaces.
void MarchingCubeCase03(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 3.
void LegoCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots in cylindrical coordinates.
Int_t fIc3
Base colour for the 3rd Iso Surface.
void SideVisibilityDecode(Double_t val, Int_t &iv1, Int_t &iv2, Int_t &iv3, Int_t &iv4, Int_t &iv5, Int_t &iv6, Int_t &ir)
Decode side visibilities and order along R for sector.
void MarchingCubeCase12(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 12.
void FindLevelLines(Int_t np, Double_t *f, Double_t *t)
Find level lines for face.
void FillPolygonBorder(Int_t nn, Double_t *xy)
Fill a polygon including border ("RASTER SCREEN")
Double_t fF8[8]
Function values.
void FindVisibleDraw(Double_t *r1, Double_t *r2)
Find visible parts of line (draw line)
static const Int_t NumOfSlices
Int_t fNaphi
Size of fAphi.
void LegoSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots spheric coordinates.
void SurfaceCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
Draw surface in cartesian coordinate system.
void SurfaceProperty(Double_t qqa, Double_t qqd, Double_t qqs, Int_t nnqs, Int_t &irep)
Set surface property coefficients.
void InitMoveScreen(Double_t xmin, Double_t xmax)
Initialize "MOVING SCREEN" method.
Double_t fYls[NumOfLights]
void FindVisibleLine(Double_t *p1, Double_t *p2, Int_t ntmax, Int_t &nt, Double_t *t)
Find visible part of a line ("RASTER SCREEN")
void ZDepth(Double_t xyz[52][3], Int_t &nface, Int_t iface[48][3], Double_t dface[48][6], Double_t abcd[48][4], Int_t *iorder)
Z-depth algorithm for set of triangles.
Double_t fU[NumOfSlices *2]
void LegoCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
Draw stack of lego-plots in cartesian coordinates.
Int_t fNxrast
Number of pixels in x.
Int_t fNStack
Number of histograms in the stack to be painted.
Double_t fRmin[3]
Lower limits of lego.
void DrawFaceMode1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
Draw face - 1st variant (2 colors: 1st for external surface, 2nd for internal)
TPainter3dAlgorithms()
Lego default constructor.
void SideVisibilityEncode(Int_t iopt, Double_t phi1, Double_t phi2, Double_t &val)
Encode side visibilities and order along R for sector.
void LightSource(Int_t nl, Double_t yl, Double_t xscr, Double_t yscr, Double_t zscr, Int_t &irep)
Set light source.
void MarchingCubeCase04(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 4.
Int_t fJmask[30]
Indices of subsets of n-bit masks (n is from 1 to 30)
void MarchingCubeCase00(Int_t k1, Int_t k2, Int_t k3, Int_t k4, Int_t k5, Int_t k6, Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consideration of trivial cases: 1,2,5,8,9,11,14.
void GouraudFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t)
Find part of surface with luminosity in the corners.
Int_t fNcolor
Number of colours per Iso surface.
Int_t fColorLevel[NumOfColorLevels+2]
void DrawFaceMove1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 1st variant for "MOVING SCREEN" algorithm (draw face with level lines)
void FillPolygon(Int_t n, Double_t *p, Double_t *f)
Fill polygon with function values at vertexes.
void SetSurfaceFunction(SurfaceFunc_t pointer)
Store pointer to current surface function.
void SurfacePolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in polar coordinates.
~TPainter3dAlgorithms() override
destructor
std::vector< Double_t > fAphi
Double_t fXrast
Minimal x.
void SurfaceSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in spheric coordinates.
void MarchingCubeCase07(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 7.
void BackBox(Double_t ang)
Draw back surfaces of surrounding box.
void ColorFunction(Int_t nl, Double_t *fl, Int_t *icl, Int_t &irep)
Set correspondence between function and color levels.
void DrawFaceRaster2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 2nd variant for "RASTER SCREEN" algorithm (draw face for stacked lego plot)
void MarchingCubeCase10(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 10.
Double_t fD[NumOfSlices *2]
Double_t fP8[8][3]
Vertices.
Double_t fYrast
Minimal y.
Double_t fPlines[NumOfLevelLines *6]
Double_t fVls[NumOfLights *3]
void LegoPolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots in polar coordinates.
void SetEdgeAtt(Color_t color=1, Style_t style=1, Width_t width=1, Int_t n=0)
void DrawFaceGouraudShaded(Int_t *icodes, Double_t xyz[][3], Int_t np, Int_t *iface, Double_t *t)
Draw the faces for the Gouraud Shaded Iso surfaces.
Int_t fIc2
Base colour for the 2nd Iso Surface.
void MarchingCubeCase13(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 13.
std::vector< Int_t > fEdgeWidth
void InitRaster(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Int_t nx, Int_t ny)
Initialize hidden lines removal algorithm (RASTER SCREEN)
void DefineGridLevels(Int_t ndivz)
Define the grid levels drawn in the background of surface and lego plots.
void LegoFunction(Int_t ia, Int_t ib, Int_t &nv, Double_t *ab, Double_t *vv, Double_t *t)
Service function for Legos.
Int_t fLevelLine[NumOfLevelLines]
Double_t fFmin
IsoSurface minimum function value.
void MarchingCube(Double_t fiso, Double_t p[8][3], Double_t f[8], Double_t g[8][3], Int_t &nnod, Int_t &ntria, Double_t xyz[][3], Double_t grad[][3], Int_t itria[][3])
Topological decider for "Marching Cubes" algorithm Find set of triangles approximating the iso-surfac...
Int_t fMask[465]
Set of masks (30+29+28+...+1)=465.
void ModifyScreen(Double_t *r1, Double_t *r2)
Modify SCREEN.
Int_t fMesh
(=1 if mesh to draw, o otherwise)
SurfaceFunc_t fSurfaceFunction
Pointer to surface function.
void DrawFaceMove2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 2nd variant for "MOVING SCREEN" algorithm (draw face for stacked lego plot)
Int_t fIfrast
Flag, if it not zero them the algorithm is off.
LegoFunc_t fLegoFunction
Pointer to lego function.
void SetColorMain(Color_t color, Int_t n=0)
Store color for stack number n.
void Spectrum(Int_t nl, Double_t fmin, Double_t fmax, Int_t ic, Int_t idc, Int_t &irep)
Set Spectrum.
std::vector< Int_t > fEdgeColor
Double_t fG8[8][3]
Function gradients.
void TestEdge(Double_t del, Double_t xyz[52][3], Int_t i1, Int_t i2, Int_t iface[3], Double_t abcd[4], Int_t &irep)
Test edge against face (triangle)
Int_t fNyrast
Number of pixels in y.
void DrawFaceRaster1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 1st variant for "RASTER SCREEN" algorithm (draw face with level lines)
void DrawFaceMode3(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
Draw face - 3rd option (draw face for stacked lego plot)
void FrontBox(Double_t ang)
Draw front surfaces of surrounding box & axes.
void SetColorDark(Color_t color, Int_t n=0)
Store dark color for stack number n.
void DrawFaceMode2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
Draw face - 2nd option (fill in correspondence with function levels)
void FindPartEdge(Double_t *p1, Double_t *p2, Double_t f1, Double_t f2, Double_t fmin, Double_t fmax, Int_t &kpp, Double_t *pp)
Find part of edge where function defined on this edge has value from fmin to fmax
Int_t fIc1
Base colour for the 1st Iso Surface.
void ImplicitFunction(TF3 *f3, Double_t *rmin, Double_t *rmax, Int_t nx, Int_t ny, Int_t nz, const char *chopt)
Draw implicit function FUN(X,Y,Z) = 0 in cartesian coordinates using hidden surface removal algorithm...
Double_t fFmax
IsoSurface maximum function value.
void MarchingCubeSurfacePenetration(Double_t a00, Double_t a10, Double_t a11, Double_t a01, Double_t b00, Double_t b10, Double_t b11, Double_t b01, Int_t &irep)
Check for surface penetration ("bottle neck")
void Luminosity(TView *view, Double_t *anorm, Double_t &flum)
Find surface luminosity at given point.
Float_t GetLegoInnerR() const
virtual Double_t * GetRmax()=0
virtual Double_t * GetRmin()=0
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
static TView * CreateView(Int_t system=1, const Double_t *rmin=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.
virtual void FindPhiSectors(Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2)=0
virtual Double_t * GetTnorm()=0
virtual void FindThetaSectors(Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2)=0
virtual void SetRange(const Double_t *min, const Double_t *max)=0
virtual void FindNormal(Double_t x, Double_t y, Double_t z, Double_t &zn)=0
virtual void AxisVertex(Double_t ang, Double_t *av, Int_t &ix1, Int_t &ix2, Int_t &iy1, Int_t &iy2, Int_t &iz1, Int_t &iz2)=0
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)=0
virtual Double_t * GetTN()=0
virtual void NormalWCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual TList * GetStack() const =0
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Histograms' drawing options structure.
int Proj
"AITOFF", "MERCATOR", "SINUSOIDAL" and "PARABOLIC" projections for 2d plots.
int Logx
log scale in X. Also set by histogram option
int MinimumZero
"MIN0" or gStyle->GetHistMinimumZero()
int Zero
"0" if selected with any LEGO option the empty bins are not drawn.
int Logz
log scale in Z. Also set by histogram option
int Surf
"SURF" and "SURFn" Draw as a Surface ((1 <= n <= 4).
int Logy
log scale in Y. Also set by histogram option
int System
"POL", "CYL", "SPH" and "PSR" Type of coordinate system for 3D plots.
Histogram parameters structure.
Double_t baroffset
Offset of bin for bars or legos [0,1].
Double_t xmin
Minimum value along X.
Int_t ylast
Last bin number along Y.
Int_t xfirst
First bin number along X.
Double_t zmin
Minimum value along Z.
Double_t ymin
Minimum value along y.
Double_t ymax
Maximum value along y.
Double_t factor
Multiplication factor (normalization)
Int_t xlast
Last bin number along X.
Double_t barwidth
Width of bin for bars and legos [0,1].
Double_t zmax
Maximum value along Z.
Double_t xmax
Maximum value along X.
Int_t yfirst
First bin number along Y.