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.; }
160 for (i=0;i<3;i++) {
fRmin[i] = rmin[i];
fRmax[i] = rmax[i]; }
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.; }
220 static Int_t iface1[4] = { 1, 4, 8, 5 };
221 static Int_t iface2[4] = { 4, 3, 7, 8 };
225 Error(
"BackBox",
"no TView in current pad");
231 Int_t ix1, ix2, iy1, iy2, iz1, iz2;
234 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
235 for (
Int_t i = 0; i < 8; ++i) {
236 r[i*3 + 0] = av[i*3 + 0] + av[i*3 + 1]*cosa;
237 r[i*3 + 1] = av[i*3 + 1]*sina;
238 r[i*3 + 2] = av[i*3 + 2];
242 Int_t icodes[3] = { 0, 0, 0 };
244 tt[0] =
r[(iface1[0]-1)*3 + 2];
245 tt[1] =
r[(iface1[1]-1)*3 + 2];
246 tt[2] =
r[(iface1[2]-1)*3 + 2];
247 tt[3] =
r[(iface1[3]-1)*3 + 2];
249 tt[0] =
r[(iface2[0]-1)*3 + 2];
250 tt[1] =
r[(iface2[1]-1)*3 + 2];
251 tt[2] =
r[(iface2[2]-1)*3 + 2];
252 tt[3] =
r[(iface2[3]-1)*3 + 2];
263 static Int_t iface1[4] = { 1, 2, 6, 5 };
264 static Int_t iface2[4] = { 2, 3, 7, 6 };
268 Error(
"FrontBox",
"no TView in current pad");
274 Int_t ix1, ix2, iy1, iy2, iz1, iz2;
277 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
278 for (
Int_t i = 0; i < 8; ++i) {
279 r[i*3 + 0] = av[i*3 + 0] + av[i*3 + 1]*cosa;
280 r[i*3 + 1] = av[i*3 + 1]*sina;
281 r[i*3 + 2] = av[i*3 + 2];
290 for (
Int_t i = 0; i < 4; ++i) {
291 Int_t k = iface1[i] - 1;
295 gPad->PaintPolyLine(4,
x,
y);
296 for (
Int_t i = 0; i < 4; ++i) {
297 Int_t k = iface2[i] - 1;
301 gPad->PaintPolyLine(4,
x,
y);
325 static const char *where =
"ColorFunction";
334 if (nl < 0 || nl > 256) {
335 Error(where,
"illegal number of levels (%d)", nl);
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;
379 if (!rmin || !rmax)
return;
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; }
417 view->
WCtoNDC(&xyz[(k-1)*3], p3);
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]);
461 Double_t x[12+1] = {0},
y[12+1] = {0}, p3[3*12];
462 for (
Int_t i = 0; i <
np; ++i) {
464 view->
WCtoNDC(&xyz[(k-1)*3], &p3[i*3]);
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]; }
477 Int_t k1 = 0, k2 = 2;
478 Double_t z1 = (
x[k1+1] -
x[k1+0])*(
y[k1+2] -
y[k1+1]) - (
y[k1+1] -
y[k1+0])*(
x[k1+2] -
x[k1+1]);
479 Double_t z2 = (
x[k2+1] -
x[k2+0])*(
y[k2+2] -
y[k2+1]) - (
y[k2+1] -
y[k2+0])*(
x[k2+2] -
x[k2+1]);
480 if (z1 > z2) { k1 = 2; k2 = 0; }
483 gPad->PaintPolyLine(3, &
x[k1], &
y[k1]);
487 gPad->PaintPolyLine(3, &
x[k2], &
y[k2]);
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) {
519 view->
WCtoNDC(&xyz[(k-1)*3], p3);
520 x[i] = p3[0];
y[i] = p3[1];
528 if (icodes[3] == 1) icol =
fColorMain[icodes[2] - 1];
529 if (icodes[3] == 2) icol =
fColorDark[icodes[2] - 1];
530 if (icodes[3] == 3) icol =
fColorMain[icodes[2] - 1];
531 if (icodes[3] == 4) icol =
fColorDark[icodes[2] - 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];
577 if (icodes[2] == 0) {
591 for (
Int_t it = 0; it <
fNT; ++it) {
592 x[0] = p1[0] + xdel*
fT[2*it + 0];
593 y[0] = p1[1] + ydel*
fT[2*it + 0];
594 x[1] = p1[0] + xdel*
fT[2*it + 1];
595 y[1] = p1[1] + ydel*
fT[2*it + 1];
596 gPad->PaintPolyLine(2,
x,
y);
601 if (icodes[2] == 0) {
611 for (
Int_t i = 0; i <
np; ++i) {
613 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
619 for (
Int_t it = 0; it <
fNT; ++it) {
620 x[0] = p1[0] + xdel*
fT[2*it + 0];
621 y[0] = p1[1] + ydel*
fT[2*it + 0];
622 x[1] = p1[0] + xdel*
fT[2*it + 1];
623 y[1] = p1[1] + ydel*
fT[2*it + 1];
624 gPad->PaintPolyLine(2,
x,
y);
629 for (
Int_t i = 0; i <
np; ++i) {
631 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
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];
661 if (icodes[2] == 0) {
671 for (
Int_t i = 0; i <
np; ++i) {
673 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
679 for (
Int_t it = 0; it <
fNT; ++it) {
680 x[0] = p1[0] + xdel*
fT[2*it + 0];
681 y[0] = p1[1] + ydel*
fT[2*it + 0];
682 x[1] = p1[0] + xdel*
fT[2*it + 1];
683 y[1] = p1[1] + ydel*
fT[2*it + 1];
684 gPad->PaintPolyLine(2,
x,
y);
689 for (
Int_t i = 0; i <
np; ++i) {
691 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
712 if (icodes[2] == 0) {
724 Double_t p3[3*12] = {0}, ttt[12] = {0};
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];
735 Int_t ipol[2] = { 0, 0 };
736 if (
np == 4 && icodes[2] != 0) {
741 npol[0] = 3; npol[1] = 3;
742 ipol[0] = 0; ipol[1] = 2;
746 for (
Int_t kpol = 0; kpol < 2; ++kpol) {
747 if (npol[kpol] == 0)
continue;
748 Int_t nv = npol[kpol];
749 Int_t iv = ipol[kpol];
761 for (
Int_t it = 0; it <
fNT; ++it) {
762 x[0] = p1[0] + xdel*
fT[2*it + 0];
763 y[0] = p1[1] + ydel*
fT[2*it + 0];
764 x[1] = p1[0] + xdel*
fT[2*it + 1];
765 y[1] = p1[1] + ydel*
fT[2*it + 1];
766 gPad->PaintPolyLine(2,
x,
y);
772 for (
Int_t i = 0; i <
np; ++i) {
774 Int_t i2 = (i ==
np - 1) ? 0 : i1 + 1;
795 if (icodes[2] == 0) {
807 Double_t p3[3*12] = {0}, ttt[12] = {0};
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];
818 Int_t ipol[2] = { 0, 0 };
819 if (
np == 4 && icodes[2] != 0) {
824 npol[0] = 3; npol[1] = 3;
825 ipol[0] = 0; ipol[1] = 2;
829 for (
Int_t kpol = 0; kpol < 2; ++kpol) {
830 if (npol[kpol] == 0)
continue;
831 Int_t nv = npol[kpol];
832 Int_t iv = ipol[kpol];
841 x[0] = p1[0];
y[0] = p1[1];
842 x[1] = p2[0];
y[1] = p2[1];
843 gPad->PaintPolyLine(2,
x,
y);
863 Double_t p3[3*12] = {0}, pp[2*12] = {0};
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];
882 if (icodes[2] == 0) {
896 for (
Int_t it = 0; it <
fNT; ++it) {
897 x[0] = p1[0] + xdel*
fT[2*it + 0];
898 y[0] = p1[1] + ydel*
fT[2*it + 0];
899 x[1] = p1[0] + xdel*
fT[2*it + 1];
900 y[1] = p1[1] + ydel*
fT[2*it + 1];
901 gPad->PaintPolyLine(2,
x,
y);
906 if (icodes[2] == 0) {
916 for (
Int_t i = 0; i <
np; ++i) {
917 if (iface[i] < 0)
continue;
919 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
921 Double_t xdel = pp[2*i2 + 0] - pp[2*i1 + 0];
922 Double_t ydel = pp[2*i2 + 1] - pp[2*i1 + 1];
923 for (
Int_t it = 0; it <
fNT; ++it) {
924 x[0] = pp[2*i1 + 0] + xdel*
fT[2*it + 0];
925 y[0] = pp[2*i1 + 1] + ydel*
fT[2*it + 0];
926 x[1] = pp[2*i1 + 0] + xdel*
fT[2*it + 1];
927 y[1] = pp[2*i1 + 1] + ydel*
fT[2*it + 1];
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;
969 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
971 Double_t xdel = pp[2*i2 + 0] - pp[2*i1 + 0];
972 Double_t ydel = pp[2*i2 + 1] - pp[2*i1 + 1];
973 for (
Int_t it = 0; it <
fNT; ++it) {
974 x[0] = pp[2*i1 + 0] + xdel*
fT[2*it + 0];
975 y[0] = pp[2*i1 + 1] + ydel*
fT[2*it + 0];
976 x[1] = pp[2*i1 + 0] + xdel*
fT[2*it + 1];
977 y[1] = pp[2*i1 + 1] + ydel*
fT[2*it + 1];
978 gPad->PaintPolyLine(2,
x,
y);
999 Int_t ilev, i, k, icol, i1, i2, nl,
np;
1010 Error(
"FillPolygon",
"illegal number of vertices in polygon (%d)",
n);
1020 if (nl < 0) nl = -nl;
1023 for (i = 2; i <=
np; ++i) {
1024 if (fmin >
f[i]) fmin =
f[i];
1025 if (fmax <
f[i]) fmax =
f[i];
1028 if (fmin < funmin) funmin = fmin - 1;
1030 if (fmax > funmax) funmax = fmax + 1;
1034 for (ilev = 1; ilev <= nl+1; ++ilev) {
1037 if (ilev == nl + 1) f2 = funmax;
1039 if (fmax <
f1)
return;
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) {
1057 icol=
gPad->GetFillColor();
1064 gPad->PaintFillArea(k,
x,
y);
1077 i, j, k,
n, ibase, t,
x,
y, xscan[24] ,
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) {
1143 xcur[i - 1] =
x1[i - 1];
1144 dy =
y2[i - 1] -
y1[i - 1];
1145 dx =
x2[i - 1] -
x1[i - 1];
1147 if (dx < 0) signdx = -1;
1148 if (dx < 0) dx = -dx;
1150 t = -(dy + 1) / 2 + dx;
1153 xnex[i - 1] = xcur[i - 1];
1155 test[i - 1] = t - dy;
1156 xnex[i - 1] = xcur[i - 1] + signdx;
1158 }
else if (dy != 0) {
1159 step = (dx - 1) / (dy + dy) + 1;
1160 test[i - 1] = step*dy - (dx + 1) / 2 - dx;
1161 xnex[i - 1] = xcur[i - 1] + signdx*step;
1167 for (yscan =
ymin; yscan <=
ymax; ++yscan) {
1171 for (i = nstart; i <=
n; ++i) {
1172 if (
y1[i - 1] > yscan)
goto L500;
1173 if (
y2[i - 1] <= yscan) {
1174 if (i == nstart) ++nstart;
1175 if (
y2[i - 1] != yscan)
continue;
1177 if (
x2[i - 1] >= xcur[i - 1]) {
1178 xscan[2*nxb - 2] = xcur[i - 1];
1179 xscan[2*nxb - 1] =
x2[i - 1];
1181 xscan[2*nxb - 2] =
x2[i - 1];
1182 xscan[2*nxb - 1] = xcur[i - 1];
1190 dy =
y2[i - 1] -
y1[i - 1];
1191 dx =
x2[i - 1] -
x1[i - 1];
1194 xscan[2*nxa - 2] = xcur[i - 1];
1195 xscan[2*nxa - 1] = xnex[i - 1];
1196 if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
1202 xscan[2*nxa - 2] = xnex[i - 1];
1203 xscan[2*nxa - 1] = xcur[i - 1];
1204 if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
1208 xcur[i - 1] = xnex[i - 1];
1211 if (
test[i - 1] < 0)
continue;
1213 xnex[i - 1] += signdx;
1217 t =
test[i - 1] + step*dy;
1219 test[i - 1] = t - dx;
1220 xnex[i - 1] += signdx*step;
1222 test[i - 1] = t + dy - dx;
1223 xnex[i - 1] += signdx*(step + 1);
1229 if (yscan < 0)
continue;
1232 for (i = 1; i < nxa; ++i) {
1233 for (j = i; j >= 1; --j) {
1234 if (xscan[2*j] >= xscan[2*j - 2])
continue;
1236 xscan[2*j] = xscan[2*j - 2];
1239 xscan[2*j + 1] = xscan[2*j - 1];
1243 for (i = 1; i <= nxa; i += 2) {
1245 xscan[2*nx - 2] = xscan[2*i - 2];
1247 if (xscan[2*i - 1] >
x)
x = xscan[2*i - 1];
1248 xscan[2*nx - 1] =
x;
1252 for (i = nxb; i <=
kLmax; ++i) {
1254 xscan[2*nx - 2] = xscan[2*i - 2];
1255 xscan[2*nx - 1] = xscan[2*i - 1];
1260 xx1 = xscan[2*nx - 2];
1261 xx2 = xscan[2*nx - 1];
1265 if ((xscan[2*k - 2] <= xx2 + 1) && (xscan[2*k - 1] >= xx1 - 1)) {
1266 if (xscan[2*k - 2] < xx1) xx1 = xscan[2*k - 2];
1267 if (xscan[2*k - 1] > xx2) xx2 = xscan[2*k - 1];
1268 xscan[2*k - 2] = xscan[2*nx - 2];
1269 xscan[2*k - 1] = xscan[2*nx - 1];
1273 if (xx1 < 0) xx1 = 0;
1275 nbit = xx2 - xx1 + 1;
1278 ib = kbit - iw*30 + 1;
1281 if (nb > nbit) nb = nbit;
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];
1323 for (
Int_t il = 1; il <= nl; ++il) {
1324 if (tmin >=
fFunLevel[il - 1])
continue;
1330 for (
Int_t i = 0; i <
np; ++i) {
1332 Int_t i2 = (i ==
np-1) ? 0 : i+1;
1335 if (d1 == 0) d1 = 1
e-99;
1336 if (d2 == 0) d2 = 1
e-99;
1337 if (d1*d2 > 0)
continue;
1341 d1 /= t[i2] - t[i1];
1342 d2 /= t[i2] - t[i1];
1349 Error(
"FindLevelLines",
"number of points for line not equal 2");
1382 if (
f1 < fmin) k1 = -2;
1383 if (
f1 == fmin) k1 = -1;
1384 if (
f1 == fmax) k1 = 1;
1385 if (
f1 > fmax) k1 = 2;
1387 if (f2 < fmin) k2 = -2;
1388 if (f2 == fmin) k2 = -1;
1389 if (f2 == fmax) k2 = 1;
1390 if (f2 > fmax) k2 = 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];
1434 d1 = (fmin -
f1) / (
f1 - f2);
1435 d2 = (fmin - f2) / (
f1 - f2);
1436 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1437 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1438 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1444 d1 = (fmax -
f1) / (
f1 - f2);
1445 d2 = (fmax - f2) / (
f1 - f2);
1446 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1447 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1448 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1454 pp[kpp*3 + 1] = p1[1];
1455 pp[kpp*3 + 2] = p1[2];
1456 pp[kpp*3 + 3] = p1[3];
1458 d1 = (fmin -
f1) / (
f1 - f2);
1459 d2 = (fmin - f2) / (
f1 - f2);
1460 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1461 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1462 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1468 pp[kpp*3 + 1] = p1[1];
1469 pp[kpp*3 + 2] = p1[2];
1470 pp[kpp*3 + 3] = p1[3];
1472 d1 = (fmax -
f1) / (
f1 - f2);
1473 d2 = (fmax - f2) / (
f1 - f2);
1474 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1475 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1476 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1482 d1 = (fmin -
f1) / (
f1 - f2);
1483 d2 = (fmin - f2) / (
f1 - f2);
1484 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1485 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1486 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1488 d1 = (fmax -
f1) / (
f1 - f2);
1489 d2 = (fmax - f2) / (
f1 - f2);
1490 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1491 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1492 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1498 d1 = (fmax -
f1) / (
f1 - f2);
1499 d2 = (fmax - f2) / (
f1 - f2);
1500 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1501 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1502 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1504 d1 = (fmin -
f1) / (
f1 - f2);
1505 d2 = (fmin - f2) / (
f1 - f2);
1506 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1507 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1508 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1520 Int_t i, icase, i1, i2, icase1, icase2, iv, ifback;
1523 Double_t tt, uu, ww, yy, yy1, yy2, yy1d, yy2d;
1534 x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
1535 x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
1536 y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
1537 y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
1538 z1 = tn[8]*r1[1] + tn[9]*r1[2] + tn[10]*r1[3] + tn[11];
1539 z2 = tn[8]*r2[1] + tn[9]*r2[2] + tn[10]*r2[3] + tn[11];
1541 Error(
"FindVisibleDraw",
"invalid TView in current pad");
1545 Error(
"FindVisibleDraw",
"no TView in current pad");
1571 dy = (
y2 -
y1) / di;
1574 for (i = i1; i <= i2 - 1; ++i) {
1575 yy1 =
y1 + dy*(i - i1);
1577 yy1u = yy1 -
fU[2*i - 2];
1578 yy1d = yy1 -
fD[2*i - 2];
1579 yy2u = yy2 -
fU[2*i - 1];
1580 yy2d = yy2 -
fD[2*i - 1];
1584 if (yy1u > kEpsil) icase1 = 0;
1585 if (yy1d < -kEpsil) icase1 = 2;
1586 if ((icase1 == 0 || icase1 == 2) && iv <= 0) {
1591 if (icase1 == 1 && iv >= 0) {
1597 if (yy2u > kEpsil) icase2 = 0;
1598 if (yy2d < -kEpsil) icase2 = 2;
1599 icase = icase1*3 + icase2;
1602 fT[2*
fNT - 1] =
tt + dt*(yy1u / (yy1u - yy2u));
1605 fT[2*
fNT - 1] =
tt + dt*(yy1u / (yy1u - yy2u));
1607 fT[2*
fNT - 2] =
tt + dt*(yy1d / (yy1d - yy2d));
1612 fT[2*
fNT - 2] =
tt + dt*(yy1u / (yy1u - yy2u));
1617 fT[2*
fNT - 2] =
tt + dt*(yy1d / (yy1d - yy2d));
1620 fT[2*
fNT - 1] =
tt + dt*(yy1d / (yy1d - yy2d));
1622 fT[2*
fNT - 2] =
tt + dt*(yy1u / (yy1u - yy2u));
1626 fT[2*
fNT - 1] =
tt + dt*(yy1d / (yy1d - yy2d));
1628 if (
fNT + 1 >= 100)
break;
1630 if (iv > 0)
fT[2*
fNT - 1] = 1;
1638 if (
y2 ==
y1) {
fNT = 0;
return;}
1639 ifback = 1 - ifback;
1647 if (uu <
fU[2*i1 - 3]) uu =
fU[2*i1 - 3];
1648 if (dd >
fD[2*i1 - 3]) dd =
fD[2*i1 - 3];
1651 if (y1 < uu && y2 > dd) {
1652 if (
y1 >= dd &&
y2 <= uu) {
fNT = 0;
return;}
1667 if (ifback == 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;
1735 if (dy > dx)
goto L200;
1739 ddtt = dt*(float).5;
1744 for (ix =
x1; incrx < 0 ? ix >=
x2 : ix <=
x2; ix += incrx) {
1753 if (iy < 0)
goto L110;
1755 if (ix < 0)
goto L110;
1758 ib = kb - iw*30 + 1;
1760 if (ivis > 0)
continue;
1766 if (ivis == 0)
continue;
1769 if (nt == ntmax)
goto L300;
1771 if (ivis > 0) t[2*nt + 2] = tcur + dt + ddtt;
1777 ddtt = dt*(float).5;
1783 for (iy =
y1; iy <=
y2; ++iy) {
1792 if (iy < 0)
goto L210;
1793 if (ix < 0)
goto L210;
1796 ib = kb - iw*30 + 1;
1798 if (ivis > 0)
continue;
1804 if (ivis == 0)
continue;
1807 if (nt == ntmax)
goto L300;
1809 if (ivis > 0) t[2*nt + 2] = tcur + dt;
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;
1817 if (ifinve == 0)
return;
1818 for (i = 1; i <= nt; ++i) {
1821 t[2*i + 1] = 1 - t2;
1822 t[2*i + 2] = 1 -
t1;
1838 Int_t incrx[3], incry[3];
1862 if (ixt == 1) incrx[0] = 0;
1867 if (iyt == 1) incry[0] = 0;
1872 for (j = 1; j <= 3; ++j) {
1873 for (i = 1; i <= 3; ++i) {
1874 i1 = ia + incrx[i - 1];
1875 i2 = ib + incry[j - 1];
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];
1929 an[(i + j*3)*3 - 12] =
y1*z2 -
y2*z1;
1930 an[(i + j*3)*3 - 11] = z1*
x2 - z2*
x1;
1931 an[(i + j*3)*3 - 10] =
x1*
y2 -
x2*
y1;
1932 s =
TMath::Sqrt(an[(i + j*3)*3 - 12]*an[(i + j*3)*3 - 12] + an[
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];
1974 fU[2*i + 0] = -VERY_BIG;
1975 fU[2*i + 1] = -VERY_BIG;
1976 fD[2*i + 0] = VERY_BIG;
1977 fD[2*i + 1] = VERY_BIG;
1993 Int_t i, j, k, ib, nb;
2003 Int_t buffersize = nx*ny/30 + 1;
2009 for (i = 1; i <= 30; ++i) {
2012 fMask[i - 1] = pow2;
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];
2034 Int_t i, j, ixt, iyt;
2036 Double_t xlab1l, xlab2l, ylab1l, ylab2l;
2102 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2103 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2104 ab[4] = (ab[4] - yval1l) / (yval2l - yval1l);
2105 ab[8] = (ab[8] - yval1l) / (yval2l - yval1l);
2107 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2108 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2110 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2111 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2112 ab[4] = 180*(ab[4] - ylab1l) / (ylab2l - ylab1l);
2113 ab[8] = 180*(ab[8] - ylab1l) / (ylab2l - ylab1l);
2115 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2116 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2117 ab[4] = (180 - dangle*2)*(ab[4] - ylab1l) / (ylab2l - ylab1l) + dangle;
2118 ab[8] = (180 - dangle*2)*(ab[8] - ylab1l) / (ylab2l - ylab1l) + dangle;
2144 if (stack) nids = stack->
GetSize();
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];
2207 Int_t icodes[4], iface[4];
2209 Int_t firstStackNumberDrawn=-1 ;
2213 Error(
"LegoCartesian",
"no TView in current pad");
2221 std::vector<Double_t>
v(vSize),
tt(4*vSize);
2224 Int_t incrx = (tnorm[8] < 0.) ? -1 : +1;
2225 Int_t incry = (tnorm[9] < 0.) ? -1 : +1;
2226 if (*chopt !=
'B' && *chopt !=
'b') {
2227 incrx = -incrx; incry = -incry;
2229 Int_t ix1 = (incrx == +1) ? 1 : nx;
2230 Int_t iy1 = (incry == +1) ? 1 : ny;
2231 Int_t ix2 = (incrx == +1) ? nx : 1;
2232 Int_t iy2 = (incry == +1) ? ny : 1;
2236 Int_t ivis[6] = { 0,0,0,0,0,0 };
2238 if (zn < 0) ivis[0] = 1;
2239 if (zn > 0) ivis[2] = 1;
2241 if (zn > 0) ivis[1] = 1;
2242 if (zn < 0) ivis[3] = 1;
2244 if (zn > 0) ivis[5] = 1;
2245 if (zn < 0) ivis[4] = 1;
2250 for (
Int_t iy = iy1; iy != iy2+incry; iy += incry) {
2251 for (
Int_t ix = ix1; ix != ix2+incrx; ix += incrx) {
2252 if (!painter->
IsInside(ix,iy))
continue;
2254 if (nv < 2 || nv > vSize)
continue;
2257 for (
Int_t iv = 1; iv < nv; ++iv) { total_content +=
v[iv]; }
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];
2269 firstStackNumberDrawn = -1;
2270 for (
Int_t iv = 1; iv < nv; ++iv) {
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;
2287 tface[0] =
tt[k1 + (iv << 2) - 5];
2288 tface[1] =
tt[k2 + (iv << 2) - 5];
2289 tface[2] =
tt[k2 + ((iv + 1) << 2) - 5];
2290 tface[3] =
tt[k1 + ((iv + 1) << 2) - 5];
2292 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2294 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2300 for (
Int_t i = 1; i <= 4; ++i) {
2301 xyz[i*3 - 1] =
v[0];
2302 iface[i - 1] = 5 - i;
2303 tface[i - 1] =
tt[5 - i - 1];
2310 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2316 for (
Int_t i = 1; i <= 4; ++i) {
2317 iface[i - 1] = i + 4;
2318 tface[i - 1] =
tt[i + (nv << 2) - 5];
2323 if ( nv > 2 && (
v[nv-1] ==
v[nv-2])) {
2324 for (
Int_t iv = nv-1; iv > 2; --iv) {
2325 if (
v[nv-1] ==
v[iv-1]) {
2332 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2353 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2355 Int_t incrr, k1, k2, ia, ib, ir1, ir2;
2357 Int_t ir, jr, iv, nr, nv, icodes[4];
2360 Int_t firstStackNumberDrawn = -1 ;
2364 Error(
"LegoPolar",
"no TView in current pad");
2383 if (
fAphi.empty()) {
2384 Error(
"LegoPolar",
"failed to allocate array fAphi[%d]",
fNaphi);
2389 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2393 std::vector<Double_t>
v(vSize),
tt(4*vSize);
2399 if (iordr == 0) ia = nr;
2400 if (iordr != 0) ib = nr;
2401 for (i = 1; i <= nphi; ++i) {
2402 if (iordr == 0) ib = i;
2403 if (iordr != 0) ia = i;
2405 if (i == 1)
fAphi[0] = ab[jphi - 1];
2406 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2407 fAphi[i] = ab[jphi + 3];
2413 for (i = 1; i <= nphi; ++i) {
2424 if (iphi > nphi)
goto L300;
2429 if (incrr < 0) ir1 = nr;
2432 for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
2433 if (iordr == 0) { ia = ir; ib = iphi; }
2434 else { ia = iphi; ib = ir; }
2436 if (nv < 2 || nv > vSize)
continue;
2439 for (iv = 1; iv < nv; ++iv) total_content +=
v[iv];
2440 if (total_content==0)
continue;
2444 for (i = 1; i <= 4; ++i) {
2446 if (iordr != 0 && i == 2) j = 4;
2447 if (iordr != 0 && i == 4) j = 2;
2448 xyz[j*3 - 3] = ab[jr + 2*i - 3]*
TMath::Cos(ab[jphi + 2*i - 3]*
kRad);
2449 xyz[j*3 - 2] = ab[jr + 2*i - 3]*
TMath::Sin(ab[jphi + 2*i - 3]*
kRad);
2450 xyz[(j + 4)*3 - 3] = xyz[j*3 - 3];
2451 xyz[(j + 4)*3 - 2] = xyz[j*3 - 2];
2454 firstStackNumberDrawn = -1;
2455 for (iv = 1; iv < nv; ++iv) {
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;
2473 tface[0] =
tt[k1 + (iv << 2) - 5];
2474 tface[1] =
tt[k2 + (iv << 2) - 5];
2475 tface[2] =
tt[k2 + ((iv + 1) << 2) - 5];
2476 tface[3] =
tt[k1 + ((iv + 1) << 2) - 5];
2479 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2481 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2487 for (i = 1; i <= 4; ++i) {
2488 xyz[i*3 - 1] =
v[0];
2489 iface[i - 1] = 5 - i;
2490 tface[i - 1] =
tt[5 - i - 1];
2497 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2503 for (i = 1; i <= 4; ++i) {
2504 iface[i - 1] = i + 4;
2505 tface[i - 1] =
tt[i + (nv << 2) - 5];
2510 if ( nv > 2 && (
v[nv-1] ==
v[nv-2])) {
2511 for (iv = nv-1; iv>2; iv--) {
2512 if (
v[nv-1] ==
v[iv-1]) {
2519 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2526 if (iphi == 0) iphi = kphi;
2527 if (iphi > kphi) iphi = 1;
2528 if (iphi != iphi2)
goto L100;
2555 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2558 Int_t ia, ib, idummy, iz1, iz2, nz, incrz, k1, k2, nv;
2559 Int_t iv, iz, jz, icodes[4];
2564 Int_t firstStackNumberDrawn=-1 ;
2568 Error(
"LegoCylindrical",
"no TView in current pad");
2587 if (
fAphi.empty()) {
2588 Error(
"LegoCylindrical",
"failed to allocate array fAphi[%d]",
fNaphi);
2593 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2597 std::vector<Double_t>
v(vSize),
tt(4*vSize);
2603 if (iordr == 0) ia = nz;
2604 if (iordr != 0) ib = nz;
2605 for (i = 1; i <= nphi; ++i) {
2606 if (iordr == 0) ib = i;
2607 if (iordr != 0) ia = i;
2609 if (i == 1)
fAphi[0] = ab[jphi - 1];
2610 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2611 fAphi[i] = ab[jphi + 3];
2617 for (i = 1; i <= nphi; ++i) {
2618 if (iordr == 0) ib = i;
2619 if (iordr != 0) ia = i;
2628 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
2638 if (iphi > nphi)
goto L400;
2642 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
2643 if (iordr == 0) {ia = iz; ib = iphi;}
2644 else {ia = iphi; ib = iz;}
2646 if (nv < 2 || nv > vSize)
continue;
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];
2659 firstStackNumberDrawn = -1;
2660 for (iv = 1; iv < nv; ++iv) {
2661 for (i = 1; i <= 4; ++i) {
2662 xyz[i*3 - 3] =
v[iv - 1]*cosphi[i - 1];
2663 xyz[i*3 - 2] =
v[iv - 1]*sinphi[i - 1];
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;
2678 tface[0] =
tt[k1 + (iv << 2) - 5];
2679 tface[1] =
tt[k2 + (iv << 2) - 5];
2680 tface[2] =
tt[k2 + ((iv + 1) << 2) - 5];
2681 tface[3] =
tt[k1 + ((iv + 1) << 2) - 5];
2684 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2686 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
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];
2696 tface[i - 1] =
tt[i - 1];
2703 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
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])) {
2717 for (iv = nv-1; iv>2; iv--) {
2718 if (
v[nv-1] ==
v[iv-1]) {
2725 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2732 if (iphi == 0) iphi = kphi;
2733 if (iphi > kphi) iphi = 1;
2734 if (iphi != iphi2)
goto L100;
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;
2766 Int_t iv, icodes[4];
2772 Int_t firstStackNumberDrawn=-1 ;
2776 Error(
"LegoSpherical",
"no TView in current pad");
2795 if (
fAphi.empty()) {
2796 Error(
"LegoSpherical",
"failed to allocate array fAphi[%d]",
fNaphi);
2801 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2805 std::vector<Double_t>
v(vSize),
tt(4*vSize);
2812 if (mth == 0) mth = 1;
2813 if (iordr == 0) ia = mth;
2814 if (iordr != 0) ib = mth;
2815 for (i = 1; i <= nphi; ++i) {
2816 if (iordr == 0) ib = i;
2817 if (iordr != 0) ia = i;
2819 if (i == 1)
fAphi[0] = ab[jphi - 1];
2820 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2821 fAphi[i] = ab[jphi + 3];
2826 if (iordr == 0) ib = 1;
2827 if (iordr != 0) ia = 1;
2828 for (i = 1; i <= nth; ++i) {
2829 if (iordr == 0) ia = i;
2830 if (iordr != 0) ib = i;
2832 if (i == 1)
fAphi[0] = ab[jth - 1];
2833 fAphi[i - 1] = (
fAphi[i - 1] + ab[jth - 1]) / (
float)2.;
2834 fAphi[i] = ab[jth + 3];
2843 if (iphi > nphi)
goto L500;
2846 if (!iordr) {ia = mth; ib = iphi; }
2847 else {ia = iphi; ib = mth; }
2849 phi = (ab[jphi - 1] + ab[jphi + 3]) / (
float)2.;
2854 if (ith > nth)
goto L400;
2855 if (iordr == 0) ia = ith;
2856 if (iordr != 0) ib = ith;
2858 if (nv < 2 || nv > vSize)
goto L400;
2861 for (i = 1; i <= 6; ++i) ivis[i - 1] = 0;
2863 phi1 =
kRad*ab[jphi - 1];
2864 phi2 =
kRad*ab[jphi + 3];
2868 if (zn > 0) ivis[1] = 1;
2870 if (zn > 0) ivis[3] = 1;
2871 phi = (phi1 + phi2) / (
float)2.;
2873 if (zn > 0) ivis[0] = 1;
2875 if (zn > 0) ivis[2] = 1;
2876 th = (
th1 +
th2) / (
float)2.;
2877 if (ipsdr == 1) th =
kRad*90;
2879 if (zn < 0) ivis[4] = 1;
2880 if (zn > 0) ivis[5] = 1;
2885 for (i = 1; i <= 4; ++i) {
2887 if (iordr != 0 && i == 2) j = 4;
2888 if (iordr != 0 && i == 4) j = 2;
2894 firstStackNumberDrawn = -1;
2895 for (iv = 1; iv < nv; ++iv) {
2897 for (i = 1; i <= 4; ++i) {
2898 xyz[i*3 - 3] =
v[iv - 1]*cosphi[i - 1];
2899 xyz[i*3 - 2] =
v[iv - 1]*sinphi[i - 1];
2900 xyz[i*3 - 1] =
v[iv - 1]*costh[i - 1] / sinth[i - 1];
2901 xyz[(i + 4)*3 - 3] =
v[iv]*cosphi[i - 1];
2902 xyz[(i + 4)*3 - 2] =
v[iv]*sinphi[i - 1];
2903 xyz[(i + 4)*3 - 1] =
v[iv]*costh[i - 1] / sinth[i - 1];
2906 for (i = 1; i <= 4; ++i) {
2907 xyz[i*3 - 3] =
v[iv - 1]*sinth[i - 1]*cosphi[i - 1];
2908 xyz[i*3 - 2] =
v[iv - 1]*sinth[i - 1]*sinphi[i - 1];
2909 xyz[i*3 - 1] =
v[iv - 1]*costh[i - 1];
2910 xyz[(i + 4)*3 - 3] =
v[iv]*sinth[i - 1]*cosphi[i - 1];
2911 xyz[(i + 4)*3 - 2] =
v[iv]*sinth[i - 1]*sinphi[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;
2926 tface[0] =
tt[k1 + (iv << 2) - 5];
2927 tface[1] =
tt[k2 + (iv << 2) - 5];
2928 tface[2] =
tt[k2 + ((iv + 1) << 2) - 5];
2929 tface[3] =
tt[k1 + ((iv + 1) << 2) - 5];
2932 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2934 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
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];
2944 xyz[i*3 - 1] =
v[0]*costh[i - 1] / sinth[i - 1];
2946 xyz[i*3 - 3] =
v[0]*sinth[i - 1]*cosphi[i - 1];
2947 xyz[i*3 - 2] =
v[0]*sinth[i - 1]*sinphi[i - 1];
2948 xyz[i*3 - 1] =
v[0]*costh[i - 1];
2950 iface[i - 1] = 5 - i;
2951 tface[i - 1] =
tt[5 - i - 1];
2958 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2961 if (ivis[5] != 0 &&
v[nv - 1] > 0) {
2964 for (i = 1; i <= 4; ++i) {
2965 iface[i - 1] = i + 4;
2966 tface[i - 1] =
tt[i + 4 + 2*nv - 5];
2971 if ( nv > 2 && (
v[nv-1] ==
v[nv-2])) {
2972 for (iv = nv-1; iv>2; iv--) {
2973 if (
v[nv-1] ==
v[iv-1]) {
2980 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2986 if (ith == 0) ith = kth;
2987 if (ith > kth) ith = 1;
2988 if (ith != ith2)
goto L200;
2989 if (incrth == 0)
goto L500;
3000 if (iphi == 0) iphi = kphi;
3001 if (iphi > kphi) iphi = 1;
3002 if (iphi != iphi2)
goto L100;
3032 if (nl < 0)
goto L100;
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);
3060 s =
TMath::Sqrt(xscr*xscr + yscr*yscr + zscr*zscr);
3062 Error(
"LightSource",
"light source is placed at origin");
3067 fVls[nl*3 - 3] = xscr / s;
3068 fVls[nl*3 - 2] = yscr / s;
3069 fVls[nl*3 - 1] = zscr / s;
3073 if (
fYdl != 0)
return;
3074 for (i = 1; i <= 4; ++i) {
3075 if (
fYls[i - 1] != 0)
return;
3092 if (!view ||
fLoff)
return;
3101 s =
TMath::Sqrt(vn[0]*vn[0] + vn[1]*vn[1] + vn[2]*vn[2]);
3109 for (i = 1; i <= 4; ++i) {
3110 if (
fYls[i - 1] <= 0)
continue;
3111 vl[0] =
fVls[i*3 - 3];
3112 vl[1] =
fVls[i*3 - 2];
3113 vl[2] =
fVls[i*3 - 1];
3114 cosn = vl[0]*vn[0] + vl[1]*vn[1] + vl[2]*vn[2];
3115 if (cosn < 0)
continue;
3116 cosr = vn[1]*(vn[2]*vl[1] - vn[1]*vl[2]) - vn[0]*(vn[0]*vl[2]
3117 - vn[2]*vl[0]) + vn[2]*cosn;
3118 if (cosr <= 0) cosr = 0;
3144 x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
3145 x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
3146 y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
3147 y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
3149 Error(
"ModifyScreen",
"invalid TView in current pad");
3153 Error(
"ModifyScreen",
"no TView in current pad");
3167 if (i1 == i2)
return;
3170 dy = (
y2 -
y1) / (i2 - i1);
3171 for (i = i1; i <= i2 - 1; ++i) {
3172 yy1 =
y1 + dy*(i - i1);
3174 if (
fD[2*i - 2] > yy1)
fD[2*i - 2] = yy1;
3175 if (
fD[2*i - 1] > yy2)
fD[2*i - 1] = yy2;
3176 if (
fU[2*i - 2] < yy1)
fU[2*i - 2] = yy1;
3177 if (
fU[2*i - 1] < yy2)
fU[2*i - 1] = yy2;
3246 Int_t ivis[6], i, k, num;
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;
3295 phi = (phi1 + phi2) / (
float)2.;
3299 if ((zn <= 0 && iopt == 1) || (zn > 0 && iopt == 2)) ++k;
3316 static const char *where =
"Spectrum";
3323 if (nl == 0) {
fNlevel = 0;
return; }
3327 Error(where,
"fmax (%f) less than fmin (%f)", fmax, fmin);
3331 if (nl < 0 || nl > 256) {
3332 Error(where,
"illegal number of levels (%d)", nl);
3337 Error(where,
"initial color index is negative");
3342 Error(where,
"color index increment must be positive");
3347 const Int_t kMAXCOL = 50;
3348 delf = (fmax - fmin) / nl;
3350 for (i = 1; i <= nl+1; ++i) {
3372 Int_t iface[4] = { 1,2,3,4 };
3378 Error(
"SurfaceCartesian",
"no TView in current pad");
3385 Int_t incrx = (tnorm[8] < 0.) ? -1 : +1;
3386 Int_t incry = (tnorm[9] < 0.) ? -1 : +1;
3387 if (*chopt !=
'B' && *chopt !=
'b') {
3388 incrx = -incrx; incry = -incry;
3390 Int_t ix1 = (incrx == +1) ? 1 : nx;
3391 Int_t iy1 = (incry == +1) ? 1 : ny;
3392 Int_t ix2 = (incrx == +1) ? nx : 1;
3393 Int_t iy2 = (incry == +1) ? ny : 1;
3397 for (
Int_t iy = iy1; iy != iy2+incry; iy += incry) {
3398 for (
Int_t ix = ix1; ix != ix2+incrx; ix += incrx) {
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];
3439 static Int_t ixadd[4] = { 0,1,1,0 };
3440 static Int_t iyadd[4] = { 0,0,1,1 };
3445 Double_t xlab1l, xlab2l, ylab1l, ylab2l;
3446 Int_t i, ixa, iya, icx, ixt, iyt;
3479 for (i = 1; i <= 4; ++i) {
3500 f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3501 f[i*3 + 2] = (
f[i*3 + 2] - yval1l) / (yval2l - yval1l);
3503 f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3505 f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3506 f[i*3 + 2] = 360*(
f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l);
3508 f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3509 f[i*3 + 2] = (180 - dangle*2)*(
f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l) + dangle;
3532 t[i] =
f[i * 3 + 3];
3537 for (i = 1; i <= 4; ++i)
f[i * 3 + 3] =
fRmax[2];
3541 for (i = 1; i <= 4; ++i) {
3542 f[i*3 + 3] = (1 - rinrad)*((
f[i*3 + 3] -
Hparam.
zmin) /
3562 static Int_t iface[4] = { 1,2,3,4 };
3566 Error(
"SurfacePolar",
"no TView in current pad");
3570 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3572 Int_t i, j, incrr, ir1, ir2;
3574 Int_t ia, ib, ir, jr, nr, icodes[3];
3594 if (
fAphi.empty()) {
3595 Error(
"SurfacePolar",
"failed to allocate array fAphi[%d]",
fNaphi);
3600 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3605 if (iordr == 0) ia = nr;
3606 if (iordr != 0) ib = nr;
3607 for (i = 1; i <= nphi; ++i) {
3608 if (iordr == 0) ib = i;
3609 if (iordr != 0) ia = i;
3611 if (i == 1)
fAphi[0] =
f[jphi - 1];
3612 fAphi[i - 1] = (
fAphi[i - 1] +
f[jphi - 1]) / (
float)2.;
3623 if (iphi > nphi)
goto L300;
3626 if (iordr == 0) {ia = nr; ib = iphi;}
3627 else {ia = iphi;ib = nr;}
3630 phi =
kRad*((
f[jphi - 1] +
f[jphi + 5]) / 2);
3634 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
3640 for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
3641 if (iordr == 0) ia = ir;
3642 if (iordr != 0) ib = ir;
3645 for (i = 1; i <= 4; ++i) {
3647 if (iordr != 0 && i == 2) j = 4;
3648 if (iordr != 0 && i == 4) j = 2;
3651 xyz[j*3 - 1] =
f[i*3 - 1];
3652 ttt[j - 1] =
tt[i - 1];
3656 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3661 if (iphi == 0) iphi = kphi;
3662 if (iphi > kphi) iphi = 1;
3663 if (iphi != iphi2)
goto L100;
3664 if (incr == 0)
return;
3690 static Int_t iface[4] = { 1,2,3,4 };
3692 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3693 Int_t i, j, incrz, nz, iz1, iz2;
3694 Int_t ia, ib, iz, jz, icodes[3];
3703 Error(
"SurfaceCylindrical",
"no TView in current pad");
3722 if (
fAphi.empty()) {
3723 Error(
"SurfaceCylindrical",
"failed to allocate array fAphi[%d]",
fNaphi);
3728 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3733 if (iordr == 0) ia = nz;
3734 if (iordr != 0) ib = nz;
3735 for (i = 1; i <= nphi; ++i) {
3736 if (iordr == 0) ib = i;
3737 if (iordr != 0) ia = i;
3739 if (i == 1)
fAphi[0] =
f[jphi - 1];
3740 fAphi[i - 1] = (
fAphi[i - 1] +
f[jphi - 1]) / (
float)2.;
3749 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
3761 if (iphi > nphi)
goto L400;
3762 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
3763 if (iordr == 0) {ia = iz; ib = iphi;}
3764 else {ia = iphi; ib = iz;}
3766 for (i = 1; i <= 4; ++i) {
3768 if (iordr == 0 && i == 2) j = 4;
3769 if (iordr == 0 && i == 4) j = 2;
3772 xyz[j*3 - 1] =
f[jz + i*3 - 4];
3773 ttt[j - 1] =
tt[i - 1];
3777 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3782 if (iphi == 0) iphi = kphi;
3783 if (iphi > kphi) iphi = 1;
3784 if (iphi != iphi2)
goto L100;
3785 if (incr == 0)
return;
3810 static Int_t iface[4] = { 1,2,3,4 };
3812 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3813 Int_t i, j, incrth, ith, jth, kth, nth, mth, ith1, ith2;
3814 Int_t ia, ib, icodes[3];
3823 Error(
"SurfaceSpherical",
"no TView in current pad");
3842 if (
fAphi.empty()) {
3843 Error(
"SurfaceSpherical",
"failed to allocate array fAphi[%d]",
fNaphi);
3848 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3854 if (mth == 0) mth = 1;
3855 if (iordr == 0) ia = mth;
3856 if (iordr != 0) ib = mth;
3857 for (i = 1; i <= nphi; ++i) {
3858 if (iordr == 0) ib = i;
3859 if (iordr != 0) ia = i;
3861 if (i == 1)
fAphi[0] =
f[jphi - 1];
3862 fAphi[i - 1] = (
fAphi[i - 1] +
f[jphi - 1]) / (
float)2.;
3868 if (iordr == 0) ib = 1;
3869 if (iordr != 0) ia = 1;
3870 for (i = 1; i <= nth; ++i) {
3871 if (iordr == 0) ia = i;
3872 if (iordr != 0) ib = i;
3875 if (i == 1)
fAphi[0] =
f[jth - 1];
3876 fAphi[i - 1] = (
fAphi[i - 1] +
f[jth - 1]) / (
float)2.;
3887 if (iphi > nphi)
goto L500;
3890 if (iordr == 0) {ia = mth; ib = iphi;}
3891 else {ia = iphi;ib = mth;}
3894 phi = (
f[jphi - 1] +
f[jphi + 5]) / (
float)2.;
3899 if (ith > nth)
goto L400;
3900 if (iordr == 0) ia = ith;
3901 if (iordr != 0) ib = ith;
3905 for (i = 1; i <= 4; ++i) {
3907 if (iordr != 0 && i == 2) j = 4;
3908 if (iordr != 0 && i == 4) j = 2;
3913 ttt[j - 1] =
tt[i - 1];
3916 for (i = 1; i <= 4; ++i) {
3918 if (iordr != 0 && i == 2) j = 4;
3919 if (iordr != 0 && i == 4) j = 2;
3923 ttt[j - 1] =
tt[i - 1];
3928 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3932 if (ith == 0) ith = kth;
3933 if (ith > kth) ith = 1;
3934 if (ith != ith2)
goto L200;
3935 if (incrth == 0)
goto L500;
3946 if (iphi == 0) iphi = kphi;
3947 if (iphi > kphi) iphi = 1;
3948 if (iphi != iphi2)
goto L100;
3949 if (incr == 0)
return;
3974 if (qqa < 0 || qqa > 1 || qqd < 0 || qqd > 1 || qqs < 0 || qqs > 1 || nnqs < 1) {
3975 Error(
"SurfaceProperty",
"error in coefficients");
4004 Error(
"ImplicitFunction",
"no TF3 function provided");
4009 Int_t ix1, iy1, iz1;
4010 Int_t ix2, iy2, iz2;
4011 Int_t incr, incrx, incry, incrz;
4012 Int_t icodes[3], i, i1, i2, k, nnod, ntria;
4015 Double_t p[8][3], pf[8], pn[8][3], t[3], fsurf,
w;
4023 Error(
"ImplicitFunction",
"no TView in current pad");
4031 Double_t fgF3XClip = 0., fgF3YClip = 0., fgF3ZClip = 0.;
4034 fgF3Clipping =
kTRUE;
4035 fgF3XClip = clip[0];
4036 fgF3YClip = clip[1];
4037 fgF3ZClip = clip[2];
4041 if (*chopt ==
'B' || *chopt ==
'b') {
4050 if (tnorm[8] < 0.) incrx =-incrx;
4051 if (tnorm[9] < 0.) incry =-incry;
4052 if (tnorm[10] < 0.) incrz =-incrz;
4056 if (incrx == -1) ix1 = nx;
4057 if (incry == -1) iy1 = ny;
4058 if (incrz == -1) iz1 = nz;
4062 dx = (rmax[0]-rmin[0]) / nx;
4063 dy = (rmax[1]-rmin[1]) / ny;
4064 dz = (rmax[2]-rmin[2]) / nz;
4067 Float_t r=0.,
g=0.,
b=0., hue, light, satur, light2;
4077 light2 = 1-.5*light;
4088 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
4089 z1 = (iz-1)*dz + rmin[2];
4099 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
4100 y1 = (iy-1)*dy + rmin[1];
4123 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
4150 if (pf[0] >= -
kFdel)
goto L110;
4151 if (pf[1] >= -
kFdel)
goto L120;
4152 if (pf[2] >= -
kFdel)
goto L120;
4153 if (pf[3] >= -
kFdel)
goto L120;
4154 if (pf[4] >= -
kFdel)
goto L120;
4155 if (pf[5] >= -
kFdel)
goto L120;
4156 if (pf[6] >= -
kFdel)
goto L120;
4157 if (pf[7] >= -
kFdel)
goto L120;
4160 if (pf[1] < -
kFdel)
goto L120;
4161 if (pf[2] < -
kFdel)
goto L120;
4162 if (pf[3] < -
kFdel)
goto L120;
4163 if (pf[4] < -
kFdel)
goto L120;
4164 if (pf[5] < -
kFdel)
goto L120;
4165 if (pf[6] < -
kFdel)
goto L120;
4166 if (pf[7] < -
kFdel)
goto L120;
4181 pn[0][0] = (pf[1] - pf[0]) / dx;
4182 pn[3][0] = (pf[2] - pf[3]) / dx;
4183 pn[4][0] = (pf[5] - pf[4]) / dx;
4184 pn[7][0] = (pf[6] - pf[7]) / dx;
4186 pn[0][0] = (pf[1] - f3->
Eval(
x1-dx,
y1,z1)) / (dx + dx);
4187 pn[3][0] = (pf[2] - f3->
Eval(
x1-dx,
y2,z1)) / (dx + dx);
4188 pn[4][0] = (pf[5] - f3->
Eval(
x1-dx,
y1,z2)) / (dx + dx);
4189 pn[7][0] = (pf[6] - f3->
Eval(
x1-dx,
y2,z2)) / (dx + dx);
4192 pn[1][0] = (pf[1] - pf[0]) / dx;
4193 pn[2][0] = (pf[2] - pf[3]) / dx;
4194 pn[5][0] = (pf[5] - pf[4]) / dx;
4195 pn[6][0] = (pf[6] - pf[7]) / dx;
4197 pn[1][0] = (f3->
Eval(
x2+dx,
y1,z1) - pf[0]) / (dx + dx);
4198 pn[2][0] = (f3->
Eval(
x2+dx,
y2,z1) - pf[3]) / (dx + dx);
4199 pn[5][0] = (f3->
Eval(
x2+dx,
y1,z2) - pf[4]) / (dx + dx);
4200 pn[6][0] = (f3->
Eval(
x2+dx,
y2,z2) - pf[7]) / (dx + dx);
4204 pn[0][1] = (pf[3] - pf[0]) / dy;
4205 pn[1][1] = (pf[2] - pf[1]) / dy;
4206 pn[4][1] = (pf[7] - pf[4]) / dy;
4207 pn[5][1] = (pf[6] - pf[5]) / dy;
4209 pn[0][1] = (pf[3] - f3->
Eval(
x1,
y1-dy,z1)) / (dy + dy);
4210 pn[1][1] = (pf[2] - f3->
Eval(
x2,
y1-dy,z1)) / (dy + dy);
4211 pn[4][1] = (pf[7] - f3->
Eval(
x1,
y1-dy,z2)) / (dy + dy);
4212 pn[5][1] = (pf[6] - f3->
Eval(
x2,
y1-dy,z2)) / (dy + dy);
4215 pn[2][1] = (pf[2] - pf[1]) / dy;
4216 pn[3][1] = (pf[3] - pf[0]) / dy;
4217 pn[6][1] = (pf[6] - pf[5]) / dy;
4218 pn[7][1] = (pf[7] - pf[4]) / dy;
4220 pn[2][1] = (f3->
Eval(
x2,
y2+dy,z1) - pf[1]) / (dy + dy);
4221 pn[3][1] = (f3->
Eval(
x1,
y2+dy,z1) - pf[0]) / (dy + dy);
4222 pn[6][1] = (f3->
Eval(
x2,
y2+dy,z2) - pf[5]) / (dy + dy);
4223 pn[7][1] = (f3->
Eval(
x1,
y2+dy,z2) - pf[4]) / (dy + dy);
4227 pn[0][2] = (pf[4] - pf[0]) / dz;
4228 pn[1][2] = (pf[5] - pf[1]) / dz;
4229 pn[2][2] = (pf[6] - pf[2]) / dz;
4230 pn[3][2] = (pf[7] - pf[3]) / dz;
4232 pn[0][2] = (pf[4] - f3->
Eval(
x1,
y1,z1-dz)) / (dz + dz);
4233 pn[1][2] = (pf[5] - f3->
Eval(
x2,
y1,z1-dz)) / (dz + dz);
4234 pn[2][2] = (pf[6] - f3->
Eval(
x2,
y2,z1-dz)) / (dz + dz);
4235 pn[3][2] = (pf[7] - f3->
Eval(
x1,
y2,z1-dz)) / (dz + dz);
4238 pn[4][2] = (pf[4] - pf[0]) / dz;
4239 pn[5][2] = (pf[5] - pf[1]) / dz;
4240 pn[6][2] = (pf[6] - pf[2]) / dz;
4241 pn[7][2] = (pf[7] - pf[3]) / dz;
4243 pn[4][2] = (f3->
Eval(
x1,
y1,z2+dz) - pf[0]) / (dz + dz);
4244 pn[5][2] = (f3->
Eval(
x2,
y1,z2+dz) - pf[1]) / (dz + dz);
4245 pn[6][2] = (f3->
Eval(
x2,
y2,z2+dz) - pf[2]) / (dz + dz);
4246 pn[7][2] = (f3->
Eval(
x1,
y2,z2+dz) - pf[3]) / (dz + dz);
4249 MarchingCube(fsurf,
p, pf, pn, nnod, ntria, xyz, grad, itria);
4250 if (ntria == 0)
goto L510;
4252 for ( i=1 ; i<=nnod ; i++ ) {
4253 view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
4257 ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
4258 if (ntria == 0)
goto L510;
4260 if (*chopt ==
'B' || *chopt ==
'b') incr =-1;
4262 if (incr == -1) i1 = ntria;
4263 i2 = ntria - i1 + 1;
4266 if(
x2<=fgF3XClip && y2 <=fgF3YClip && z2>=fgF3ZClip)
goto L510;
4269 for (i=i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
4305 static Int_t irota[24][8] = { { 1,2,3,4,5,6,7,8 }, { 2,3,4,1,6,7,8,5 },
4306 { 3,4,1,2,7,8,5,6 }, { 4,1,2,3,8,5,6,7 },
4307 { 6,5,8,7,2,1,4,3 }, { 5,8,7,6,1,4,3,2 },
4308 { 8,7,6,5,4,3,2,1 }, { 7,6,5,8,3,2,1,4 },
4309 { 2,6,7,3,1,5,8,4 }, { 6,7,3,2,5,8,4,1 },
4310 { 7,3,2,6,8,4,1,5 }, { 3,2,6,7,4,1,5,8 },
4311 { 5,1,4,8,6,2,3,7 }, { 1,4,8,5,2,3,7,6 },
4312 { 4,8,5,1,3,7,6,2 }, { 8,5,1,4,7,6,2,3 },
4313 { 5,6,2,1,8,7,3,4 }, { 6,2,1,5,7,3,4,8 },
4314 { 2,1,5,6,3,4,8,7 }, { 1,5,6,2,4,8,7,3 },
4315 { 4,3,7,8,1,2,6,5 }, { 3,7,8,4,2,6,5,1 },
4316 { 7,8,4,3,6,5,1,2 }, { 8,4,3,7,5,1,2,6 } };
4318 static Int_t iwhat[21] = { 1,3,5,65,50,67,74,51,177,105,113,58,165,178,
4319 254,252,250,190,205,188,181 };
4320 Int_t j, i, i1, i2, i3, ir, irt=0, k, k1, k2, incr, icase=0,
n;
4327 for ( i=1; i<=8 ; i++) {
4328 fF8[i-1] =
f[i-1] - fiso;
4330 for ( ir=1 ; ir<=24 ; ir++ ) {
4333 for ( i=1 ; i<=8 ; i++ ) {
4334 if (
fF8[irota[ir-1][i-1]-1] >= 0.) k = k + incr;
4337 if (k==0 || k==255)
return;
4338 for ( i=1 ; i<=21 ; i++ ) {
4339 if (k != iwhat[i-1])
continue;
4348 for ( i=1 ; i<=8 ; i++ ) {
4349 k = irota[irt-1][i-1];
4350 fF8[i-1] =
f[k-1] - fiso;
4351 fP8[i-1][0] =
p[k-1][0];
4352 fP8[i-1][1] =
p[k-1][1];
4353 fP8[i-1][2] =
p[k-1][2];
4354 fG8[i-1][0] =
g[k-1][0];
4355 fG8[i-1][1] =
g[k-1][1];
4356 fG8[i-1][2] =
g[k-1][2];
4361 switch ((
int)icase) {
4364 MarchingCubeCase00(1, 4, 9, 0, 0, 0, nnod, ntria, xyz, grad, itria);
4368 MarchingCubeCase00(2, 4, 9, 10, 0, 0, nnod, ntria, xyz, grad, itria);
4380 MarchingCubeCase00(6, 2, 1, 9, 8, 0, nnod, ntria, xyz, grad, itria);
4391 MarchingCubeCase00(2, 4, 8, 6, 0, 0, nnod, ntria, xyz, grad, itria);
4394 MarchingCubeCase00(1, 4, 12, 7, 6, 10, nnod, ntria, xyz, grad, itria);
4400 MarchingCubeCase00(1, 4, 8, 7, 11, 10, nnod, ntria, xyz, grad, itria);
4409 MarchingCubeCase00(1, 9, 12, 7, 6, 2, nnod, ntria, xyz, grad, itria);
4415 if (ntria == 0)
return;
4416 if (icase <= 14)
goto L500;
4417 for ( i=1; i<=ntria ; i++ ) {
4421 if (itria[i-1][2] < 0) i1 =-i1;
4422 if (itria[i-1][1] < 0) i3 =-i3;
4423 if (itria[i-1][0] < 0) i2 =-i2;
4433 if (
n > ntria)
return;
4434 for ( i=1 ; i<=3 ; i++ ) {
4437 if (i2 == 4) i2 = 1;
4444 if (i3 == 0) i3 = 3;
4451 for ( i=1 ; i<=3 ; i++ ) {
4452 itr[i-1] = itria[
n-1][i-1];
4453 itria[
n-1][i-1] = itria[ntria-1][i-1];
4456 if (ntria == 0)
return;
4457 if (itr[i2-1]*itr[i3-1] > 0)
goto L510;
4460 if (itr[i2-1] < 0) {
4464 if (itr[i3-1] < 0) {
4468 for ( j=1 ; j<=ntria ; j++ ) {
4469 for ( i=1 ; i<=3 ; i++ ) {
4470 if (itria[j-1][i-1] != k2)
continue;
4473 if (i2 == k1) itria[j-1][i-1] =-itria[j-1][i-1];
4499 static Int_t it[4][4][3] = { { { 1,2, 3 }, { 0,0, 0 }, { 0,0, 0 }, { 0,0, 0 } },
4500 { { 1,2,-3 }, {-1,3, 4 }, { 0,0, 0 }, { 0,0, 0 } },
4501 { { 1,2,-3 }, {-1,3,-4 }, {-1,4, 5 }, { 0,0, 0 } },
4502 { { 1,2,-3 }, {-1,3,-4 }, {-4,6,-1 }, { 4,5,-6 } }
4504 Int_t it2[4][3], i, j;
4516 if (ie[5] == 0) nnod = 5;
4517 if (ie[4] == 0) nnod = 4;
4518 if (ie[3] == 0) nnod = 3;
4524 for ( i=0; i<3 ; i++) {
4525 for ( j=0; j<4 ; j++) {
4526 it2[j][i] = it[ntria-1][j][i];
4539 static Int_t ie[6] = { 4,9,1, 2,11,3 };
4540 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4541 static Int_t it2[4][3] = { { 1,2,-5 }, { -1,5,6 }, { 5,-2,4 }, { -4,2,3 } };
4549 if (f0>=0. &&
fF8[0]>=0.)
goto L100;
4550 if (f0<0. &&
fF8[0]<0.)
goto L100;
4568 static Int_t ie[6] = { 4,9,1, 7,11,6 };
4569 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4570 static Int_t it2[6][3] = { { 1,2,4 }, { 2,3,6 }, { 3,1,5 },
4571 { 4,5,1 }, { 5,6,3 }, { 6,4,2 } };
4598 static Int_t ie[7] = { 2,4,9,10, 6,7,11 };
4599 static Int_t it1[5][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 } };
4600 static Int_t it2[3][3] = { { 1,2,-3 }, { -1,3,4 }, { 5,6,7 } };
4601 static Int_t it3[7][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 },
4602 { 1,7,-5 }, { -1,5,4 } };
4610 if (f0>=0. &&
fF8[1]>=0.)
goto L100;
4611 if (f0<0. &&
fF8[1]<0.)
goto L100;
4640 static Int_t ie[9] = { 3,12,4, 1,10,2, 11,6,7 };
4641 static Int_t it[9][9][3] = {
4642 {{ 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}},
4643 {{ 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}},
4644 {{ 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}},
4645 {{-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}},
4646 {{ 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}},
4647 {{-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}},
4648 {{ 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}},
4649 {{ 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}},
4650 {{ -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}}
4653 Int_t it2[9][3], i, j;
4664 if (
f1>=0. &&
fF8[2] <0.) icase = icase + 1;
4665 if (
f1 <0. &&
fF8[2]>=0.) icase = icase + 1;
4666 if (f2>=0. &&
fF8[2] <0.) icase = icase + 2;
4667 if (f2 <0. &&
fF8[2]>=0.) icase = icase + 2;
4668 if (f3>=0. &&
fF8[2] <0.) icase = icase + 4;
4669 if (f3 <0. &&
fF8[2]>=0.) icase = icase + 4;
4672 switch ((
int)icase) {
4693 for ( i=0; i<3 ; i++) {
4694 for ( j=0; j<9 ; j++) {
4695 it2[j][i] = it[icase-1][j][i];
4705 if (irep != 2)
goto L400;
4712 for ( i=0; i<3 ; i++) {
4713 for ( j=0; j<9 ; j++) {
4714 it2[j][i] = it[icase-1][j][i];
4728 static Int_t ie[8] = { 1,3,12,9, 5,7,11,10 };
4729 static Int_t it[6][8][3] = {
4730 {{1,2,-3}, {-1,3,4}, {5,6,-7}, {-5,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4731 {{ 9,1,2}, { 9,2,3}, { 9,3,4}, { 9,4,5}, { 9,5,6}, { 9,6,7}, { 9,7,8}, { 9,8,1}},
4732 {{ 9,1,2}, { 9,4,1}, { 9,3,4}, { 9,6,3}, { 9,5,6}, { 9,8,5}, { 9,7,8}, { 9,2,7}},
4733 {{1,2,-7}, {-1,7,8}, {5,6,-3}, {-5,3,4}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4734 {{1,2,-7}, {-1,7,8}, {2,3,-6}, {-2,6,7}, {3,4,-5}, {-3,5,6}, {4,1,-8}, {-4,8,5}},
4735 {{1,2,-3}, {-1,3,4}, {2,7,-6}, {-2,6,3}, {7,8,-5}, {-7,5,6}, {8,1,-4}, {-8,4,5}}
4737 Int_t it2[8][3], i, j;
4747 if (
f1 >= 0.) icase = icase + 1;
4748 if (f2 >= 0.) icase = icase + 2;
4749 if (icase==1 || icase==4)
goto L100;
4755 for ( i=0; i<3 ; i++) {
4756 for ( j=0; j<8 ; j++) {
4757 it2[j][i] = it[icase-1][j][i];
4768 if (irep == 0)
goto L200;
4771 if (icase == 1) icase = 5;
4772 if (icase == 4) icase = 6;
4777 for ( i=0; i<3 ; i++) {
4778 for ( j=0; j<8 ; j++) {
4779 it2[j][i] = it[icase-1][j][i];
4793 static Int_t ie[8] = { 3,12,4, 1,9,8,6,2 };
4794 static Int_t it[6][8][3] = {
4795 {{ 1,2,3}, {4,5,-6}, {-4,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4796 {{-9,1,2}, {9,2,-3}, {-9,3,4}, {9,4,-5}, {-9,5,6}, {9,6,-7}, {-9,7,8}, {9,8,-1}},
4797 {{9,1,-2}, {-9,2,6}, {9,6,-7}, {-9,7,8}, {9,8,-4}, {-9,4,5}, {9,5,-3}, {-9,3,1}},
4798 {{ 3,4,5}, {1,2,-6}, {-1,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4799 {{ 7,8,6}, {6,8,-1}, {-6,1,2}, {3,1,-8}, {-3,8,4}, { 3,4,5}, {3,5,-6}, {-3,6,2}},
4800 {{ 7,8,6}, {6,8,-4}, {-6,4,5}, {3,4,-8}, {-3,8,1}, { 3,1,2}, {3,2,-6}, {-3,6,5}}
4802 Int_t it2[8][3], i, j;
4812 if (
f1 >= 0.) icase = icase + 1;
4813 if (f2 >= 0.) icase = icase + 2;
4814 if (icase==1 || icase==4)
goto L100;
4820 for ( i=0; i<3 ; i++) {
4821 for ( j=0; j<8 ; j++) {
4822 it2[j][i] = it[icase-1][j][i];
4833 if (irep != 1)
goto L200;
4836 if (icase == 1) icase = 5;
4837 if (icase == 4) icase = 6;
4842 for ( i=0; i<3 ; i++) {
4843 for ( j=0; j<8 ; j++) {
4844 it2[j][i] = it[icase-1][j][i];
4858 Int_t nr, nf, i, k, incr,
n, kr, icase, irep;
4859 static Int_t irota[12][8] = {
4860 {1,2,3,4,5,6,7,8}, {1,5,6,2,4,8,7,3}, {1,4,8,5,2,3,7,6},
4861 {3,7,8,4,2,6,5,1}, {3,2,6,7,4,1,5,8}, {3,4,1,2,7,8,5,6},
4862 {6,7,3,2,5,8,4,1}, {6,5,8,7,2,1,4,3}, {6,2,1,5,7,3,4,8},
4863 {8,4,3,7,5,1,2,6}, {8,5,1,4,7,6,2,3}, {8,7,6,5,4,3,2,1} };
4864 static Int_t iwhat[8] = { 63,62,54,26,50,9,1,0 };
4865 static Int_t ie[12] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
4866 static Int_t iface[6][4] = {
4867 {1,2,3,4}, {5,6,7,8}, {1,2,6,5}, {2,6,7,3}, {4,3,7,8}, {1,5,8,4} };
4868 static Int_t it1[4][3] = { {1,2,10}, {9,5,8}, {6,11,7}, {3,4,12} };
4869 static Int_t it2[4][3] = { {5,6,10}, {1,4,9}, {2,11,3}, {7,8,12} };
4870 static Int_t it3[6][3] = { {10,12,-3}, {-10,3,2}, {12,10,-1}, {-12,1,4},
4871 {9,5,8}, {6,11,7} };
4872 static Int_t it4[6][3] = { {11,9,-1}, {-11,1,2}, {9,11,-3}, {-9,3,4},
4873 {5,6,10}, {7,8,12} };
4874 static Int_t it5[10][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
4875 {13,10,1}, {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2}, {5,8,9} };
4876 static Int_t it6[10][3] = { {13,2,-10}, {-13,10,5}, {13,5,-6}, {-13,6,11},
4877 {13,11,3}, {13,3,-4}, {-13,4,9}, {13,9,-1}, {-13,1,2}, {12,7,8} };
4878 static Int_t it7[12][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
4879 {13,10,-5}, {-13,5,8}, {13,8,-9}, {-13,9,1},
4880 {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2} };
4881 static Int_t it8[6][3] = { {3,8,12}, {3,-2,-8}, {-2,5,-8}, {2,10,-5},
4882 {7,6,11}, {1,4,9} };
4883 static Int_t it9[10][3] = { {7,12,-3}, {-7,3,11}, {11,3,2}, {6,11,-2}, {-6,2,10},
4884 {6,10,5}, {7,6,-5}, {-7,5,8}, {7,8,12}, {1,4,9} };
4885 static Int_t it10[10][3] = { {9,1,-10}, {-9,10,5}, {9,5,8}, {4,9,-8}, {-4,8,12},
4886 {4,12,3}, {1,4,-3}, {-1,3,2}, {1,2,10}, {7,6,11} };
4892 for ( nr=1 ; nr<=12 ; nr++ ) {
4895 for ( nf=1 ; nf<=6 ; nf++ ) {
4896 f1 =
fF8[irota[nr-1][iface[nf-1][0]-1]-1];
4897 f2 =
fF8[irota[nr-1][iface[nf-1][1]-1]-1];
4898 f3 =
fF8[irota[nr-1][iface[nf-1][2]-1]-1];
4899 f4 =
fF8[irota[nr-1][iface[nf-1][3]-1]-1];
4900 if ((
f1*f3-f2*f4)/(
f1+f3-f2-f4) >= 0.) k = k + incr;
4903 for ( i=1 ; i<=8 ; i++ ) {
4904 if (k != iwhat[i-1])
continue;
4910 Error(
"MarchingCubeCase13",
"configuration is not found");
4915 if (icase==1 || icase==8)
goto L300;
4916 for (
n=1 ;
n<=8 ;
n++) {
4917 k = irota[kr-1][
n-1];
4919 for ( i=1 ; i<=3 ; i++ ) {
4920 xyz[
n-1][i-1] =
fP8[k-1][i-1];
4921 grad[
n-1][i-1] =
fG8[k-1][i-1];
4924 for (
n=1 ;
n<=8 ;
n++ ) {
4926 for ( i=1 ; i<=3 ; i++ ) {
4927 fP8[
n-1][i-1] = xyz[
n-1][i-1];
4928 fG8[
n-1][i-1] = grad[
n-1][i-1];
4938 switch ((
int)icase) {
4959 &xyz[nnod-1][0], &grad[nnod-1][0]);
4966 &xyz[nnod-1][0], &grad[nnod-1][0]);
4973 &xyz[nnod-1][0], &grad[nnod-1][0]);
4980 switch ((
int)(irep+1)) {
5009 for (
n=1 ;
n<=ntria ;
n++ ) {
5010 for ( i=1 ; i<=3 ; i++ ) {
5012 itria[
n-1][i-1] = k;
5036 for ( i=1 ; i<=3 ; i++ ) {
5040 for (
n=1 ;
n<=nnod ;
n++ ) {
5043 for ( i=1 ; i<=3 ; i++ ) {
5044 p[i-1] =
p[i-1] + xyz[k-1][i-1];
5045 g[i-1] =
g[i-1] + grad[k-1][i-1];
5048 for ( i=1 ; i<=3 ; i++ ) {
5049 pxyz[i-1] =
p[i-1] / nnod;
5050 pgrad[i-1] =
g[i-1] / nnod;
5072 a = (a11-a01)*(b00-b10) - (a00-a10)*(b11-b01);
5073 if (
a == 0.)
return;
5074 b = a01*(b00-b10)-(a11-a01)*b00-(a00-a10)*b01+a00*(b11-b01);
5075 c = a00*b01 - a01*b00;
5077 if (
d <= 0.)
return;
5080 s1 = (-
b+
d) / (2*
a);
5081 if (s1<0. || s1>1.)
return;
5083 s2 = (-
b-
d) / (2*
a);
5084 if (s2<0. || s2>1.)
return;
5088 if (a00 >= 0) iposa = iposa + 1;
5089 if (a01 >= 0) iposa = iposa + 2;
5090 if (a10 >= 0) iposa = iposa + 4;
5091 if (a11 >= 0) iposa = iposa + 8;
5092 if (iposa==6 || iposa==9)
goto L100;
5098 s0 = (a00-a01) / (a00+a11-a10-a01);
5099 if (
s1>=
s0 && s2<
s0)
return;
5100 if (s1<s0 && s2>=
s0)
return;
5102 if (
s1 >=
s0) irep = 2;
5106 if (b00 >= 0) iposb = iposb + 1;
5107 if (b01 >= 0) iposb = iposb + 2;
5108 if (b10 >= 0) iposb = iposb + 4;
5109 if (b11 >= 0) iposb = iposb + 8;
5110 if (iposb!=6 && iposb!=9)
return;
5111 s0 = (b00-b01) / (b00+b11-b10-b01);
5112 if (iposa != iposb)
goto L200;
5114 if (irep==1 &&
s1>
s0)
return;
5115 if (irep==2 &&
s1<
s0)
return;
5120 if (irep==1 &&
s1<
s0)
return;
5121 if (irep==2 &&
s1>
s0)
return;
5140 static Int_t iedge[12][2] = {
5141 {1,2}, {2,3}, {3,4}, {4,1}, {5,6}, {6,7}, {7,8}, {8,5}, {1,5}, {2,6}, {3,7}, {4,8} };
5143 for (
n=1 ;
n<=nnod ;
n++ ) {
5149 for ( i=1 ; i<=3 ; i++ ) {
5150 xyz[
n-1][i-1] = (
fP8[n2-1][i-1]-
fP8[n1-1][i-1])*t +
fP8[n1-1][i-1];
5151 grad[
n-1][i-1] = (
fG8[n2-1][i-1]-
fG8[n1-1][i-1])*t +
fG8[n1-1][i-1];
5172 Int_t n, nf, i1, i2, i3, i, icur, k, itst, kface, kf, irep;
5182 for (
n=1 ;
n<=nface ;
n++ ) {
5206 for ( i=1 ; i<=3 ; i++ ) {
5207 wmin = xyz[i1-1][i-1];
5208 wmax = xyz[i1-1][i-1];
5209 if (
wmin > xyz[i2-1][i-1])
wmin = xyz[i2-1][i-1];
5210 if (
wmax < xyz[i2-1][i-1])
wmax = xyz[i2-1][i-1];
5211 if (
wmin > xyz[i3-1][i-1])
wmin = xyz[i3-1][i-1];
5212 if (
wmax < xyz[i3-1][i-1])
wmax = xyz[i3-1][i-1];
5213 dface[
n-1][i-1] =
wmin;
5214 dface[
n-1][i+2] =
wmax;
5217 for ( i=1 ; i<=3 ; i++ ) {
5218 v[0][i-1] = xyz[i2-1][i-1] - xyz[i1-1][i-1];
5219 v[1][i-1] = xyz[i3-1][i-1] - xyz[i2-1][i-1];
5221 a = (
v[0][1]*
v[1][2] -
v[0][2]*
v[1][1]);
5222 b = (
v[0][2]*
v[1][0] -
v[0][0]*
v[1][2]);
5223 c = (
v[0][0]*
v[1][1] -
v[0][1]*
v[1][0]);
5232 abcd[
n-1][3] =-(
a*xyz[i1-1][0] +
b*xyz[i1-1][1] +
c*xyz[i1-1][2]);
5235 if (nf <= 1)
return;
5238 for ( icur=2 ; icur<=nface ; icur++ ) {
5240 zcur = dface[k-1][2];
5241 for ( itst=icur-1 ; itst>=1 ; itst-- ) {
5243 if (zcur < dface[k-1][2])
break;
5245 iorder[itst-1] = iorder[itst];
5253 if (kface == 1)
goto L900;
5254 nf = iorder[kface-1];
5255 if (nf < 0) nf =-nf;
5256 abcdn[0] = abcd[nf-1][0];
5257 abcdn[1] = abcd[nf-1][1];
5258 abcdn[2] = abcd[nf-1][2];
5259 abcdn[3] = abcd[nf-1][3];
5265 for ( k=kface-1 ; k>=1 ; k-- ) {
5267 if (kf < 0) kf =-kf;
5268 if (dface[nf-1][5] > dface[kf-1][2]+
kDel)
goto L400;
5269 if (iorder[k-1] > 0)
goto L900;
5274 if (dface[kf-1][0] >= dface[nf-1][3]-
kDel)
goto L800;
5275 if (dface[kf-1][3] <= dface[nf-1][0]+
kDel)
goto L800;
5276 if (dface[kf-1][1] >= dface[nf-1][4]-
kDel)
goto L800;
5277 if (dface[kf-1][4] <= dface[nf-1][1]+
kDel)
goto L800;
5283 if (abcdn[0]*xyz[kk[0]-1][0]+abcdn[1]*xyz[kk[0]-1][1]+
5284 abcdn[2]*xyz[kk[0]-1][2]+abcdn[3] < -
kDel)
goto L500;
5285 if (abcdn[0]*xyz[kk[1]-1][0]+abcdn[1]*xyz[kk[1]-1][1]+
5286 abcdn[2]*xyz[kk[1]-1][2]+abcdn[3] < -
kDel)
goto L500;
5287 if (abcdn[0]*xyz[kk[2]-1][0]+abcdn[1]*xyz[kk[2]-1][1]+
5288 abcdn[2]*xyz[kk[2]-1][2]+abcdn[3] < -
kDel)
goto L500;
5293 abcdk[0] = abcd[kf-1][0];
5294 abcdk[1] = abcd[kf-1][1];
5295 abcdk[2] = abcd[kf-1][2];
5296 abcdk[3] = abcd[kf-1][3];
5297 if (abcdk[0]*xyz[nn[0]-1][0]+abcdk[1]*xyz[nn[0]-1][1]+
5298 abcdk[2]*xyz[nn[0]-1][2]+abcdk[3] >
kDel)
goto L600;
5299 if (abcdk[0]*xyz[nn[1]-1][0]+abcdk[1]*xyz[nn[1]-1][1]+
5300 abcdk[2]*xyz[nn[1]-1][2]+abcdk[3] >
kDel)
goto L600;
5301 if (abcdk[0]*xyz[nn[2]-1][0]+abcdk[1]*xyz[nn[2]-1][1]+
5302 abcdk[2]*xyz[nn[2]-1][2]+abcdk[3] >
kDel)
goto L600;
5308 for ( i=1 ; i<=3 ; i++ ) {
5311 if (i != 3) i2 = kk[i];
5313 if ( irep<0 )
goto L700;
5314 if ( irep==0 )
continue;
5315 if ( irep>0 )
goto L800;
5318 for ( i=1 ; i<=3 ; i++ ) {
5321 if (i != 3) i2 = nn[i];
5323 if ( irep<0 )
goto L800;
5324 if ( irep==0 )
continue;
5325 if ( irep>0 )
goto L700;
5332 for ( i=k+1 ; i<=kface ; i++ ) {
5333 iorder[i-2] = iorder[i-1];
5335 iorder[kface-1] =-kf;
5336 if (kf > 0)
goto L300;
5344 if (iorder[kface-1] < 0) iorder[kface-1] =-iorder[kface-1];
5346 if (kface > 0)
goto L300;
5364 Int_t k, k1, k2, ixy, i;
5365 Double_t a,
b,
c, d1, d2, dd,
xy, tmin, tmax, tmid,
x,
y, z;
5371 delta[0] = xyz[i2-1][0] - xyz[i1-1][0];
5372 delta[1] = xyz[i2-1][1] - xyz[i1-1][1];
5373 delta[2] = xyz[i2-1][2] - xyz[i1-1][2];
5379 c =-(
a*xyz[i1-1][0] +
b*xyz[i1-1][1]);
5380 d[0] =
a*xyz[iface[0]-1][0] +
b*xyz[iface[0]-1][1] +
c;
5381 d[1] =
a*xyz[iface[1]-1][0] +
b*xyz[iface[1]-1][1] +
c;
5382 d[2] =
a*xyz[iface[2]-1][0] +
b*xyz[iface[2]-1][1] +
c;
5384 for ( i=1 ; i<=3 ; i++ ) {
5388 if (
d[k1-1]>=0. &&
d[k2-1]>=0.)
continue;
5389 if (
d[k1-1] <0. &&
d[k2-1] <0.)
continue;
5390 d1 =
d[k1-1] / (
d[k1-1] -
d[k2-1]);
5391 d2 =
d[k2-1] / (
d[k1-1] -
d[k2-1]);
5392 xy = d1*xyz[iface[k2-1]-1][ixy-1] - d2*xyz[iface[k1-1]-1][ixy-1];
5394 t[k-1] = (
xy-xyz[i1-1][ixy-1]) / delta[ixy-1];
5395 if (k == 2)
goto L200;
5403 if (tmin>1. || tmax<0)
return;
5404 if (tmin < 0.) tmin = 0.;
5405 if (tmax > 1.) tmax = 1.;
5406 tmid = (tmin + tmax) / 2.;
5407 x = delta[0]*tmid + xyz[i1-1][0];
5408 y = delta[1]*tmid + xyz[i1-1][1];
5409 z = delta[2]*tmid + xyz[i1-1][2];
5410 dd = abcd[0]*
x + abcd[1]*
y + abcd[2]*z + abcd[3];
5411 if (dd >
del)
goto L997;
5412 if (dd <-
del)
goto L998;
5444 Double_t p0[3], p1[3], p2[3], p3[3], t[3];
5447 Int_t i, i1, i2, j, ibase, nnod, knod, ntria, ktria, iopt, iready;
5448 Int_t ixcrit, iycrit, izcrit, incrx, incry, incrz, incr;
5449 Int_t ix, ix1=0, ix2=0, iy, iy1=0, iy2=0, iz, iz1=0, iz2=0, k, kx, ky, kz, isurf, nsurf;
5455 static Int_t ind[8][3] = { { 0,0,0 }, { 1,0,0 }, { 1,0,1 }, { 0,0,1 },
5456 { 0,1,0 }, { 1,1,0 }, { 1,1,1 }, { 0,1,1 } };
5465 Error(
"ImplicitFunction",
"no TView in current pad");
5470 if (nsurf >
kNiso) {
5471 Warning(
"IsoSurface",
"Number of iso-surfaces too large. Increase kNiso");
5474 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
5498 if (p1[2] < p0[2]) ixcrit = 1;
5499 if (p2[2] < p0[2]) iycrit = 1;
5500 if (p3[2] < p0[2]) izcrit = 1;
5509 if (iopt == 1) iz1 = 1;
5510 if (iopt == 1) iz2 = izcrit-1;
5511 if (iopt == 2) iz1 = izcrit;
5512 if (iopt == 2) iz2 = nz - 1;
5514 if (iopt == 1) iz1 = nz - 1;
5515 if (iopt == 1) iz2 = izcrit;
5516 if (iopt == 2) iz1 = izcrit-1;
5517 if (iopt == 2) iz2 = 1;
5519 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
5522 if (iopt == 1) iy1 = 1;
5523 if (iopt == 1) iy2 = iycrit-1;
5524 if (iopt == 2) iy1 = iycrit;
5525 if (iopt == 2) iy2 = ny - 1;
5527 if (iopt == 1) iy1 = ny - 1;
5528 if (iopt == 1) iy2 = iycrit;
5529 if (iopt == 2) iy1 = iycrit-1;
5530 if (iopt == 2) iy2 = 1;
5532 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
5535 if (iopt == 1) ix1 = 1;
5536 if (iopt == 1) ix2 = ixcrit-1;
5537 if (iopt == 2) ix1 = ixcrit;
5538 if (iopt == 2) ix2 = nx - 1;
5540 if (iopt == 1) ix1 = nx - 1;
5541 if (iopt == 1) ix2 = ixcrit;
5542 if (iopt == 2) ix1 = ixcrit-1;
5543 if (iopt == 2) ix2 = 1;
5545 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
5549 for ( isurf=1 ; isurf<=nsurf ; isurf++ ) {
5587 if (iready !=0)
goto L310;
5589 for ( i=1 ; i<=8 ; i++ ) {
5590 kx = ix + ind[i-1][0];
5591 ky = iy + ind[i-1][1];
5592 kz = iz + ind[i-1][2];
5593 p[i-1][0] =
x[kx-1];
5594 p[i-1][1] =
y[ky-1];
5595 p[i-1][2] = z[kz-1];
5602 }
else if (kx == nx) {
5607 d1 =
x[kx-1] -
x[kx-2];
5608 d2 =
x[kx] -
x[kx-1];
5618 pn[i-1][0] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5626 }
else if (ky == ny) {
5631 d1 =
y[ky-1] -
y[ky-2];
5632 d2 =
y[ky] -
y[ky-1];
5642 pn[i-1][1] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5650 }
else if (kz == nz) {
5655 d1 = z[kz-1] - z[kz-2];
5656 d2 = z[kz] - z[kz-1];
5666 pn[i-1][2] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5677 xyz_tmp, grad_tmp, itria_tmp);
5679 for(
l=0 ;
l<knod ;
l++) {
5680 xyz[nnod+
l][0] = xyz_tmp[
l][0];
5681 xyz[nnod+
l][1] = xyz_tmp[
l][1];
5682 xyz[nnod+
l][2] = xyz_tmp[
l][2];
5683 grad[nnod+
l][0] = grad_tmp[
l][0];
5684 grad[nnod+
l][1] = grad_tmp[
l][1];
5685 grad[nnod+
l][2] = grad_tmp[
l][2];
5687 for(
l=0 ;
l<ktria ;
l++) {
5688 itria[ntria+
l][0] = itria_tmp[
l][0];
5689 itria[ntria+
l][1] = itria_tmp[
l][1];
5690 itria[ntria+
l][2] = itria_tmp[
l][2];
5693 for ( i=ntria+1 ; i<=ntria+ktria ; i++ ) {
5694 for ( j=1 ; j<=3 ; j++ ){
5696 if (itria[i-1][j-1] < 0) ibase =-nnod;
5697 itria[i-1][j-1] = itria[i-1][j-1] + ibase;
5702 ntria = ntria + ktria;
5706 if (ntria == 0)
continue;
5707 for ( i=1 ; i<=nnod ; i++ ) {
5708 view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
5712 ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
5713 if (ntria == 0)
continue;
5715 if (iopt == 1) incr = -1;
5717 if (incr == -1) i1 = ntria;
5718 i2 = ntria - i1 + 1;
5719 for (i = i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
5724 icodes[0] = iattr[k-1];
5725 icodes[1] = iattr[k-1];
5726 icodes[2] = iattr[k-1];
5731 if (incrx < 0)
goto L130;
5734 if (incry < 0)
goto L120;
5737 if (incrz < 0)
goto L110;
5753 Error(
"ImplicitFunction",
"no TView in current pad");
5760 for ( i=1 ; i<=
np ; i++) {
5763 view->
WCtoNDC(&xyz[k-1][0], &p3[i-1][0]);
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.
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
Initialize this color and its associated colors.
static void RGBtoHLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
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 from Ernst-Jan Buis.
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 from Ernst-Jan Buis.
static Int_t ProjectMercator2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
Bool_t IsInside(Int_t x, Int_t y) override
Return kTRUE if the cell ix, iy is inside one of the graphical cuts.
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.