115 for (i=0;i<3;i++) {
fRmin[i] = 0;
fRmax[i] = 1; }
116 for (i=0;i<4;i++) {
fYls[i] = 0; }
118 for (i=0;i<30;i++) {
fJmask[i] = 0; }
120 for (i=0;i<465;i++) {
fMask[i] = 0; }
122 for (i=0;i<1200;i++) {
fPlines[i] = 0.; }
123 for (i=0;i<200;i++) {
fT[i] = 0.; }
125 for (i=0;i<12;i++) {
fVls[i] = 0.; }
126 for (i=0;i<257;i++) {
fFunLevel[i] = 0.; }
127 for (i=0;i<183;i++) {
fAphi[i] = 0.; }
128 for (i=0;i<8;i++) {
fF8[i] = 0.; }
198 for (i=0;i<3;i++) {
fRmin[i] = rmin[i];
fRmax[i] = rmax[i]; }
199 for (i=0;i<4;i++) {
fYls[i] = 0; }
201 for (i=0;i<30;i++) {
fJmask[i] = 0; }
203 for (i=0;i<465;i++) {
fMask[i] = 0; }
205 for (i=0;i<1200;i++) {
fPlines[i] = 0.; }
206 for (i=0;i<200;i++) {
fT[i] = 0.; }
208 for (i=0;i<12;i++) {
fVls[i] = 0.; }
209 for (i=0;i<257;i++) {
fFunLevel[i] = 0.; }
210 for (i=0;i<183;i++) {
fAphi[i] = 0.; }
211 for (i=0;i<8;i++) {
fF8[i] = 0.; }
267 static Int_t iface1[4] = { 1, 4, 8, 5 };
268 static Int_t iface2[4] = { 4, 3, 7, 8 };
273 Error(
"BackBox",
"no TView in current pad");
279 Int_t ix1, ix2, iy1, iy2, iz1, iz2;
282 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
283 for (
Int_t i = 0; i < 8; ++i) {
284 r[i*3 + 0] = av[i*3 + 0] + av[i*3 + 1]*cosa;
285 r[i*3 + 1] = av[i*3 + 1]*sina;
286 r[i*3 + 2] = av[i*3 + 2];
290 Int_t icodes[3] = { 0, 0, 0 };
292 tt[0] = r[(iface1[0]-1)*3 + 2];
293 tt[1] = r[(iface1[1]-1)*3 + 2];
294 tt[2] = r[(iface1[2]-1)*3 + 2];
295 tt[3] = r[(iface1[3]-1)*3 + 2];
296 (this->*
fDrawFace)(icodes, r, 4, iface1, tt);
297 tt[0] = r[(iface2[0]-1)*3 + 2];
298 tt[1] = r[(iface2[1]-1)*3 + 2];
299 tt[2] = r[(iface2[2]-1)*3 + 2];
300 tt[3] = r[(iface2[3]-1)*3 + 2];
301 (this->*
fDrawFace)(icodes, r, 4, iface2, tt);
311 static Int_t iface1[4] = { 1, 2, 6, 5 };
312 static Int_t iface2[4] = { 2, 3, 7, 6 };
317 Error(
"FrontBox",
"no TView in current pad");
323 Int_t ix1, ix2, iy1, iy2, iz1, iz2;
326 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
327 for (
Int_t i = 0; i < 8; ++i) {
328 r[i*3 + 0] = av[i*3 + 0] + av[i*3 + 1]*cosa;
329 r[i*3 + 1] = av[i*3 + 1]*sina;
330 r[i*3 + 2] = av[i*3 + 2];
331 view->
WCtoNDC(&r[i*3],&r[i*3]);
339 for (
Int_t i = 0; i < 4; ++i) {
340 Int_t k = iface1[i] - 1;
344 gPad->PaintPolyLine(4, x, y);
345 for (
Int_t i = 0; i < 4; ++i) {
346 Int_t k = iface2[i] - 1;
350 gPad->PaintPolyLine(4, x, y);
374 static const char *where =
"ColorFunction";
383 if (nl < 0 || nl > 256) {
384 Error(where,
"illegal number of levels (%d)", nl);
389 for (
Int_t i = 1; i < nl; ++i) {
390 if (fl[i] <= fl[i - 1]) {
397 for (
Int_t i = 0; i < nl; ++i) {
420 Error(
"GridLevels",
"no TView in current pad");
426 Double_t binLow = 0, binHigh = 0, binWidth = 0;
429 if (!rmin || !rmax)
return;
432 binLow, binHigh, nbins, binWidth,
" ");
437 binWidth = (binHigh - binLow)/nbins;
465 for (
Int_t i = 0; i < np; ++i) {
467 if (k < 0) { k = -k; ifneg =
true; }
469 x[i] =
p3[0];
y[i] =
p3[1];
471 x[np] = x[0];
y[np] =
y[0];
475 for (
Int_t i = 0; i < np; ++i) {
476 z +=
y[i]*x[i+1] - x[i]*
y[i+1];
483 gPad->PaintFillArea(np, x,
y);
489 for (
Int_t i = 0; i < np; ++i) {
490 if (iface[i] > 0)
gPad->PaintPolyLine(2, &x[i], &
y[i]);
493 gPad->PaintPolyLine(np+1, x,
y);
514 for (
Int_t i = 0; i < np; ++i) {
517 x[i] =
p3[i*3+0];
y[i] =
p3[i*3+1];
519 x[np] = x[0];
y[np] =
y[0];
527 Double_t ttt[5] = { t[0], t[1], t[2], t[3], t[0] };
528 for (
Int_t i = 0; i<3; ++i) {
p3[3*4+i] =
p3[i]; }
529 Int_t k1 = 0, k2 = 2;
530 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]);
531 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]);
532 if (z1 > z2) { k1 = 2; k2 = 0; }
535 gPad->PaintPolyLine(3, &x[k1], &
y[k1]);
539 gPad->PaintPolyLine(3, &x[k2], &
y[k2]);
541 x[1] = x[2];
y[1] =
y[2];
542 gPad->PaintPolyLine(2, &x[0], &
y[0]);
548 gPad->PaintPolyLine(np+1, x,
y);
570 for (
Int_t i = 0; i < np; ++i) {
573 x[i] =
p3[0];
y[i] =
p3[1];
575 x[np] = x[0];
y[np] =
y[0];
581 if (icodes[3] == 1) icol =
fColorMain[icodes[2] - 1];
582 if (icodes[3] == 2) icol =
fColorDark[icodes[2] - 1];
583 if (icodes[3] == 3) icol =
fColorMain[icodes[2] - 1];
584 if (icodes[3] == 4) icol =
fColorDark[icodes[2] - 1];
588 gPad->PaintFillArea(np, x,
y);
596 gPad->PaintPolyLine(np+1, x,
y);
618 for (
Int_t i = 0; i < np; ++i) {
620 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
621 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
622 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
631 if (icodes[2] == 0) {
645 for (
Int_t it = 0; it <
fNT; ++it) {
646 x[0] = p1[0] + xdel*
fT[2*it + 0];
647 y[0] = p1[1] + ydel*fT[2*it + 0];
648 x[1] = p1[0] + xdel*fT[2*it + 1];
649 y[1] = p1[1] + ydel*fT[2*it + 1];
650 gPad->PaintPolyLine(2, x, y);
655 if (icodes[2] == 0) {
665 for (
Int_t i = 0; i < np; ++i) {
667 Int_t i2 = (i == np-1) ? 0 : i + 1;
673 for (
Int_t it = 0; it <
fNT; ++it) {
674 x[0] = p1[0] + xdel*
fT[2*it + 0];
675 y[0] = p1[1] + ydel*fT[2*it + 0];
676 x[1] = p1[0] + xdel*fT[2*it + 1];
677 y[1] = p1[1] + ydel*fT[2*it + 1];
678 gPad->PaintPolyLine(2, x, y);
683 for (
Int_t i = 0; i < np; ++i) {
685 Int_t i2 = (i == np-1) ? 0 : i + 1;
707 for (
Int_t i = 0; i < np; ++i) {
709 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
710 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
711 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
716 if (icodes[2] == 0) {
726 for (
Int_t i = 0; i < np; ++i) {
728 Int_t i2 = (i == np-1) ? 0 : i + 1;
734 for (
Int_t it = 0; it <
fNT; ++it) {
735 x[0] = p1[0] + xdel*
fT[2*it + 0];
736 y[0] = p1[1] + ydel*fT[2*it + 0];
737 x[1] = p1[0] + xdel*fT[2*it + 1];
738 y[1] = p1[1] + ydel*fT[2*it + 1];
739 gPad->PaintPolyLine(2, x, y);
744 for (
Int_t i = 0; i < np; ++i) {
746 Int_t i2 = (i == np-1) ? 0 : i + 1;
768 if (icodes[2] == 0) {
781 for (
Int_t i = 0; i < np; ++i) {
783 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
784 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
785 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
790 Int_t npol[2] = { np, 0 };
791 Int_t ipol[2] = { 0, 0 };
792 if (np == 4 && icodes[2] != 0) {
797 npol[0] = 3; npol[1] = 3;
798 ipol[0] = 0; ipol[1] = 2;
802 for (
Int_t kpol = 0; kpol < 2; ++kpol) {
803 if (npol[kpol] == 0)
continue;
804 Int_t nv = npol[kpol];
805 Int_t iv = ipol[kpol];
817 for (
Int_t it = 0; it <
fNT; ++it) {
818 x[0] = p1[0] + xdel*
fT[2*it + 0];
819 y[0] = p1[1] + ydel*fT[2*it + 0];
820 x[1] = p1[0] + xdel*fT[2*it + 1];
821 y[1] = p1[1] + ydel*fT[2*it + 1];
822 gPad->PaintPolyLine(2, x, y);
828 for (
Int_t i = 0; i < np; ++i) {
830 Int_t i2 = (i == np - 1) ? 0 : i1 + 1;
852 if (icodes[2] == 0) {
865 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];
874 Int_t npol[2] = { np, 0 };
875 Int_t ipol[2] = { 0, 0 };
876 if (np == 4 && icodes[2] != 0) {
881 npol[0] = 3; npol[1] = 3;
882 ipol[0] = 0; ipol[1] = 2;
886 for (
Int_t kpol = 0; kpol < 2; ++kpol) {
887 if (npol[kpol] == 0)
continue;
888 Int_t nv = npol[kpol];
889 Int_t iv = ipol[kpol];
898 x[0] = p1[0]; y[0] = p1[1];
899 x[1] = p2[0]; y[1] = p2[1];
900 gPad->PaintPolyLine(2, x, y);
922 for (
Int_t i = 0; i < np; ++i) {
925 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
926 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
927 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
940 if (icodes[2] == 0) {
954 for (
Int_t it = 0; it <
fNT; ++it) {
955 x[0] = p1[0] + xdel*
fT[2*it + 0];
956 y[0] = p1[1] + ydel*fT[2*it + 0];
957 x[1] = p1[0] + xdel*fT[2*it + 1];
958 y[1] = p1[1] + ydel*fT[2*it + 1];
959 gPad->PaintPolyLine(2, x, y);
964 if (icodes[2] == 0) {
974 for (
Int_t i = 0; i < np; ++i) {
975 if (iface[i] < 0)
continue;
977 Int_t i2 = (i == np-1) ? 0 : i + 1;
979 Double_t xdel = pp[2*i2 + 0] - pp[2*i1 + 0];
980 Double_t ydel = pp[2*i2 + 1] - pp[2*i1 + 1];
981 for (
Int_t it = 0; it <
fNT; ++it) {
982 x[0] = pp[2*i1 + 0] + xdel*
fT[2*it + 0];
983 y[0] = pp[2*i1 + 1] + ydel*fT[2*it + 0];
984 x[1] = pp[2*i1 + 0] + xdel*fT[2*it + 1];
985 y[1] = pp[2*i1 + 1] + ydel*fT[2*it + 1];
986 gPad->PaintPolyLine(2, x, y);
1011 for (
Int_t i = 0; i < np; ++i) {
1015 view->
WCtoNDC(&xyz[(k-1)*3], p);
1025 for (
Int_t i = 0; i < np; ++i) {
1026 if (iface[i] < 0)
continue;
1028 Int_t i2 = (i == np-1) ? 0 : i + 1;
1030 Double_t xdel = pp[2*i2 + 0] - pp[2*i1 + 0];
1031 Double_t ydel = pp[2*i2 + 1] - pp[2*i1 + 1];
1032 for (
Int_t it = 0; it <
fNT; ++it) {
1033 x[0] = pp[2*i1 + 0] + xdel*
fT[2*it + 0];
1034 y[0] = pp[2*i1 + 1] + ydel*fT[2*it + 0];
1035 x[1] = pp[2*i1 + 0] + xdel*fT[2*it + 1];
1036 y[1] = pp[2*i1 + 1] + ydel*fT[2*it + 1];
1037 gPad->PaintPolyLine(2, x, y);
1058 Int_t ilev, i, k, icol, i1, i2, nl, np;
1069 Error(
"FillPolygon",
"illegal number of vertices in polygon (%d)", n);
1079 if (nl < 0) nl = -nl;
1082 for (i = 2; i <= np; ++i) {
1083 if (fmin > f[i]) fmin = f[i];
1084 if (fmax < f[i]) fmax = f[i];
1087 if (fmin < funmin) funmin = fmin - 1;
1089 if (fmax > funmax) funmax = fmax + 1;
1093 for (ilev = 1; ilev <= nl+1; ++ilev) {
1096 if (ilev == nl + 1) f2 = funmax;
1098 if (fmax < f1)
return;
1099 if (fmin > f2)
continue;
1102 for (i = 1; i <= np; ++i) {
1105 if (i == np) i2 = 1;
1106 FindPartEdge(&p[i1*3 + 1], &p[i2*3 + 1], f[i1], f[i2], f1, f2, k, p3);
1109 if (k < 3)
continue;
1110 for (i = 1; i <= k; ++i) {
1116 icol=
gPad->GetFillColor();
1123 gPad->PaintFillArea(k, x, y);
1136 i, j, k,
n, ibase, t,
x,
y, xscan[24] ,
1138 ib, nb, dx, dy, iw, nx, xx, yy, signdx, nstart, xx1, xx2, nxa, nxb;
1149 for (i = 1; i <=
n; ++i) {
1160 for (i = 1; i <=
n; ++i) {
1161 if (ymin > y1[i - 1]) ymin = y1[i - 1];
1162 if (ymax < y1[i - 1]) ymax = y1[i - 1];
1163 if (y1[i - 1] <= y1[i]) {x2[i - 1] = x1[i]; y2[i - 1] = y1[i];}
1165 x2[i - 1] = x1[i - 1];
1166 y2[i - 1] = y1[i - 1];
1172 if (ymax < 0)
return;
1176 for (i = 1; i <
n; ++i) {
1177 if (y1[i] >= y1[i - 1])
continue;
1180 for (j = i - 1; j >= 1; --j) {
1181 if (y < y1[j - 1])
continue;
1188 for (j = i; j >= k; --j) {
1201 for (i = 1; i <=
n; ++i) {
1202 xcur[i - 1] = x1[i - 1];
1203 dy = y2[i - 1] - y1[i - 1];
1204 dx = x2[i - 1] - x1[i - 1];
1206 if (dx < 0) signdx = -1;
1207 if (dx < 0) dx = -dx;
1209 t = -(dy + 1) / 2 + dx;
1212 xnex[i - 1] = xcur[i - 1];
1214 test[i - 1] = t - dy;
1215 xnex[i - 1] = xcur[i - 1] + signdx;
1217 }
else if (dy != 0) {
1218 step = (dx - 1) / (dy + dy) + 1;
1219 test[i - 1] = step*dy - (dx + 1) / 2 - dx;
1220 xnex[i - 1] = xcur[i - 1] + signdx*step;
1226 for (yscan = ymin; yscan <=
ymax; ++yscan) {
1230 for (i = nstart; i <=
n; ++i) {
1231 if (y1[i - 1] > yscan)
goto L500;
1232 if (y2[i - 1] <= yscan) {
1233 if (i == nstart) ++nstart;
1234 if (y2[i - 1] != yscan)
continue;
1236 if (x2[i - 1] >= xcur[i - 1]) {
1237 xscan[2*nxb - 2] = xcur[i - 1];
1238 xscan[2*nxb - 1] = x2[i - 1];
1240 xscan[2*nxb - 2] = x2[i - 1];
1241 xscan[2*nxb - 1] = xcur[i - 1];
1249 dy = y2[i - 1] - y1[i - 1];
1250 dx = x2[i - 1] - x1[i - 1];
1253 xscan[2*nxa - 2] = xcur[i - 1];
1254 xscan[2*nxa - 1] = xnex[i - 1];
1255 if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
1261 xscan[2*nxa - 2] = xnex[i - 1];
1262 xscan[2*nxa - 1] = xcur[i - 1];
1263 if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
1267 xcur[i - 1] = xnex[i - 1];
1270 if (test[i - 1] < 0)
continue;
1272 xnex[i - 1] += signdx;
1276 t = test[i - 1] + step*dy;
1278 test[i - 1] = t - dx;
1279 xnex[i - 1] += signdx*step;
1281 test[i - 1] = t + dy - dx;
1282 xnex[i - 1] += signdx*(step + 1);
1288 if (yscan < 0)
continue;
1291 for (i = 1; i < nxa; ++i) {
1292 for (j = i; j >= 1; --j) {
1293 if (xscan[2*j] >= xscan[2*j - 2])
continue;
1295 xscan[2*j] = xscan[2*j - 2];
1298 xscan[2*j + 1] = xscan[2*j - 1];
1302 for (i = 1; i <= nxa; i += 2) {
1304 xscan[2*nx - 2] = xscan[2*i - 2];
1306 if (xscan[2*i - 1] > x) x = xscan[2*i - 1];
1307 xscan[2*nx - 1] =
x;
1311 for (i = nxb; i <=
kLmax; ++i) {
1313 xscan[2*nx - 2] = xscan[2*i - 2];
1314 xscan[2*nx - 1] = xscan[2*i - 1];
1319 xx1 = xscan[2*nx - 2];
1320 xx2 = xscan[2*nx - 1];
1324 if ((xscan[2*k - 2] <= xx2 + 1) && (xscan[2*k - 1] >= xx1 - 1)) {
1325 if (xscan[2*k - 2] < xx1) xx1 = xscan[2*k - 2];
1326 if (xscan[2*k - 1] > xx2) xx2 = xscan[2*k - 1];
1327 xscan[2*k - 2] = xscan[2*nx - 2];
1328 xscan[2*k - 1] = xscan[2*nx - 1];
1332 if (xx1 < 0) xx1 = 0;
1333 if (xx2 >= fNxrast) xx2 = fNxrast - 1;
1334 nbit = xx2 - xx1 + 1;
1337 ib = kbit - iw*30 + 1;
1340 if (nb > nbit) nb = nbit;
1374 for (
Int_t i = 1; i < np; ++i) {
1375 if (t[i] < tmin) tmin = t[i];
1376 if (t[i] > tmax) tmax = t[i];
1382 for (
Int_t il = 1; il <= nl; ++il) {
1383 if (tmin >=
fFunLevel[il - 1])
continue;
1389 for (
Int_t i = 0; i < np; ++i) {
1391 Int_t i2 = (i == np-1) ? 0 : i+1;
1393 Double_t d2 = t[i2] - fFunLevel[il - 1];
1394 if (d1 == 0) d1 = 1
e-99;
1395 if (d2 == 0) d2 = 1
e-99;
1396 if (d1*d2 > 0)
continue;
1400 d1 /= t[i2] - t[i1];
1401 d2 /= t[i2] - t[i1];
1402 fPlines[(kp + 2*
fNlines)*3 - 9] = d2*f[i1*3 + 0] - d1*f[i2*3 + 0];
1403 fPlines[(kp + 2*
fNlines)*3 - 8] = d2*f[i1*3 + 1] - d1*f[i2*3 + 1];
1404 fPlines[(kp + 2*
fNlines)*3 - 7] = d2*f[i1*3 + 2] - d1*f[i2*3 + 2];
1408 Error(
"FindLevelLines",
"number of points for line not equal 2");
1441 if (f1 < fmin) k1 = -2;
1442 if (f1 == fmin) k1 = -1;
1443 if (f1 == fmax) k1 = 1;
1444 if (f1 > fmax) k1 = 2;
1446 if (f2 < fmin) k2 = -2;
1447 if (f2 == fmin) k2 = -1;
1448 if (f2 == fmax) k2 = 1;
1449 if (f2 > fmax) k2 = 2;
1450 kk = (k1 + 2)*5 + (k2 + 2) + 1;
1485 pp[kpp*3 + 1] = p1[1];
1486 pp[kpp*3 + 2] = p1[2];
1487 pp[kpp*3 + 3] = p1[3];
1493 d1 = (fmin -
f1) / (f1 - f2);
1494 d2 = (fmin - f2) / (f1 - f2);
1495 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1496 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1497 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1503 d1 = (fmax -
f1) / (f1 - f2);
1504 d2 = (fmax - f2) / (f1 - f2);
1505 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1506 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1507 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1513 pp[kpp*3 + 1] = p1[1];
1514 pp[kpp*3 + 2] = p1[2];
1515 pp[kpp*3 + 3] = p1[3];
1517 d1 = (fmin -
f1) / (f1 - f2);
1518 d2 = (fmin - f2) / (f1 - f2);
1519 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1520 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1521 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1527 pp[kpp*3 + 1] = p1[1];
1528 pp[kpp*3 + 2] = p1[2];
1529 pp[kpp*3 + 3] = p1[3];
1531 d1 = (fmax -
f1) / (f1 - f2);
1532 d2 = (fmax - f2) / (f1 - f2);
1533 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1534 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1535 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1541 d1 = (fmin -
f1) / (f1 - f2);
1542 d2 = (fmin - f2) / (f1 - f2);
1543 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1544 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1545 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1547 d1 = (fmax -
f1) / (f1 - f2);
1548 d2 = (fmax - f2) / (f1 - f2);
1549 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1550 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1551 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1557 d1 = (fmax -
f1) / (f1 - f2);
1558 d2 = (fmax - f2) / (f1 - f2);
1559 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1560 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1561 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1563 d1 = (fmin -
f1) / (f1 - f2);
1564 d2 = (fmin - f2) / (f1 - f2);
1565 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1566 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1567 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1579 Int_t i, icase, i1, i2, icase1, icase2, iv, ifback;
1582 Double_t tt, uu, ww, yy, yy1, yy2, yy1d, yy2d;
1594 x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
1595 x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
1596 y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
1597 y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
1598 z1 = tn[8]*r1[1] + tn[9]*r1[2] + tn[10]*r1[3] + tn[11];
1599 z2 = tn[8]*r2[1] + tn[9]*r2[2] + tn[10]*r2[3] + tn[11];
1601 Error(
"FindVisibleDraw",
"invalid TView in current pad");
1605 Error(
"FindVisibleDraw",
"no TView in current pad");
1631 dy = (y2 - y1) / di;
1634 for (i = i1; i <= i2 - 1; ++i) {
1635 yy1 = y1 + dy*(i - i1);
1637 yy1u = yy1 -
fU[2*i - 2];
1638 yy1d = yy1 -
fD[2*i - 2];
1639 yy2u = yy2 - fU[2*i - 1];
1640 yy2d = yy2 - fD[2*i - 1];
1644 if (yy1u > kEpsil) icase1 = 0;
1645 if (yy1d < -kEpsil) icase1 = 2;
1646 if ((icase1 == 0 || icase1 == 2) && iv <= 0) {
1651 if (icase1 == 1 && iv >= 0) {
1657 if (yy2u > kEpsil) icase2 = 0;
1658 if (yy2d < -kEpsil) icase2 = 2;
1659 icase = icase1*3 + icase2;
1662 fT[2*
fNT - 1] = tt + dt*(yy1u / (yy1u - yy2u));
1665 fT[2*
fNT - 1] = tt + dt*(yy1u / (yy1u - yy2u));
1667 fT[2*
fNT - 2] = tt + dt*(yy1d / (yy1d - yy2d));
1672 fT[2*
fNT - 2] = tt + dt*(yy1u / (yy1u - yy2u));
1677 fT[2*
fNT - 2] = tt + dt*(yy1d / (yy1d - yy2d));
1680 fT[2*
fNT - 1] = tt + dt*(yy1d / (yy1d - yy2d));
1682 fT[2*
fNT - 2] = tt + dt*(yy1u / (yy1u - yy2u));
1686 fT[2*
fNT - 1] = tt + dt*(yy1d / (yy1d - yy2d));
1688 if (
fNT + 1 >= 100)
break;
1690 if (iv > 0)
fT[2*
fNT - 1] = 1;
1698 if (y2 == y1) {
fNT = 0;
return;}
1699 ifback = 1 - ifback;
1707 if (uu <
fU[2*i1 - 3]) uu =
fU[2*i1 - 3];
1708 if (dd >
fD[2*i1 - 3]) dd =
fD[2*i1 - 3];
1711 if (y1 < uu && y2 > dd) {
1712 if (y1 >= dd && y2 <= uu) {
fNT = 0;
return;}
1717 fT[2*
fNT - 1] = (dd - y1) / (y2 - y1);
1721 fT[2*
fNT - 2] = (uu - y1) / (y2 - y1);
1727 if (ifback == 0)
return;
1728 if (
fNT == 0)
return;
1729 for (i = 1; i <=
fNT; ++i) {
1730 fT[2*i - 2] = 1 -
fT[2*i - 2];
1731 fT[2*i - 1] = 1 -
fT[2*i - 1];
1749 Int_t i, incrx, ivis,
x1, y1,
x2, y2, ib, kb, dx, dy, iw, ix, iy, ifinve, dx2, dy2;
1783 if (x1 < 0 && x2 < 0)
return;
1795 if (dy > dx)
goto L200;
1799 ddtt = dt*(float).5;
1804 for (ix = x1; incrx < 0 ? ix >=
x2 : ix <=
x2; ix += incrx) {
1813 if (iy < 0)
goto L110;
1815 if (ix < 0)
goto L110;
1818 ib = kb - iw*30 + 1;
1820 if (ivis > 0)
continue;
1826 if (ivis == 0)
continue;
1829 if (nt == ntmax)
goto L300;
1831 if (ivis > 0) t[2*nt + 2] = tcur + dt + ddtt;
1837 ddtt = dt*(float).5;
1843 for (iy = y1; iy <= y2; ++iy) {
1852 if (iy < 0)
goto L210;
1853 if (ix < 0)
goto L210;
1856 ib = kb - iw*30 + 1;
1858 if (ivis > 0)
continue;
1864 if (ivis == 0)
continue;
1867 if (nt == ntmax)
goto L300;
1869 if (ivis > 0) t[2*nt + 2] = tcur + dt;
1873 if (nt == 0)
return;
1875 if (t[3] <= dt) t[3] = 0;
1876 if (t[2*nt + 2] >= 1 - dt) t[2*nt + 2] = 1;
1877 if (ifinve == 0)
return;
1878 for (i = 1; i <= nt; ++i) {
1881 t[2*i + 1] = 1 - t2;
1882 t[2*i + 2] = 1 -
t1;
1898 Int_t incrx[3], incry[3];
1915 ixt = ia + Hparam.
xfirst - 1;
1916 iyt = ib + Hparam.
yfirst - 1;
1922 if (ixt == 1) incrx[0] = 0;
1923 if (ixt == Hparam.
xlast - 1) incrx[2] = 0;
1927 if (iyt == 1) incry[0] = 0;
1928 if (iyt == Hparam.
ylast - 1) incry[2] = 0;
1932 for (j = 1; j <= 3; ++j) {
1933 for (i = 1; i <= 3; ++i) {
1934 i1 = ia + incrx[i - 1];
1935 i2 = ib + incry[j - 1];
1941 for (k = 1; k <= 4; ++k) {
1942 for (i = 1; i <= 3; ++i) {
1943 face[i + k*3] = f[i + (k + 32)*3 - 52];
1948 for (j = 1; j <= 3; ++j) {
1949 for (i = 1; i <= 3; ++i) {
1950 for (k = 1; k <= 4; ++k) {
1952 phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1953 r = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
1954 x[k + ((i + j*3) << 2) - 17] = r *
TMath::Cos(phi);
1955 y[k + ((i + j*3) << 2) - 17] = r *
TMath::Sin(phi);
1956 z[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 49];
1958 phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1959 r = f[(k + ((i + j*3) << 2))*3 - 49];
1960 x[k + ((i + j*3) << 2) - 17] = r*
TMath::Cos(phi);
1961 y[k + ((i + j*3) << 2) - 17] = r*
TMath::Sin(phi);
1962 z[k + ((i + j*3) << 2) - 17] = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
1964 phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1965 th = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1966 r = f[(k + ((i + j*3) << 2))*3 - 49];
1969 z[k + ((i + j*3) << 2) - 17] = r*
TMath::Cos(th);
1971 phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1972 th = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1973 r = f[(k + ((i + j*3) << 2))*3 - 49];
1974 x[k + ((i + j*3) << 2) - 17] = r*
TMath::Cos(phi);
1975 y[k + ((i + j*3) << 2) - 17] = r*
TMath::Sin(phi);
1978 x[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 51];
1979 y[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 50];
1980 z[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 49];
1983 x1 = x[((i + j*3) << 2) - 14] - x[((i + j*3) << 2) - 16];
1984 x2 = x[((i + j*3) << 2) - 13] - x[((i + j*3) << 2) - 15];
1985 y1 = y[((i + j*3) << 2) - 14] - y[((i + j*3) << 2) - 16];
1986 y2 = y[((i + j*3) << 2) - 13] - y[((i + j*3) << 2) - 15];
1987 z1 = z[((i + j*3) << 2) - 14] - z[((i + j*3) << 2) - 16];
1988 z2 = z[((i + j*3) << 2) - 13] - z[((i + j*3) << 2) - 15];
1989 an[(i + j*3)*3 - 12] = y1*z2 - y2*z1;
1990 an[(i + j*3)*3 - 11] = z1*x2 - z2*x1;
1991 an[(i + j*3)*3 - 10] = x1*y2 - x2*y1;
1992 s =
TMath::Sqrt(an[(i + j*3)*3 - 12]*an[(i + j*3)*3 - 12] + an[
1993 (i + j*3)*3 - 11]*an[(i + j*3)*3 - 11] + an[(i
1994 + j*3)*3 - 10]*an[(i + j*3)*3 - 10]);
1996 an[(i + j*3)*3 - 12] /= s;
1997 an[(i + j*3)*3 - 11] /= s;
1998 an[(i + j*3)*3 - 10] /= s;
2003 for (j = 1; j <= 2; ++j) {
2004 for (i = 1; i <= 2; ++i) {
2005 for (k = 1; k <= 3; ++k) {
2006 bn[k + (i + 2*j)*3 - 10] = an[k + (i + j*3)*3 - 13]
2007 + an[k + (i + 1 + j*3)*3 - 13] + an[k + (i + 1 +
2008 (j + 1)*3)*3 - 13] + an[k + (i + (j + 1)*3)*3 - 13];
2032 fU[2*i + 0] = -VERY_BIG;
2033 fU[2*i + 1] = -VERY_BIG;
2034 fD[2*i + 0] = VERY_BIG;
2035 fD[2*i + 1] = VERY_BIG;
2051 Int_t i, j, k, ib, nb;
2061 Int_t buffersize = nx*ny/30 + 1;
2067 for (i = 1; i <= 30; ++i) {
2070 fMask[i - 1] = pow2;
2074 for (nb = 2; nb <= 30; ++nb) {
2075 for (ib = 1; ib <= 30 - nb + 1; ++ib) {
2077 for (i = ib; i <= ib + nb - 1; ++i) k = k |
fMask[i - 1];
2092 Int_t i, j, ixt, iyt;
2094 Double_t xlab1l, xlab2l, ylab1l, ylab2l;
2103 ixt = ia + Hparam.
xfirst - 1;
2104 iyt = ib + Hparam.
yfirst - 1;
2112 ab[5] = ab[3] + xwid*Hparam.
barwidth;
2113 ab[8] = ab[4] + ywid*Hparam.
barwidth;
2117 else ab[3] = Hparam.
xmin;
2119 else ab[5] = Hparam.
xmin;
2125 else ab[4] = Hparam.
ymin;
2127 else ab[8] = Hparam.
ymin;
2129 yval1l = Hparam.
ymin;
2130 yval2l = Hparam.
ymax;
2132 if (ab[3] < Hparam.
xmin) ab[3] = Hparam.
xmin;
2133 if (ab[4] < Hparam.
ymin) ab[4] = Hparam.
ymin;
2134 if (ab[5] > Hparam.
xmax) ab[5] = Hparam.
xmax;
2135 if (ab[8] > Hparam.
ymax) ab[8] = Hparam.
ymax;
2136 if (ab[5] < Hparam.
xmin) ab[5] = Hparam.
xmin;
2137 if (ab[8] < Hparam.
ymin) ab[8] = Hparam.
ymin;
2160 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2161 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2162 ab[4] = (ab[4] - yval1l) / (yval2l - yval1l);
2163 ab[8] = (ab[8] - yval1l) / (yval2l - yval1l);
2165 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2166 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2168 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2169 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2170 ab[4] = 180*(ab[4] - ylab1l) / (ylab2l - ylab1l);
2171 ab[8] = 180*(ab[8] - ylab1l) / (ylab2l - ylab1l);
2173 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2174 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2175 ab[4] = (180 - dangle*2)*(ab[4] - ylab1l) / (ylab2l - ylab1l) + dangle;
2176 ab[8] = (180 - dangle*2)*(ab[8] - ylab1l) / (ylab2l - ylab1l) + dangle;
2187 vv[1] = Hparam.
zmin;
2202 if (stack) nids = stack->
GetSize();
2204 for (i = 2; i <= nids + 1; ++i) {
2213 for (i = 2; i <= nv; ++i) {
2218 vv[i] = Hparam.
zmin;
2226 if (!Hoption.
Logz) {
2229 if (vv[i] < vv[i - 1]) {
2241 for (i = 1; i <= nv; ++i) {
2242 vv[i] = (1 - rinrad)*((vv[i] - Hparam.
zmin) /
2243 (Hparam.
zmax - Hparam.
zmin)) + rinrad;
2247 for (i = 1; i <= nv; ++i) {
2248 for (j = 1; j <= 4; ++j) t[j + (i << 2)] = vv[i];
2264 Int_t icodes[4], iface[4];
2266 Int_t firstStackNumberDrawn=-1 ;
2271 Error(
"LegoCartesian",
"no TView in current pad");
2290 Int_t incrx = (tnorm[8] < 0.) ? -1 : +1;
2291 Int_t incry = (tnorm[9] < 0.) ? -1 : +1;
2292 if (*chopt !=
'B' && *chopt !=
'b') {
2293 incrx = -incrx; incry = -incry;
2295 Int_t ix1 = (incrx == +1) ? 1 : nx;
2296 Int_t iy1 = (incry == +1) ? 1 : ny;
2297 Int_t ix2 = (incrx == +1) ? nx : 1;
2298 Int_t iy2 = (incry == +1) ? ny : 1;
2302 Int_t ivis[6] = { 0,0,0,0,0,0 };
2304 if (zn < 0) ivis[0] = 1;
2305 if (zn > 0) ivis[2] = 1;
2307 if (zn > 0) ivis[1] = 1;
2308 if (zn < 0) ivis[3] = 1;
2310 if (zn > 0) ivis[5] = 1;
2311 if (zn < 0) ivis[4] = 1;
2316 for (
Int_t iy = iy1; iy != iy2+incry; iy += incry) {
2317 for (
Int_t ix = ix1; ix != ix2+incrx; ix += incrx) {
2318 if (!painter->
IsInside(ix,iy))
continue;
2320 if (nv < 2 || nv > vSize)
continue;
2323 for (
Int_t iv = 1; iv < nv; ++iv) { total_content += v[iv]; }
2324 if (total_content <= Hparam.
zmin)
continue;
2328 for (
Int_t i = 1; i <= 4; ++i) {
2329 xyz[i*3 - 3] = xy[2*i - 2];
2330 xyz[i*3 - 2] = xy[2*i - 1];
2331 xyz[(i + 4)*3 - 3] = xyz[i*3 - 3];
2332 xyz[(i + 4)*3 - 2] = xyz[i*3 - 2];
2335 firstStackNumberDrawn = -1;
2336 for (
Int_t iv = 1; iv < nv; ++iv) {
2337 for (
Int_t i = 1; i <= 4; ++i) {
2338 xyz[i*3 - 1] = v[iv - 1];
2339 xyz[(i + 4)*3 - 1] = v[iv];
2341 if (v[iv - 1] == v[iv])
continue;
2343 for (
Int_t i = 1; i <= 4; ++i) {
2344 if (ivis[i - 1] == 0)
continue;
2353 tface[0] = tt[k1 + (iv << 2) - 5];
2354 tface[1] = tt[k2 + (iv << 2) - 5];
2355 tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
2356 tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
2358 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2360 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2366 for (
Int_t i = 1; i <= 4; ++i) {
2367 xyz[i*3 - 1] = v[0];
2368 iface[i - 1] = 5 - i;
2369 tface[i - 1] = tt[5 - i - 1];
2376 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2382 for (
Int_t i = 1; i <= 4; ++i) {
2383 iface[i - 1] = i + 4;
2384 tface[i - 1] = tt[i + (nv << 2) - 5];
2389 if ( nv > 2 && (v[nv-1] == v[nv-2])) {
2390 for (
Int_t iv = nv-1; iv > 2; --iv) {
2391 if (v[nv-1] == v[iv-1]) {
2398 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2422 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2424 Int_t incrr, k1, k2, ia, ib, ir1, ir2;
2426 Int_t ir, jr, iv, nr, nv, icodes[4];
2430 Int_t firstStackNumberDrawn=-1 ;
2434 Error(
"LegoPolar",
"no TView in current pad");
2450 Error(
"LegoPolar",
"too many PHI sectors (%d)", nphi);
2454 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2472 if (iordr == 0) ia = nr;
2473 if (iordr != 0) ib = nr;
2474 for (i = 1; i <= nphi; ++i) {
2475 if (iordr == 0) ib = i;
2476 if (iordr != 0) ia = i;
2478 if (i == 1)
fAphi[0] = ab[jphi - 1];
2479 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2480 fAphi[i] = ab[jphi + 3];
2486 for (i = 1; i <= nphi; ++i) {
2497 if (iphi > nphi)
goto L300;
2502 if (incrr < 0) ir1 = nr;
2505 for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
2506 if (iordr == 0) { ia = ir; ib = iphi; }
2507 else { ia = iphi; ib = ir; }
2509 if (nv < 2 || nv > vSize)
continue;
2512 for (iv = 1; iv < nv; ++iv) total_content += v[iv];
2513 if (total_content==0)
continue;
2517 for (i = 1; i <= 4; ++i) {
2519 if (iordr != 0 && i == 2) j = 4;
2520 if (iordr != 0 && i == 4) j = 2;
2521 xyz[j*3 - 3] = ab[jr + 2*i - 3]*
TMath::Cos(ab[jphi + 2*i - 3]*
kRad);
2522 xyz[j*3 - 2] = ab[jr + 2*i - 3]*
TMath::Sin(ab[jphi + 2*i - 3]*
kRad);
2523 xyz[(j + 4)*3 - 3] = xyz[j*3 - 3];
2524 xyz[(j + 4)*3 - 2] = xyz[j*3 - 2];
2527 firstStackNumberDrawn = -1;
2528 for (iv = 1; iv < nv; ++iv) {
2529 for (i = 1; i <= 4; ++i) {
2530 xyz[i*3 - 1] = v[iv - 1];
2531 xyz[(i + 4)*3 - 1] = v[iv];
2533 if (v[iv - 1] >= v[iv])
continue;
2535 for (i = 1; i <= 4; ++i) {
2536 if (ivis[i - 1] == 0)
continue;
2540 if (xyz[k1*3 - 3] == xyz[k2*3 - 3] && xyz[k1*3 - 2] ==
2541 xyz[k2*3 - 2])
continue;
2546 tface[0] = tt[k1 + (iv << 2) - 5];
2547 tface[1] = tt[k2 + (iv << 2) - 5];
2548 tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
2549 tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
2552 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2554 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2560 for (i = 1; i <= 4; ++i) {
2561 xyz[i*3 - 1] = v[0];
2562 iface[i - 1] = 5 - i;
2563 tface[i - 1] = tt[5 - i - 1];
2570 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2576 for (i = 1; i <= 4; ++i) {
2577 iface[i - 1] = i + 4;
2578 tface[i - 1] = tt[i + (nv << 2) - 5];
2583 if ( nv > 2 && (v[nv-1] == v[nv-2])) {
2584 for (iv = nv-1; iv>2; iv--) {
2585 if (v[nv-1] == v[iv-1]) {
2592 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2599 if (iphi == 0) iphi = kphi;
2600 if (iphi > kphi) iphi = 1;
2601 if (iphi != iphi2)
goto L100;
2632 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2635 Int_t ia, ib, idummy, iz1, iz2, nz, incrz, k1, k2, nv;
2636 Int_t iv, iz, jz, icodes[4];
2642 Int_t firstStackNumberDrawn=-1 ;
2646 Error(
"LegoCylindrical",
"no TView in current pad");
2662 Error(
"LegoCylindrical",
"too many PHI sectors (%d)", nphi);
2666 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2684 if (iordr == 0) ia = nz;
2685 if (iordr != 0) ib = nz;
2686 for (i = 1; i <= nphi; ++i) {
2687 if (iordr == 0) ib = i;
2688 if (iordr != 0) ia = i;
2690 if (i == 1)
fAphi[0] = ab[jphi - 1];
2691 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2692 fAphi[i] = ab[jphi + 3];
2698 for (i = 1; i <= nphi; ++i) {
2699 if (iordr == 0) ib = i;
2700 if (iordr != 0) ia = i;
2709 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
2719 if (iphi > nphi)
goto L400;
2723 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
2724 if (iordr == 0) {ia = iz; ib = iphi;}
2725 else {ia = iphi; ib = iz;}
2727 if (nv < 2 || nv > vSize)
continue;
2730 for (i = 1; i <= 4; ++i) {
2732 if (iordr != 0 && i == 2) j = 4;
2733 if (iordr != 0 && i == 4) j = 2;
2736 xyz[j*3 - 1] = ab[jz + 2*i - 3];
2737 xyz[(j + 4)*3 - 1] = ab[jz + 2*i - 3];
2740 firstStackNumberDrawn = -1;
2741 for (iv = 1; iv < nv; ++iv) {
2742 for (i = 1; i <= 4; ++i) {
2743 xyz[i*3 - 3] = v[iv - 1]*cosphi[i - 1];
2744 xyz[i*3 - 2] = v[iv - 1]*sinphi[i - 1];
2745 xyz[(i + 4)*3 - 3] = v[iv]*cosphi[i - 1];
2746 xyz[(i + 4)*3 - 2] = v[iv]*sinphi[i - 1];
2748 if (v[iv - 1] >= v[iv])
continue;
2750 for (i = 1; i <= 4; ++i) {
2751 if (ivis[i - 1] == 0)
continue;
2759 tface[0] = tt[k1 + (iv << 2) - 5];
2760 tface[1] = tt[k2 + (iv << 2) - 5];
2761 tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
2762 tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
2765 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2767 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2770 if (ivis[4] != 0 && v[0] > 0) {
2773 for (i = 1; i <= 4; ++i) {
2774 xyz[i*3 - 3] = v[0]*cosphi[i - 1];
2775 xyz[i*3 - 2] = v[0]*sinphi[i - 1];
2777 tface[i - 1] = tt[i - 1];
2784 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2787 if (ivis[5] != 0 && v[nv - 1] > 0) {
2790 for (i = 1; i <= 4; ++i) {
2791 iface[i - 1] = 5 - i + 4;
2792 tface[i - 1] = tt[5 - i + (nv << 2) - 5];
2797 if ( nv > 2 && (v[nv-1] == v[nv-2])) {
2798 for (iv = nv-1; iv>2; iv--) {
2799 if (v[nv-1] == v[iv-1]) {
2806 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2813 if (iphi == 0) iphi = kphi;
2814 if (iphi > kphi) iphi = 1;
2815 if (iphi != iphi2)
goto L100;
2845 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2848 Int_t k1, k2, ia, ib, incrth, ith, jth, kth, nth, mth, ith1, ith2, nv;
2851 Int_t iv, icodes[4];
2858 Int_t firstStackNumberDrawn=-1 ;
2862 Error(
"LegoSpherical",
"no TView in current pad");
2878 Error(
"LegoSpherical",
"too many THETA sectors (%d)", nth);
2882 Error(
"LegoSpherical",
"too many PHI sectors (%d)", nphi);
2886 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2905 if (mth == 0) mth = 1;
2906 if (iordr == 0) ia = mth;
2907 if (iordr != 0) ib = mth;
2908 for (i = 1; i <= nphi; ++i) {
2909 if (iordr == 0) ib = i;
2910 if (iordr != 0) ia = i;
2912 if (i == 1)
fAphi[0] = ab[jphi - 1];
2913 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2914 fAphi[i] = ab[jphi + 3];
2919 if (iordr == 0) ib = 1;
2920 if (iordr != 0) ia = 1;
2921 for (i = 1; i <= nth; ++i) {
2922 if (iordr == 0) ia = i;
2923 if (iordr != 0) ib = i;
2925 if (i == 1)
fAphi[0] = ab[jth - 1];
2926 fAphi[i - 1] = (
fAphi[i - 1] + ab[jth - 1]) / (
float)2.;
2927 fAphi[i] = ab[jth + 3];
2936 if (iphi > nphi)
goto L500;
2939 if (!iordr) {ia = mth; ib = iphi; }
2940 else {ia = iphi;ib = mth; }
2942 phi = (ab[jphi - 1] + ab[jphi + 3]) / (
float)2.;
2947 if (ith > nth)
goto L400;
2948 if (iordr == 0) ia = ith;
2949 if (iordr != 0) ib = ith;
2951 if (nv < 2 || nv > vSize)
goto L400;
2954 for (i = 1; i <= 6; ++i) ivis[i - 1] = 0;
2956 phi1 =
kRad*ab[jphi - 1];
2957 phi2 =
kRad*ab[jphi + 3];
2958 th1 =
kRad*ab[jth - 1];
2959 th2 =
kRad*ab[jth + 3];
2961 if (zn > 0) ivis[1] = 1;
2963 if (zn > 0) ivis[3] = 1;
2964 phi = (phi1 + phi2) / (
float)2.;
2966 if (zn > 0) ivis[0] = 1;
2968 if (zn > 0) ivis[2] = 1;
2969 th = (th1 +
th2) / (
float)2.;
2970 if (ipsdr == 1) th =
kRad*90;
2972 if (zn < 0) ivis[4] = 1;
2973 if (zn > 0) ivis[5] = 1;
2978 for (i = 1; i <= 4; ++i) {
2980 if (iordr != 0 && i == 2) j = 4;
2981 if (iordr != 0 && i == 4) j = 2;
2987 firstStackNumberDrawn = -1;
2988 for (iv = 1; iv < nv; ++iv) {
2990 for (i = 1; i <= 4; ++i) {
2991 xyz[i*3 - 3] = v[iv - 1]*cosphi[i - 1];
2992 xyz[i*3 - 2] = v[iv - 1]*sinphi[i - 1];
2993 xyz[i*3 - 1] = v[iv - 1]*costh[i - 1] / sinth[i - 1];
2994 xyz[(i + 4)*3 - 3] = v[iv]*cosphi[i - 1];
2995 xyz[(i + 4)*3 - 2] = v[iv]*sinphi[i - 1];
2996 xyz[(i + 4)*3 - 1] = v[iv]*costh[i - 1] / sinth[i - 1];
2999 for (i = 1; i <= 4; ++i) {
3000 xyz[i*3 - 3] = v[iv - 1]*sinth[i - 1]*cosphi[i - 1];
3001 xyz[i*3 - 2] = v[iv - 1]*sinth[i - 1]*sinphi[i - 1];
3002 xyz[i*3 - 1] = v[iv - 1]*costh[i - 1];
3003 xyz[(i + 4)*3 - 3] = v[iv]*sinth[i - 1]*cosphi[i - 1];
3004 xyz[(i + 4)*3 - 2] = v[iv]*sinth[i - 1]*sinphi[i - 1];
3005 xyz[(i + 4)*3 - 1] = v[iv]*costh[i - 1];
3008 if (v[iv - 1] >= v[iv])
continue;
3010 for (i = 1; i <= 4; ++i) {
3011 if (ivis[i - 1] == 0)
continue;
3019 tface[0] = tt[k1 + (iv << 2) - 5];
3020 tface[1] = tt[k2 + (iv << 2) - 5];
3021 tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
3022 tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
3025 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
3027 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
3030 if (ivis[4] != 0 && v[0] > 0) {
3033 for (i = 1; i <= 4; ++i) {
3035 xyz[i*3 - 3] = v[0]*cosphi[i - 1];
3036 xyz[i*3 - 2] = v[0]*sinphi[i - 1];
3037 xyz[i*3 - 1] = v[0]*costh[i - 1] / sinth[i - 1];
3039 xyz[i*3 - 3] = v[0]*sinth[i - 1]*cosphi[i - 1];
3040 xyz[i*3 - 2] = v[0]*sinth[i - 1]*sinphi[i - 1];
3041 xyz[i*3 - 1] = v[0]*costh[i - 1];
3043 iface[i - 1] = 5 - i;
3044 tface[i - 1] = tt[5 - i - 1];
3051 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
3054 if (ivis[5] != 0 && v[nv - 1] > 0) {
3057 for (i = 1; i <= 4; ++i) {
3058 iface[i - 1] = i + 4;
3059 tface[i - 1] = tt[i + 4 + 2*nv - 5];
3064 if ( nv > 2 && (v[nv-1] == v[nv-2])) {
3065 for (iv = nv-1; iv>2; iv--) {
3066 if (v[nv-1] == v[iv-1]) {
3073 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
3079 if (ith == 0) ith = kth;
3080 if (ith > kth) ith = 1;
3081 if (ith != ith2)
goto L200;
3082 if (incrth == 0)
goto L500;
3093 if (iphi == 0) iphi = kphi;
3094 if (iphi > kphi) iphi = 1;
3095 if (iphi != iphi2)
goto L100;
3130 if (nl < 0)
goto L100;
3131 else if (nl == 0)
goto L200;
3138 for (i = 1; i <= 4; ++i) {
3145 Error(
"LightSource",
"negative light intensity");
3153 if (nl > 4 || yl < 0) {
3154 Error(
"LightSource",
"illegal light source number (nl=%d, yl=%f)", nl, yl);
3158 s =
TMath::Sqrt(xscr*xscr + yscr*yscr + zscr*zscr);
3160 Error(
"LightSource",
"light source is placed at origin");
3165 fVls[nl*3 - 3] = xscr /
s;
3166 fVls[nl*3 - 2] = yscr /
s;
3167 fVls[nl*3 - 1] = zscr /
s;
3171 if (
fYdl != 0)
return;
3172 for (i = 1; i <= 4; ++i) {
3173 if (
fYls[i - 1] != 0)
return;
3200 if (
fLoff != 0)
return;
3204 s =
TMath::Sqrt(vn[0]*vn[0] + vn[1]*vn[1] + vn[2]*vn[2]);
3212 for (i = 1; i <= 4; ++i) {
3213 if (
fYls[i - 1] <= 0)
continue;
3214 vl[0] =
fVls[i*3 - 3];
3215 vl[1] =
fVls[i*3 - 2];
3216 vl[2] =
fVls[i*3 - 1];
3217 cosn = vl[0]*vn[0] + vl[1]*vn[1] + vl[2]*vn[2];
3218 if (cosn < 0)
continue;
3219 cosr = vn[1]*(vn[2]*vl[1] - vn[1]*vl[2]) - vn[0]*(vn[0]*vl[2]
3220 - vn[2]*vl[0]) + vn[2]*cosn;
3221 if (cosr <= 0) cosr = 0;
3248 x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
3249 x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
3250 y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
3251 y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
3253 Error(
"ModifyScreen",
"invalid TView in current pad");
3257 Error(
"ModifyScreen",
"no TView in current pad");
3271 if (i1 == i2)
return;
3274 dy = (y2 - y1) / (i2 - i1);
3275 for (i = i1; i <= i2 - 1; ++i) {
3276 yy1 = y1 + dy*(i - i1);
3278 if (
fD[2*i - 2] > yy1)
fD[2*i - 2] = yy1;
3279 if (
fD[2*i - 1] > yy2)
fD[2*i - 1] = yy2;
3280 if (
fU[2*i - 2] < yy1)
fU[2*i - 2] = yy1;
3281 if (
fU[2*i - 1] < yy2)
fU[2*i - 1] = yy2;
3383 Int_t ivis[6], i, k, num;
3387 for (i = 1; i <= 6; ++i) {
3390 if (k < num)
continue;
3395 if (k == 1) ir = -1;
3422 Error(
"SideVisibilityEncode",
"no TView in current pad");
3427 if (zn > 0) k += 64;
3428 if (zn < 0) k += 32;
3430 if (zn > 0) k += 16;
3433 phi = (phi1 + phi2) / (
float)2.;
3437 if ((zn <= 0 && iopt == 1) || (zn > 0 && iopt == 2)) ++k;
3454 static const char *where =
"Spectrum";
3461 if (nl == 0) {
fNlevel = 0;
return; }
3465 Error(where,
"fmax (%f) less than fmin (%f)", fmax, fmin);
3469 if (nl < 0 || nl > 256) {
3470 Error(where,
"illegal number of levels (%d)", nl);
3475 Error(where,
"initial color index is negative");
3480 Error(where,
"color index increment must be positive");
3485 const Int_t kMAXCOL = 50;
3486 delf = (fmax - fmin) / nl;
3488 for (i = 1; i <= nl+1; ++i) {
3491 if (ic <= kMAXCOL && fColorLevel[i] > kMAXCOL) fColorLevel[i] -= kMAXCOL;
3509 Int_t iface[4] = { 1,2,3,4 };
3516 Error(
"SurfaceCartesian",
"no TView in current pad");
3523 Int_t incrx = (tnorm[8] < 0.) ? -1 : +1;
3524 Int_t incry = (tnorm[9] < 0.) ? -1 : +1;
3525 if (*chopt !=
'B' && *chopt !=
'b') {
3526 incrx = -incrx; incry = -incry;
3528 Int_t ix1 = (incrx == +1) ? 1 : nx;
3529 Int_t iy1 = (incry == +1) ? 1 : ny;
3530 Int_t ix2 = (incrx == +1) ? nx : 1;
3531 Int_t iy2 = (incry == +1) ? ny : 1;
3535 for (
Int_t iy = iy1; iy != iy2+incry; iy += incry) {
3536 for (
Int_t ix = ix1; ix != ix2+incrx; ix += incrx) {
3537 if (!painter->
IsInside(ix,iy))
continue;
3539 for (
Int_t i = 0; i < 4; ++i) {
3540 xyz[i*3 + 0] = f[i*3 + 0];
3541 xyz[i*3 + 1] = f[i*3 + 1];
3542 xyz[i*3 + 2] = f[i*3 + 2];
3545 if (Hoption.
Proj == 1 ) {
3549 }
else if (Hoption.
Proj == 2 ) {
3553 }
else if (Hoption.
Proj == 3) {
3557 }
else if (Hoption.
Proj == 4) {
3567 (this->*
fDrawFace)(icodes, xyz, 4, iface, tt);
3577 static Int_t ixadd[4] = { 0,1,1,0 };
3578 static Int_t iyadd[4] = { 0,0,1,1 };
3583 Double_t xlab1l, xlab2l, ylab1l, ylab2l;
3584 Int_t i, ixa, iya, icx, ixt, iyt;
3590 ixt = ia + Hparam.
xfirst - 1;
3591 iyt = ib + Hparam.
yfirst - 1;
3595 yval1l = Hparam.
ymin;
3596 yval2l = Hparam.
ymax;
3617 for (i = 1; i <= 4; ++i) {
3628 if (f[i*3 + 1] > 0) f[i*3 + 1] =
TMath::Log10(f[i*3 + 1]);
3629 else f[i*3 + 1] = Hparam.
xmin;
3632 if (f[i*3 + 2] > 0) f[i*3 + 2] =
TMath::Log10(f[i*3 + 2]);
3633 else f[i*3 + 2] = Hparam.
ymin;
3638 f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3639 f[i*3 + 2] = (f[i*3 + 2] - yval1l) / (yval2l - yval1l);
3641 f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3643 f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3644 f[i*3 + 2] = 360*(f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l);
3646 f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3647 f[i*3 + 2] = (180 - dangle*2)*(f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l) + dangle;
3655 if (icx > Hparam.
xlast) icx = 1;
3659 else f[i*3+3] = Hparam.
zmin;
3660 if (f[i*3+3] < Hparam.
zmin) f[i*3+3] = Hparam.
zmin;
3661 if (f[i*3+3] > Hparam.
zmax) f[i*3+3] = Hparam.
zmax;
3670 t[i] = f[i * 3 + 3];
3674 if (Hoption.
Surf == 23) {
3675 for (i = 1; i <= 4; ++i) f[i * 3 + 3] =
fRmax[2];
3679 for (i = 1; i <= 4; ++i) {
3680 f[i*3 + 3] = (1 - rinrad)*((f[i*3 + 3] - Hparam.
zmin) /
3681 (Hparam.
zmax - Hparam.
zmin)) + rinrad;
3699 static Int_t iface[4] = { 1,2,3,4 };
3704 Error(
"SurfacePolar",
"no TView in current pad");
3708 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3710 Int_t i, j, incrr, ir1, ir2;
3712 Int_t ia, ib, ir, jr, nr, icodes[3];
3729 Error(
"SurfacePolar",
"too many PHI sectors (%d)", nphi);
3733 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3738 if (iordr == 0) ia = nr;
3739 if (iordr != 0) ib = nr;
3740 for (i = 1; i <= nphi; ++i) {
3741 if (iordr == 0) ib = i;
3742 if (iordr != 0) ia = i;
3744 if (i == 1)
fAphi[0] = f[jphi - 1];
3745 fAphi[i - 1] = (
fAphi[i - 1] + f[jphi - 1]) / (
float)2.;
3746 fAphi[i] = f[jphi + 5];
3756 if (iphi > nphi)
goto L300;
3759 if (iordr == 0) {ia = nr; ib = iphi;}
3760 else {ia = iphi;ib = nr;}
3763 phi =
kRad*((f[jphi - 1] + f[jphi + 5]) / 2);
3767 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
3773 for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
3774 if (iordr == 0) ia = ir;
3775 if (iordr != 0) ib = ir;
3778 for (i = 1; i <= 4; ++i) {
3780 if (iordr != 0 && i == 2) j = 4;
3781 if (iordr != 0 && i == 4) j = 2;
3782 xyz[j*3 - 3] = f[jr + i*3 - 4]*
TMath::Cos(f[jphi + i*3 - 4]*
kRad);
3783 xyz[j*3 - 2] = f[jr + i*3 - 4]*
TMath::Sin(f[jphi + i*3 - 4]*
kRad);
3784 xyz[j*3 - 1] = f[i*3 - 1];
3785 ttt[j - 1] = tt[i - 1];
3789 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3794 if (iphi == 0) iphi = kphi;
3795 if (iphi > kphi) iphi = 1;
3796 if (iphi != iphi2)
goto L100;
3797 if (incr == 0)
return;
3822 static Int_t iface[4] = { 1,2,3,4 };
3824 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3825 Int_t i, j, incrz, nz, iz1, iz2;
3826 Int_t ia, ib, iz, jz, icodes[3];
3836 Error(
"SurfaceCylindrical",
"no TView in current pad");
3852 Error(
"SurfaceCylindrical",
"too many PHI sectors (%d)", nphi);
3856 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3861 if (iordr == 0) ia = nz;
3862 if (iordr != 0) ib = nz;
3863 for (i = 1; i <= nphi; ++i) {
3864 if (iordr == 0) ib = i;
3865 if (iordr != 0) ia = i;
3867 if (i == 1)
fAphi[0] = f[jphi - 1];
3868 fAphi[i - 1] = (
fAphi[i - 1] + f[jphi - 1]) / (
float)2.;
3869 fAphi[i] = f[jphi + 5];
3877 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
3889 if (iphi > nphi)
goto L400;
3890 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
3891 if (iordr == 0) {ia = iz; ib = iphi;}
3892 else {ia = iphi; ib = iz;}
3894 for (i = 1; i <= 4; ++i) {
3896 if (iordr == 0 && i == 2) j = 4;
3897 if (iordr == 0 && i == 4) j = 2;
3900 xyz[j*3 - 1] = f[jz + i*3 - 4];
3901 ttt[j - 1] = tt[i - 1];
3905 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3910 if (iphi == 0) iphi = kphi;
3911 if (iphi > kphi) iphi = 1;
3912 if (iphi != iphi2)
goto L100;
3913 if (incr == 0)
return;
3937 static Int_t iface[4] = { 1,2,3,4 };
3939 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3940 Int_t i, j, incrth, ith, jth, kth, nth, mth, ith1, ith2;
3941 Int_t ia, ib, icodes[3];
3951 Error(
"SurfaceSpherical",
"no TView in current pad");
3967 Error(
"SurfaceSpherical",
"too many THETA sectors (%d)", nth);
3971 Error(
"SurfaceSpherical",
"too many PHI sectors (%d)", nphi);
3975 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3981 if (mth == 0) mth = 1;
3982 if (iordr == 0) ia = mth;
3983 if (iordr != 0) ib = mth;
3984 for (i = 1; i <= nphi; ++i) {
3985 if (iordr == 0) ib = i;
3986 if (iordr != 0) ia = i;
3988 if (i == 1)
fAphi[0] = f[jphi - 1];
3989 fAphi[i - 1] = (
fAphi[i - 1] + f[jphi - 1]) / (
float)2.;
3990 fAphi[i] = f[jphi + 5];
3995 if (iordr == 0) ib = 1;
3996 if (iordr != 0) ia = 1;
3997 for (i = 1; i <= nth; ++i) {
3998 if (iordr == 0) ia = i;
3999 if (iordr != 0) ib = i;
4002 if (i == 1)
fAphi[0] = f[jth - 1];
4003 fAphi[i - 1] = (
fAphi[i - 1] + f[jth - 1]) / (
float)2.;
4004 fAphi[i] = f[jth + 5];
4014 if (iphi > nphi)
goto L500;
4017 if (iordr == 0) {ia = mth; ib = iphi;}
4018 else {ia = iphi;ib = mth;}
4021 phi = (f[jphi - 1] + f[jphi + 5]) / (
float)2.;
4026 if (ith > nth)
goto L400;
4027 if (iordr == 0) ia = ith;
4028 if (iordr != 0) ib = ith;
4032 for (i = 1; i <= 4; ++i) {
4034 if (iordr != 0 && i == 2) j = 4;
4035 if (iordr != 0 && i == 4) j = 2;
4040 ttt[j - 1] = tt[i - 1];
4043 for (i = 1; i <= 4; ++i) {
4045 if (iordr != 0 && i == 2) j = 4;
4046 if (iordr != 0 && i == 4) j = 2;
4050 ttt[j - 1] = tt[i - 1];
4055 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
4059 if (ith == 0) ith = kth;
4060 if (ith > kth) ith = 1;
4061 if (ith != ith2)
goto L200;
4062 if (incrth == 0)
goto L500;
4073 if (iphi == 0) iphi = kphi;
4074 if (iphi > kphi) iphi = 1;
4075 if (iphi != iphi2)
goto L100;
4076 if (incr == 0)
return;
4101 if (qqa < 0 || qqa > 1 || qqd < 0 || qqd > 1 || qqs < 0 || qqs > 1 || nnqs < 1) {
4102 Error(
"SurfaceProperty",
"error in coefficients");
4129 Int_t ix1, iy1, iz1;
4130 Int_t ix2, iy2, iz2;
4131 Int_t incr, incrx, incry, incrz;
4132 Int_t icodes[3], i, i1, i2, k, nnod, ntria;
4135 Double_t p[8][3], pf[8], pn[8][3], t[3], fsurf, w;
4144 Error(
"ImplicitFunction",
"no TView in current pad");
4151 if (*chopt ==
'B' || *chopt ==
'b') {
4160 if (tnorm[8] < 0.) incrx =-incrx;
4161 if (tnorm[9] < 0.) incry =-incry;
4162 if (tnorm[10] < 0.) incrz =-incrz;
4166 if (incrx == -1) ix1 = nx;
4167 if (incry == -1) iy1 = ny;
4168 if (incrz == -1) iz1 = nz;
4172 dx = (rmax[0]-rmin[0]) / nx;
4173 dy = (rmax[1]-rmin[1]) / ny;
4174 dz = (rmax[2]-rmin[2]) / nz;
4177 Float_t r=0.,
g=0.,
b=0., hue, light, satur, light2;
4179 if (colref) colref->
GetRGB(r,
g,
b);
4187 light2 = 1-.5*light;
4193 if (colref) colref->
GetRGB(r,
g,
b);
4198 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
4199 z1 = (iz-1)*dz + rmin[2];
4209 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
4210 y1 = (iy-1)*dy + rmin[1];
4233 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
4260 if (pf[0] >= -
kFdel)
goto L110;
4261 if (pf[1] >= -
kFdel)
goto L120;
4262 if (pf[2] >= -
kFdel)
goto L120;
4263 if (pf[3] >= -
kFdel)
goto L120;
4264 if (pf[4] >= -
kFdel)
goto L120;
4265 if (pf[5] >= -
kFdel)
goto L120;
4266 if (pf[6] >= -
kFdel)
goto L120;
4267 if (pf[7] >= -
kFdel)
goto L120;
4270 if (pf[1] < -
kFdel)
goto L120;
4271 if (pf[2] < -
kFdel)
goto L120;
4272 if (pf[3] < -
kFdel)
goto L120;
4273 if (pf[4] < -
kFdel)
goto L120;
4274 if (pf[5] < -
kFdel)
goto L120;
4275 if (pf[6] < -
kFdel)
goto L120;
4276 if (pf[7] < -
kFdel)
goto L120;
4291 pn[0][0] = (pf[1] - pf[0]) / dx;
4292 pn[3][0] = (pf[2] - pf[3]) / dx;
4293 pn[4][0] = (pf[5] - pf[4]) / dx;
4294 pn[7][0] = (pf[6] - pf[7]) / dx;
4302 pn[1][0] = (pf[1] - pf[0]) / dx;
4303 pn[2][0] = (pf[2] - pf[3]) / dx;
4304 pn[5][0] = (pf[5] - pf[4]) / dx;
4305 pn[6][0] = (pf[6] - pf[7]) / dx;
4314 pn[0][1] = (pf[3] - pf[0]) / dy;
4315 pn[1][1] = (pf[2] - pf[1]) / dy;
4316 pn[4][1] = (pf[7] - pf[4]) / dy;
4317 pn[5][1] = (pf[6] - pf[5]) / dy;
4325 pn[2][1] = (pf[2] - pf[1]) / dy;
4326 pn[3][1] = (pf[3] - pf[0]) / dy;
4327 pn[6][1] = (pf[6] - pf[5]) / dy;
4328 pn[7][1] = (pf[7] - pf[4]) / dy;
4337 pn[0][2] = (pf[4] - pf[0]) / dz;
4338 pn[1][2] = (pf[5] - pf[1]) / dz;
4339 pn[2][2] = (pf[6] - pf[2]) / dz;
4340 pn[3][2] = (pf[7] - pf[3]) / dz;
4348 pn[4][2] = (pf[4] - pf[0]) / dz;
4349 pn[5][2] = (pf[5] - pf[1]) / dz;
4350 pn[6][2] = (pf[6] - pf[2]) / dz;
4351 pn[7][2] = (pf[7] - pf[3]) / dz;
4359 MarchingCube(fsurf, p, pf, pn, nnod, ntria, xyz, grad, itria);
4360 if (ntria == 0)
goto L510;
4362 for ( i=1 ; i<=nnod ; i++ ) {
4363 view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
4367 ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
4368 if (ntria == 0)
goto L510;
4370 if (*chopt ==
'B' || *chopt ==
'b') incr =-1;
4372 if (incr == -1) i1 = ntria;
4373 i2 = ntria - i1 + 1;
4379 for (i=i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
4415 static Int_t irota[24][8] = { { 1,2,3,4,5,6,7,8 }, { 2,3,4,1,6,7,8,5 },
4416 { 3,4,1,2,7,8,5,6 }, { 4,1,2,3,8,5,6,7 },
4417 { 6,5,8,7,2,1,4,3 }, { 5,8,7,6,1,4,3,2 },
4418 { 8,7,6,5,4,3,2,1 }, { 7,6,5,8,3,2,1,4 },
4419 { 2,6,7,3,1,5,8,4 }, { 6,7,3,2,5,8,4,1 },
4420 { 7,3,2,6,8,4,1,5 }, { 3,2,6,7,4,1,5,8 },
4421 { 5,1,4,8,6,2,3,7 }, { 1,4,8,5,2,3,7,6 },
4422 { 4,8,5,1,3,7,6,2 }, { 8,5,1,4,7,6,2,3 },
4423 { 5,6,2,1,8,7,3,4 }, { 6,2,1,5,7,3,4,8 },
4424 { 2,1,5,6,3,4,8,7 }, { 1,5,6,2,4,8,7,3 },
4425 { 4,3,7,8,1,2,6,5 }, { 3,7,8,4,2,6,5,1 },
4426 { 7,8,4,3,6,5,1,2 }, { 8,4,3,7,5,1,2,6 } };
4428 static Int_t iwhat[21] = { 1,3,5,65,50,67,74,51,177,105,113,58,165,178,
4429 254,252,250,190,205,188,181 };
4430 Int_t j, i, i1, i2, i3, ir, irt=0, k, k1, k2, incr, icase=0,
n;
4437 for ( i=1; i<=8 ; i++) {
4438 fF8[i-1] = f[i-1] - fiso;
4440 for ( ir=1 ; ir<=24 ; ir++ ) {
4443 for ( i=1 ; i<=8 ; i++ ) {
4444 if (
fF8[irota[ir-1][i-1]-1] >= 0.) k = k + incr;
4447 if (k==0 || k==255)
return;
4448 for ( i=1 ; i<=21 ; i++ ) {
4449 if (k != iwhat[i-1])
continue;
4458 for ( i=1 ; i<=8 ; i++ ) {
4459 k = irota[irt-1][i-1];
4460 fF8[i-1] = f[k-1] - fiso;
4461 fP8[i-1][0] = p[k-1][0];
4462 fP8[i-1][1] = p[k-1][1];
4463 fP8[i-1][2] = p[k-1][2];
4464 fG8[i-1][0] = g[k-1][0];
4465 fG8[i-1][1] = g[k-1][1];
4466 fG8[i-1][2] = g[k-1][2];
4471 switch ((
int)icase) {
4474 MarchingCubeCase00(1, 4, 9, 0, 0, 0, nnod, ntria, xyz, grad, itria);
4478 MarchingCubeCase00(2, 4, 9, 10, 0, 0, nnod, ntria, xyz, grad, itria);
4490 MarchingCubeCase00(6, 2, 1, 9, 8, 0, nnod, ntria, xyz, grad, itria);
4501 MarchingCubeCase00(2, 4, 8, 6, 0, 0, nnod, ntria, xyz, grad, itria);
4504 MarchingCubeCase00(1, 4, 12, 7, 6, 10, nnod, ntria, xyz, grad, itria);
4510 MarchingCubeCase00(1, 4, 8, 7, 11, 10, nnod, ntria, xyz, grad, itria);
4519 MarchingCubeCase00(1, 9, 12, 7, 6, 2, nnod, ntria, xyz, grad, itria);
4525 if (ntria == 0)
return;
4526 if (icase <= 14)
goto L500;
4527 for ( i=1; i<=ntria ; i++ ) {
4531 if (itria[i-1][2] < 0) i1 =-i1;
4532 if (itria[i-1][1] < 0) i3 =-i3;
4533 if (itria[i-1][0] < 0) i2 =-i2;
4543 if (
n > ntria)
return;
4544 for ( i=1 ; i<=3 ; i++ ) {
4547 if (i2 == 4) i2 = 1;
4554 if (i3 == 0) i3 = 3;
4561 for ( i=1 ; i<=3 ; i++ ) {
4562 itr[i-1] = itria[
n-1][i-1];
4563 itria[
n-1][i-1] = itria[ntria-1][i-1];
4566 if (ntria == 0)
return;
4567 if (itr[i2-1]*itr[i3-1] > 0)
goto L510;
4570 if (itr[i2-1] < 0) {
4574 if (itr[i3-1] < 0) {
4578 for ( j=1 ; j<=ntria ; j++ ) {
4579 for ( i=1 ; i<=3 ; i++ ) {
4580 if (itria[j-1][i-1] != k2)
continue;
4583 if (i2 == k1) itria[j-1][i-1] =-itria[j-1][i-1];
4604 static Int_t it[4][4][3] = { { { 1,2, 3 }, { 0,0, 0 }, { 0,0, 0 }, { 0,0, 0 } },
4605 { { 1,2,-3 }, {-1,3, 4 }, { 0,0, 0 }, { 0,0, 0 } },
4606 { { 1,2,-3 }, {-1,3,-4 }, {-1,4, 5 }, { 0,0, 0 } },
4607 { { 1,2,-3 }, {-1,3,-4 }, {-4,6,-1 }, { 4,5,-6 } }
4609 Int_t it2[4][3], i, j;
4621 if (ie[5] == 0) nnod = 5;
4622 if (ie[4] == 0) nnod = 4;
4623 if (ie[3] == 0) nnod = 3;
4629 for ( i=0; i<3 ; i++) {
4630 for ( j=0; j<4 ; j++) {
4631 it2[j][i] = it[ntria-1][j][i];
4644 static Int_t ie[6] = { 4,9,1, 2,11,3 };
4645 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4646 static Int_t it2[4][3] = { { 1,2,-5 }, { -1,5,6 }, { 5,-2,4 }, { -4,2,3 } };
4654 if (f0>=0. &&
fF8[0]>=0.)
goto L100;
4655 if (f0<0. &&
fF8[0]<0.)
goto L100;
4673 static Int_t ie[6] = { 4,9,1, 7,11,6 };
4674 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4675 static Int_t it2[6][3] = { { 1,2,4 }, { 2,3,6 }, { 3,1,5 },
4676 { 4,5,1 }, { 5,6,3 }, { 6,4,2 } };
4703 static Int_t ie[7] = { 2,4,9,10, 6,7,11 };
4704 static Int_t it1[5][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 } };
4705 static Int_t it2[3][3] = { { 1,2,-3 }, { -1,3,4 }, { 5,6,7 } };
4706 static Int_t it3[7][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 },
4707 { 1,7,-5 }, { -1,5,4 } };
4715 if (f0>=0. &&
fF8[1]>=0.)
goto L100;
4716 if (f0<0. &&
fF8[1]<0.)
goto L100;
4745 static Int_t ie[9] = { 3,12,4, 1,10,2, 11,6,7 };
4746 static Int_t it[9][9][3] = {
4747 {{ 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}},
4748 {{ 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}},
4749 {{ 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}},
4750 {{-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}},
4751 {{ 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}},
4752 {{-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}},
4753 {{ 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}},
4754 {{ 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}},
4755 {{ -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}}
4758 Int_t it2[9][3], i, j;
4769 if (f1>=0. &&
fF8[2] <0.) icase = icase + 1;
4770 if (f1 <0. &&
fF8[2]>=0.) icase = icase + 1;
4771 if (f2>=0. &&
fF8[2] <0.) icase = icase + 2;
4772 if (f2 <0. &&
fF8[2]>=0.) icase = icase + 2;
4773 if (f3>=0. &&
fF8[2] <0.) icase = icase + 4;
4774 if (f3 <0. &&
fF8[2]>=0.) icase = icase + 4;
4777 switch ((
int)icase) {
4798 for ( i=0; i<3 ; i++) {
4799 for ( j=0; j<9 ; j++) {
4800 it2[j][i] = it[icase-1][j][i];
4810 if (irep != 2)
goto L400;
4817 for ( i=0; i<3 ; i++) {
4818 for ( j=0; j<9 ; j++) {
4819 it2[j][i] = it[icase-1][j][i];
4833 static Int_t ie[8] = { 1,3,12,9, 5,7,11,10 };
4834 static Int_t it[6][8][3] = {
4835 {{1,2,-3}, {-1,3,4}, {5,6,-7}, {-5,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4836 {{ 9,1,2}, { 9,2,3}, { 9,3,4}, { 9,4,5}, { 9,5,6}, { 9,6,7}, { 9,7,8}, { 9,8,1}},
4837 {{ 9,1,2}, { 9,4,1}, { 9,3,4}, { 9,6,3}, { 9,5,6}, { 9,8,5}, { 9,7,8}, { 9,2,7}},
4838 {{1,2,-7}, {-1,7,8}, {5,6,-3}, {-5,3,4}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4839 {{1,2,-7}, {-1,7,8}, {2,3,-6}, {-2,6,7}, {3,4,-5}, {-3,5,6}, {4,1,-8}, {-4,8,5}},
4840 {{1,2,-3}, {-1,3,4}, {2,7,-6}, {-2,6,3}, {7,8,-5}, {-7,5,6}, {8,1,-4}, {-8,4,5}}
4842 Int_t it2[8][3], i, j;
4852 if (f1 >= 0.) icase = icase + 1;
4853 if (f2 >= 0.) icase = icase + 2;
4854 if (icase==1 || icase==4)
goto L100;
4860 for ( i=0; i<3 ; i++) {
4861 for ( j=0; j<8 ; j++) {
4862 it2[j][i] = it[icase-1][j][i];
4873 if (irep == 0)
goto L200;
4876 if (icase == 1) icase = 5;
4877 if (icase == 4) icase = 6;
4882 for ( i=0; i<3 ; i++) {
4883 for ( j=0; j<8 ; j++) {
4884 it2[j][i] = it[icase-1][j][i];
4898 static Int_t ie[8] = { 3,12,4, 1,9,8,6,2 };
4899 static Int_t it[6][8][3] = {
4900 {{ 1,2,3}, {4,5,-6}, {-4,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4901 {{-9,1,2}, {9,2,-3}, {-9,3,4}, {9,4,-5}, {-9,5,6}, {9,6,-7}, {-9,7,8}, {9,8,-1}},
4902 {{9,1,-2}, {-9,2,6}, {9,6,-7}, {-9,7,8}, {9,8,-4}, {-9,4,5}, {9,5,-3}, {-9,3,1}},
4903 {{ 3,4,5}, {1,2,-6}, {-1,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4904 {{ 7,8,6}, {6,8,-1}, {-6,1,2}, {3,1,-8}, {-3,8,4}, { 3,4,5}, {3,5,-6}, {-3,6,2}},
4905 {{ 7,8,6}, {6,8,-4}, {-6,4,5}, {3,4,-8}, {-3,8,1}, { 3,1,2}, {3,2,-6}, {-3,6,5}}
4907 Int_t it2[8][3], i, j;
4917 if (f1 >= 0.) icase = icase + 1;
4918 if (f2 >= 0.) icase = icase + 2;
4919 if (icase==1 || icase==4)
goto L100;
4925 for ( i=0; i<3 ; i++) {
4926 for ( j=0; j<8 ; j++) {
4927 it2[j][i] = it[icase-1][j][i];
4938 if (irep != 1)
goto L200;
4941 if (icase == 1) icase = 5;
4942 if (icase == 4) icase = 6;
4947 for ( i=0; i<3 ; i++) {
4948 for ( j=0; j<8 ; j++) {
4949 it2[j][i] = it[icase-1][j][i];
4963 Int_t nr, nf, i, k, incr,
n, kr, icase, irep;
4964 static Int_t irota[12][8] = {
4965 {1,2,3,4,5,6,7,8}, {1,5,6,2,4,8,7,3}, {1,4,8,5,2,3,7,6},
4966 {3,7,8,4,2,6,5,1}, {3,2,6,7,4,1,5,8}, {3,4,1,2,7,8,5,6},
4967 {6,7,3,2,5,8,4,1}, {6,5,8,7,2,1,4,3}, {6,2,1,5,7,3,4,8},
4968 {8,4,3,7,5,1,2,6}, {8,5,1,4,7,6,2,3}, {8,7,6,5,4,3,2,1} };
4969 static Int_t iwhat[8] = { 63,62,54,26,50,9,1,0 };
4970 static Int_t ie[12] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
4971 static Int_t iface[6][4] = {
4972 {1,2,3,4}, {5,6,7,8}, {1,2,6,5}, {2,6,7,3}, {4,3,7,8}, {1,5,8,4} };
4973 static Int_t it1[4][3] = { {1,2,10}, {9,5,8}, {6,11,7}, {3,4,12} };
4974 static Int_t it2[4][3] = { {5,6,10}, {1,4,9}, {2,11,3}, {7,8,12} };
4975 static Int_t it3[6][3] = { {10,12,-3}, {-10,3,2}, {12,10,-1}, {-12,1,4},
4976 {9,5,8}, {6,11,7} };
4977 static Int_t it4[6][3] = { {11,9,-1}, {-11,1,2}, {9,11,-3}, {-9,3,4},
4978 {5,6,10}, {7,8,12} };
4979 static Int_t it5[10][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
4980 {13,10,1}, {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2}, {5,8,9} };
4981 static Int_t it6[10][3] = { {13,2,-10}, {-13,10,5}, {13,5,-6}, {-13,6,11},
4982 {13,11,3}, {13,3,-4}, {-13,4,9}, {13,9,-1}, {-13,1,2}, {12,7,8} };
4983 static Int_t it7[12][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
4984 {13,10,-5}, {-13,5,8}, {13,8,-9}, {-13,9,1},
4985 {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2} };
4986 static Int_t it8[6][3] = { {3,8,12}, {3,-2,-8}, {-2,5,-8}, {2,10,-5},
4987 {7,6,11}, {1,4,9} };
4988 static Int_t it9[10][3] = { {7,12,-3}, {-7,3,11}, {11,3,2}, {6,11,-2}, {-6,2,10},
4989 {6,10,5}, {7,6,-5}, {-7,5,8}, {7,8,12}, {1,4,9} };
4990 static Int_t it10[10][3] = { {9,1,-10}, {-9,10,5}, {9,5,8}, {4,9,-8}, {-4,8,12},
4991 {4,12,3}, {1,4,-3}, {-1,3,2}, {1,2,10}, {7,6,11} };
4997 for ( nr=1 ; nr<=12 ; nr++ ) {
5000 for ( nf=1 ; nf<=6 ; nf++ ) {
5001 f1 =
fF8[irota[nr-1][iface[nf-1][0]-1]-1];
5002 f2 =
fF8[irota[nr-1][iface[nf-1][1]-1]-1];
5003 f3 =
fF8[irota[nr-1][iface[nf-1][2]-1]-1];
5004 f4 =
fF8[irota[nr-1][iface[nf-1][3]-1]-1];
5005 if ((f1*f3-f2*f4)/(f1+f3-f2-f4) >= 0.) k = k + incr;
5008 for ( i=1 ; i<=8 ; i++ ) {
5009 if (k != iwhat[i-1])
continue;
5015 Error(
"MarchingCubeCase13",
"configuration is not found");
5020 if (icase==1 || icase==8)
goto L300;
5021 for ( n=1 ; n<=8 ; n++) {
5022 k = irota[kr-1][n-1];
5024 for ( i=1 ; i<=3 ; i++ ) {
5025 xyz[n-1][i-1] =
fP8[k-1][i-1];
5026 grad[n-1][i-1] =
fG8[k-1][i-1];
5029 for ( n=1 ; n<=8 ; n++ ) {
5031 for ( i=1 ; i<=3 ; i++ ) {
5032 fP8[n-1][i-1] = xyz[n-1][i-1];
5033 fG8[n-1][i-1] = grad[n-1][i-1];
5043 switch ((
int)icase) {
5064 &xyz[nnod-1][0], &grad[nnod-1][0]);
5071 &xyz[nnod-1][0], &grad[nnod-1][0]);
5078 &xyz[nnod-1][0], &grad[nnod-1][0]);
5085 switch ((
int)(irep+1)) {
5114 for ( n=1 ; n<=ntria ; n++ ) {
5115 for ( i=1 ; i<=3 ; i++ ) {
5117 itria[n-1][i-1] = k;
5141 for ( i=1 ; i<=3 ; i++ ) {
5145 for ( n=1 ; n<=nnod ; n++ ) {
5148 for ( i=1 ; i<=3 ; i++ ) {
5149 p[i-1] = p[i-1] + xyz[k-1][i-1];
5150 g[i-1] = g[i-1] + grad[k-1][i-1];
5153 for ( i=1 ; i<=3 ; i++ ) {
5154 pxyz[i-1] = p[i-1] / nnod;
5155 pgrad[i-1] = g[i-1] / nnod;
5177 a = (a11-a01)*(b00-b10) - (a00-a10)*(b11-b01);
5178 if (a == 0.)
return;
5179 b = a01*(b00-b10)-(a11-a01)*b00-(a00-a10)*b01+a00*(b11-b01);
5180 c = a00*b01 - a01*b00;
5182 if (d <= 0.)
return;
5185 s1 = (-b+
d) / (2*a);
5186 if (s1<0. || s1>1.)
return;
5188 s2 = (-b-
d) / (2*a);
5189 if (s2<0. || s2>1.)
return;
5193 if (a00 >= 0) iposa = iposa + 1;
5194 if (a01 >= 0) iposa = iposa + 2;
5195 if (a10 >= 0) iposa = iposa + 4;
5196 if (a11 >= 0) iposa = iposa + 8;
5197 if (iposa==6 || iposa==9)
goto L100;
5203 s0 = (a00-a01) / (a00+a11-a10-a01);
5204 if (s1>=s0 && s2<s0)
return;
5205 if (s1<s0 && s2>=s0)
return;
5207 if (s1 >= s0) irep = 2;
5211 if (b00 >= 0) iposb = iposb + 1;
5212 if (b01 >= 0) iposb = iposb + 2;
5213 if (b10 >= 0) iposb = iposb + 4;
5214 if (b11 >= 0) iposb = iposb + 8;
5215 if (iposb!=6 && iposb!=9)
return;
5216 s0 = (b00-b01) / (b00+b11-b10-b01);
5217 if (iposa != iposb)
goto L200;
5219 if (irep==1 && s1>s0)
return;
5220 if (irep==2 && s1<s0)
return;
5225 if (irep==1 && s1<s0)
return;
5226 if (irep==2 && s1>s0)
return;
5245 static Int_t iedge[12][2] = {
5246 {1,2}, {2,3}, {3,4}, {4,1}, {5,6}, {6,7}, {7,8}, {8,5}, {1,5}, {2,6}, {3,7}, {4,8} };
5248 for ( n=1 ; n<=nnod ; n++ ) {
5254 for ( i=1 ; i<=3 ; i++ ) {
5255 xyz[n-1][i-1] = (
fP8[n2-1][i-1]-
fP8[n1-1][i-1])*t +
fP8[n1-1][i-1];
5256 grad[n-1][i-1] = (
fG8[n2-1][i-1]-
fG8[n1-1][i-1])*t +
fG8[n1-1][i-1];
5277 Int_t n, nf, i1, i2, i3, i, icur, k, itst, kface, kf, irep;
5287 for ( n=1 ; n<=nface ; n++ ) {
5311 for ( i=1 ; i<=3 ; i++ ) {
5312 wmin = xyz[i1-1][i-1];
5313 wmax = xyz[i1-1][i-1];
5314 if (wmin > xyz[i2-1][i-1]) wmin = xyz[i2-1][i-1];
5315 if (wmax < xyz[i2-1][i-1]) wmax = xyz[i2-1][i-1];
5316 if (wmin > xyz[i3-1][i-1]) wmin = xyz[i3-1][i-1];
5317 if (wmax < xyz[i3-1][i-1]) wmax = xyz[i3-1][i-1];
5318 dface[n-1][i-1] = wmin;
5319 dface[n-1][i+2] = wmax;
5322 for ( i=1 ; i<=3 ; i++ ) {
5323 v[0][i-1] = xyz[i2-1][i-1] - xyz[i1-1][i-1];
5324 v[1][i-1] = xyz[i3-1][i-1] - xyz[i2-1][i-1];
5326 a = (v[0][1]*v[1][2] - v[0][2]*v[1][1]);
5327 b = (v[0][2]*v[1][0] - v[0][0]*v[1][2]);
5328 c = (v[0][0]*v[1][1] - v[0][1]*v[1][0]);
5337 abcd[n-1][3] =-(a*xyz[i1-1][0] + b*xyz[i1-1][1] + c*xyz[i1-1][2]);
5340 if (nf <= 1)
return;
5343 for ( icur=2 ; icur<=nface ; icur++ ) {
5345 zcur = dface[k-1][2];
5346 for ( itst=icur-1 ; itst>=1 ; itst-- ) {
5348 if (zcur < dface[k-1][2])
break;
5350 iorder[itst-1] = iorder[itst];
5358 if (kface == 1)
goto L900;
5359 nf = iorder[kface-1];
5360 if (nf < 0) nf =-nf;
5361 abcdn[0] = abcd[nf-1][0];
5362 abcdn[1] = abcd[nf-1][1];
5363 abcdn[2] = abcd[nf-1][2];
5364 abcdn[3] = abcd[nf-1][3];
5370 for ( k=kface-1 ; k>=1 ; k-- ) {
5372 if (kf < 0) kf =-kf;
5373 if (dface[nf-1][5] > dface[kf-1][2]+
kDel)
goto L400;
5374 if (iorder[k-1] > 0)
goto L900;
5379 if (dface[kf-1][0] >= dface[nf-1][3]-
kDel)
goto L800;
5380 if (dface[kf-1][3] <= dface[nf-1][0]+
kDel)
goto L800;
5381 if (dface[kf-1][1] >= dface[nf-1][4]-
kDel)
goto L800;
5382 if (dface[kf-1][4] <= dface[nf-1][1]+
kDel)
goto L800;
5388 if (abcdn[0]*xyz[kk[0]-1][0]+abcdn[1]*xyz[kk[0]-1][1]+
5389 abcdn[2]*xyz[kk[0]-1][2]+abcdn[3] < -
kDel)
goto L500;
5390 if (abcdn[0]*xyz[kk[1]-1][0]+abcdn[1]*xyz[kk[1]-1][1]+
5391 abcdn[2]*xyz[kk[1]-1][2]+abcdn[3] < -
kDel)
goto L500;
5392 if (abcdn[0]*xyz[kk[2]-1][0]+abcdn[1]*xyz[kk[2]-1][1]+
5393 abcdn[2]*xyz[kk[2]-1][2]+abcdn[3] < -
kDel)
goto L500;
5398 abcdk[0] = abcd[kf-1][0];
5399 abcdk[1] = abcd[kf-1][1];
5400 abcdk[2] = abcd[kf-1][2];
5401 abcdk[3] = abcd[kf-1][3];
5402 if (abcdk[0]*xyz[nn[0]-1][0]+abcdk[1]*xyz[nn[0]-1][1]+
5403 abcdk[2]*xyz[nn[0]-1][2]+abcdk[3] >
kDel)
goto L600;
5404 if (abcdk[0]*xyz[nn[1]-1][0]+abcdk[1]*xyz[nn[1]-1][1]+
5405 abcdk[2]*xyz[nn[1]-1][2]+abcdk[3] >
kDel)
goto L600;
5406 if (abcdk[0]*xyz[nn[2]-1][0]+abcdk[1]*xyz[nn[2]-1][1]+
5407 abcdk[2]*xyz[nn[2]-1][2]+abcdk[3] >
kDel)
goto L600;
5413 for ( i=1 ; i<=3 ; i++ ) {
5416 if (i != 3) i2 = kk[i];
5418 if ( irep<0 )
goto L700;
5419 if ( irep==0 )
continue;
5420 if ( irep>0 )
goto L800;
5423 for ( i=1 ; i<=3 ; i++ ) {
5426 if (i != 3) i2 = nn[i];
5428 if ( irep<0 )
goto L800;
5429 if ( irep==0 )
continue;
5430 if ( irep>0 )
goto L700;
5437 for ( i=k+1 ; i<=kface ; i++ ) {
5438 iorder[i-2] = iorder[i-1];
5440 iorder[kface-1] =-kf;
5441 if (kf > 0)
goto L300;
5449 if (iorder[kface-1] < 0) iorder[kface-1] =-iorder[kface-1];
5451 if (kface > 0)
goto L300;
5469 Int_t k, k1, k2, ixy, i;
5470 Double_t a,
b,
c, d1, d2, dd,
xy, tmin, tmax, tmid,
x,
y,
z;
5476 delta[0] = xyz[i2-1][0] - xyz[i1-1][0];
5477 delta[1] = xyz[i2-1][1] - xyz[i1-1][1];
5478 delta[2] = xyz[i2-1][2] - xyz[i1-1][2];
5484 c =-(a*xyz[i1-1][0] + b*xyz[i1-1][1]);
5485 d[0] = a*xyz[iface[0]-1][0] + b*xyz[iface[0]-1][1] +
c;
5486 d[1] = a*xyz[iface[1]-1][0] + b*xyz[iface[1]-1][1] +
c;
5487 d[2] = a*xyz[iface[2]-1][0] + b*xyz[iface[2]-1][1] +
c;
5489 for ( i=1 ; i<=3 ; i++ ) {
5493 if (d[k1-1]>=0. && d[k2-1]>=0.)
continue;
5494 if (d[k1-1] <0. && d[k2-1] <0.)
continue;
5495 d1 = d[k1-1] / (d[k1-1] - d[k2-1]);
5496 d2 = d[k2-1] / (d[k1-1] - d[k2-1]);
5497 xy = d1*xyz[iface[k2-1]-1][ixy-1] - d2*xyz[iface[k1-1]-1][ixy-1];
5499 t[k-1] = (xy-xyz[i1-1][ixy-1]) / delta[ixy-1];
5500 if (k == 2)
goto L200;
5508 if (tmin>1. || tmax<0)
return;
5509 if (tmin < 0.) tmin = 0.;
5510 if (tmax > 1.) tmax = 1.;
5511 tmid = (tmin + tmax) / 2.;
5512 x = delta[0]*tmid + xyz[i1-1][0];
5513 y = delta[1]*tmid + xyz[i1-1][1];
5514 z = delta[2]*tmid + xyz[i1-1][2];
5515 dd = abcd[0]*x + abcd[1]*y + abcd[2]*z + abcd[3];
5516 if (dd > del)
goto L997;
5517 if (dd <-del)
goto L998;
5549 Double_t fsurf, w, d1, d2, df1, df2;
5551 Int_t i, i1, i2, j, ibase, nnod, knod, ntria, ktria, iopt, iready;
5552 Int_t ixcrit, iycrit, izcrit, incrx, incry, incrz, incr;
5553 Int_t ix, ix1=0, ix2=0, iy, iy1=0, iy2=0, iz, iz1=0, iz2=0, k, kx, ky, kz, isurf, nsurf;
5559 static Int_t ind[8][3] = { { 0,0,0 }, { 1,0,0 }, { 1,0,1 }, { 0,0,1 },
5560 { 0,1,0 }, { 1,1,0 }, { 1,1,1 }, { 0,1,1 } };
5571 Error(
"ImplicitFunction",
"no TView in current pad");
5576 if (nsurf >
kNiso) {
5577 Warning(
"IsoSurface",
"Number of iso-surfaces too large. Increase kNiso");
5580 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
5604 if (p1[2] < p0[2]) ixcrit = 1;
5605 if (p2[2] < p0[2]) iycrit = 1;
5606 if (p3[2] < p0[2]) izcrit = 1;
5615 if (iopt == 1) iz1 = 1;
5616 if (iopt == 1) iz2 = izcrit-1;
5617 if (iopt == 2) iz1 = izcrit;
5618 if (iopt == 2) iz2 = nz - 1;
5620 if (iopt == 1) iz1 = nz - 1;
5621 if (iopt == 1) iz2 = izcrit;
5622 if (iopt == 2) iz1 = izcrit-1;
5623 if (iopt == 2) iz2 = 1;
5625 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
5628 if (iopt == 1) iy1 = 1;
5629 if (iopt == 1) iy2 = iycrit-1;
5630 if (iopt == 2) iy1 = iycrit;
5631 if (iopt == 2) iy2 = ny - 1;
5633 if (iopt == 1) iy1 = ny - 1;
5634 if (iopt == 1) iy2 = iycrit;
5635 if (iopt == 2) iy1 = iycrit-1;
5636 if (iopt == 2) iy2 = 1;
5638 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
5641 if (iopt == 1) ix1 = 1;
5642 if (iopt == 1) ix2 = ixcrit-1;
5643 if (iopt == 2) ix1 = ixcrit;
5644 if (iopt == 2) ix2 = nx - 1;
5646 if (iopt == 1) ix1 = nx - 1;
5647 if (iopt == 1) ix2 = ixcrit;
5648 if (iopt == 2) ix1 = ixcrit-1;
5649 if (iopt == 2) ix2 = 1;
5651 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
5655 for ( isurf=1 ; isurf<=nsurf ; isurf++ ) {
5693 if (iready !=0)
goto L310;
5695 for ( i=1 ; i<=8 ; i++ ) {
5696 kx = ix + ind[i-1][0];
5697 ky = iy + ind[i-1][1];
5698 kz = iz + ind[i-1][2];
5699 p[i-1][0] = x[kx-1];
5700 p[i-1][1] = y[ky-1];
5701 p[i-1][2] = z[kz-1];
5708 }
else if (kx == nx) {
5713 d1 = x[kx-1] - x[kx-2];
5714 d2 = x[kx] - x[kx-1];
5724 pn[i-1][0] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5732 }
else if (ky == ny) {
5737 d1 = y[ky-1] - y[ky-2];
5738 d2 = y[ky] - y[ky-1];
5748 pn[i-1][1] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5756 }
else if (kz == nz) {
5761 d1 = z[kz-1] - z[kz-2];
5762 d2 = z[kz] - z[kz-1];
5772 pn[i-1][2] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5783 xyz_tmp, grad_tmp, itria_tmp);
5785 for( l=0 ; l<knod ; l++) {
5786 xyz[nnod+
l][0] = xyz_tmp[
l][0];
5787 xyz[nnod+
l][1] = xyz_tmp[
l][1];
5788 xyz[nnod+
l][2] = xyz_tmp[
l][2];
5789 grad[nnod+
l][0] = grad_tmp[
l][0];
5790 grad[nnod+
l][1] = grad_tmp[
l][1];
5791 grad[nnod+
l][2] = grad_tmp[
l][2];
5793 for( l=0 ; l<ktria ; l++) {
5794 itria[ntria+
l][0] = itria_tmp[
l][0];
5795 itria[ntria+
l][1] = itria_tmp[
l][1];
5796 itria[ntria+
l][2] = itria_tmp[
l][2];
5799 for ( i=ntria+1 ; i<=ntria+ktria ; i++ ) {
5800 for ( j=1 ; j<=3 ; j++ ){
5802 if (itria[i-1][j-1] < 0) ibase =-nnod;
5803 itria[i-1][j-1] = itria[i-1][j-1] + ibase;
5808 ntria = ntria + ktria;
5812 if (ntria == 0)
continue;
5813 for ( i=1 ; i<=nnod ; i++ ) {
5814 view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
5818 ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
5819 if (ntria == 0)
continue;
5821 if (iopt == 1) incr = -1;
5823 if (incr == -1) i1 = ntria;
5824 i2 = ntria - i1 + 1;
5825 for (i = i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
5830 icodes[0] = iattr[k-1];
5831 icodes[1] = iattr[k-1];
5832 icodes[2] = iattr[k-1];
5837 if (incrx < 0)
goto L130;
5840 if (incry < 0)
goto L120;
5843 if (incrz < 0)
goto L110;
5860 Error(
"ImplicitFunction",
"no TView in current pad");
5867 for ( i=1 ; i<=np ; i++) {
5870 view->
WCtoNDC(&xyz[k-1][0], &p3[i-1][0]);
static Double_t gV[kVSizeMax]
virtual void NormalWCtoNDC(const Float_t *pw, Float_t *pn)=0
void SideVisibilityEncode(Int_t iopt, Double_t phi1, Double_t phi2, Double_t &val)
Encode side visibilities and order along R for sector.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
void SurfaceProperty(Double_t qqa, Double_t qqd, Double_t qqs, Int_t nnqs, Int_t &irep)
Set surface property coefficients.
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 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.
Int_t yfirst
first bin number along Y
void LegoCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
Draw stack of lego-plots in cartesian coordinates.
Double_t factor
multiplication factor (normalization)
static Int_t ProjectAitoff2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
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.
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)
static double p3(double t, double a, double b, double c, double d)
void SetColorDark(Color_t color, Int_t n=0)
Store dark color for stack number n.
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.
TVirtualHistPainter * GetPainter(Option_t *option="")
Return pointer to painter.
Histogram option structure.
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual Double_t * GetRmax()=0
virtual TList * GetStack() const =0
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
Double_t fAphi[183]
Upper limits of lego.
int Proj
1: Aitoff, 2: Mercator, 3: Sinusoidal, 4: Parabolic
void MarchingCubeFindNodes(Int_t nnod, Int_t *ie, Double_t xyz[52][3], Double_t grad[52][3])
Find nodes and normales.
void(TPainter3dAlgorithms::* SurfaceFunc_t)(Int_t, Int_t, Double_t *, Double_t *)
R__EXTERN TStyle * gStyle
int Logy
log scale in Y. Also set by histogram option
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Int_t * fColorMain
Coordinate system.
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.
virtual ~TPainter3dAlgorithms()
Lego default destructor.
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 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 SurfaceFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t)
Service function for Surfaces.
virtual void SetRange(const Double_t *min, const Double_t *max)=0
void ColorFunction(Int_t nl, Double_t *fl, Int_t *icl, Int_t &irep)
Set correspondance between function and color levels.
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.
Short_t Min(Short_t a, Short_t b)
static void HLStoRGB(Float_t h, Float_t l, Float_t s, Float_t &r, Float_t &g, Float_t &b)
void FindVisibleDraw(Double_t *r1, Double_t *r2)
Find visible parts of line (draw line)
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
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 zmin
minimum value along Z
virtual void Modify()
Change current line attributes if necessary.
Double_t ymin
minimum value along y
Double_t zmax
maximum value along Z
static constexpr double rad
void InitMoveScreen(Double_t xmin, Double_t xmax)
Initialize "MOVING SCREEN" method.
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Double_t fFmax
IsoSurface minimum function value.
static Double_t gTT[4 *kVSizeMax]
int Logx
log scale in X. Also set by histogram option
static Int_t fgF3Clipping
Base colour for the 3rd Iso Surface.
Double_t ymax
maximum value along y
static Int_t ProjectMercator2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
static Double_t fgF3YClip
Clipping plane along X.
static void SetF3(TF3 *f3)
Static function Store pointer to current implicit function.
void DefineGridLevels(Int_t ndivz)
Define the grid levels drawn in the background of surface and lego plots.
void LegoPolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots in polar coordinates.
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)
SurfaceFunc_t fSurfaceFunction
pointer to lego function
static const double x2[5]
Fill Area Attributes class.
int Surf
"SURF" Draw as a Surface (SURF,Surf=1, SURF1,Surf=11, SURF2,Surf=12)
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 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) ...
static const Int_t NumOfSlices
void LightSource(Int_t nl, Double_t yl, Double_t xscr, Double_t yscr, Double_t zscr, Int_t &irep)
Set light source.
virtual void Modify()
Change current fill area attributes if necessary.
Double_t Log10(Double_t x)
static double p2(double t, double a, double b, double c)
void DrawFaceMode2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
Draw face - 2nd option (fill in correspondance with function levels)
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 Double_t * GetTnorm()=0
Double_t baroffset
offset of bin for bars or legos [0,1]
virtual Bool_t IsInside(Int_t x, Int_t y)
Return kTRUE if the cell ix, iy is inside one of the graphical cuts.
void ImplicitFunction(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...
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)
void LegoCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots in cylindrical coordinates.
Int_t xfirst
first bin number along X
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) ...
Double_t fYls[NumOfLights]
void ClearRaster()
Clear screen.
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) ...
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.
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)=0
Int_t fNcolor
IsoSurface maximum function value.
static void RGBtoHLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
virtual void FindThetaSectors(Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2)=0
void FillPolygon(Int_t n, Double_t *p, Double_t *f)
Fill polygon with function values at vertexes.
void SetDrawFace(DrawFaceFunc_t pointer)
Store pointer to current algorithm to draw faces.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
static Int_t gEdgeStyle[kVSizeMax+1]
void(TPainter3dAlgorithms::* DrawFaceFunc_t)(Int_t *, Double_t *, Int_t, Int_t *, Double_t *)
Pointer to the 3D function to be paint.
Float_t GetLegoInnerR() const
void SetColorMain(Color_t color, Int_t n=0)
Store color for stack number n.
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 fPlines[NumOfLevelLines *6]
void FrontBox(Double_t ang)
Draw front surfaces of surrounding box & axes.
Int_t fIc2
Base colour for the 1st Iso Surface.
static Int_t gEdgeWidth[kVSizeMax+1]
void FindLevelLines(Int_t np, Double_t *f, Double_t *t)
Find level lines for face.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
A 3-Dim function with parameters.
Double_t fU[NumOfSlices *2]
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 LegoFunction(Int_t ia, Int_t ib, Int_t &nv, Double_t *ab, Double_t *vv, Double_t *t)
Service function for Legos.
Bool_t GetHistMinimumZero() const
void SurfaceCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in cylindrical 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.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Luminosity(Double_t *anorm, Double_t &flum)
Find surface luminosity at given point.
static double p1(double t, double a, double b)
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Double_t fRmax[3]
Lower limits of lego.
static Int_t gEdgeColor[kVSizeMax+1]
Int_t ylast
last bin number along Y
void DrawLevelLines(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw level lines without hidden line removal.
virtual Double_t * GetRmin()=0
virtual void FindNormal(Double_t x, Double_t y, Double_t z, Double_t &zn)=0
void SetLegoFunction(LegoFunc_t pointer)
Store pointer to current lego function.
The histogram painter class.
virtual Color_t GetLineColor() const
Return the line color.
virtual Double_t * GetTN()=0
void SurfaceSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in spheric coordinates.
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.
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.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
Int_t fIc1
Number of colours per Iso surface.
static const double x1[5]
int Zero
if selected with any LEGO option the empty bins are not drawn.
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.
The Legos and Surfaces painter class.
virtual void FindPhiSectors(Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2)=0
static Double_t fgF3ZClip
Clipping plane along Y.
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.
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
Initialize this color and its associated colors.
static void SetF3ClippingBoxOn(Double_t xclip, Double_t yclip, Double_t zclip)
Static function Set the implicit function clipping box "on" and define the clipping box...
virtual Color_t GetFillColor() const
Return the fill area color.
Int_t xlast
last bin number along X
const Int_t kF3FillColor2
static constexpr double s
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
void SetEdgeAtt(Color_t color=1, Style_t style=1, Width_t width=1, Int_t n=0)
The color creation and management class.
LegoFunc_t fLegoFunction
pointer to face drawing function
void Spectrum(Int_t nl, Double_t fmin, Double_t fmax, Int_t ic, Int_t idc, Int_t &irep)
Set Spectrum.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
void(TPainter3dAlgorithms::* LegoFunc_t)(Int_t, Int_t, Int_t &, Double_t *, Double_t *, Double_t *)
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...
static TView * CreateView(Int_t system=1, const Double_t *rmin=0, const Double_t *rmax=0)
Create a concrete default 3-d view via the plug-in manager.
const Int_t kF3FillColor1
Int_t fColorLevel[NumOfColorLevels+2]
void BackBox(Double_t ang)
Draw back surfaces of surrounding box.
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
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 ProjectParabolic2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function code from Ernst-Jan Buis.
static TF3 * fgCurrentF3
Clipping plane along Y.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
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")
Double_t fFmin
Number of histograms in the stack to be painted.
Int_t fNStack
(=1 if mesh to draw, o otherwise)
Double_t xmin
minimum value along X
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 fLevelLine[NumOfLevelLines]
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")
Short_t Max(Short_t a, Short_t b)
static void SetF3ClippingBoxOff()
Static function Set the implicit function clipping box "off".
Double_t xmax
maximum value along X
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) ...
static Double_t fgF3XClip
Clipping box is off (0) or on (1)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
int System
type of coordinate system(1=car,2=pol,3=cyl,4=sph,5=psr)
void ModifyScreen(Double_t *r1, Double_t *r2)
Modify SCREEN.
static Int_t gColorDark[kVSizeMax+1]
void SurfacePolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in polar coordinates.
void SurfaceCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
Draw surface in cartesian coordinate system.
static Int_t gColorMain[kVSizeMax+1]
void SetSurfaceFunction(SurfaceFunc_t pointer)
Store pointer to current surface function.
Int_t fIc3
Base colour for the 2nd Iso Surface.
Double_t Sqrt(Double_t x)
TPainter3dAlgorithms()
pointer to surface function
Double_t fD[NumOfSlices *2]
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Histogram parameters structure.
void GouraudFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t)
Find part of surface with luminosity in the corners.
Double_t fFunLevel[NumOfColorLevels+1]
static constexpr double ns
Double_t barwidth
width of bin for bars and legos [0,1]
void FillPolygonBorder(Int_t nn, Double_t *xy)
Fill a polygon including border ("RASTER SCREEN")
int Logz
log scale in Z. Also set by histogram option
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Double_t fVls[NumOfLights *3]