63 TF3 *TPainter3dAlgorithms::fgCurrentF3 = 0;
103 if (stack) fNStack = stack->
GetSize();
105 fColorMain =
new Int_t[fNStack+1];
106 fColorDark =
new Int_t[fNStack+1];
107 fEdgeColor =
new Int_t[fNStack+1];
108 fEdgeStyle =
new Int_t[fNStack+1];
109 fEdgeWidth =
new Int_t[fNStack+1];
118 for (i=0;i<fNStack;i++) { fColorMain[i] = 1; fColorDark[i] = 1; fEdgeColor[i] = 1; fEdgeStyle[i] = 1; fEdgeWidth[i] = 1; }
119 for (i=0;i<3;i++) { fRmin[i] = 0; fRmax[i] = 1; }
120 for (i=0;i<4;i++) { fYls[i] = 0; }
122 for (i=0;i<30;i++) { fJmask[i] = 0; }
123 for (i=0;i<200;i++) { fLevelLine[i] = 0; }
124 for (i=0;i<465;i++) { fMask[i] = 0; }
125 for (i=0;i<258;i++) { fColorLevel[i] = 0; }
126 for (i=0;i<1200;i++) { fPlines[i] = 0.; }
127 for (i=0;i<200;i++) { fT[i] = 0.; }
128 for (i=0;i<2000;i++) { fU[i] = 0.; fD[i] = 0.; }
129 for (i=0;i<12;i++) { fVls[i] = 0.; }
130 for (i=0;i<257;i++) { fFunLevel[i] = 0.; }
131 for (i=0;i<183;i++) { fAphi[i] = 0.; }
132 for (i=0;i<8;i++) { fF8[i] = 0.; }
203 for (i=0;i<3;i++) {
fRmin[i] = rmin[i];
fRmax[i] = rmax[i]; }
204 for (i=0;i<4;i++) {
fYls[i] = 0; }
206 for (i=0;i<30;i++) {
fJmask[i] = 0; }
208 for (i=0;i<465;i++) {
fMask[i] = 0; }
210 for (i=0;i<1200;i++) {
fPlines[i] = 0.; }
211 for (i=0;i<200;i++) {
fT[i] = 0.; }
212 for (i=0;i<2000;i++) {
fU[i] = 0.;
fD[i] = 0.; }
213 for (i=0;i<12;i++) {
fVls[i] = 0.; }
214 for (i=0;i<257;i++) {
fFunLevel[i] = 0.; }
215 for (i=0;i<183;i++) {
fAphi[i] = 0.; }
216 for (i=0;i<8;i++) {
fF8[i] = 0.; }
277 static Int_t iface1[4] = { 1,4,8,5 };
278 static Int_t iface2[4] = { 4,3,7,8 };
283 Error(
"BackBox",
"no TView in current pad");
293 Int_t ix1, ix2, iy1, iy2, iz1, iz2;
297 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
298 for (i = 1; i <= 8; ++i) {
299 r[i*3 - 3] = av[i*3 - 3] + av[i*3 - 2]*cosa;
300 r[i*3 - 2] = av[i*3 - 2]*sina;
301 r[i*3 - 1] = av[i*3 - 1];
308 tt[0] = r[iface1[0]*3 - 1];
309 tt[1] = r[iface1[1]*3 - 1];
310 tt[2] = r[iface1[2]*3 - 1];
311 tt[3] = r[iface1[3]*3 - 1];
312 (this->*
fDrawFace)(icodes, r, 4, iface1, tt);
313 tt[0] = r[iface2[0]*3 - 1];
314 tt[1] = r[iface2[1]*3 - 1];
315 tt[2] = r[iface2[2]*3 - 1];
316 tt[3] = r[iface2[3]*3 - 1];
317 (this->*
fDrawFace)(icodes, r, 4, iface2, tt);
343 static const char *where =
"ColorFunction";
349 if (nl == 0) {
fNlevel = 0;
return; }
352 if (nl < 0 || nl > 256) {
353 Error(where,
"illegal number of levels (%d)", nl);
357 for (i = 1; i < nl; ++i) {
358 if (fl[i] <= fl[i - 1]) {
364 for (i = 0; i < nl; ++i) {
386 Double_t binLow = 0, binHigh = 0, binWidth = 0;
391 Error(
"GridLevels",
"no TView in current pad");
398 if (!rmin || !rmax)
return;
401 binLow, binHigh, nbins, binWidth,
" ");
406 binWidth = (binHigh-binLow)/nbins;
428 Int_t i, k,ifneg,i1, i2;
445 for (i = 1; i <= np; ++i) {
447 if (k < 0) ifneg = 1;
449 view->
WCtoNDC(&xyz[k*3 + 1], &p3[2*i - 2]);
450 x[i - 1] = p3[2*i - 2];
451 y[i - 1] = p3[2*i - 1];
456 for (i = 1; i <= np; ++i) {
460 z = z + p3[2*i1 - 1]*p3[2*i2 - 2] - p3[2*i1 - 2] *
469 gPad->PaintFillArea(np, x, y);
476 gPad->PaintFillArea(np, x, y);
482 for (i = 1; i <= np; ++i) {
483 if (iface[i] > 0)
gPad->PaintPolyLine(2, &x[i-1], &y[i-1]);
516 for (i = 1; i <= np; ++i) {
518 view->
WCtoNDC(&xyz[k*3 + 1], &p3[i*3 - 3]);
519 x[i - 1] = p3[i*3 - 3];
520 y[i - 1] = p3[i*3 - 2];
526 if (Hoption.
Lego!=0 && Hoption.
Surf==0) {
530 gPad->PaintFillArea(np, x, y);
536 gPad->PaintPolyLine(np, x, y);
568 if (icodes[4] == 1) icol =
fColorMain[icodes[3] - 1];
569 if (icodes[4] == 2) icol =
fColorDark[icodes[3] - 1];
570 if (icodes[4] == 3) icol =
fColorMain[icodes[3] - 1];
571 if (icodes[4] == 4) icol =
fColorDark[icodes[3] - 1];
573 for (i = 1; i <= np; ++i) {
575 view->
WCtoNDC(&xyz[k*3 + 1], &p3[i*3 - 3]);
576 x[i - 1] = p3[i*3 - 3];
577 y[i - 1] = p3[i*3 - 2];
583 gPad->PaintFillArea(np, x, y);
588 gPad->PaintFillArea(np, x, y);
593 gPad->PaintPolyLine(np, x, y);
611 Int_t i, k, i1, i2, il, it;
626 for (i = 1; i <= np; ++i) {
628 p3[i*3 - 3] = xyz[k*3 + 1];
629 p3[i*3 - 2] = xyz[k*3 + 2];
630 p3[i*3 - 1] = xyz[k*3 + 3];
646 for (il = 1; il <=
fNlines; ++il) {
650 xdel = p2[0] - p1[0];
651 ydel = p2[1] - p1[1];
652 for (it = 1; it <=
fNT; ++it) {
653 x[0] = p1[0] + xdel*
fT[2*it - 2];
654 y[0] = p1[1] + ydel*fT[2*it - 2];
655 x[1] = p1[0] + xdel*fT[2*it - 1];
656 y[1] = p1[1] + ydel*fT[2*it - 1];
657 gPad->PaintPolyLine(2, x, y);
672 for (i = 1; i <= np; ++i) {
677 view->
WCtoNDC(&p3[i1*3 - 3], p1);
678 view->
WCtoNDC(&p3[i2*3 - 3], p2);
679 xdel = p2[0] - p1[0];
680 ydel = p2[1] - p1[1];
681 for (it = 1; it <=
fNT; ++it) {
682 x[0] = p1[0] + xdel*
fT[2*it - 2];
683 y[0] = p1[1] + ydel*fT[2*it - 2];
684 x[1] = p1[0] + xdel*fT[2*it - 1];
685 y[1] = p1[1] + ydel*fT[2*it - 1];
686 gPad->PaintPolyLine(2, x, y);
691 for (i = 1; i <= np; ++i) {
713 Int_t i, k, i1, i2, il, it;
728 for (i = 1; i <= np; ++i) {
730 p3[i*3 - 3] = xyz[k*3 + 1];
731 p3[i*3 - 2] = xyz[k*3 + 2];
732 p3[i*3 - 1] = xyz[k*3 + 3];
749 for (il = 1; il <=
fNlines; ++il) {
753 xdel = p2[0] - p1[0];
754 ydel = p2[1] - p1[1];
755 for (it = 1; it <=
fNT; ++it) {
756 x[0] = p1[0] + xdel*
fT[2*it - 2];
757 y[0] = p1[1] + ydel*fT[2*it - 2];
758 x[1] = p1[0] + xdel*fT[2*it - 1];
759 y[1] = p1[1] + ydel*fT[2*it - 1];
760 gPad->PaintPolyLine(2, x, y);
765 for (i = 1; i <= np; ++i) {
786 Int_t i, k, i1, i2, it;
801 for (i = 1; i <= np; ++i) {
803 p3[i*3 - 3] = xyz[k*3 + 1];
804 p3[i*3 - 2] = xyz[k*3 + 2];
805 p3[i*3 - 1] = xyz[k*3 + 3];
819 for (i = 1; i <= np; ++i) {
824 view->
WCtoNDC(&p3[i1*3 - 3], p1);
825 view->
WCtoNDC(&p3[i2*3 - 3], p2);
826 xdel = p2[0] - p1[0];
827 ydel = p2[1] - p1[1];
828 for (it = 1; it <=
fNT; ++it) {
829 x[0] = p1[0] + xdel*
fT[2*it - 2];
830 y[0] = p1[1] + ydel*fT[2*it - 2];
831 x[1] = p1[0] + xdel*fT[2*it - 1];
832 y[1] = p1[1] + ydel*fT[2*it - 1];
833 gPad->PaintPolyLine(2, x, y);
838 for (i = 1; i <= np; ++i) {
859 Int_t i, k, i1, i2, il, it;
875 for (i = 1; i <= np; ++i) {
878 p3[i*3 - 3] = xyz[k*3 + 1];
879 p3[i*3 - 2] = xyz[k*3 + 2];
880 p3[i*3 - 1] = xyz[k*3 + 3];
881 view->
WCtoNDC(&p3[i*3 - 3], &pp[2*i - 2]);
897 for (il = 1; il <=
fNlines; ++il) {
901 xdel = p2[0] - p1[0];
902 ydel = p2[1] - p1[1];
903 for (it = 1; it <=
fNT; ++it) {
904 x[0] = p1[0] + xdel*
fT[2*it - 2];
905 y[0] = p1[1] + ydel*fT[2*it - 2];
906 x[1] = p1[0] + xdel*fT[2*it - 1];
907 y[1] = p1[1] + ydel*fT[2*it - 1];
908 gPad->PaintPolyLine(2, x, y);
923 for (i = 1; i <= np; ++i) {
924 if (iface[i] < 0)
continue;
929 xdel = pp[2*i2 - 2] - pp[2*i1 - 2];
930 ydel = pp[2*i2 - 1] - pp[2*i1 - 1];
931 for (it = 1; it <=
fNT; ++it) {
932 x[0] = pp[2*i1 - 2] + xdel*
fT[2*it - 2];
933 y[0] = pp[2*i1 - 1] + ydel*fT[2*it - 2];
934 x[1] = pp[2*i1 - 2] + xdel*fT[2*it - 1];
935 y[1] = pp[2*i1 - 1] + ydel*fT[2*it - 1];
936 gPad->PaintPolyLine(2, x, y);
957 Int_t i, k, i1, i2, it;
972 for (i = 1; i <= np; ++i) {
975 view->
WCtoNDC(&xyz[k*3 + 1], p);
985 for (i = 1; i <= np; ++i) {
986 if (iface[i] < 0)
continue;
991 xdel = pp[2*i2 - 2] - pp[2*i1 - 2];
992 ydel = pp[2*i2 - 1] - pp[2*i1 - 1];
993 for (it = 1; it <=
fNT; ++it) {
994 x[0] = pp[2*i1 - 2] + xdel*
fT[2*it - 2];
995 y[0] = pp[2*i1 - 1] + ydel*fT[2*it - 2];
996 x[1] = pp[2*i1 - 2] + xdel*fT[2*it - 1];
997 y[1] = pp[2*i1 - 1] + ydel*fT[2*it - 1];
998 gPad->PaintPolyLine(2, x, y);
1020 Int_t ilev, i, k, icol, i1, i2, nl, np;
1031 Error(
"FillPolygon",
"illegal number of vertices in polygon (%d)", n);
1041 if (nl < 0) nl = -nl;
1044 for (i = 2; i <= np; ++i) {
1045 if (fmin > f[i]) fmin = f[i];
1046 if (fmax < f[i]) fmax = f[i];
1049 if (fmin < funmin) funmin = fmin - 1;
1051 if (fmax > funmax) funmax = fmax + 1;
1055 for (ilev = 1; ilev <= nl+1; ++ilev) {
1058 if (ilev == nl + 1) f2 = funmax;
1060 if (fmax < f1)
return;
1061 if (fmin > f2)
continue;
1064 for (i = 1; i <= np; ++i) {
1067 if (i == np) i2 = 1;
1068 FindPartEdge(&p[i1*3 + 1], &p[i2*3 + 1], f[i1], f[i2], f1, f2, k, p3);
1071 if (k < 3)
continue;
1072 for (i = 1; i <= k; ++i) {
1078 icol=
gPad->GetFillColor();
1085 gPad->PaintFillArea(k, x, y);
1099 i, j, k,
n, ibase, t,
x,
y, xscan[24] ,
1101 ib, nb, dx, dy, iw,
nx, xx, yy, signdx, nstart, xx1, xx2, nxa, nxb;
1112 for (i = 1; i <=
n; ++i) {
1123 for (i = 1; i <=
n; ++i) {
1124 if (ymin > y1[i - 1]) ymin = y1[i - 1];
1125 if (ymax < y1[i - 1]) ymax = y1[i - 1];
1126 if (y1[i - 1] <= y1[i]) {x2[i - 1] = x1[i]; y2[i - 1] = y1[i];}
1128 x2[i - 1] = x1[i - 1];
1129 y2[i - 1] = y1[i - 1];
1135 if (ymax < 0)
return;
1139 for (i = 1; i <
n; ++i) {
1140 if (y1[i] >= y1[i - 1])
continue;
1143 for (j = i - 1; j >= 1; --j) {
1144 if (y < y1[j - 1])
continue;
1151 for (j = i; j >= k; --j) {
1164 for (i = 1; i <=
n; ++i) {
1165 xcur[i - 1] = x1[i - 1];
1166 dy = y2[i - 1] - y1[i - 1];
1167 dx = x2[i - 1] - x1[i - 1];
1169 if (dx < 0) signdx = -1;
1170 if (dx < 0) dx = -dx;
1172 t = -(dy + 1) / 2 + dx;
1175 xnex[i - 1] = xcur[i - 1];
1177 test[i - 1] = t - dy;
1178 xnex[i - 1] = xcur[i - 1] + signdx;
1180 }
else if (dy != 0) {
1181 step = (dx - 1) / (dy + dy) + 1;
1182 test[i - 1] = step*dy - (dx + 1) / 2 - dx;
1183 xnex[i - 1] = xcur[i - 1] + signdx*step;
1189 for (yscan = ymin; yscan <=
ymax; ++yscan) {
1193 for (i = nstart; i <=
n; ++i) {
1194 if (y1[i - 1] > yscan)
goto L500;
1195 if (y2[i - 1] <= yscan) {
1196 if (i == nstart) ++nstart;
1197 if (y2[i - 1] != yscan)
continue;
1199 if (x2[i - 1] >= xcur[i - 1]) {
1200 xscan[2*nxb - 2] = xcur[i - 1];
1201 xscan[2*nxb - 1] = x2[i - 1];
1203 xscan[2*nxb - 2] = x2[i - 1];
1204 xscan[2*nxb - 1] = xcur[i - 1];
1212 dy = y2[i - 1] - y1[i - 1];
1213 dx = x2[i - 1] - x1[i - 1];
1216 xscan[2*nxa - 2] = xcur[i - 1];
1217 xscan[2*nxa - 1] = xnex[i - 1];
1218 if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
1224 xscan[2*nxa - 2] = xnex[i - 1];
1225 xscan[2*nxa - 1] = xcur[i - 1];
1226 if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
1230 xcur[i - 1] = xnex[i - 1];
1233 if (test[i - 1] < 0)
continue;
1235 xnex[i - 1] += signdx;
1239 t = test[i - 1] + step*dy;
1241 test[i - 1] = t - dx;
1242 xnex[i - 1] += signdx*step;
1244 test[i - 1] = t + dy - dx;
1245 xnex[i - 1] += signdx*(step + 1);
1251 if (yscan < 0)
continue;
1254 for (i = 1; i < nxa; ++i) {
1255 for (j = i; j >= 1; --j) {
1256 if (xscan[2*j] >= xscan[2*j - 2])
continue;
1258 xscan[2*j] = xscan[2*j - 2];
1261 xscan[2*j + 1] = xscan[2*j - 1];
1265 for (i = 1; i <= nxa; i += 2) {
1267 xscan[2*nx - 2] = xscan[2*i - 2];
1269 if (xscan[2*i - 1] > x) x = xscan[2*i - 1];
1270 xscan[2*nx - 1] =
x;
1274 for (i = nxb; i <=
kLmax; ++i) {
1276 xscan[2*nx - 2] = xscan[2*i - 2];
1277 xscan[2*nx - 1] = xscan[2*i - 1];
1282 xx1 = xscan[2*nx - 2];
1283 xx2 = xscan[2*nx - 1];
1287 if ((xscan[2*k - 2] <= xx2 + 1) && (xscan[2*k - 1] >= xx1 - 1)) {
1288 if (xscan[2*k - 2] < xx1) xx1 = xscan[2*k - 2];
1289 if (xscan[2*k - 1] > xx2) xx2 = xscan[2*k - 1];
1290 xscan[2*k - 2] = xscan[2*nx - 2];
1291 xscan[2*k - 1] = xscan[2*nx - 1];
1295 if (xx1 < 0) xx1 = 0;
1296 if (xx2 >= fNxrast) xx2 = fNxrast - 1;
1297 nbit = xx2 - xx1 + 1;
1300 ib = kbit - iw*30 + 1;
1303 if (nb > nbit) nb = nbit;
1331 Int_t i, k, i1, i2, il, nl;
1342 if (nl < 0) nl = -nl;
1347 for (i = 2; i <= np; ++i) {
1348 if (t[i] < tmin) tmin = t[i];
1349 if (t[i] > tmax) tmax = t[i];
1355 for (il = 1; il <= nl; ++il) {
1356 if (tmin >=
fFunLevel[il - 1])
continue;
1362 for (i = 1; i <= np; ++i) {
1365 if (i == np) i2 = 1;
1367 d2 = t[i2] - fFunLevel[il - 1];
1369 if (d1*d2 < 0)
goto L320;
1376 if (k == 1)
continue;
1380 d1 /= t[i2] - t[i1];
1381 d2 /= t[i2] - t[i1];
1382 fPlines[(k + 2*
fNlines)*3 - 9] = d2*f[i1*3 + 1] - d1*f[i2*3 + 1];
1383 fPlines[(k + 2*
fNlines)*3 - 8] = d2*f[i1*3 + 2] - d1*f[i2*3 + 2];
1384 fPlines[(k + 2*
fNlines)*3 - 7] = d2*f[i1*3 + 3] - d1*f[i2*3 + 3];
1385 if (k != 1)
goto L340;
1388 Error(
"FindLevelLines",
"number of points for line not equal 2");
1424 if (f1 < fmin) k1 = -2;
1425 if (f1 == fmin) k1 = -1;
1426 if (f1 == fmax) k1 = 1;
1427 if (f1 > fmax) k1 = 2;
1429 if (f2 < fmin) k2 = -2;
1430 if (f2 == fmin) k2 = -1;
1431 if (f2 == fmax) k2 = 1;
1432 if (f2 > fmax) k2 = 2;
1433 kk = (k1 + 2)*5 + (k2 + 2) + 1;
1468 pp[kpp*3 + 1] = p1[1];
1469 pp[kpp*3 + 2] = p1[2];
1470 pp[kpp*3 + 3] = p1[3];
1476 d1 = (fmin -
f1) / (f1 - f2);
1477 d2 = (fmin -
f2) / (f1 - f2);
1478 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1479 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1480 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1486 d1 = (fmax -
f1) / (f1 - f2);
1487 d2 = (fmax -
f2) / (f1 - f2);
1488 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1489 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1490 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1496 pp[kpp*3 + 1] = p1[1];
1497 pp[kpp*3 + 2] = p1[2];
1498 pp[kpp*3 + 3] = p1[3];
1500 d1 = (fmin -
f1) / (f1 - f2);
1501 d2 = (fmin -
f2) / (f1 - f2);
1502 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1503 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1504 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1510 pp[kpp*3 + 1] = p1[1];
1511 pp[kpp*3 + 2] = p1[2];
1512 pp[kpp*3 + 3] = p1[3];
1514 d1 = (fmax -
f1) / (f1 - f2);
1515 d2 = (fmax -
f2) / (f1 - f2);
1516 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1517 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1518 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1524 d1 = (fmin -
f1) / (f1 - f2);
1525 d2 = (fmin -
f2) / (f1 - f2);
1526 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1527 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1528 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1530 d1 = (fmax -
f1) / (f1 - f2);
1531 d2 = (fmax -
f2) / (f1 - f2);
1532 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1533 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1534 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1540 d1 = (fmax -
f1) / (f1 - f2);
1541 d2 = (fmax -
f2) / (f1 - f2);
1542 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1543 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1544 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1546 d1 = (fmin -
f1) / (f1 - f2);
1547 d2 = (fmin -
f2) / (f1 - f2);
1548 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1549 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1550 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1563 Int_t i, icase, i1, i2, icase1, icase2, iv, ifback;
1566 Double_t tt, uu, ww, yy, yy1, yy2, yy1d, yy2d;
1578 x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
1579 x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
1580 y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
1581 y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
1582 z1 = tn[8]*r1[1] + tn[9]*r1[2] + tn[10]*r1[3] + tn[11];
1583 z2 = tn[8]*r2[1] + tn[9]*r2[2] + tn[10]*r2[3] + tn[11];
1585 Error(
"FindVisibleDraw",
"invalid TView in current pad");
1589 Error(
"FindVisibleDraw",
"no TView in current pad");
1615 dy = (y2 - y1) / di;
1618 for (i = i1; i <= i2 - 1; ++i) {
1619 yy1 = y1 + dy*(i - i1);
1621 yy1u = yy1 -
fU[2*i - 2];
1622 yy1d = yy1 -
fD[2*i - 2];
1623 yy2u = yy2 - fU[2*i - 1];
1624 yy2d = yy2 - fD[2*i - 1];
1628 if (yy1u > kEpsil) icase1 = 0;
1629 if (yy1d < -kEpsil) icase1 = 2;
1630 if ((icase1 == 0 || icase1 == 2) && iv <= 0) {
1635 if (icase1 == 1 && iv >= 0) {
1641 if (yy2u > kEpsil) icase2 = 0;
1642 if (yy2d < -kEpsil) icase2 = 2;
1643 icase = icase1*3 + icase2;
1646 fT[2*
fNT - 1] = tt + dt*(yy1u / (yy1u - yy2u));
1649 fT[2*
fNT - 1] = tt + dt*(yy1u / (yy1u - yy2u));
1651 fT[2*
fNT - 2] = tt + dt*(yy1d / (yy1d - yy2d));
1656 fT[2*
fNT - 2] = tt + dt*(yy1u / (yy1u - yy2u));
1661 fT[2*
fNT - 2] = tt + dt*(yy1d / (yy1d - yy2d));
1664 fT[2*
fNT - 1] = tt + dt*(yy1d / (yy1d - yy2d));
1666 fT[2*
fNT - 2] = tt + dt*(yy1u / (yy1u - yy2u));
1670 fT[2*
fNT - 1] = tt + dt*(yy1d / (yy1d - yy2d));
1672 if (
fNT + 1 >= 100)
break;
1674 if (iv > 0)
fT[2*
fNT - 1] = 1;
1682 if (y2 == y1) {
fNT = 0;
return;}
1683 ifback = 1 - ifback;
1691 if (uu <
fU[2*i1 - 3]) uu =
fU[2*i1 - 3];
1692 if (dd >
fD[2*i1 - 3]) dd =
fD[2*i1 - 3];
1695 if (y1 < uu && y2 > dd) {
1696 if (y1 >= dd && y2 <= uu) {
fNT = 0;
return;}
1701 fT[2*
fNT - 1] = (dd - y1) / (y2 - y1);
1705 fT[2*
fNT - 2] = (uu - y1) / (y2 - y1);
1711 if (ifback == 0)
return;
1712 if (
fNT == 0)
return;
1713 for (i = 1; i <=
fNT; ++i) {
1714 fT[2*i - 2] = 1 -
fT[2*i - 2];
1715 fT[2*i - 1] = 1 -
fT[2*i - 1];
1734 Int_t i, incrx, ivis,
x1, y1,
x2, y2, ib, kb, dx, dy, iw, ix, iy, ifinve, dx2, dy2;
1768 if (x1 < 0 && x2 < 0)
return;
1780 if (dy > dx)
goto L200;
1784 ddtt = dt*(float).5;
1789 for (ix = x1; incrx < 0 ? ix >= x2 : ix <=
x2; ix += incrx) {
1798 if (iy < 0)
goto L110;
1800 if (ix < 0)
goto L110;
1803 ib = kb - iw*30 + 1;
1805 if (ivis > 0)
continue;
1811 if (ivis == 0)
continue;
1814 if (nt == ntmax)
goto L300;
1816 if (ivis > 0) t[2*nt + 2] = tcur + dt + ddtt;
1822 ddtt = dt*(float).5;
1828 for (iy = y1; iy <= y2; ++iy) {
1837 if (iy < 0)
goto L210;
1838 if (ix < 0)
goto L210;
1841 ib = kb - iw*30 + 1;
1843 if (ivis > 0)
continue;
1849 if (ivis == 0)
continue;
1852 if (nt == ntmax)
goto L300;
1854 if (ivis > 0) t[2*nt + 2] = tcur + dt;
1858 if (nt == 0)
return;
1860 if (t[3] <= dt) t[3] = 0;
1861 if (t[2*nt + 2] >= 1 - dt) t[2*nt + 2] = 1;
1862 if (ifinve == 0)
return;
1863 for (i = 1; i <= nt; ++i) {
1866 t[2*i + 1] = 1 - t2;
1867 t[2*i + 2] = 1 -
t1;
1880 static Int_t iface1[4] = { 1,2,6,5 };
1881 static Int_t iface2[4] = { 2,3,7,6 };
1887 Int_t i, ix1, ix2, iy1, iy2, iz1, iz2;
1892 Error(
"FrontBox",
"no TView in current pad");
1898 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
1899 for (i = 1; i <= 8; ++i) {
1900 r[i*3 - 3] = av[i*3 - 3] + av[i*3 - 2] * cosa;
1901 r[i*3 - 2] = av[i*3 - 2] * sina;
1902 r[i*3 - 1] = av[i*3 - 1];
1909 (this->*
fDrawFace)(icodes, r, 4, iface1, fdummy);
1910 (this->*
fDrawFace)(icodes, r, 4, iface2, fdummy);
1926 Int_t incrx[3], incry[3];
1943 ixt = ia + Hparam.
xfirst - 1;
1944 iyt = ib + Hparam.
yfirst - 1;
1950 if (ixt == 1) incrx[0] = 0;
1951 if (ixt == Hparam.
xlast - 1) incrx[2] = 0;
1955 if (iyt == 1) incry[0] = 0;
1956 if (iyt == Hparam.
ylast - 1) incry[2] = 0;
1960 for (j = 1; j <= 3; ++j) {
1961 for (i = 1; i <= 3; ++i) {
1962 i1 = ia + incrx[i - 1];
1963 i2 = ib + incry[j - 1];
1969 for (k = 1; k <= 4; ++k) {
1970 for (i = 1; i <= 3; ++i) {
1971 face[i + k*3] = f[i + (k + 32)*3 - 52];
1976 for (j = 1; j <= 3; ++j) {
1977 for (i = 1; i <= 3; ++i) {
1978 for (k = 1; k <= 4; ++k) {
1980 phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1981 r = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
1982 x[k + ((i + j*3) << 2) - 17] = r *
TMath::Cos(phi);
1983 y[k + ((i + j*3) << 2) - 17] = r *
TMath::Sin(phi);
1984 z[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 49];
1986 phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1987 r = f[(k + ((i + j*3) << 2))*3 - 49];
1988 x[k + ((i + j*3) << 2) - 17] = r*
TMath::Cos(phi);
1989 y[k + ((i + j*3) << 2) - 17] = r*
TMath::Sin(phi);
1990 z[k + ((i + j*3) << 2) - 17] = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
1992 phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1993 th = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1994 r = f[(k + ((i + j*3) << 2))*3 - 49];
1997 z[k + ((i + j*3) << 2) - 17] = r*
TMath::Cos(th);
1999 phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
2000 th = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
2001 r = f[(k + ((i + j*3) << 2))*3 - 49];
2002 x[k + ((i + j*3) << 2) - 17] = r*
TMath::Cos(phi);
2003 y[k + ((i + j*3) << 2) - 17] = r*
TMath::Sin(phi);
2006 x[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 51];
2007 y[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 50];
2008 z[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 49];
2011 x1 = x[((i + j*3) << 2) - 14] - x[((i + j*3) << 2) - 16];
2012 x2 = x[((i + j*3) << 2) - 13] - x[((i + j*3) << 2) - 15];
2013 y1 = y[((i + j*3) << 2) - 14] - y[((i + j*3) << 2) - 16];
2014 y2 = y[((i + j*3) << 2) - 13] - y[((i + j*3) << 2) - 15];
2015 z1 = z[((i + j*3) << 2) - 14] - z[((i + j*3) << 2) - 16];
2016 z2 = z[((i + j*3) << 2) - 13] - z[((i + j*3) << 2) - 15];
2017 an[(i + j*3)*3 - 12] = y1*z2 - y2*z1;
2018 an[(i + j*3)*3 - 11] = z1*x2 - z2*x1;
2019 an[(i + j*3)*3 - 10] = x1*y2 - x2*y1;
2020 s =
TMath::Sqrt(an[(i + j*3)*3 - 12]*an[(i + j*3)*3 - 12] + an[
2021 (i + j*3)*3 - 11]*an[(i + j*3)*3 - 11] + an[(i
2022 + j*3)*3 - 10]*an[(i + j*3)*3 - 10]);
2024 an[(i + j*3)*3 - 12] /= s;
2025 an[(i + j*3)*3 - 11] /= s;
2026 an[(i + j*3)*3 - 10] /= s;
2031 for (j = 1; j <= 2; ++j) {
2032 for (i = 1; i <= 2; ++i) {
2033 for (k = 1; k <= 3; ++k) {
2034 bn[k + (i + 2*j)*3 - 10] = an[k + (i + j*3)*3 - 13]
2035 + an[k + (i + 1 + j*3)*3 - 13] + an[k + (i + 1 +
2036 (j + 1)*3)*3 - 13] + an[k + (i + (j + 1)*3)*3 - 13];
2059 for (
Int_t i = 1; i <= 1000; ++i) {
2060 fU[2*i - 2] = (float)-999;
2061 fU[2*i - 1] = (float)-999;
2062 fD[2*i - 2] = (float)999;
2063 fD[2*i - 1] = (float)999;
2080 Int_t i, j, k, ib, nb;
2090 Int_t buffersize = nx*ny/30 + 1;
2096 for (i = 1; i <= 30; ++i) {
2099 fMask[i - 1] = pow2;
2103 for (nb = 2; nb <= 30; ++nb) {
2104 for (ib = 1; ib <= 30 - nb + 1; ++ib) {
2106 for (i = ib; i <= ib + nb - 1; ++i) k = k |
fMask[i - 1];
2122 Int_t i, j, ixt, iyt;
2124 Double_t xlab1l, xlab2l, ylab1l, ylab2l;
2133 ixt = ia + Hparam.
xfirst - 1;
2134 iyt = ib + Hparam.
yfirst - 1;
2142 ab[5] = ab[3] + xwid*Hparam.
barwidth;
2143 ab[8] = ab[4] + ywid*Hparam.
barwidth;
2147 else ab[3] = Hparam.
xmin;
2149 else ab[5] = Hparam.
xmin;
2155 else ab[4] = Hparam.
ymin;
2157 else ab[8] = Hparam.
ymin;
2159 yval1l = Hparam.
ymin;
2160 yval2l = Hparam.
ymax;
2162 if (ab[3] < Hparam.
xmin) ab[3] = Hparam.
xmin;
2163 if (ab[4] < Hparam.
ymin) ab[4] = Hparam.
ymin;
2164 if (ab[5] > Hparam.
xmax) ab[5] = Hparam.
xmax;
2165 if (ab[8] > Hparam.
ymax) ab[8] = Hparam.
ymax;
2166 if (ab[5] < Hparam.
xmin) ab[5] = Hparam.
xmin;
2167 if (ab[8] < Hparam.
ymin) ab[8] = Hparam.
ymin;
2190 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2191 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2192 ab[4] = (ab[4] - yval1l) / (yval2l - yval1l);
2193 ab[8] = (ab[8] - yval1l) / (yval2l - yval1l);
2195 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2196 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2198 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2199 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2200 ab[4] = 180*(ab[4] - ylab1l) / (ylab2l - ylab1l);
2201 ab[8] = 180*(ab[8] - ylab1l) / (ylab2l - ylab1l);
2203 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2204 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2205 ab[4] = (180 - dangle*2)*(ab[4] - ylab1l) / (ylab2l - ylab1l) + dangle;
2206 ab[8] = (180 - dangle*2)*(ab[8] - ylab1l) / (ylab2l - ylab1l) + dangle;
2217 vv[1] = Hparam.
zmin;
2232 if (stack) nids = stack->
GetSize();
2234 for (i = 2; i <= nids + 1; ++i) {
2243 for (i = 2; i <= nv; ++i) {
2248 vv[i] = Hparam.
zmin;
2256 if (!Hoption.
Logz) {
2259 if (vv[i] < vv[i - 1]) {
2271 for (i = 1; i <= nv; ++i) {
2272 vv[i] = (1 - rinrad)*((vv[i] - Hparam.
zmin) /
2273 (Hparam.
zmax - Hparam.
zmin)) + rinrad;
2277 for (i = 1; i <= nv; ++i) {
2278 for (j = 1; j <= 4; ++j) t[j + (i << 2)] = vv[i];
2299 Int_t ivis[4], iface[4];
2301 Int_t incrx, incry, i1, k1, k2, ix1, iy1, ix2, iy2, i, iv, ix, iy, nv;
2307 Int_t firstStackNumberDrawn=-1 ;
2315 Error(
"LegoCartesian",
"no TView in current pad");
2322 if (tn[0] < 0) i1 = 2;
2323 if (tn[0]*cosa + tn[1]*sina < 0) i1 = 5 - i1;
2339 if (*chopt ==
'B' || *chopt ==
'b') {
2346 if (i1 == 1 || i1 == 2) incrx = -incrx;
2347 if (i1 == 2 || i1 == 3) incry = -incry;
2350 if (incrx < 0) ix1 =
nx;
2351 if (incry < 0) iy1 =
ny;
2362 if (zn < 0) ivis[0] = 1;
2363 if (zn > 0) ivis[2] = 1;
2365 if (zn > 0) ivis[1] = 1;
2366 if (zn < 0) ivis[3] = 1;
2370 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
2371 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
2372 if (!painter->
IsInside(ix,iy))
continue;
2374 if (nv < 2 || nv > vSize)
continue;
2377 for (iv = 1; iv < nv; ++iv) total_content += v[iv];
2378 if (total_content==0)
continue;
2382 for (i = 1; i <= 4; ++i) {
2383 xyz[i*3 - 3] = xy[2*i - 2] + xy[2*i - 1]*cosa;
2384 xyz[i*3 - 2] = xy[2*i - 1]*sina;
2385 xyz[(i + 4)*3 - 3] = xyz[i*3 - 3];
2386 xyz[(i + 4)*3 - 2] = xyz[i*3 - 2];
2389 firstStackNumberDrawn = -1;
2390 for (iv = 1; iv < nv; ++iv) {
2391 for (i = 1; i <= 4; ++i) {
2392 xyz[i*3 - 1] = v[iv - 1];
2393 xyz[(i + 4)*3 - 1] = v[iv];
2395 if (v[iv - 1] == v[iv])
continue;
2397 for (i = 1; i <= 4; ++i) {
2398 if (ivis[i - 1] == 0)
continue;
2407 tface[0] = tt[k1 + (iv << 2) - 5];
2408 tface[1] = tt[k2 + (iv << 2) - 5];
2409 tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
2410 tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
2412 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2414 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2421 for (i = 1; i <= 4; ++i) {
2422 xyz[i*3 - 1] = v[0];
2423 iface[i - 1] = 5 - i;
2424 tface[i - 1] = tt[5 - i - 1];
2431 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2437 for (i = 1; i <= 4; ++i) {
2438 iface[i - 1] = i + 4;
2439 tface[i - 1] = tt[i + (nv << 2) - 5];
2444 if ( nv > 2 && (v[nv-1] == v[nv-2])) {
2445 for (iv = nv-1; iv>2; iv--) {
2446 if (v[nv-1] == v[iv-1]) {
2453 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2478 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2480 Int_t incrr, k1, k2, ia, ib, ir1, ir2;
2482 Int_t ir, jr, iv, nr, nv, icodes[4];
2486 Int_t firstStackNumberDrawn=-1 ;
2490 Error(
"LegoPolar",
"no TView in current pad");
2506 Error(
"LegoPolar",
"too many PHI sectors (%d)", nphi);
2510 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2528 if (iordr == 0) ia = nr;
2529 if (iordr != 0) ib = nr;
2530 for (i = 1; i <= nphi; ++i) {
2531 if (iordr == 0) ib = i;
2532 if (iordr != 0) ia = i;
2534 if (i == 1)
fAphi[0] = ab[jphi - 1];
2535 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2536 fAphi[i] = ab[jphi + 3];
2542 for (i = 1; i <= nphi; ++i) {
2553 if (iphi > nphi)
goto L300;
2558 if (incrr < 0) ir1 = nr;
2561 for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
2562 if (iordr == 0) { ia = ir; ib = iphi; }
2563 else { ia = iphi; ib = ir; }
2565 if (nv < 2 || nv > vSize)
continue;
2568 for (iv = 1; iv < nv; ++iv) total_content += v[iv];
2569 if (total_content==0)
continue;
2573 for (i = 1; i <= 4; ++i) {
2575 if (iordr != 0 && i == 2) j = 4;
2576 if (iordr != 0 && i == 4) j = 2;
2577 xyz[j*3 - 3] = ab[jr + 2*i - 3]*
TMath::Cos(ab[jphi + 2*i - 3]*
kRad);
2578 xyz[j*3 - 2] = ab[jr + 2*i - 3]*
TMath::Sin(ab[jphi + 2*i - 3]*
kRad);
2579 xyz[(j + 4)*3 - 3] = xyz[j*3 - 3];
2580 xyz[(j + 4)*3 - 2] = xyz[j*3 - 2];
2583 firstStackNumberDrawn = -1;
2584 for (iv = 1; iv < nv; ++iv) {
2585 for (i = 1; i <= 4; ++i) {
2586 xyz[i*3 - 1] = v[iv - 1];
2587 xyz[(i + 4)*3 - 1] = v[iv];
2589 if (v[iv - 1] >= v[iv])
continue;
2591 for (i = 1; i <= 4; ++i) {
2592 if (ivis[i - 1] == 0)
continue;
2596 if (xyz[k1*3 - 3] == xyz[k2*3 - 3] && xyz[k1*3 - 2] ==
2597 xyz[k2*3 - 2])
continue;
2602 tface[0] = tt[k1 + (iv << 2) - 5];
2603 tface[1] = tt[k2 + (iv << 2) - 5];
2604 tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
2605 tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
2608 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2610 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2616 for (i = 1; i <= 4; ++i) {
2617 xyz[i*3 - 1] = v[0];
2618 iface[i - 1] = 5 - i;
2619 tface[i - 1] = tt[5 - i - 1];
2626 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2632 for (i = 1; i <= 4; ++i) {
2633 iface[i - 1] = i + 4;
2634 tface[i - 1] = tt[i + (nv << 2) - 5];
2639 if ( nv > 2 && (v[nv-1] == v[nv-2])) {
2640 for (iv = nv-1; iv>2; iv--) {
2641 if (v[nv-1] == v[iv-1]) {
2648 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2655 if (iphi == 0) iphi = kphi;
2656 if (iphi > kphi) iphi = 1;
2657 if (iphi != iphi2)
goto L100;
2689 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2692 Int_t ia, ib, idummy, iz1, iz2, nz, incrz, k1, k2, nv;
2693 Int_t iv, iz, jz, icodes[4];
2699 Int_t firstStackNumberDrawn=-1 ;
2703 Error(
"LegoCylindrical",
"no TView in current pad");
2719 Error(
"LegoCylindrical",
"too many PHI sectors (%d)", nphi);
2723 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2741 if (iordr == 0) ia = nz;
2742 if (iordr != 0) ib = nz;
2743 for (i = 1; i <= nphi; ++i) {
2744 if (iordr == 0) ib = i;
2745 if (iordr != 0) ia = i;
2747 if (i == 1)
fAphi[0] = ab[jphi - 1];
2748 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2749 fAphi[i] = ab[jphi + 3];
2755 for (i = 1; i <= nphi; ++i) {
2756 if (iordr == 0) ib = i;
2757 if (iordr != 0) ia = i;
2766 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
2776 if (iphi > nphi)
goto L400;
2780 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
2781 if (iordr == 0) {ia = iz; ib = iphi;}
2782 else {ia = iphi; ib = iz;}
2784 if (nv < 2 || nv > vSize)
continue;
2787 for (i = 1; i <= 4; ++i) {
2789 if (iordr != 0 && i == 2) j = 4;
2790 if (iordr != 0 && i == 4) j = 2;
2793 xyz[j*3 - 1] = ab[jz + 2*i - 3];
2794 xyz[(j + 4)*3 - 1] = ab[jz + 2*i - 3];
2797 firstStackNumberDrawn = -1;
2798 for (iv = 1; iv < nv; ++iv) {
2799 for (i = 1; i <= 4; ++i) {
2800 xyz[i*3 - 3] = v[iv - 1]*cosphi[i - 1];
2801 xyz[i*3 - 2] = v[iv - 1]*sinphi[i - 1];
2802 xyz[(i + 4)*3 - 3] = v[iv]*cosphi[i - 1];
2803 xyz[(i + 4)*3 - 2] = v[iv]*sinphi[i - 1];
2805 if (v[iv - 1] >= v[iv])
continue;
2807 for (i = 1; i <= 4; ++i) {
2808 if (ivis[i - 1] == 0)
continue;
2816 tface[0] = tt[k1 + (iv << 2) - 5];
2817 tface[1] = tt[k2 + (iv << 2) - 5];
2818 tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
2819 tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
2822 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2824 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2827 if (ivis[4] != 0 && v[0] > 0) {
2830 for (i = 1; i <= 4; ++i) {
2831 xyz[i*3 - 3] = v[0]*cosphi[i - 1];
2832 xyz[i*3 - 2] = v[0]*sinphi[i - 1];
2834 tface[i - 1] = tt[i - 1];
2841 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2844 if (ivis[5] != 0 && v[nv - 1] > 0) {
2847 for (i = 1; i <= 4; ++i) {
2848 iface[i - 1] = 5 - i + 4;
2849 tface[i - 1] = tt[5 - i + (nv << 2) - 5];
2854 if ( nv > 2 && (v[nv-1] == v[nv-2])) {
2855 for (iv = nv-1; iv>2; iv--) {
2856 if (v[nv-1] == v[iv-1]) {
2863 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2870 if (iphi == 0) iphi = kphi;
2871 if (iphi > kphi) iphi = 1;
2872 if (iphi != iphi2)
goto L100;
2903 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2906 Int_t k1, k2, ia, ib, incrth, ith, jth, kth, nth, mth, ith1, ith2, nv;
2909 Int_t iv, icodes[4];
2916 Int_t firstStackNumberDrawn=-1 ;
2920 Error(
"LegoSpherical",
"no TView in current pad");
2936 Error(
"LegoSpherical",
"too many THETA sectors (%d)", nth);
2940 Error(
"LegoSpherical",
"too many PHI sectors (%d)", nphi);
2944 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2963 if (mth == 0) mth = 1;
2964 if (iordr == 0) ia = mth;
2965 if (iordr != 0) ib = mth;
2966 for (i = 1; i <= nphi; ++i) {
2967 if (iordr == 0) ib = i;
2968 if (iordr != 0) ia = i;
2970 if (i == 1)
fAphi[0] = ab[jphi - 1];
2971 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2972 fAphi[i] = ab[jphi + 3];
2977 if (iordr == 0) ib = 1;
2978 if (iordr != 0) ia = 1;
2979 for (i = 1; i <= nth; ++i) {
2980 if (iordr == 0) ia = i;
2981 if (iordr != 0) ib = i;
2983 if (i == 1)
fAphi[0] = ab[jth - 1];
2984 fAphi[i - 1] = (
fAphi[i - 1] + ab[jth - 1]) / (
float)2.;
2985 fAphi[i] = ab[jth + 3];
2994 if (iphi > nphi)
goto L500;
2997 if (!iordr) {ia = mth; ib = iphi; }
2998 else {ia = iphi;ib = mth; }
3000 phi = (ab[jphi - 1] + ab[jphi + 3]) / (
float)2.;
3005 if (ith > nth)
goto L400;
3006 if (iordr == 0) ia = ith;
3007 if (iordr != 0) ib = ith;
3009 if (nv < 2 || nv > vSize)
goto L400;
3012 for (i = 1; i <= 6; ++i) ivis[i - 1] = 0;
3014 phi1 =
kRad*ab[jphi - 1];
3015 phi2 =
kRad*ab[jphi + 3];
3016 th1 =
kRad*ab[jth - 1];
3017 th2 =
kRad*ab[jth + 3];
3019 if (zn > 0) ivis[1] = 1;
3021 if (zn > 0) ivis[3] = 1;
3022 phi = (phi1 + phi2) / (
float)2.;
3024 if (zn > 0) ivis[0] = 1;
3026 if (zn > 0) ivis[2] = 1;
3027 th = (th1 +
th2) / (
float)2.;
3028 if (ipsdr == 1) th =
kRad*90;
3030 if (zn < 0) ivis[4] = 1;
3031 if (zn > 0) ivis[5] = 1;
3036 for (i = 1; i <= 4; ++i) {
3038 if (iordr != 0 && i == 2) j = 4;
3039 if (iordr != 0 && i == 4) j = 2;
3045 firstStackNumberDrawn = -1;
3046 for (iv = 1; iv < nv; ++iv) {
3048 for (i = 1; i <= 4; ++i) {
3049 xyz[i*3 - 3] = v[iv - 1]*cosphi[i - 1];
3050 xyz[i*3 - 2] = v[iv - 1]*sinphi[i - 1];
3051 xyz[i*3 - 1] = v[iv - 1]*costh[i - 1] / sinth[i - 1];
3052 xyz[(i + 4)*3 - 3] = v[iv]*cosphi[i - 1];
3053 xyz[(i + 4)*3 - 2] = v[iv]*sinphi[i - 1];
3054 xyz[(i + 4)*3 - 1] = v[iv]*costh[i - 1] / sinth[i - 1];
3057 for (i = 1; i <= 4; ++i) {
3058 xyz[i*3 - 3] = v[iv - 1]*sinth[i - 1]*cosphi[i - 1];
3059 xyz[i*3 - 2] = v[iv - 1]*sinth[i - 1]*sinphi[i - 1];
3060 xyz[i*3 - 1] = v[iv - 1]*costh[i - 1];
3061 xyz[(i + 4)*3 - 3] = v[iv]*sinth[i - 1]*cosphi[i - 1];
3062 xyz[(i + 4)*3 - 2] = v[iv]*sinth[i - 1]*sinphi[i - 1];
3063 xyz[(i + 4)*3 - 1] = v[iv]*costh[i - 1];
3066 if (v[iv - 1] >= v[iv])
continue;
3068 for (i = 1; i <= 4; ++i) {
3069 if (ivis[i - 1] == 0)
continue;
3077 tface[0] = tt[k1 + (iv << 2) - 5];
3078 tface[1] = tt[k2 + (iv << 2) - 5];
3079 tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
3080 tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
3083 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
3085 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
3088 if (ivis[4] != 0 && v[0] > 0) {
3091 for (i = 1; i <= 4; ++i) {
3093 xyz[i*3 - 3] = v[0]*cosphi[i - 1];
3094 xyz[i*3 - 2] = v[0]*sinphi[i - 1];
3095 xyz[i*3 - 1] = v[0]*costh[i - 1] / sinth[i - 1];
3097 xyz[i*3 - 3] = v[0]*sinth[i - 1]*cosphi[i - 1];
3098 xyz[i*3 - 2] = v[0]*sinth[i - 1]*sinphi[i - 1];
3099 xyz[i*3 - 1] = v[0]*costh[i - 1];
3101 iface[i - 1] = 5 - i;
3102 tface[i - 1] = tt[5 - i - 1];
3109 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
3112 if (ivis[5] != 0 && v[nv - 1] > 0) {
3115 for (i = 1; i <= 4; ++i) {
3116 iface[i - 1] = i + 4;
3117 tface[i - 1] = tt[i + 4 + 2*nv - 5];
3122 if ( nv > 2 && (v[nv-1] == v[nv-2])) {
3123 for (iv = nv-1; iv>2; iv--) {
3124 if (v[nv-1] == v[iv-1]) {
3131 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
3137 if (ith == 0) ith = kth;
3138 if (ith > kth) ith = 1;
3139 if (ith != ith2)
goto L200;
3140 if (incrth == 0)
goto L500;
3151 if (iphi == 0) iphi = kphi;
3152 if (iphi > kphi) iphi = 1;
3153 if (iphi != iphi2)
goto L100;
3189 if (nl < 0)
goto L100;
3190 else if (nl == 0)
goto L200;
3197 for (i = 1; i <= 4; ++i) {
3204 Error(
"LightSource",
"negative light intensity");
3212 if (nl > 4 || yl < 0) {
3213 Error(
"LightSource",
"illegal light source number (nl=%d, yl=%f)", nl, yl);
3217 s =
TMath::Sqrt(xscr*xscr + yscr*yscr + zscr*zscr);
3219 Error(
"LightSource",
"light source is placed at origin");
3224 fVls[nl*3 - 3] = xscr / s;
3225 fVls[nl*3 - 2] = yscr / s;
3226 fVls[nl*3 - 1] = zscr / s;
3230 if (
fYdl != 0)
return;
3231 for (i = 1; i <= 4; ++i) {
3232 if (
fYls[i - 1] != 0)
return;
3260 if (
fLoff != 0)
return;
3264 s =
TMath::Sqrt(vn[0]*vn[0] + vn[1]*vn[1] + vn[2]*vn[2]);
3272 for (i = 1; i <= 4; ++i) {
3273 if (
fYls[i - 1] <= 0)
continue;
3274 vl[0] =
fVls[i*3 - 3];
3275 vl[1] =
fVls[i*3 - 2];
3276 vl[2] =
fVls[i*3 - 1];
3277 cosn = vl[0]*vn[0] + vl[1]*vn[1] + vl[2]*vn[2];
3278 if (cosn < 0)
continue;
3279 cosr = vn[1]*(vn[2]*vl[1] - vn[1]*vl[2]) - vn[0]*(vn[0]*vl[2]
3280 - vn[2]*vl[0]) + vn[2]*cosn;
3281 if (cosr <= 0) cosr = 0;
3309 x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
3310 x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
3311 y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
3312 y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
3314 Error(
"ModifyScreen",
"invalid TView in current pad");
3318 Error(
"ModifyScreen",
"no TView in current pad");
3332 if (i1 == i2)
return;
3335 dy = (y2 - y1) / (i2 - i1);
3336 for (i = i1; i <= i2 - 1; ++i) {
3337 yy1 = y1 + dy*(i - i1);
3339 if (
fD[2*i - 2] > yy1)
fD[2*i - 2] = yy1;
3340 if (
fD[2*i - 1] > yy2)
fD[2*i - 1] = yy2;
3341 if (
fU[2*i - 2] < yy1)
fU[2*i - 2] = yy1;
3342 if (
fU[2*i - 1] < yy2)
fU[2*i - 1] = yy2;
3454 Int_t ivis[6], i, k, num;
3458 for (i = 1; i <= 6; ++i) {
3461 if (k < num)
continue;
3466 if (k == 1) ir = -1;
3494 Error(
"SideVisibilityEncode",
"no TView in current pad");
3499 if (zn > 0) k += 64;
3500 if (zn < 0) k += 32;
3502 if (zn > 0) k += 16;
3505 phi = (phi1 + phi2) / (
float)2.;
3509 if ((zn <= 0 && iopt == 1) || (zn > 0 && iopt == 2)) ++k;
3527 static const char *where =
"Spectrum";
3534 if (nl == 0) {
fNlevel = 0;
return; }
3538 Error(where,
"fmax (%f) less than fmin (%f)", fmax, fmin);
3542 if (nl < 0 || nl > 256) {
3543 Error(where,
"illegal number of levels (%d)", nl);
3548 Error(where,
"initial color index is negative");
3553 Error(where,
"color index increment must be positive");
3558 const Int_t kMAXCOL = 50;
3559 delf = (fmax - fmin) / nl;
3561 for (i = 1; i <= nl+1; ++i) {
3564 if (ic <= kMAXCOL && fColorLevel[i] > kMAXCOL) fColorLevel[i] -= kMAXCOL;
3585 Int_t iface[4] = { 1,2,3,4 };
3589 Int_t i, incrx, incry, i1, ix, iy;
3591 Int_t icodes[3], ix1, iy1, ix2, iy2;
3603 Error(
"SurfaceCartesian",
"no TView in current pad");
3610 if (tn[0] < 0) i1 = 2;
3611 if (tn[0]*cosa + tn[1]*sina < 0) i1 = 5 - i1;
3615 if (*chopt ==
'B' || *chopt ==
'b') {incrx = -1; incry = -1;}
3616 else {incrx = 1; incry = 1;}
3617 if (i1 == 1 || i1 == 2) incrx = -incrx;
3618 if (i1 == 2 || i1 == 3) incry = -incry;
3621 if (incrx < 0) ix1 =
nx;
3622 if (incry < 0) iy1 =
ny;
3630 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
3631 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
3632 if (!painter->
IsInside(ix,iy))
continue;
3634 for (i = 1; i <= 4; ++i) {
3635 xyz[i*3 - 3] = f[i*3 - 3] + f[i*3 - 2]*cosa;
3636 xyz[i*3 - 2] = f[i*3 - 2]*sina;
3637 xyz[i*3 - 1] = f[i*3 - 1];
3640 if (Hoption.
Proj == 1 ) {
3644 }
else if (Hoption.
Proj == 2 ) {
3648 }
else if (Hoption.
Proj == 3) {
3652 }
else if (Hoption.
Proj == 4) {
3660 (this->*
fDrawFace)(icodes, xyz, 4, iface, tt);
3671 static Int_t ixadd[4] = { 0,1,1,0 };
3672 static Int_t iyadd[4] = { 0,0,1,1 };
3677 Double_t xlab1l, xlab2l, ylab1l, ylab2l;
3678 Int_t i, ixa, iya, icx, ixt, iyt;
3684 ixt = ia + Hparam.
xfirst - 1;
3685 iyt = ib + Hparam.
yfirst - 1;
3689 yval1l = Hparam.
ymin;
3690 yval2l = Hparam.
ymax;
3711 for (i = 1; i <= 4; ++i) {
3722 if (f[i*3 + 1] > 0) f[i*3 + 1] =
TMath::Log10(f[i*3 + 1]);
3723 else f[i*3 + 1] = Hparam.
xmin;
3726 if (f[i*3 + 2] > 0) f[i*3 + 2] =
TMath::Log10(f[i*3 + 2]);
3727 else f[i*3 + 2] = Hparam.
ymin;
3732 f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3733 f[i*3 + 2] = (f[i*3 + 2] - yval1l) / (yval2l - yval1l);
3735 f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3737 f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3738 f[i*3 + 2] = 360*(f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l);
3740 f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3741 f[i*3 + 2] = (180 - dangle*2)*(f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l) + dangle;
3749 if (icx > Hparam.
xlast) icx = 1;
3753 else f[i*3+3] = Hparam.
zmin;
3754 if (f[i*3+3] < Hparam.
zmin) f[i*3+3] = Hparam.
zmin;
3755 if (f[i*3+3] > Hparam.
zmax) f[i*3+3] = Hparam.
zmax;
3764 t[i] = f[i * 3 + 3];
3768 if (Hoption.
Surf == 23) {
3769 for (i = 1; i <= 4; ++i) f[i * 3 + 3] =
fRmax[2];
3773 for (i = 1; i <= 4; ++i) {
3774 f[i*3 + 3] = (1 - rinrad)*((f[i*3 + 3] - Hparam.
zmin) /
3775 (Hparam.
zmax - Hparam.
zmin)) + rinrad;
3794 static Int_t iface[4] = { 1,2,3,4 };
3799 Error(
"SurfacePolar",
"no TView in current pad");
3803 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3805 Int_t i, j, incrr, ir1, ir2;
3807 Int_t ia, ib, ir, jr, nr, icodes[3];
3824 Error(
"SurfacePolar",
"too many PHI sectors (%d)", nphi);
3828 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3833 if (iordr == 0) ia = nr;
3834 if (iordr != 0) ib = nr;
3835 for (i = 1; i <= nphi; ++i) {
3836 if (iordr == 0) ib = i;
3837 if (iordr != 0) ia = i;
3839 if (i == 1)
fAphi[0] = f[jphi - 1];
3840 fAphi[i - 1] = (
fAphi[i - 1] + f[jphi - 1]) / (
float)2.;
3841 fAphi[i] = f[jphi + 5];
3851 if (iphi > nphi)
goto L300;
3854 if (iordr == 0) {ia = nr; ib = iphi;}
3855 else {ia = iphi;ib = nr;}
3858 phi =
kRad*((f[jphi - 1] + f[jphi + 5]) / 2);
3862 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
3868 for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
3869 if (iordr == 0) ia = ir;
3870 if (iordr != 0) ib = ir;
3873 for (i = 1; i <= 4; ++i) {
3875 if (iordr != 0 && i == 2) j = 4;
3876 if (iordr != 0 && i == 4) j = 2;
3877 xyz[j*3 - 3] = f[jr + i*3 - 4]*
TMath::Cos(f[jphi + i*3 - 4]*
kRad);
3878 xyz[j*3 - 2] = f[jr + i*3 - 4]*
TMath::Sin(f[jphi + i*3 - 4]*
kRad);
3879 xyz[j*3 - 1] = f[i*3 - 1];
3880 ttt[j - 1] = tt[i - 1];
3884 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3889 if (iphi == 0) iphi = kphi;
3890 if (iphi > kphi) iphi = 1;
3891 if (iphi != iphi2)
goto L100;
3892 if (incr == 0)
return;
3918 static Int_t iface[4] = { 1,2,3,4 };
3920 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3921 Int_t i, j, incrz, nz, iz1, iz2;
3922 Int_t ia, ib, iz, jz, icodes[3];
3932 Error(
"SurfaceCylindrical",
"no TView in current pad");
3948 Error(
"SurfaceCylindrical",
"too many PHI sectors (%d)", nphi);
3952 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3957 if (iordr == 0) ia = nz;
3958 if (iordr != 0) ib = nz;
3959 for (i = 1; i <= nphi; ++i) {
3960 if (iordr == 0) ib = i;
3961 if (iordr != 0) ia = i;
3963 if (i == 1)
fAphi[0] = f[jphi - 1];
3964 fAphi[i - 1] = (
fAphi[i - 1] + f[jphi - 1]) / (
float)2.;
3965 fAphi[i] = f[jphi + 5];
3973 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
3985 if (iphi > nphi)
goto L400;
3986 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
3987 if (iordr == 0) {ia = iz; ib = iphi;}
3988 else {ia = iphi; ib = iz;}
3990 for (i = 1; i <= 4; ++i) {
3992 if (iordr == 0 && i == 2) j = 4;
3993 if (iordr == 0 && i == 4) j = 2;
3996 xyz[j*3 - 1] = f[jz + i*3 - 4];
3997 ttt[j - 1] = tt[i - 1];
4001 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
4006 if (iphi == 0) iphi = kphi;
4007 if (iphi > kphi) iphi = 1;
4008 if (iphi != iphi2)
goto L100;
4009 if (incr == 0)
return;
4034 static Int_t iface[4] = { 1,2,3,4 };
4036 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
4037 Int_t i, j, incrth, ith, jth, kth, nth, mth, ith1, ith2;
4038 Int_t ia, ib, icodes[3];
4048 Error(
"SurfaceSpherical",
"no TView in current pad");
4064 Error(
"SurfaceSpherical",
"too many THETA sectors (%d)", nth);
4068 Error(
"SurfaceSpherical",
"too many PHI sectors (%d)", nphi);
4072 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
4078 if (mth == 0) mth = 1;
4079 if (iordr == 0) ia = mth;
4080 if (iordr != 0) ib = mth;
4081 for (i = 1; i <= nphi; ++i) {
4082 if (iordr == 0) ib = i;
4083 if (iordr != 0) ia = i;
4085 if (i == 1)
fAphi[0] = f[jphi - 1];
4086 fAphi[i - 1] = (
fAphi[i - 1] + f[jphi - 1]) / (
float)2.;
4087 fAphi[i] = f[jphi + 5];
4092 if (iordr == 0) ib = 1;
4093 if (iordr != 0) ia = 1;
4094 for (i = 1; i <= nth; ++i) {
4095 if (iordr == 0) ia = i;
4096 if (iordr != 0) ib = i;
4099 if (i == 1)
fAphi[0] = f[jth - 1];
4100 fAphi[i - 1] = (
fAphi[i - 1] + f[jth - 1]) / (
float)2.;
4101 fAphi[i] = f[jth + 5];
4111 if (iphi > nphi)
goto L500;
4114 if (iordr == 0) {ia = mth; ib = iphi;}
4115 else {ia = iphi;ib = mth;}
4118 phi = (f[jphi - 1] + f[jphi + 5]) / (
float)2.;
4123 if (ith > nth)
goto L400;
4124 if (iordr == 0) ia = ith;
4125 if (iordr != 0) ib = ith;
4129 for (i = 1; i <= 4; ++i) {
4131 if (iordr != 0 && i == 2) j = 4;
4132 if (iordr != 0 && i == 4) j = 2;
4137 ttt[j - 1] = tt[i - 1];
4140 for (i = 1; i <= 4; ++i) {
4142 if (iordr != 0 && i == 2) j = 4;
4143 if (iordr != 0 && i == 4) j = 2;
4147 ttt[j - 1] = tt[i - 1];
4152 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
4156 if (ith == 0) ith = kth;
4157 if (ith > kth) ith = 1;
4158 if (ith != ith2)
goto L200;
4159 if (incrth == 0)
goto L500;
4170 if (iphi == 0) iphi = kphi;
4171 if (iphi > kphi) iphi = 1;
4172 if (iphi != iphi2)
goto L100;
4173 if (incr == 0)
return;
4199 if (qqa < 0 || qqa > 1 || qqd < 0 || qqd > 1 || qqs < 0 || qqs > 1 || nnqs < 1) {
4200 Error(
"SurfaceProperty",
"error in coefficients");
4228 Int_t ix1, iy1, iz1;
4229 Int_t ix2, iy2, iz2;
4230 Int_t incr, incrx, incry, incrz;
4231 Int_t icodes[3], i, i1, i2, k, nnod, ntria;
4234 Double_t p[8][3], pf[8], pn[8][3], t[3], fsurf, w;
4243 Error(
"ImplicitFunction",
"no TView in current pad");
4250 if (*chopt ==
'B' || *chopt ==
'b') {
4259 if (tnorm[8] < 0.) incrx =-incrx;
4260 if (tnorm[9] < 0.) incry =-incry;
4261 if (tnorm[10] < 0.) incrz =-incrz;
4265 if (incrx == -1) ix1 =
nx;
4266 if (incry == -1) iy1 =
ny;
4267 if (incrz == -1) iz1 = nz;
4271 dx = (rmax[0]-rmin[0]) / nx;
4272 dy = (rmax[1]-rmin[1]) / ny;
4273 dz = (rmax[2]-rmin[2]) / nz;
4276 Float_t r=0.,
g=0., b=0., hue, light, satur, light2;
4278 if (colref) colref->
GetRGB(r,
g, b);
4282 if (acol) acol->
SetRGB(r,
g, b);
4286 light2 = 1-.5*light;
4290 if (acol) acol->
SetRGB(r,
g, b);
4292 if (colref) colref->
GetRGB(r,
g, b);
4294 if (acol) acol->
SetRGB(r,
g, b);
4297 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
4298 z1 = (iz-1)*dz + rmin[2];
4308 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
4309 y1 = (iy-1)*dy + rmin[1];
4332 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
4359 if (pf[0] >= -
kFdel)
goto L110;
4360 if (pf[1] >= -
kFdel)
goto L120;
4361 if (pf[2] >= -
kFdel)
goto L120;
4362 if (pf[3] >= -
kFdel)
goto L120;
4363 if (pf[4] >= -
kFdel)
goto L120;
4364 if (pf[5] >= -
kFdel)
goto L120;
4365 if (pf[6] >= -
kFdel)
goto L120;
4366 if (pf[7] >= -
kFdel)
goto L120;
4369 if (pf[1] < -
kFdel)
goto L120;
4370 if (pf[2] < -
kFdel)
goto L120;
4371 if (pf[3] < -
kFdel)
goto L120;
4372 if (pf[4] < -
kFdel)
goto L120;
4373 if (pf[5] < -
kFdel)
goto L120;
4374 if (pf[6] < -
kFdel)
goto L120;
4375 if (pf[7] < -
kFdel)
goto L120;
4390 pn[0][0] = (pf[1] - pf[0]) / dx;
4391 pn[3][0] = (pf[2] - pf[3]) / dx;
4392 pn[4][0] = (pf[5] - pf[4]) / dx;
4393 pn[7][0] = (pf[6] - pf[7]) / dx;
4401 pn[1][0] = (pf[1] - pf[0]) / dx;
4402 pn[2][0] = (pf[2] - pf[3]) / dx;
4403 pn[5][0] = (pf[5] - pf[4]) / dx;
4404 pn[6][0] = (pf[6] - pf[7]) / dx;
4413 pn[0][1] = (pf[3] - pf[0]) / dy;
4414 pn[1][1] = (pf[2] - pf[1]) / dy;
4415 pn[4][1] = (pf[7] - pf[4]) / dy;
4416 pn[5][1] = (pf[6] - pf[5]) / dy;
4424 pn[2][1] = (pf[2] - pf[1]) / dy;
4425 pn[3][1] = (pf[3] - pf[0]) / dy;
4426 pn[6][1] = (pf[6] - pf[5]) / dy;
4427 pn[7][1] = (pf[7] - pf[4]) / dy;
4436 pn[0][2] = (pf[4] - pf[0]) / dz;
4437 pn[1][2] = (pf[5] - pf[1]) / dz;
4438 pn[2][2] = (pf[6] - pf[2]) / dz;
4439 pn[3][2] = (pf[7] - pf[3]) / dz;
4447 pn[4][2] = (pf[4] - pf[0]) / dz;
4448 pn[5][2] = (pf[5] - pf[1]) / dz;
4449 pn[6][2] = (pf[6] - pf[2]) / dz;
4450 pn[7][2] = (pf[7] - pf[3]) / dz;
4458 MarchingCube(fsurf, p, pf, pn, nnod, ntria, xyz, grad, itria);
4459 if (ntria == 0)
goto L510;
4461 for ( i=1 ; i<=nnod ; i++ ) {
4462 view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
4466 ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
4467 if (ntria == 0)
goto L510;
4469 if (*chopt ==
'B' || *chopt ==
'b') incr =-1;
4471 if (incr == -1) i1 = ntria;
4472 i2 = ntria - i1 + 1;
4478 for (i=i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
4515 static Int_t irota[24][8] = { { 1,2,3,4,5,6,7,8 }, { 2,3,4,1,6,7,8,5 },
4516 { 3,4,1,2,7,8,5,6 }, { 4,1,2,3,8,5,6,7 },
4517 { 6,5,8,7,2,1,4,3 }, { 5,8,7,6,1,4,3,2 },
4518 { 8,7,6,5,4,3,2,1 }, { 7,6,5,8,3,2,1,4 },
4519 { 2,6,7,3,1,5,8,4 }, { 6,7,3,2,5,8,4,1 },
4520 { 7,3,2,6,8,4,1,5 }, { 3,2,6,7,4,1,5,8 },
4521 { 5,1,4,8,6,2,3,7 }, { 1,4,8,5,2,3,7,6 },
4522 { 4,8,5,1,3,7,6,2 }, { 8,5,1,4,7,6,2,3 },
4523 { 5,6,2,1,8,7,3,4 }, { 6,2,1,5,7,3,4,8 },
4524 { 2,1,5,6,3,4,8,7 }, { 1,5,6,2,4,8,7,3 },
4525 { 4,3,7,8,1,2,6,5 }, { 3,7,8,4,2,6,5,1 },
4526 { 7,8,4,3,6,5,1,2 }, { 8,4,3,7,5,1,2,6 } };
4528 static Int_t iwhat[21] = { 1,3,5,65,50,67,74,51,177,105,113,58,165,178,
4529 254,252,250,190,205,188,181 };
4530 Int_t j, i, i1, i2, i3, ir, irt=0, k, k1, k2, incr, icase=0,
n;
4537 for ( i=1; i<=8 ; i++) {
4538 fF8[i-1] = f[i-1] - fiso;
4540 for ( ir=1 ; ir<=24 ; ir++ ) {
4543 for ( i=1 ; i<=8 ; i++ ) {
4544 if (
fF8[irota[ir-1][i-1]-1] >= 0.) k = k + incr;
4547 if (k==0 || k==255)
return;
4548 for ( i=1 ; i<=21 ; i++ ) {
4549 if (k != iwhat[i-1])
continue;
4558 for ( i=1 ; i<=8 ; i++ ) {
4559 k = irota[irt-1][i-1];
4560 fF8[i-1] = f[k-1] - fiso;
4561 fP8[i-1][0] = p[k-1][0];
4562 fP8[i-1][1] = p[k-1][1];
4563 fP8[i-1][2] = p[k-1][2];
4564 fG8[i-1][0] = g[k-1][0];
4565 fG8[i-1][1] = g[k-1][1];
4566 fG8[i-1][2] = g[k-1][2];
4571 switch ((
int)icase) {
4574 MarchingCubeCase00(1, 4, 9, 0, 0, 0, nnod, ntria, xyz, grad, itria);
4578 MarchingCubeCase00(2, 4, 9, 10, 0, 0, nnod, ntria, xyz, grad, itria);
4590 MarchingCubeCase00(6, 2, 1, 9, 8, 0, nnod, ntria, xyz, grad, itria);
4601 MarchingCubeCase00(2, 4, 8, 6, 0, 0, nnod, ntria, xyz, grad, itria);
4604 MarchingCubeCase00(1, 4, 12, 7, 6, 10, nnod, ntria, xyz, grad, itria);
4610 MarchingCubeCase00(1, 4, 8, 7, 11, 10, nnod, ntria, xyz, grad, itria);
4619 MarchingCubeCase00(1, 9, 12, 7, 6, 2, nnod, ntria, xyz, grad, itria);
4625 if (ntria == 0)
return;
4626 if (icase <= 14)
goto L500;
4627 for ( i=1; i<=ntria ; i++ ) {
4631 if (itria[i-1][2] < 0) i1 =-i1;
4632 if (itria[i-1][1] < 0) i3 =-i3;
4633 if (itria[i-1][0] < 0) i2 =-i2;
4643 if (
n > ntria)
return;
4644 for ( i=1 ; i<=3 ; i++ ) {
4661 for ( i=1 ; i<=3 ; i++ ) {
4662 itr[i-1] = itria[
n-1][i-1];
4663 itria[
n-1][i-1] = itria[ntria-1][i-1];
4666 if (ntria == 0)
return;
4667 if (itr[i2-1]*itr[i3-1] > 0)
goto L510;
4670 if (itr[i2-1] < 0) {
4674 if (itr[i3-1] < 0) {
4678 for ( j=1 ; j<=ntria ; j++ ) {
4679 for ( i=1 ; i<=3 ; i++ ) {
4680 if (itria[j-1][i-1] != k2)
continue;
4683 if (i2 == k1) itria[j-1][i-1] =-itria[j-1][i-1];
4705 static Int_t it[4][4][3] = { { { 1,2, 3 }, { 0,0, 0 }, { 0,0, 0 }, { 0,0, 0 } },
4706 { { 1,2,-3 }, {-1,3, 4 }, { 0,0, 0 }, { 0,0, 0 } },
4707 { { 1,2,-3 }, {-1,3,-4 }, {-1,4, 5 }, { 0,0, 0 } },
4708 { { 1,2,-3 }, {-1,3,-4 }, {-4,6,-1 }, { 4,5,-6 } }
4710 Int_t it2[4][3], i, j;
4722 if (ie[5] == 0) nnod = 5;
4723 if (ie[4] == 0) nnod = 4;
4724 if (ie[3] == 0) nnod = 3;
4730 for ( i=0; i<3 ; i++) {
4731 for ( j=0; j<4 ; j++) {
4732 it2[j][i] = it[ntria-1][j][i];
4746 static Int_t ie[6] = { 4,9,1, 2,11,3 };
4747 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4748 static Int_t it2[4][3] = { { 1,2,-5 }, { -1,5,6 }, { 5,-2,4 }, { -4,2,3 } };
4756 if (f0>=0. &&
fF8[0]>=0.)
goto L100;
4757 if (f0<0. &&
fF8[0]<0.)
goto L100;
4776 static Int_t ie[6] = { 4,9,1, 7,11,6 };
4777 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4778 static Int_t it2[6][3] = { { 1,2,4 }, { 2,3,6 }, { 3,1,5 },
4779 { 4,5,1 }, { 5,6,3 }, { 6,4,2 } };
4807 static Int_t ie[7] = { 2,4,9,10, 6,7,11 };
4808 static Int_t it1[5][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 } };
4809 static Int_t it2[3][3] = { { 1,2,-3 }, { -1,3,4 }, { 5,6,7 } };
4810 static Int_t it3[7][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 },
4811 { 1,7,-5 }, { -1,5,4 } };
4819 if (f0>=0. &&
fF8[1]>=0.)
goto L100;
4820 if (f0<0. &&
fF8[1]<0.)
goto L100;
4850 static Int_t ie[9] = { 3,12,4, 1,10,2, 11,6,7 };
4851 static Int_t it[9][9][3] = {
4852 {{ 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}},
4853 {{ 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}},
4854 {{ 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}},
4855 {{-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}},
4856 {{ 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}},
4857 {{-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}},
4858 {{ 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}},
4859 {{ 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}},
4860 {{ -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}}
4863 Int_t it2[9][3], i, j;
4874 if (f1>=0. &&
fF8[2] <0.) icase = icase + 1;
4875 if (f1 <0. &&
fF8[2]>=0.) icase = icase + 1;
4876 if (f2>=0. &&
fF8[2] <0.) icase = icase + 2;
4877 if (f2 <0. &&
fF8[2]>=0.) icase = icase + 2;
4878 if (f3>=0. &&
fF8[2] <0.) icase = icase + 4;
4879 if (f3 <0. &&
fF8[2]>=0.) icase = icase + 4;
4882 switch ((
int)icase) {
4903 for ( i=0; i<3 ; i++) {
4904 for ( j=0; j<9 ; j++) {
4905 it2[j][i] = it[icase-1][j][i];
4915 if (irep != 2)
goto L400;
4922 for ( i=0; i<3 ; i++) {
4923 for ( j=0; j<9 ; j++) {
4924 it2[j][i] = it[icase-1][j][i];
4939 static Int_t ie[8] = { 1,3,12,9, 5,7,11,10 };
4940 static Int_t it[6][8][3] = {
4941 {{1,2,-3}, {-1,3,4}, {5,6,-7}, {-5,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4942 {{ 9,1,2}, { 9,2,3}, { 9,3,4}, { 9,4,5}, { 9,5,6}, { 9,6,7}, { 9,7,8}, { 9,8,1}},
4943 {{ 9,1,2}, { 9,4,1}, { 9,3,4}, { 9,6,3}, { 9,5,6}, { 9,8,5}, { 9,7,8}, { 9,2,7}},
4944 {{1,2,-7}, {-1,7,8}, {5,6,-3}, {-5,3,4}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4945 {{1,2,-7}, {-1,7,8}, {2,3,-6}, {-2,6,7}, {3,4,-5}, {-3,5,6}, {4,1,-8}, {-4,8,5}},
4946 {{1,2,-3}, {-1,3,4}, {2,7,-6}, {-2,6,3}, {7,8,-5}, {-7,5,6}, {8,1,-4}, {-8,4,5}}
4948 Int_t it2[8][3], i, j;
4958 if (f1 >= 0.) icase = icase + 1;
4959 if (f2 >= 0.) icase = icase + 2;
4960 if (icase==1 || icase==4)
goto L100;
4966 for ( i=0; i<3 ; i++) {
4967 for ( j=0; j<8 ; j++) {
4968 it2[j][i] = it[icase-1][j][i];
4979 if (irep == 0)
goto L200;
4982 if (icase == 1) icase = 5;
4983 if (icase == 4) icase = 6;
4988 for ( i=0; i<3 ; i++) {
4989 for ( j=0; j<8 ; j++) {
4990 it2[j][i] = it[icase-1][j][i];
5005 static Int_t ie[8] = { 3,12,4, 1,9,8,6,2 };
5006 static Int_t it[6][8][3] = {
5007 {{ 1,2,3}, {4,5,-6}, {-4,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
5008 {{-9,1,2}, {9,2,-3}, {-9,3,4}, {9,4,-5}, {-9,5,6}, {9,6,-7}, {-9,7,8}, {9,8,-1}},
5009 {{9,1,-2}, {-9,2,6}, {9,6,-7}, {-9,7,8}, {9,8,-4}, {-9,4,5}, {9,5,-3}, {-9,3,1}},
5010 {{ 3,4,5}, {1,2,-6}, {-1,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
5011 {{ 7,8,6}, {6,8,-1}, {-6,1,2}, {3,1,-8}, {-3,8,4}, { 3,4,5}, {3,5,-6}, {-3,6,2}},
5012 {{ 7,8,6}, {6,8,-4}, {-6,4,5}, {3,4,-8}, {-3,8,1}, { 3,1,2}, {3,2,-6}, {-3,6,5}}
5014 Int_t it2[8][3], i, j;
5024 if (f1 >= 0.) icase = icase + 1;
5025 if (f2 >= 0.) icase = icase + 2;
5026 if (icase==1 || icase==4)
goto L100;
5032 for ( i=0; i<3 ; i++) {
5033 for ( j=0; j<8 ; j++) {
5034 it2[j][i] = it[icase-1][j][i];
5045 if (irep != 1)
goto L200;
5048 if (icase == 1) icase = 5;
5049 if (icase == 4) icase = 6;
5054 for ( i=0; i<3 ; i++) {
5055 for ( j=0; j<8 ; j++) {
5056 it2[j][i] = it[icase-1][j][i];
5071 Int_t nr, nf, i, k, incr,
n, kr, icase, irep;
5072 static Int_t irota[12][8] = {
5073 {1,2,3,4,5,6,7,8}, {1,5,6,2,4,8,7,3}, {1,4,8,5,2,3,7,6},
5074 {3,7,8,4,2,6,5,1}, {3,2,6,7,4,1,5,8}, {3,4,1,2,7,8,5,6},
5075 {6,7,3,2,5,8,4,1}, {6,5,8,7,2,1,4,3}, {6,2,1,5,7,3,4,8},
5076 {8,4,3,7,5,1,2,6}, {8,5,1,4,7,6,2,3}, {8,7,6,5,4,3,2,1} };
5077 static Int_t iwhat[8] = { 63,62,54,26,50,9,1,0 };
5078 static Int_t ie[12] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
5079 static Int_t iface[6][4] = {
5080 {1,2,3,4}, {5,6,7,8}, {1,2,6,5}, {2,6,7,3}, {4,3,7,8}, {1,5,8,4} };
5081 static Int_t it1[4][3] = { {1,2,10}, {9,5,8}, {6,11,7}, {3,4,12} };
5082 static Int_t it2[4][3] = { {5,6,10}, {1,4,9}, {2,11,3}, {7,8,12} };
5083 static Int_t it3[6][3] = { {10,12,-3}, {-10,3,2}, {12,10,-1}, {-12,1,4},
5084 {9,5,8}, {6,11,7} };
5085 static Int_t it4[6][3] = { {11,9,-1}, {-11,1,2}, {9,11,-3}, {-9,3,4},
5086 {5,6,10}, {7,8,12} };
5087 static Int_t it5[10][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
5088 {13,10,1}, {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2}, {5,8,9} };
5089 static Int_t it6[10][3] = { {13,2,-10}, {-13,10,5}, {13,5,-6}, {-13,6,11},
5090 {13,11,3}, {13,3,-4}, {-13,4,9}, {13,9,-1}, {-13,1,2}, {12,7,8} };
5091 static Int_t it7[12][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
5092 {13,10,-5}, {-13,5,8}, {13,8,-9}, {-13,9,1},
5093 {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2} };
5094 static Int_t it8[6][3] = { {3,8,12}, {3,-2,-8}, {-2,5,-8}, {2,10,-5},
5095 {7,6,11}, {1,4,9} };
5096 static Int_t it9[10][3] = { {7,12,-3}, {-7,3,11}, {11,3,2}, {6,11,-2}, {-6,2,10},
5097 {6,10,5}, {7,6,-5}, {-7,5,8}, {7,8,12}, {1,4,9} };
5098 static Int_t it10[10][3] = { {9,1,-10}, {-9,10,5}, {9,5,8}, {4,9,-8}, {-4,8,12},
5099 {4,12,3}, {1,4,-3}, {-1,3,2}, {1,2,10}, {7,6,11} };
5105 for ( nr=1 ; nr<=12 ; nr++ ) {
5108 for ( nf=1 ; nf<=6 ; nf++ ) {
5109 f1 =
fF8[irota[nr-1][iface[nf-1][0]-1]-1];
5110 f2 =
fF8[irota[nr-1][iface[nf-1][1]-1]-1];
5111 f3 =
fF8[irota[nr-1][iface[nf-1][2]-1]-1];
5112 f4 =
fF8[irota[nr-1][iface[nf-1][3]-1]-1];
5113 if ((f1*f3-f2*f4)/(f1+f3-f2-f4) >= 0.) k = k + incr;
5116 for ( i=1 ; i<=8 ; i++ ) {
5117 if (k != iwhat[i-1])
continue;
5123 Error(
"MarchingCubeCase13",
"configuration is not found");
5128 if (icase==1 || icase==8)
goto L300;
5129 for ( n=1 ; n<=8 ; n++) {
5130 k = irota[kr-1][n-1];
5132 for ( i=1 ; i<=3 ; i++ ) {
5133 xyz[n-1][i-1] =
fP8[k-1][i-1];
5134 grad[n-1][i-1] =
fG8[k-1][i-1];
5137 for ( n=1 ; n<=8 ; n++ ) {
5139 for ( i=1 ; i<=3 ; i++ ) {
5140 fP8[n-1][i-1] = xyz[n-1][i-1];
5141 fG8[n-1][i-1] = grad[n-1][i-1];
5151 switch ((
int)icase) {
5172 &xyz[nnod-1][0], &grad[nnod-1][0]);
5179 &xyz[nnod-1][0], &grad[nnod-1][0]);
5186 &xyz[nnod-1][0], &grad[nnod-1][0]);
5193 switch ((
int)(irep+1)) {
5223 for ( n=1 ; n<=ntria ; n++ ) {
5224 for ( i=1 ; i<=3 ; i++ ) {
5226 itria[n-1][i-1] = k;
5251 for ( i=1 ; i<=3 ; i++ ) {
5255 for ( n=1 ; n<=nnod ; n++ ) {
5258 for ( i=1 ; i<=3 ; i++ ) {
5259 p[i-1] = p[i-1] + xyz[k-1][i-1];
5260 g[i-1] = g[i-1] + grad[k-1][i-1];
5263 for ( i=1 ; i<=3 ; i++ ) {
5264 pxyz[i-1] = p[i-1] / nnod;
5265 pgrad[i-1] = g[i-1] / nnod;
5288 a = (a11-a01)*(b00-b10) - (a00-a10)*(b11-b01);
5289 if (a == 0.)
return;
5290 b = a01*(b00-b10)-(a11-a01)*b00-(a00-a10)*b01+a00*(b11-b01);
5291 c = a00*b01 - a01*b00;
5293 if (d <= 0.)
return;
5296 s1 = (-b+d) / (2*a);
5297 if (s1<0. || s1>1.)
return;
5299 s2 = (-b-d) / (2*a);
5300 if (s2<0. || s2>1.)
return;
5304 if (a00 >= 0) iposa = iposa + 1;
5305 if (a01 >= 0) iposa = iposa + 2;
5306 if (a10 >= 0) iposa = iposa + 4;
5307 if (a11 >= 0) iposa = iposa + 8;
5308 if (iposa==6 || iposa==9)
goto L100;
5314 s0 = (a00-a01) / (a00+a11-a10-a01);
5315 if (s1>=s0 && s2<s0)
return;
5316 if (s1<s0 && s2>=s0)
return;
5318 if (s1 >= s0) irep = 2;
5322 if (b00 >= 0) iposb = iposb + 1;
5323 if (b01 >= 0) iposb = iposb + 2;
5324 if (b10 >= 0) iposb = iposb + 4;
5325 if (b11 >= 0) iposb = iposb + 8;
5326 if (iposb!=6 && iposb!=9)
return;
5327 s0 = (b00-b01) / (b00+b11-b10-b01);
5328 if (iposa != iposb)
goto L200;
5330 if (irep==1 && s1>s0)
return;
5331 if (irep==2 && s1<s0)
return;
5336 if (irep==1 && s1<s0)
return;
5337 if (irep==2 && s1>s0)
return;
5357 static Int_t iedge[12][2] = {
5358 {1,2}, {2,3}, {3,4}, {4,1}, {5,6}, {6,7}, {7,8}, {8,5}, {1,5}, {2,6}, {3,7}, {4,8} };
5360 for ( n=1 ; n<=nnod ; n++ ) {
5366 for ( i=1 ; i<=3 ; i++ ) {
5367 xyz[n-1][i-1] = (
fP8[n2-1][i-1]-
fP8[n1-1][i-1])*t +
fP8[n1-1][i-1];
5368 grad[n-1][i-1] = (
fG8[n2-1][i-1]-
fG8[n1-1][i-1])*t +
fG8[n1-1][i-1];
5390 Int_t n, nf, i1, i2, i3, i, icur, k, itst, kface, kf, irep;
5400 for ( n=1 ; n<=nface ; n++ ) {
5424 for ( i=1 ; i<=3 ; i++ ) {
5425 wmin = xyz[i1-1][i-1];
5426 wmax = xyz[i1-1][i-1];
5427 if (wmin > xyz[i2-1][i-1]) wmin = xyz[i2-1][i-1];
5428 if (wmax < xyz[i2-1][i-1]) wmax = xyz[i2-1][i-1];
5429 if (wmin > xyz[i3-1][i-1]) wmin = xyz[i3-1][i-1];
5430 if (wmax < xyz[i3-1][i-1]) wmax = xyz[i3-1][i-1];
5431 dface[n-1][i-1] = wmin;
5432 dface[n-1][i+2] = wmax;
5435 for ( i=1 ; i<=3 ; i++ ) {
5436 v[0][i-1] = xyz[i2-1][i-1] - xyz[i1-1][i-1];
5437 v[1][i-1] = xyz[i3-1][i-1] - xyz[i2-1][i-1];
5439 a = (v[0][1]*v[1][2] - v[0][2]*v[1][1]);
5440 b = (v[0][2]*v[1][0] - v[0][0]*v[1][2]);
5441 c = (v[0][0]*v[1][1] - v[0][1]*v[1][0]);
5450 abcd[n-1][3] =-(a*xyz[i1-1][0] + b*xyz[i1-1][1] + c*xyz[i1-1][2]);
5453 if (nf <= 1)
return;
5456 for ( icur=2 ; icur<=nface ; icur++ ) {
5458 zcur = dface[k-1][2];
5459 for ( itst=icur-1 ; itst>=1 ; itst-- ) {
5461 if (zcur < dface[k-1][2])
break;
5463 iorder[itst-1] = iorder[itst];
5471 if (kface == 1)
goto L900;
5472 nf = iorder[kface-1];
5473 if (nf < 0) nf =-nf;
5474 abcdn[0] = abcd[nf-1][0];
5475 abcdn[1] = abcd[nf-1][1];
5476 abcdn[2] = abcd[nf-1][2];
5477 abcdn[3] = abcd[nf-1][3];
5483 for ( k=kface-1 ; k>=1 ; k-- ) {
5485 if (kf < 0) kf =-kf;
5486 if (dface[nf-1][5] > dface[kf-1][2]+
kDel)
goto L400;
5487 if (iorder[k-1] > 0)
goto L900;
5492 if (dface[kf-1][0] >= dface[nf-1][3]-
kDel)
goto L800;
5493 if (dface[kf-1][3] <= dface[nf-1][0]+
kDel)
goto L800;
5494 if (dface[kf-1][1] >= dface[nf-1][4]-
kDel)
goto L800;
5495 if (dface[kf-1][4] <= dface[nf-1][1]+
kDel)
goto L800;
5501 if (abcdn[0]*xyz[kk[0]-1][0]+abcdn[1]*xyz[kk[0]-1][1]+
5502 abcdn[2]*xyz[kk[0]-1][2]+abcdn[3] < -
kDel)
goto L500;
5503 if (abcdn[0]*xyz[kk[1]-1][0]+abcdn[1]*xyz[kk[1]-1][1]+
5504 abcdn[2]*xyz[kk[1]-1][2]+abcdn[3] < -
kDel)
goto L500;
5505 if (abcdn[0]*xyz[kk[2]-1][0]+abcdn[1]*xyz[kk[2]-1][1]+
5506 abcdn[2]*xyz[kk[2]-1][2]+abcdn[3] < -
kDel)
goto L500;
5511 abcdk[0] = abcd[kf-1][0];
5512 abcdk[1] = abcd[kf-1][1];
5513 abcdk[2] = abcd[kf-1][2];
5514 abcdk[3] = abcd[kf-1][3];
5515 if (abcdk[0]*xyz[nn[0]-1][0]+abcdk[1]*xyz[nn[0]-1][1]+
5516 abcdk[2]*xyz[nn[0]-1][2]+abcdk[3] >
kDel)
goto L600;
5517 if (abcdk[0]*xyz[nn[1]-1][0]+abcdk[1]*xyz[nn[1]-1][1]+
5518 abcdk[2]*xyz[nn[1]-1][2]+abcdk[3] >
kDel)
goto L600;
5519 if (abcdk[0]*xyz[nn[2]-1][0]+abcdk[1]*xyz[nn[2]-1][1]+
5520 abcdk[2]*xyz[nn[2]-1][2]+abcdk[3] >
kDel)
goto L600;
5526 for ( i=1 ; i<=3 ; i++ ) {
5529 if (i != 3) i2 = kk[i];
5531 if ( irep<0 )
goto L700;
5532 if ( irep==0 )
continue;
5533 if ( irep>0 )
goto L800;
5536 for ( i=1 ; i<=3 ; i++ ) {
5539 if (i != 3) i2 = nn[i];
5541 if ( irep<0 )
goto L800;
5542 if ( irep==0 )
continue;
5543 if ( irep>0 )
goto L700;
5550 for ( i=k+1 ; i<=kface ; i++ ) {
5551 iorder[i-2] = iorder[i-1];
5553 iorder[kface-1] =-kf;
5554 if (kf > 0)
goto L300;
5562 if (iorder[kface-1] < 0) iorder[kface-1] =-iorder[kface-1];
5564 if (kface > 0)
goto L300;
5583 Int_t k, k1, k2, ixy, i;
5584 Double_t a, b,
c, d1, d2, dd,
xy, tmin, tmax, tmid,
x,
y, z;
5590 delta[0] = xyz[i2-1][0] - xyz[i1-1][0];
5591 delta[1] = xyz[i2-1][1] - xyz[i1-1][1];
5592 delta[2] = xyz[i2-1][2] - xyz[i1-1][2];
5598 c =-(a*xyz[i1-1][0] + b*xyz[i1-1][1]);
5599 d[0] = a*xyz[iface[0]-1][0] + b*xyz[iface[0]-1][1] +
c;
5600 d[1] = a*xyz[iface[1]-1][0] + b*xyz[iface[1]-1][1] +
c;
5601 d[2] = a*xyz[iface[2]-1][0] + b*xyz[iface[2]-1][1] +
c;
5603 for ( i=1 ; i<=3 ; i++ ) {
5607 if (d[k1-1]>=0. && d[k2-1]>=0.)
continue;
5608 if (d[k1-1] <0. && d[k2-1] <0.)
continue;
5609 d1 = d[k1-1] / (d[k1-1] - d[k2-1]);
5610 d2 = d[k2-1] / (d[k1-1] - d[k2-1]);
5611 xy = d1*xyz[iface[k2-1]-1][ixy-1] - d2*xyz[iface[k1-1]-1][ixy-1];
5613 t[k-1] = (xy-xyz[i1-1][ixy-1]) / delta[ixy-1];
5614 if (k == 2)
goto L200;
5622 if (tmin>1. || tmax<0)
return;
5623 if (tmin < 0.) tmin = 0.;
5624 if (tmax > 1.) tmax = 1.;
5625 tmid = (tmin + tmax) / 2.;
5626 x = delta[0]*tmid + xyz[i1-1][0];
5627 y = delta[1]*tmid + xyz[i1-1][1];
5628 z = delta[2]*tmid + xyz[i1-1][2];
5629 dd = abcd[0]*x + abcd[1]*y + abcd[2]*z + abcd[3];
5630 if (dd > del)
goto L997;
5631 if (dd <-del)
goto L998;
5664 Double_t fsurf, w, d1, d2, df1, df2;
5666 Int_t i, i1, i2, j, ibase, nnod, knod, ntria, ktria, iopt, iready;
5667 Int_t ixcrit, iycrit, izcrit, incrx, incry, incrz, incr;
5668 Int_t ix, ix1=0, ix2=0, iy, iy1=0, iy2=0, iz, iz1=0, iz2=0, k, kx, ky, kz, isurf, nsurf;
5674 static Int_t ind[8][3] = { { 0,0,0 }, { 1,0,0 }, { 1,0,1 }, { 0,0,1 },
5675 { 0,1,0 }, { 1,1,0 }, { 1,1,1 }, { 0,1,1 } };
5686 Error(
"ImplicitFunction",
"no TView in current pad");
5691 if (nsurf >
kNiso) {
5692 Warning(
"IsoSurface",
"Number of isosurfaces too large. Increase kNiso");
5695 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
5719 if (p1[2] < p0[2]) ixcrit = 1;
5720 if (p2[2] < p0[2]) iycrit = 1;
5721 if (p3[2] < p0[2]) izcrit = 1;
5730 if (iopt == 1) iz1 = 1;
5731 if (iopt == 1) iz2 = izcrit-1;
5732 if (iopt == 2) iz1 = izcrit;
5733 if (iopt == 2) iz2 = nz - 1;
5735 if (iopt == 1) iz1 = nz - 1;
5736 if (iopt == 1) iz2 = izcrit;
5737 if (iopt == 2) iz1 = izcrit-1;
5738 if (iopt == 2) iz2 = 1;
5740 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
5743 if (iopt == 1) iy1 = 1;
5744 if (iopt == 1) iy2 = iycrit-1;
5745 if (iopt == 2) iy1 = iycrit;
5746 if (iopt == 2) iy2 = ny - 1;
5748 if (iopt == 1) iy1 = ny - 1;
5749 if (iopt == 1) iy2 = iycrit;
5750 if (iopt == 2) iy1 = iycrit-1;
5751 if (iopt == 2) iy2 = 1;
5753 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
5756 if (iopt == 1) ix1 = 1;
5757 if (iopt == 1) ix2 = ixcrit-1;
5758 if (iopt == 2) ix1 = ixcrit;
5759 if (iopt == 2) ix2 = nx - 1;
5761 if (iopt == 1) ix1 = nx - 1;
5762 if (iopt == 1) ix2 = ixcrit;
5763 if (iopt == 2) ix1 = ixcrit-1;
5764 if (iopt == 2) ix2 = 1;
5766 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
5770 for ( isurf=1 ; isurf<=nsurf ; isurf++ ) {
5808 if (iready !=0)
goto L310;
5810 for ( i=1 ; i<=8 ; i++ ) {
5811 kx = ix + ind[i-1][0];
5812 ky = iy + ind[i-1][1];
5813 kz = iz + ind[i-1][2];
5814 p[i-1][0] = x[kx-1];
5815 p[i-1][1] = y[ky-1];
5816 p[i-1][2] = z[kz-1];
5823 }
else if (kx == nx) {
5828 d1 = x[kx-1] - x[kx-2];
5829 d2 = x[kx] - x[kx-1];
5839 pn[i-1][0] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5847 }
else if (ky == ny) {
5852 d1 = y[ky-1] - y[ky-2];
5853 d2 = y[ky] - y[ky-1];
5863 pn[i-1][1] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5871 }
else if (kz == nz) {
5876 d1 = z[kz-1] - z[kz-2];
5877 d2 = z[kz] - z[kz-1];
5887 pn[i-1][2] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5898 xyz_tmp, grad_tmp, itria_tmp);
5900 for( l=0 ; l<knod ; l++) {
5901 xyz[nnod+
l][0] = xyz_tmp[
l][0];
5902 xyz[nnod+
l][1] = xyz_tmp[
l][1];
5903 xyz[nnod+
l][2] = xyz_tmp[
l][2];
5904 grad[nnod+
l][0] = grad_tmp[
l][0];
5905 grad[nnod+
l][1] = grad_tmp[
l][1];
5906 grad[nnod+
l][2] = grad_tmp[
l][2];
5908 for( l=0 ; l<ktria ; l++) {
5909 itria[ntria+
l][0] = itria_tmp[
l][0];
5910 itria[ntria+
l][1] = itria_tmp[
l][1];
5911 itria[ntria+
l][2] = itria_tmp[
l][2];
5914 for ( i=ntria+1 ; i<=ntria+ktria ; i++ ) {
5915 for ( j=1 ; j<=3 ; j++ ){
5917 if (itria[i-1][j-1] < 0) ibase =-nnod;
5918 itria[i-1][j-1] = itria[i-1][j-1] + ibase;
5923 ntria = ntria + ktria;
5927 if (ntria == 0)
continue;
5928 for ( i=1 ; i<=nnod ; i++ ) {
5929 view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
5933 ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
5934 if (ntria == 0)
continue;
5936 if (iopt == 1) incr = -1;
5938 if (incr == -1) i1 = ntria;
5939 i2 = ntria - i1 + 1;
5940 for (i = i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
5945 icodes[0] = iattr[k-1];
5946 icodes[1] = iattr[k-1];
5947 icodes[2] = iattr[k-1];
5952 if (incrx < 0)
goto L130;
5955 if (incry < 0)
goto L120;
5958 if (incrz < 0)
goto L110;
5975 Error(
"ImplicitFunction",
"no TView in current pad");
5982 for ( i=1 ; i<=np ; i++) {
5985 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)
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.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
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 if painter does not exist, it is created
Histogram option structure.
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual Double_t * GetRmax()=0
virtual TList * GetStack() const =0
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.
R__EXTERN TStyle * gStyle
int Logy
log scale in Y. Also set by histogram option
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 Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
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)
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
void FindVisibleDraw(Double_t *r1, Double_t *r2)
Find visible parts of line (draw line)
virtual void SetFillStyle(Style_t fstyle)
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
void InitMoveScreen(Double_t xmin, Double_t xmax)
Initialize "MOVING SCREEN" method.
static Double_t gTT[4 *kVSizeMax]
int Logx
log scale in X. Also set by histogram option
static Int_t fgF3Clipping
Bool_t GetHistMinimumZero() const
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
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)
Float_t GetLegoInnerR() const
static Double_t fgF3YClip
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
static const double x2[5]
ClassImp(TPainter3dAlgorithms) TPainter3dAlgorithms
Lego default constructor.
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) ...
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)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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) ...
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
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)
static Int_t gEdgeStyle[kVSizeMax+1]
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 isosurfaces for a scalar function defined on a grid.
void FrontBox(Double_t ang)
Draw forward faces of surrounding box & axes.
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)
A 3-Dim function with parameters.
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.
unsigned int r1[N_CITIES]
virtual Color_t GetFillColor() const
void SurfaceCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in cylindrical coordinates.
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
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 Luminosity(Double_t *anorm, Double_t &flum)
Find surface luminosity at given point.
static double p1(double t, double a, double b)
virtual Color_t GetLineColor() const
static Int_t gEdgeColor[kVSizeMax+1]
Int_t ylast
last bin number along Y
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 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 Int_t GetSize() const
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
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...
Int_t xlast
last bin number along X
const Int_t kF3FillColor2
void SetEdgeAtt(Color_t color=1, Style_t style=1, Width_t width=1, Int_t n=0)
The color creation and management class.
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)
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 aproximating the isosurface ...
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
void BackBox(Double_t ang)
Draw back surfaces of surrounding box.
Mother of all ROOT objects.
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.
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 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 ...
double f2(const double *x)
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) ...
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
static Double_t fgF3XClip
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.
Double_t Sqrt(Double_t x)
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 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")
unsigned int r2[N_CITIES]
int Logz
log scale in Z. Also set by histogram option
int Lego
"LEGO" Draw as a Lego plot(LEGO,Lego=1, LEGO1,Lego1=11, LEGO2,Lego=12).
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.