78 TList *stack =
nullptr;
88 for (i=0;i<3;i++) {
fRmin[i] = 0;
fRmax[i] = 1; }
89 for (i=0;i<4;i++) {
fYls[i] = 0; }
91 for (i=0;i<30;i++) {
fJmask[i] = 0; }
93 for (i=0;i<465;i++) {
fMask[i] = 0; }
95 for (i=0;i<1200;i++) {
fPlines[i] = 0.; }
96 for (i=0;i<200;i++) {
fT[i] = 0.; }
98 for (i=0;i<12;i++) {
fVls[i] = 0.; }
99 for (i=0;i<257;i++) {
fFunLevel[i] = 0.; }
100 for (i=0;i<8;i++) {
fF8[i] = 0.; }
162 for (i=0;i<3;i++) {
fRmin[i] = rmin[i];
fRmax[i] = rmax[i]; }
163 for (i=0;i<4;i++) {
fYls[i] = 0; }
165 for (i=0;i<30;i++) {
fJmask[i] = 0; }
167 for (i=0;i<465;i++) {
fMask[i] = 0; }
169 for (i=0;i<1200;i++) {
fPlines[i] = 0.; }
170 for (i=0;i<200;i++) {
fT[i] = 0.; }
172 for (i=0;i<12;i++) {
fVls[i] = 0.; }
173 for (i=0;i<257;i++) {
fFunLevel[i] = 0.; }
174 for (i=0;i<8;i++) {
fF8[i] = 0.; }
222 static Int_t iface1[4] = { 1, 4, 8, 5 };
223 static Int_t iface2[4] = { 4, 3, 7, 8 };
227 Error(
"BackBox",
"no TView in current pad");
233 Int_t ix1, ix2, iy1, iy2, iz1, iz2;
236 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
237 for (
Int_t i = 0; i < 8; ++i) {
238 r[i*3 + 0] = av[i*3 + 0] + av[i*3 + 1]*cosa;
239 r[i*3 + 1] = av[i*3 + 1]*sina;
240 r[i*3 + 2] = av[i*3 + 2];
244 Int_t icodes[3] = { 0, 0, 0 };
246 tt[0] =
r[(iface1[0]-1)*3 + 2];
247 tt[1] =
r[(iface1[1]-1)*3 + 2];
248 tt[2] =
r[(iface1[2]-1)*3 + 2];
249 tt[3] =
r[(iface1[3]-1)*3 + 2];
251 tt[0] =
r[(iface2[0]-1)*3 + 2];
252 tt[1] =
r[(iface2[1]-1)*3 + 2];
253 tt[2] =
r[(iface2[2]-1)*3 + 2];
254 tt[3] =
r[(iface2[3]-1)*3 + 2];
265 static Int_t iface1[4] = { 1, 2, 6, 5 };
266 static Int_t iface2[4] = { 2, 3, 7, 6 };
270 Error(
"FrontBox",
"no TView in current pad");
276 Int_t ix1, ix2, iy1, iy2, iz1, iz2;
279 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
280 for (
Int_t i = 0; i < 8; ++i) {
281 r[i*3 + 0] = av[i*3 + 0] + av[i*3 + 1]*cosa;
282 r[i*3 + 1] = av[i*3 + 1]*sina;
283 r[i*3 + 2] = av[i*3 + 2];
292 for (
Int_t i = 0; i < 4; ++i) {
293 Int_t k = iface1[i] - 1;
297 gPad->PaintPolyLine(4,
x,
y);
298 for (
Int_t i = 0; i < 4; ++i) {
299 Int_t k = iface2[i] - 1;
303 gPad->PaintPolyLine(4,
x,
y);
327 static const char *where =
"ColorFunction";
336 if (nl < 0 || nl > 256) {
337 Error(where,
"illegal number of levels (%d)", nl);
342 for (
Int_t i = 1; i < nl; ++i) {
343 if (fl[i] <= fl[i - 1]) {
350 for (
Int_t i = 0; i < nl; ++i) {
372 Error(
"GridLevels",
"no TView in current pad");
378 Double_t binLow = 0, binHigh = 0, binWidth = 0;
381 if (!rmin || !rmax)
return;
384 binLow, binHigh, nbins, binWidth,
" ");
389 binWidth = (binHigh - binLow)/nbins;
416 for (
Int_t i = 0; i <
np; ++i) {
418 if (k < 0) { k = -k; ifneg =
true; }
419 view->
WCtoNDC(&xyz[(k-1)*3], p3);
420 x[i] = p3[0];
y[i] = p3[1];
426 for (
Int_t i = 0; i <
np; ++i) {
427 z +=
y[i]*
x[i+1] -
x[i]*
y[i+1];
440 for (
Int_t i = 0; i <
np; ++i) {
441 if (iface[i] > 0)
gPad->PaintPolyLine(2, &
x[i], &
y[i]);
463 Double_t x[12+1] = {0},
y[12+1] = {0}, p3[3*12];
464 for (
Int_t i = 0; i <
np; ++i) {
466 view->
WCtoNDC(&xyz[(k-1)*3], &p3[i*3]);
467 x[i] = p3[i*3+0];
y[i] = p3[i*3+1];
477 Double_t ttt[5] = { t[0], t[1], t[2], t[3], t[0] };
478 for (
Int_t i = 0; i<3; ++i) { p3[3*4+i] = p3[i]; }
479 Int_t k1 = 0, k2 = 2;
480 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]);
481 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]);
488 gPad->PaintPolyLine(3, &
x[k1], &
y[k1]);
492 gPad->PaintPolyLine(3, &
x[k2], &
y[k2]);
494 x[1] =
x[2];
y[1] =
y[2];
495 gPad->PaintPolyLine(2, &
x[0], &
y[0]);
522 for (
Int_t i = 0; i <
np; ++i) {
524 view->
WCtoNDC(&xyz[(k-1)*3], p3);
525 x[i] = p3[0];
y[i] = p3[1];
533 if (icodes[3] == 1) icol =
fColorMain[icodes[2] - 1];
534 if (icodes[3] == 2) icol =
fColorDark[icodes[2] - 1];
535 if (icodes[3] == 3) icol =
fColorMain[icodes[2] - 1];
536 if (icodes[3] == 4) icol =
fColorDark[icodes[2] - 1];
569 for (
Int_t i = 0; i <
np; ++i) {
571 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
572 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
573 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
582 if (icodes[2] == 0) {
596 for (
Int_t it = 0; it <
fNT; ++it) {
597 x[0] = p1[0] + xdel*
fT[2*it + 0];
598 y[0] = p1[1] + ydel*
fT[2*it + 0];
599 x[1] = p1[0] + xdel*
fT[2*it + 1];
600 y[1] = p1[1] + ydel*
fT[2*it + 1];
602 gPad->PaintPolyLine(2,
x,
y);
607 if (icodes[2] == 0) {
617 for (
Int_t i = 0; i <
np; ++i) {
619 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
625 for (
Int_t it = 0; it <
fNT; ++it) {
626 x[0] = p1[0] + xdel*
fT[2*it + 0];
627 y[0] = p1[1] + ydel*
fT[2*it + 0];
628 x[1] = p1[0] + xdel*
fT[2*it + 1];
629 y[1] = p1[1] + ydel*
fT[2*it + 1];
631 gPad->PaintPolyLine(2,
x,
y);
636 for (
Int_t i = 0; i <
np; ++i) {
638 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
659 for (
Int_t i = 0; i <
np; ++i) {
661 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
662 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
663 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
668 if (icodes[2] == 0) {
678 for (
Int_t i = 0; i <
np; ++i) {
680 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
686 for (
Int_t it = 0; it <
fNT; ++it) {
687 x[0] = p1[0] + xdel*
fT[2*it + 0];
688 y[0] = p1[1] + ydel*
fT[2*it + 0];
689 x[1] = p1[0] + xdel*
fT[2*it + 1];
690 y[1] = p1[1] + ydel*
fT[2*it + 1];
692 gPad->PaintPolyLine(2,
x,
y);
697 for (
Int_t i = 0; i <
np; ++i) {
699 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
720 if (icodes[2] == 0) {
732 Double_t p3[3*12] = {0}, ttt[12] = {0};
733 for (
Int_t i = 0; i <
np; ++i) {
735 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
736 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
737 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
743 Int_t ipol[2] = { 0, 0 };
744 if (
np == 4 && icodes[2] != 0) {
749 npol[0] = 3; npol[1] = 3;
750 ipol[0] = 0; ipol[1] = 2;
754 for (
Int_t kpol = 0; kpol < 2; ++kpol) {
755 if (npol[kpol] == 0)
continue;
756 Int_t nv = npol[kpol];
757 Int_t iv = ipol[kpol];
769 for (
Int_t it = 0; it <
fNT; ++it) {
770 x[0] = p1[0] + xdel*
fT[2*it + 0];
771 y[0] = p1[1] + ydel*
fT[2*it + 0];
772 x[1] = p1[0] + xdel*
fT[2*it + 1];
773 y[1] = p1[1] + ydel*
fT[2*it + 1];
775 gPad->PaintPolyLine(2,
x,
y);
781 for (
Int_t i = 0; i <
np; ++i) {
783 Int_t i2 = (i ==
np - 1) ? 0 : i1 + 1;
804 if (icodes[2] == 0) {
816 Double_t p3[3*12] = {0}, ttt[12] = {0};
817 for (
Int_t i = 0; i <
np; ++i) {
819 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
820 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
821 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
827 Int_t ipol[2] = { 0, 0 };
828 if (
np == 4 && icodes[2] != 0) {
833 npol[0] = 3; npol[1] = 3;
834 ipol[0] = 0; ipol[1] = 2;
838 for (
Int_t kpol = 0; kpol < 2; ++kpol) {
839 if (npol[kpol] == 0)
continue;
840 Int_t nv = npol[kpol];
841 Int_t iv = ipol[kpol];
850 x[0] = p1[0];
y[0] = p1[1];
851 x[1] = p2[0];
y[1] = p2[1];
852 gPad->PaintPolyLine(2,
x,
y);
872 Double_t p3[3*12] = {0}, pp[2*12] = {0};
873 for (
Int_t i = 0; i <
np; ++i) {
876 p3[i*3 + 0] = xyz[(k-1)*3 + 0];
877 p3[i*3 + 1] = xyz[(k-1)*3 + 1];
878 p3[i*3 + 2] = xyz[(k-1)*3 + 2];
891 if (icodes[2] == 0) {
905 for (
Int_t it = 0; it <
fNT; ++it) {
906 x[0] = p1[0] + xdel*
fT[2*it + 0];
907 y[0] = p1[1] + ydel*
fT[2*it + 0];
908 x[1] = p1[0] + xdel*
fT[2*it + 1];
909 y[1] = p1[1] + ydel*
fT[2*it + 1];
910 gPad->PaintPolyLine(2,
x,
y);
915 if (icodes[2] == 0) {
925 for (
Int_t i = 0; i <
np; ++i) {
926 if (iface[i] < 0)
continue;
928 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
930 Double_t xdel = pp[2*i2 + 0] - pp[2*i1 + 0];
931 Double_t ydel = pp[2*i2 + 1] - pp[2*i1 + 1];
932 for (
Int_t it = 0; it <
fNT; ++it) {
933 x[0] = pp[2*i1 + 0] + xdel*
fT[2*it + 0];
934 y[0] = pp[2*i1 + 1] + ydel*
fT[2*it + 0];
935 x[1] = pp[2*i1 + 0] + xdel*
fT[2*it + 1];
936 y[1] = pp[2*i1 + 1] + ydel*
fT[2*it + 1];
937 gPad->PaintPolyLine(2,
x,
y);
961 for (
Int_t i = 0; i <
np; ++i) {
975 for (
Int_t i = 0; i <
np; ++i) {
976 if (iface[i] < 0)
continue;
978 Int_t i2 = (i ==
np-1) ? 0 : i + 1;
980 Double_t xdel = pp[2*i2 + 0] - pp[2*i1 + 0];
981 Double_t ydel = pp[2*i2 + 1] - pp[2*i1 + 1];
982 for (
Int_t it = 0; it <
fNT; ++it) {
983 x[0] = pp[2*i1 + 0] + xdel*
fT[2*it + 0];
984 y[0] = pp[2*i1 + 1] + ydel*
fT[2*it + 0];
985 x[1] = pp[2*i1 + 0] + xdel*
fT[2*it + 1];
986 y[1] = pp[2*i1 + 1] + ydel*
fT[2*it + 1];
987 gPad->PaintPolyLine(2,
x,
y);
1008 Int_t ilev, i, k, icol, i1, i2, nl,
np;
1019 Error(
"FillPolygon",
"illegal number of vertices in polygon (%d)",
n);
1029 if (nl < 0) nl = -nl;
1032 for (i = 2; i <=
np; ++i) {
1033 if (fmin >
f[i]) fmin =
f[i];
1034 if (fmax <
f[i]) fmax =
f[i];
1037 if (fmin < funmin) funmin = fmin - 1;
1039 if (fmax > funmax) funmax = fmax + 1;
1043 for (ilev = 1; ilev <= nl+1; ++ilev) {
1046 if (ilev == nl + 1) f2 = funmax;
1048 if (fmax <
f1)
return;
1049 if (fmin > f2)
continue;
1052 for (i = 1; i <=
np; ++i) {
1055 if (i ==
np) i2 = 1;
1059 if (k < 3)
continue;
1060 for (i = 1; i <= k; ++i) {
1066 icol=
gPad->GetFillColor();
1073 gPad->PaintFillArea(k,
x,
y);
1086 i, j, k,
n, ibase, t,
x,
y, xscan[24] ,
1088 ib, nb, dx, dy, iw, nx, xx, yy, signdx, nstart, xx1, xx2, nxa, nxb;
1099 for (i = 1; i <=
n; ++i) {
1110 for (i = 1; i <=
n; ++i) {
1113 if (
y1[i - 1] <=
y1[i]) {
x2[i - 1] =
x1[i];
y2[i - 1] =
y1[i];}
1115 x2[i - 1] =
x1[i - 1];
1116 y2[i - 1] =
y1[i - 1];
1122 if (
ymax < 0)
return;
1126 for (i = 1; i <
n; ++i) {
1127 if (
y1[i] >=
y1[i - 1])
continue;
1130 for (j = i - 1; j >= 1; --j) {
1131 if (
y <
y1[j - 1])
continue;
1138 for (j = i; j >= k; --j) {
1151 for (i = 1; i <=
n; ++i) {
1152 xcur[i - 1] =
x1[i - 1];
1153 dy =
y2[i - 1] -
y1[i - 1];
1154 dx =
x2[i - 1] -
x1[i - 1];
1156 if (dx < 0) signdx = -1;
1157 if (dx < 0) dx = -dx;
1159 t = -(dy + 1) / 2 + dx;
1162 xnex[i - 1] = xcur[i - 1];
1164 test[i - 1] = t - dy;
1165 xnex[i - 1] = xcur[i - 1] + signdx;
1167 }
else if (dy != 0) {
1168 step = (dx - 1) / (dy + dy) + 1;
1169 test[i - 1] = step*dy - (dx + 1) / 2 - dx;
1170 xnex[i - 1] = xcur[i - 1] + signdx*step;
1176 for (yscan =
ymin; yscan <=
ymax; ++yscan) {
1180 for (i = nstart; i <=
n; ++i) {
1181 if (
y1[i - 1] > yscan)
goto L500;
1182 if (
y2[i - 1] <= yscan) {
1183 if (i == nstart) ++nstart;
1184 if (
y2[i - 1] != yscan)
continue;
1186 if (
x2[i - 1] >= xcur[i - 1]) {
1187 xscan[2*nxb - 2] = xcur[i - 1];
1188 xscan[2*nxb - 1] =
x2[i - 1];
1190 xscan[2*nxb - 2] =
x2[i - 1];
1191 xscan[2*nxb - 1] = xcur[i - 1];
1199 dy =
y2[i - 1] -
y1[i - 1];
1200 dx =
x2[i - 1] -
x1[i - 1];
1203 xscan[2*nxa - 2] = xcur[i - 1];
1204 xscan[2*nxa - 1] = xnex[i - 1];
1205 if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
1211 xscan[2*nxa - 2] = xnex[i - 1];
1212 xscan[2*nxa - 1] = xcur[i - 1];
1213 if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
1217 xcur[i - 1] = xnex[i - 1];
1220 if (test[i - 1] < 0)
continue;
1222 xnex[i - 1] += signdx;
1226 t = test[i - 1] + step*dy;
1228 test[i - 1] = t - dx;
1229 xnex[i - 1] += signdx*step;
1231 test[i - 1] = t + dy - dx;
1232 xnex[i - 1] += signdx*(step + 1);
1238 if (yscan < 0)
continue;
1241 for (i = 1; i < nxa; ++i) {
1242 for (j = i; j >= 1; --j) {
1243 if (xscan[2*j] >= xscan[2*j - 2])
continue;
1245 xscan[2*j] = xscan[2*j - 2];
1248 xscan[2*j + 1] = xscan[2*j - 1];
1252 for (i = 1; i <= nxa; i += 2) {
1254 xscan[2*nx - 2] = xscan[2*i - 2];
1256 if (xscan[2*i - 1] >
x)
x = xscan[2*i - 1];
1257 xscan[2*nx - 1] =
x;
1261 for (i = nxb; i <=
kLmax; ++i) {
1263 xscan[2*nx - 2] = xscan[2*i - 2];
1264 xscan[2*nx - 1] = xscan[2*i - 1];
1269 xx1 = xscan[2*nx - 2];
1270 xx2 = xscan[2*nx - 1];
1274 if ((xscan[2*k - 2] <= xx2 + 1) && (xscan[2*k - 1] >= xx1 - 1)) {
1275 if (xscan[2*k - 2] < xx1) xx1 = xscan[2*k - 2];
1276 if (xscan[2*k - 1] > xx2) xx2 = xscan[2*k - 1];
1277 xscan[2*k - 2] = xscan[2*nx - 2];
1278 xscan[2*k - 1] = xscan[2*nx - 1];
1282 if (xx1 < 0) xx1 = 0;
1284 nbit = xx2 - xx1 + 1;
1287 ib = kbit - iw*30 + 1;
1290 if (nb > nbit) nb = nbit;
1324 for (
Int_t i = 1; i <
np; ++i) {
1325 if (t[i] < tmin) tmin = t[i];
1326 if (t[i] > tmax) tmax = t[i];
1332 for (
Int_t il = 1; il <= nl; ++il) {
1333 if (tmin >=
fFunLevel[il - 1])
continue;
1339 for (
Int_t i = 0; i <
np; ++i) {
1341 Int_t i2 = (i ==
np-1) ? 0 : i+1;
1344 if (d1 == 0) d1 = 1
e-99;
1345 if (d2 == 0) d2 = 1
e-99;
1346 if (d1*d2 > 0)
continue;
1350 d1 /= t[i2] - t[i1];
1351 d2 /= t[i2] - t[i1];
1358 Error(
"FindLevelLines",
"number of points for line not equal 2");
1391 if (
f1 < fmin) k1 = -2;
1392 if (
f1 == fmin) k1 = -1;
1393 if (
f1 == fmax) k1 = 1;
1394 if (
f1 > fmax) k1 = 2;
1396 if (f2 < fmin) k2 = -2;
1397 if (f2 == fmin) k2 = -1;
1398 if (f2 == fmax) k2 = 1;
1399 if (f2 > fmax) k2 = 2;
1400 kk = (k1 + 2)*5 + (k2 + 2) + 1;
1435 pp[kpp*3 + 1] = p1[1];
1436 pp[kpp*3 + 2] = p1[2];
1437 pp[kpp*3 + 3] = p1[3];
1443 d1 = (fmin -
f1) / (
f1 - f2);
1444 d2 = (fmin - f2) / (
f1 - f2);
1445 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1446 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1447 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1453 d1 = (fmax -
f1) / (
f1 - f2);
1454 d2 = (fmax - f2) / (
f1 - f2);
1455 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1456 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1457 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1463 pp[kpp*3 + 1] = p1[1];
1464 pp[kpp*3 + 2] = p1[2];
1465 pp[kpp*3 + 3] = p1[3];
1467 d1 = (fmin -
f1) / (
f1 - f2);
1468 d2 = (fmin - f2) / (
f1 - f2);
1469 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1470 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1471 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1477 pp[kpp*3 + 1] = p1[1];
1478 pp[kpp*3 + 2] = p1[2];
1479 pp[kpp*3 + 3] = p1[3];
1481 d1 = (fmax -
f1) / (
f1 - f2);
1482 d2 = (fmax - f2) / (
f1 - f2);
1483 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1484 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1485 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1491 d1 = (fmin -
f1) / (
f1 - f2);
1492 d2 = (fmin - f2) / (
f1 - f2);
1493 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1494 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1495 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1497 d1 = (fmax -
f1) / (
f1 - f2);
1498 d2 = (fmax - f2) / (
f1 - f2);
1499 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1500 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1501 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1507 d1 = (fmax -
f1) / (
f1 - f2);
1508 d2 = (fmax - f2) / (
f1 - f2);
1509 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1510 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1511 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1513 d1 = (fmin -
f1) / (
f1 - f2);
1514 d2 = (fmin - f2) / (
f1 - f2);
1515 pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
1516 pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
1517 pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
1529 Int_t i, icase, i1, i2, icase1, icase2, iv, ifback;
1532 Double_t tt, uu, ww, yy, yy1, yy2, yy1d, yy2d;
1543 x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
1544 x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
1545 y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
1546 y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
1547 z1 = tn[8]*r1[1] + tn[9]*r1[2] + tn[10]*r1[3] + tn[11];
1548 z2 = tn[8]*r2[1] + tn[9]*r2[2] + tn[10]*r2[3] + tn[11];
1550 Error(
"FindVisibleDraw",
"invalid TView in current pad");
1554 Error(
"FindVisibleDraw",
"no TView in current pad");
1580 dy = (
y2 -
y1) / di;
1583 for (i = i1; i <= i2 - 1; ++i) {
1584 yy1 =
y1 + dy*(i - i1);
1586 yy1u = yy1 -
fU[2*i - 2];
1587 yy1d = yy1 -
fD[2*i - 2];
1588 yy2u = yy2 -
fU[2*i - 1];
1589 yy2d = yy2 -
fD[2*i - 1];
1593 if (yy1u > kEpsil) icase1 = 0;
1594 if (yy1d < -kEpsil) icase1 = 2;
1595 if ((icase1 == 0 || icase1 == 2) && iv <= 0) {
1600 if (icase1 == 1 && iv >= 0) {
1606 if (yy2u > kEpsil) icase2 = 0;
1607 if (yy2d < -kEpsil) icase2 = 2;
1608 icase = icase1*3 + icase2;
1611 fT[2*
fNT - 1] =
tt + dt*(yy1u / (yy1u - yy2u));
1614 fT[2*
fNT - 1] =
tt + dt*(yy1u / (yy1u - yy2u));
1616 fT[2*
fNT - 2] =
tt + dt*(yy1d / (yy1d - yy2d));
1621 fT[2*
fNT - 2] =
tt + dt*(yy1u / (yy1u - yy2u));
1626 fT[2*
fNT - 2] =
tt + dt*(yy1d / (yy1d - yy2d));
1629 fT[2*
fNT - 1] =
tt + dt*(yy1d / (yy1d - yy2d));
1631 fT[2*
fNT - 2] =
tt + dt*(yy1u / (yy1u - yy2u));
1635 fT[2*
fNT - 1] =
tt + dt*(yy1d / (yy1d - yy2d));
1637 if (
fNT + 1 >= 100)
break;
1639 if (iv > 0)
fT[2*
fNT - 1] = 1;
1647 if (
y2 ==
y1) {
fNT = 0;
return;}
1648 ifback = 1 - ifback;
1656 if (uu <
fU[2*i1 - 3]) uu =
fU[2*i1 - 3];
1657 if (dd >
fD[2*i1 - 3]) dd =
fD[2*i1 - 3];
1660 if (y1 < uu && y2 > dd) {
1661 if (
y1 >= dd &&
y2 <= uu) {
fNT = 0;
return;}
1676 if (ifback == 0)
return;
1677 if (
fNT == 0)
return;
1678 for (i = 1; i <=
fNT; ++i) {
1679 fT[2*i - 2] = 1 -
fT[2*i - 2];
1680 fT[2*i - 1] = 1 -
fT[2*i - 1];
1698 Int_t i, incrx, ivis,
x1,
y1,
x2,
y2, ib, kb, dx, dy, iw, ix, iy, ifinve, dx2, dy2;
1732 if (
x1 < 0 &&
x2 < 0)
return;
1744 if (dy > dx)
goto L200;
1748 ddtt = dt*(float).5;
1753 for (ix =
x1; incrx < 0 ? ix >=
x2 : ix <=
x2; ix += incrx) {
1762 if (iy < 0)
goto L110;
1764 if (ix < 0)
goto L110;
1767 ib = kb - iw*30 + 1;
1769 if (ivis > 0)
continue;
1775 if (ivis == 0)
continue;
1778 if (nt == ntmax)
goto L300;
1780 if (ivis > 0) t[2*nt + 2] = tcur + dt + ddtt;
1786 ddtt = dt*(float).5;
1792 for (iy =
y1; iy <=
y2; ++iy) {
1801 if (iy < 0)
goto L210;
1802 if (ix < 0)
goto L210;
1805 ib = kb - iw*30 + 1;
1807 if (ivis > 0)
continue;
1813 if (ivis == 0)
continue;
1816 if (nt == ntmax)
goto L300;
1818 if (ivis > 0) t[2*nt + 2] = tcur + dt;
1822 if (nt == 0)
return;
1824 if (t[3] <= dt) t[3] = 0;
1825 if (t[2*nt + 2] >= 1 - dt) t[2*nt + 2] = 1;
1826 if (ifinve == 0)
return;
1827 for (i = 1; i <= nt; ++i) {
1830 t[2*i + 1] = 1 - t2;
1831 t[2*i + 2] = 1 -
t1;
1847 Int_t incrx[3], incry[3];
1871 if (ixt == 1) incrx[0] = 0;
1876 if (iyt == 1) incry[0] = 0;
1881 for (j = 1; j <= 3; ++j) {
1882 for (i = 1; i <= 3; ++i) {
1883 i1 = ia + incrx[i - 1];
1884 i2 = ib + incry[j - 1];
1890 for (k = 1; k <= 4; ++k) {
1891 for (i = 1; i <= 3; ++i) {
1892 face[i + k*3] =
f[i + (k + 32)*3 - 52];
1897 for (j = 1; j <= 3; ++j) {
1898 for (i = 1; i <= 3; ++i) {
1899 for (k = 1; k <= 4; ++k) {
1901 phi =
f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1902 r =
f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
1905 z[k + ((i + j*3) << 2) - 17] =
f[(k + ((i + j*3) << 2))*3 - 49];
1907 phi =
f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1908 r =
f[(k + ((i + j*3) << 2))*3 - 49];
1911 z[k + ((i + j*3) << 2) - 17] =
f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
1913 phi =
f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1914 th =
f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1915 r =
f[(k + ((i + j*3) << 2))*3 - 49];
1920 phi =
f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1921 th =
f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
1922 r =
f[(k + ((i + j*3) << 2))*3 - 49];
1927 x[k + ((i + j*3) << 2) - 17] =
f[(k + ((i + j*3) << 2))*3 - 51];
1928 y[k + ((i + j*3) << 2) - 17] =
f[(k + ((i + j*3) << 2))*3 - 50];
1929 z[k + ((i + j*3) << 2) - 17] =
f[(k + ((i + j*3) << 2))*3 - 49];
1932 x1 =
x[((i + j*3) << 2) - 14] -
x[((i + j*3) << 2) - 16];
1933 x2 =
x[((i + j*3) << 2) - 13] -
x[((i + j*3) << 2) - 15];
1934 y1 =
y[((i + j*3) << 2) - 14] -
y[((i + j*3) << 2) - 16];
1935 y2 =
y[((i + j*3) << 2) - 13] -
y[((i + j*3) << 2) - 15];
1936 z1 = z[((i + j*3) << 2) - 14] - z[((i + j*3) << 2) - 16];
1937 z2 = z[((i + j*3) << 2) - 13] - z[((i + j*3) << 2) - 15];
1938 an[(i + j*3)*3 - 12] =
y1*z2 -
y2*z1;
1939 an[(i + j*3)*3 - 11] = z1*
x2 - z2*
x1;
1940 an[(i + j*3)*3 - 10] =
x1*
y2 -
x2*
y1;
1941 s =
TMath::Sqrt(an[(i + j*3)*3 - 12]*an[(i + j*3)*3 - 12] + an[
1942 (i + j*3)*3 - 11]*an[(i + j*3)*3 - 11] + an[(i
1943 + j*3)*3 - 10]*an[(i + j*3)*3 - 10]);
1945 an[(i + j*3)*3 - 12] /= s;
1946 an[(i + j*3)*3 - 11] /= s;
1947 an[(i + j*3)*3 - 10] /= s;
1952 for (j = 1; j <= 2; ++j) {
1953 for (i = 1; i <= 2; ++i) {
1954 for (k = 1; k <= 3; ++k) {
1955 bn[k + (i + 2*j)*3 - 10] = an[k + (i + j*3)*3 - 13]
1956 + an[k + (i + 1 + j*3)*3 - 13] + an[k + (i + 1 +
1957 (j + 1)*3)*3 - 13] + an[k + (i + (j + 1)*3)*3 - 13];
1983 fU[2*i + 0] = -VERY_BIG;
1984 fU[2*i + 1] = -VERY_BIG;
1985 fD[2*i + 0] = VERY_BIG;
1986 fD[2*i + 1] = VERY_BIG;
2002 Int_t i, j, k, ib, nb;
2012 Int_t bufsize = nx*ny/30 + 1;
2018 for (i = 1; i <= 30; ++i) {
2021 fMask[i - 1] = pow2;
2025 for (nb = 2; nb <= 30; ++nb) {
2026 for (ib = 1; ib <= 30 - nb + 1; ++ib) {
2028 for (i = ib; i <= ib + nb - 1; ++i) k = k |
fMask[i - 1];
2043 Int_t i, j, ixt, iyt;
2045 Double_t xlab1l, xlab2l, ylab1l, ylab2l;
2111 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2112 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2113 ab[4] = (ab[4] - yval1l) / (yval2l - yval1l);
2114 ab[8] = (ab[8] - yval1l) / (yval2l - yval1l);
2116 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2117 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2119 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2120 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2121 ab[4] = 180*(ab[4] - ylab1l) / (ylab2l - ylab1l);
2122 ab[8] = 180*(ab[8] - ylab1l) / (ylab2l - ylab1l);
2124 ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
2125 ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
2126 ab[4] = (180 - dangle*2)*(ab[4] - ylab1l) / (ylab2l - ylab1l) + dangle;
2127 ab[8] = (180 - dangle*2)*(ab[8] - ylab1l) / (ylab2l - ylab1l) + dangle;
2153 if (stack) nids = stack->
GetSize();
2155 for (i = 2; i <= nids + 1; ++i) {
2164 for (i = 2; i <= nv; ++i) {
2180 if (
vv[i] <
vv[i - 1]) {
2192 for (i = 1; i <= nv; ++i) {
2198 for (i = 1; i <= nv; ++i) {
2199 for (j = 1; j <= 4; ++j) t[j + (i << 2)] =
vv[i];
2216 Int_t icodes[4], iface[4];
2218 Int_t firstStackNumberDrawn=-1 ;
2222 Error(
"LegoCartesian",
"no TView in current pad");
2230 std::vector<Double_t>
v(vSize),
tt(4*vSize);
2233 Int_t incrx = (tnorm[8] < 0.) ? -1 : +1;
2234 Int_t incry = (tnorm[9] < 0.) ? -1 : +1;
2235 if (*chopt !=
'B' && *chopt !=
'b') {
2236 incrx = -incrx; incry = -incry;
2238 Int_t ix1 = (incrx == +1) ? 1 : nx;
2239 Int_t iy1 = (incry == +1) ? 1 : ny;
2240 Int_t ix2 = (incrx == +1) ? nx : 1;
2241 Int_t iy2 = (incry == +1) ? ny : 1;
2245 Int_t ivis[6] = { 0,0,0,0,0,0 };
2247 if (zn < 0) ivis[0] = 1;
2248 if (zn > 0) ivis[2] = 1;
2250 if (zn > 0) ivis[1] = 1;
2251 if (zn < 0) ivis[3] = 1;
2253 if (zn > 0) ivis[5] = 1;
2254 if (zn < 0) ivis[4] = 1;
2259 for (
Int_t iy = iy1; iy != iy2+incry; iy += incry) {
2260 for (
Int_t ix = ix1; ix != ix2+incrx; ix += incrx) {
2261 if (!painter->
IsInside(ix,iy))
continue;
2263 if (nv < 2 || nv > vSize)
continue;
2266 for (
Int_t iv = 1; iv < nv; ++iv) { total_content +=
v[iv]; }
2271 for (
Int_t i = 1; i <= 4; ++i) {
2272 xyz[i*3 - 3] =
xy[2*i - 2];
2273 xyz[i*3 - 2] =
xy[2*i - 1];
2274 xyz[(i + 4)*3 - 3] = xyz[i*3 - 3];
2275 xyz[(i + 4)*3 - 2] = xyz[i*3 - 2];
2278 firstStackNumberDrawn = -1;
2279 for (
Int_t iv = 1; iv < nv; ++iv) {
2280 for (
Int_t i = 1; i <= 4; ++i) {
2281 xyz[i*3 - 1] =
v[iv - 1];
2282 xyz[(i + 4)*3 - 1] =
v[iv];
2284 if (
v[iv - 1] ==
v[iv])
continue;
2286 for (
Int_t i = 1; i <= 4; ++i) {
2287 if (ivis[i - 1] == 0)
continue;
2296 tface[0] =
tt[k1 + (iv << 2) - 5];
2297 tface[1] =
tt[k2 + (iv << 2) - 5];
2298 tface[2] =
tt[k2 + ((iv + 1) << 2) - 5];
2299 tface[3] =
tt[k1 + ((iv + 1) << 2) - 5];
2301 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2303 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2309 for (
Int_t i = 1; i <= 4; ++i) {
2310 xyz[i*3 - 1] =
v[0];
2311 iface[i - 1] = 5 - i;
2312 tface[i - 1] =
tt[5 - i - 1];
2319 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2325 for (
Int_t i = 1; i <= 4; ++i) {
2326 iface[i - 1] = i + 4;
2327 tface[i - 1] =
tt[i + (nv << 2) - 5];
2332 if ( nv > 2 && (
v[nv-1] ==
v[nv-2])) {
2333 for (
Int_t iv = nv-1; iv > 2; --iv) {
2334 if (
v[nv-1] ==
v[iv-1]) {
2341 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2362 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2364 Int_t incrr, k1, k2, ia, ib, ir1, ir2;
2366 Int_t ir, jr, iv, nr, nv, icodes[4];
2369 Int_t firstStackNumberDrawn = -1 ;
2373 Error(
"LegoPolar",
"no TView in current pad");
2392 if (
fAphi.empty()) {
2393 Error(
"LegoPolar",
"failed to allocate array fAphi[%d]",
fNaphi);
2398 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2402 std::vector<Double_t>
v(vSize),
tt(4*vSize);
2408 if (iordr == 0) ia = nr;
2409 if (iordr != 0) ib = nr;
2410 for (i = 1; i <= nphi; ++i) {
2411 if (iordr == 0) ib = i;
2412 if (iordr != 0) ia = i;
2414 if (i == 1)
fAphi[0] = ab[jphi - 1];
2415 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2416 fAphi[i] = ab[jphi + 3];
2422 for (i = 1; i <= nphi; ++i) {
2433 if (iphi > nphi)
goto L300;
2438 if (incrr < 0) ir1 = nr;
2441 for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
2442 if (iordr == 0) { ia = ir; ib = iphi; }
2443 else { ia = iphi; ib = ir; }
2445 if (nv < 2 || nv > vSize)
continue;
2448 for (iv = 1; iv < nv; ++iv) total_content +=
v[iv];
2449 if (total_content==0)
continue;
2453 for (i = 1; i <= 4; ++i) {
2455 if (iordr != 0 && i == 2) j = 4;
2456 if (iordr != 0 && i == 4) j = 2;
2457 xyz[j*3 - 3] = ab[jr + 2*i - 3]*
TMath::Cos(ab[jphi + 2*i - 3]*
kRad);
2458 xyz[j*3 - 2] = ab[jr + 2*i - 3]*
TMath::Sin(ab[jphi + 2*i - 3]*
kRad);
2459 xyz[(j + 4)*3 - 3] = xyz[j*3 - 3];
2460 xyz[(j + 4)*3 - 2] = xyz[j*3 - 2];
2463 firstStackNumberDrawn = -1;
2464 for (iv = 1; iv < nv; ++iv) {
2465 for (i = 1; i <= 4; ++i) {
2466 xyz[i*3 - 1] =
v[iv - 1];
2467 xyz[(i + 4)*3 - 1] =
v[iv];
2469 if (
v[iv - 1] >=
v[iv])
continue;
2471 for (i = 1; i <= 4; ++i) {
2472 if (ivis[i - 1] == 0)
continue;
2476 if (xyz[k1*3 - 3] == xyz[k2*3 - 3] && xyz[k1*3 - 2] ==
2477 xyz[k2*3 - 2])
continue;
2482 tface[0] =
tt[k1 + (iv << 2) - 5];
2483 tface[1] =
tt[k2 + (iv << 2) - 5];
2484 tface[2] =
tt[k2 + ((iv + 1) << 2) - 5];
2485 tface[3] =
tt[k1 + ((iv + 1) << 2) - 5];
2488 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2490 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2496 for (i = 1; i <= 4; ++i) {
2497 xyz[i*3 - 1] =
v[0];
2498 iface[i - 1] = 5 - i;
2499 tface[i - 1] =
tt[5 - i - 1];
2506 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2512 for (i = 1; i <= 4; ++i) {
2513 iface[i - 1] = i + 4;
2514 tface[i - 1] =
tt[i + (nv << 2) - 5];
2519 if ( nv > 2 && (
v[nv-1] ==
v[nv-2])) {
2520 for (iv = nv-1; iv>2; iv--) {
2521 if (
v[nv-1] ==
v[iv-1]) {
2528 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2535 if (iphi == 0) iphi = kphi;
2536 if (iphi > kphi) iphi = 1;
2537 if (iphi != iphi2)
goto L100;
2564 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2567 Int_t ia, ib, idummy, iz1, iz2, nz, incrz, k1, k2, nv;
2568 Int_t iv, iz, jz, icodes[4];
2573 Int_t firstStackNumberDrawn=-1 ;
2577 Error(
"LegoCylindrical",
"no TView in current pad");
2596 if (
fAphi.empty()) {
2597 Error(
"LegoCylindrical",
"failed to allocate array fAphi[%d]",
fNaphi);
2602 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2606 std::vector<Double_t>
v(vSize),
tt(4*vSize);
2612 if (iordr == 0) ia = nz;
2613 if (iordr != 0) ib = nz;
2614 for (i = 1; i <= nphi; ++i) {
2615 if (iordr == 0) ib = i;
2616 if (iordr != 0) ia = i;
2618 if (i == 1)
fAphi[0] = ab[jphi - 1];
2619 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2620 fAphi[i] = ab[jphi + 3];
2626 for (i = 1; i <= nphi; ++i) {
2627 if (iordr == 0) ib = i;
2628 if (iordr != 0) ia = i;
2637 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
2647 if (iphi > nphi)
goto L400;
2651 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
2652 if (iordr == 0) {ia = iz; ib = iphi;}
2653 else {ia = iphi; ib = iz;}
2655 if (nv < 2 || nv > vSize)
continue;
2658 for (i = 1; i <= 4; ++i) {
2660 if (iordr != 0 && i == 2) j = 4;
2661 if (iordr != 0 && i == 4) j = 2;
2664 xyz[j*3 - 1] = ab[jz + 2*i - 3];
2665 xyz[(j + 4)*3 - 1] = ab[jz + 2*i - 3];
2668 firstStackNumberDrawn = -1;
2669 for (iv = 1; iv < nv; ++iv) {
2670 for (i = 1; i <= 4; ++i) {
2671 xyz[i*3 - 3] =
v[iv - 1]*cosphi[i - 1];
2672 xyz[i*3 - 2] =
v[iv - 1]*sinphi[i - 1];
2673 xyz[(i + 4)*3 - 3] =
v[iv]*cosphi[i - 1];
2674 xyz[(i + 4)*3 - 2] =
v[iv]*sinphi[i - 1];
2676 if (
v[iv - 1] >=
v[iv])
continue;
2678 for (i = 1; i <= 4; ++i) {
2679 if (ivis[i - 1] == 0)
continue;
2687 tface[0] =
tt[k1 + (iv << 2) - 5];
2688 tface[1] =
tt[k2 + (iv << 2) - 5];
2689 tface[2] =
tt[k2 + ((iv + 1) << 2) - 5];
2690 tface[3] =
tt[k1 + ((iv + 1) << 2) - 5];
2693 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2695 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2698 if (ivis[4] != 0 &&
v[0] > 0) {
2701 for (i = 1; i <= 4; ++i) {
2702 xyz[i*3 - 3] =
v[0]*cosphi[i - 1];
2703 xyz[i*3 - 2] =
v[0]*sinphi[i - 1];
2705 tface[i - 1] =
tt[i - 1];
2712 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2715 if (ivis[5] != 0 &&
v[nv - 1] > 0) {
2718 for (i = 1; i <= 4; ++i) {
2719 iface[i - 1] = 5 - i + 4;
2720 tface[i - 1] =
tt[5 - i + (nv << 2) - 5];
2725 if ( nv > 2 && (
v[nv-1] ==
v[nv-2])) {
2726 for (iv = nv-1; iv>2; iv--) {
2727 if (
v[nv-1] ==
v[iv-1]) {
2734 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2741 if (iphi == 0) iphi = kphi;
2742 if (iphi > kphi) iphi = 1;
2743 if (iphi != iphi2)
goto L100;
2769 Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
2772 Int_t k1, k2, ia, ib, incrth, ith, jth, kth, nth, mth, ith1, ith2, nv;
2775 Int_t iv, icodes[4];
2781 Int_t firstStackNumberDrawn=-1 ;
2785 Error(
"LegoSpherical",
"no TView in current pad");
2804 if (
fAphi.empty()) {
2805 Error(
"LegoSpherical",
"failed to allocate array fAphi[%d]",
fNaphi);
2810 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
2814 std::vector<Double_t>
v(vSize),
tt(4*vSize);
2821 if (mth == 0) mth = 1;
2822 if (iordr == 0) ia = mth;
2823 if (iordr != 0) ib = mth;
2824 for (i = 1; i <= nphi; ++i) {
2825 if (iordr == 0) ib = i;
2826 if (iordr != 0) ia = i;
2828 if (i == 1)
fAphi[0] = ab[jphi - 1];
2829 fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
2830 fAphi[i] = ab[jphi + 3];
2835 if (iordr == 0) ib = 1;
2836 if (iordr != 0) ia = 1;
2837 for (i = 1; i <= nth; ++i) {
2838 if (iordr == 0) ia = i;
2839 if (iordr != 0) ib = i;
2841 if (i == 1)
fAphi[0] = ab[jth - 1];
2842 fAphi[i - 1] = (
fAphi[i - 1] + ab[jth - 1]) / (
float)2.;
2843 fAphi[i] = ab[jth + 3];
2852 if (iphi > nphi)
goto L500;
2855 if (!iordr) {ia = mth; ib = iphi; }
2856 else {ia = iphi; ib = mth; }
2858 phi = (ab[jphi - 1] + ab[jphi + 3]) / (
float)2.;
2863 if (ith > nth)
goto L400;
2864 if (iordr == 0) ia = ith;
2865 if (iordr != 0) ib = ith;
2867 if (nv < 2 || nv > vSize)
goto L400;
2870 for (i = 1; i <= 6; ++i) ivis[i - 1] = 0;
2872 phi1 =
kRad*ab[jphi - 1];
2873 phi2 =
kRad*ab[jphi + 3];
2877 if (zn > 0) ivis[1] = 1;
2879 if (zn > 0) ivis[3] = 1;
2880 phi = (phi1 + phi2) / (
float)2.;
2882 if (zn > 0) ivis[0] = 1;
2884 if (zn > 0) ivis[2] = 1;
2885 th = (
th1 +
th2) / (
float)2.;
2886 if (ipsdr == 1) th =
kRad*90;
2888 if (zn < 0) ivis[4] = 1;
2889 if (zn > 0) ivis[5] = 1;
2894 for (i = 1; i <= 4; ++i) {
2896 if (iordr != 0 && i == 2) j = 4;
2897 if (iordr != 0 && i == 4) j = 2;
2903 firstStackNumberDrawn = -1;
2904 for (iv = 1; iv < nv; ++iv) {
2906 for (i = 1; i <= 4; ++i) {
2907 xyz[i*3 - 3] =
v[iv - 1]*cosphi[i - 1];
2908 xyz[i*3 - 2] =
v[iv - 1]*sinphi[i - 1];
2909 xyz[i*3 - 1] =
v[iv - 1]*costh[i - 1] / sinth[i - 1];
2910 xyz[(i + 4)*3 - 3] =
v[iv]*cosphi[i - 1];
2911 xyz[(i + 4)*3 - 2] =
v[iv]*sinphi[i - 1];
2912 xyz[(i + 4)*3 - 1] =
v[iv]*costh[i - 1] / sinth[i - 1];
2915 for (i = 1; i <= 4; ++i) {
2916 xyz[i*3 - 3] =
v[iv - 1]*sinth[i - 1]*cosphi[i - 1];
2917 xyz[i*3 - 2] =
v[iv - 1]*sinth[i - 1]*sinphi[i - 1];
2918 xyz[i*3 - 1] =
v[iv - 1]*costh[i - 1];
2919 xyz[(i + 4)*3 - 3] =
v[iv]*sinth[i - 1]*cosphi[i - 1];
2920 xyz[(i + 4)*3 - 2] =
v[iv]*sinth[i - 1]*sinphi[i - 1];
2921 xyz[(i + 4)*3 - 1] =
v[iv]*costh[i - 1];
2924 if (
v[iv - 1] >=
v[iv])
continue;
2926 for (i = 1; i <= 4; ++i) {
2927 if (ivis[i - 1] == 0)
continue;
2935 tface[0] =
tt[k1 + (iv << 2) - 5];
2936 tface[1] =
tt[k2 + (iv << 2) - 5];
2937 tface[2] =
tt[k2 + ((iv + 1) << 2) - 5];
2938 tface[3] =
tt[k1 + ((iv + 1) << 2) - 5];
2941 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2943 if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn =
fEdgeIdx;
2946 if (ivis[4] != 0 &&
v[0] > 0) {
2949 for (i = 1; i <= 4; ++i) {
2951 xyz[i*3 - 3] =
v[0]*cosphi[i - 1];
2952 xyz[i*3 - 2] =
v[0]*sinphi[i - 1];
2953 xyz[i*3 - 1] =
v[0]*costh[i - 1] / sinth[i - 1];
2955 xyz[i*3 - 3] =
v[0]*sinth[i - 1]*cosphi[i - 1];
2956 xyz[i*3 - 2] =
v[0]*sinth[i - 1]*sinphi[i - 1];
2957 xyz[i*3 - 1] =
v[0]*costh[i - 1];
2959 iface[i - 1] = 5 - i;
2960 tface[i - 1] =
tt[5 - i - 1];
2967 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2970 if (ivis[5] != 0 &&
v[nv - 1] > 0) {
2973 for (i = 1; i <= 4; ++i) {
2974 iface[i - 1] = i + 4;
2975 tface[i - 1] =
tt[i + 4 + 2*nv - 5];
2980 if ( nv > 2 && (
v[nv-1] ==
v[nv-2])) {
2981 for (iv = nv-1; iv>2; iv--) {
2982 if (
v[nv-1] ==
v[iv-1]) {
2989 (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
2995 if (ith == 0) ith = kth;
2996 if (ith > kth) ith = 1;
2997 if (ith != ith2)
goto L200;
2998 if (incrth == 0)
goto L500;
3009 if (iphi == 0) iphi = kphi;
3010 if (iphi > kphi) iphi = 1;
3011 if (iphi != iphi2)
goto L100;
3041 if (nl < 0)
goto L100;
3042 else if (nl == 0)
goto L200;
3049 for (i = 1; i <= 4; ++i) {
3056 Error(
"LightSource",
"negative light intensity");
3064 if (nl > 4 || yl < 0) {
3065 Error(
"LightSource",
"illegal light source number (nl=%d, yl=%f)", nl, yl);
3069 s =
TMath::Sqrt(xscr*xscr + yscr*yscr + zscr*zscr);
3071 Error(
"LightSource",
"light source is placed at origin");
3076 fVls[nl*3 - 3] = xscr / s;
3077 fVls[nl*3 - 2] = yscr / s;
3078 fVls[nl*3 - 1] = zscr / s;
3082 if (
fYdl != 0)
return;
3083 for (i = 1; i <= 4; ++i) {
3084 if (
fYls[i - 1] != 0)
return;
3101 if (!view ||
fLoff)
return;
3110 s =
TMath::Sqrt(vn[0]*vn[0] + vn[1]*vn[1] + vn[2]*vn[2]);
3118 for (i = 1; i <= 4; ++i) {
3119 if (
fYls[i - 1] <= 0)
continue;
3120 vl[0] =
fVls[i*3 - 3];
3121 vl[1] =
fVls[i*3 - 2];
3122 vl[2] =
fVls[i*3 - 1];
3123 cosn = vl[0]*vn[0] + vl[1]*vn[1] + vl[2]*vn[2];
3124 if (cosn < 0)
continue;
3125 cosr = vn[1]*(vn[2]*vl[1] - vn[1]*vl[2]) - vn[0]*(vn[0]*vl[2]
3126 - vn[2]*vl[0]) + vn[2]*cosn;
3127 if (cosr <= 0) cosr = 0;
3153 x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
3154 x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
3155 y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
3156 y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
3158 Error(
"ModifyScreen",
"invalid TView in current pad");
3162 Error(
"ModifyScreen",
"no TView in current pad");
3176 if (i1 == i2)
return;
3179 dy = (
y2 -
y1) / (i2 - i1);
3180 for (i = i1; i <= i2 - 1; ++i) {
3181 yy1 =
y1 + dy*(i - i1);
3183 if (
fD[2*i - 2] > yy1)
fD[2*i - 2] = yy1;
3184 if (
fD[2*i - 1] > yy2)
fD[2*i - 1] = yy2;
3185 if (
fU[2*i - 2] < yy1)
fU[2*i - 2] = yy1;
3186 if (
fU[2*i - 1] < yy2)
fU[2*i - 1] = yy2;
3255 Int_t ivis[6], i, k, num;
3259 for (i = 1; i <= 6; ++i) {
3262 if (k < num)
continue;
3267 if (k == 1) ir = -1;
3293 Error(
"SideVisibilityEncode",
"no TView in current pad");
3298 if (zn > 0) k += 64;
3299 if (zn < 0) k += 32;
3301 if (zn > 0) k += 16;
3304 phi = (phi1 + phi2) / (
float)2.;
3308 if ((zn <= 0 && iopt == 1) || (zn > 0 && iopt == 2)) ++k;
3325 static const char *where =
"Spectrum";
3332 if (nl == 0) {
fNlevel = 0;
return; }
3336 Error(where,
"fmax (%f) less than fmin (%f)", fmax, fmin);
3340 if (nl < 0 || nl > 256) {
3341 Error(where,
"illegal number of levels (%d)", nl);
3346 Error(where,
"initial color index is negative");
3351 Error(where,
"color index increment must be positive");
3356 const Int_t kMAXCOL = 50;
3357 delf = (fmax - fmin) / nl;
3359 for (i = 1; i <= nl+1; ++i) {
3381 Int_t iface[4] = { 1,2,3,4 };
3387 Error(
"SurfaceCartesian",
"no TView in current pad");
3394 Int_t incrx = (tnorm[8] < 0.) ? -1 : +1;
3395 Int_t incry = (tnorm[9] < 0.) ? -1 : +1;
3396 if (*chopt !=
'B' && *chopt !=
'b') {
3397 incrx = -incrx; incry = -incry;
3399 Int_t ix1 = (incrx == +1) ? 1 : nx;
3400 Int_t iy1 = (incry == +1) ? 1 : ny;
3401 Int_t ix2 = (incrx == +1) ? nx : 1;
3402 Int_t iy2 = (incry == +1) ? ny : 1;
3406 for (
Int_t iy = iy1; iy != iy2+incry; iy += incry) {
3407 for (
Int_t ix = ix1; ix != ix2+incrx; ix += incrx) {
3408 if (!painter->
IsInside(ix,iy))
continue;
3410 for (
Int_t i = 0; i < 4; ++i) {
3411 xyz[i*3 + 0] =
f[i*3 + 0];
3412 xyz[i*3 + 1] =
f[i*3 + 1];
3413 xyz[i*3 + 2] =
f[i*3 + 2];
3452 static Int_t ixadd[4] = { 0,1,1,0 };
3453 static Int_t iyadd[4] = { 0,0,1,1 };
3458 Double_t xlab1l, xlab2l, ylab1l, ylab2l;
3459 Int_t i, ixa, iya, icx, ixt, iyt;
3492 for (i = 1; i <= 4; ++i) {
3513 f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3514 f[i*3 + 2] = (
f[i*3 + 2] - yval1l) / (yval2l - yval1l);
3516 f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3518 f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3519 f[i*3 + 2] = 360*(
f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l);
3521 f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
3522 f[i*3 + 2] = (180 - dangle*2)*(
f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l) + dangle;
3545 t[i] =
f[i * 3 + 3];
3550 for (i = 1; i <= 4; ++i)
f[i * 3 + 3] =
fRmax[2];
3554 for (i = 1; i <= 4; ++i) {
3555 f[i*3 + 3] = (1 - rinrad)*((
f[i*3 + 3] -
Hparam.
zmin) /
3575 static Int_t iface[4] = { 1,2,3,4 };
3579 Error(
"SurfacePolar",
"no TView in current pad");
3583 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3585 Int_t i, j, incrr, ir1, ir2;
3587 Int_t ia, ib, ir, jr, nr, icodes[3];
3607 if (
fAphi.empty()) {
3608 Error(
"SurfacePolar",
"failed to allocate array fAphi[%d]",
fNaphi);
3613 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3618 if (iordr == 0) ia = nr;
3619 if (iordr != 0) ib = nr;
3620 for (i = 1; i <= nphi; ++i) {
3621 if (iordr == 0) ib = i;
3622 if (iordr != 0) ia = i;
3624 if (i == 1)
fAphi[0] =
f[jphi - 1];
3625 fAphi[i - 1] = (
fAphi[i - 1] +
f[jphi - 1]) / (
float)2.;
3636 if (iphi > nphi)
goto L300;
3639 if (iordr == 0) {ia = nr; ib = iphi;}
3640 else {ia = iphi;ib = nr;}
3643 phi =
kRad*((
f[jphi - 1] +
f[jphi + 5]) / 2);
3647 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
3653 for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
3654 if (iordr == 0) ia = ir;
3655 if (iordr != 0) ib = ir;
3658 for (i = 1; i <= 4; ++i) {
3660 if (iordr != 0 && i == 2) j = 4;
3661 if (iordr != 0 && i == 4) j = 2;
3664 xyz[j*3 - 1] =
f[i*3 - 1];
3665 ttt[j - 1] =
tt[i - 1];
3669 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3674 if (iphi == 0) iphi = kphi;
3675 if (iphi > kphi) iphi = 1;
3676 if (iphi != iphi2)
goto L100;
3677 if (incr == 0)
return;
3703 static Int_t iface[4] = { 1,2,3,4 };
3705 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3706 Int_t i, j, incrz, nz, iz1, iz2;
3707 Int_t ia, ib, iz, jz, icodes[3];
3716 Error(
"SurfaceCylindrical",
"no TView in current pad");
3735 if (
fAphi.empty()) {
3736 Error(
"SurfaceCylindrical",
"failed to allocate array fAphi[%d]",
fNaphi);
3741 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3746 if (iordr == 0) ia = nz;
3747 if (iordr != 0) ib = nz;
3748 for (i = 1; i <= nphi; ++i) {
3749 if (iordr == 0) ib = i;
3750 if (iordr != 0) ia = i;
3752 if (i == 1)
fAphi[0] =
f[jphi - 1];
3753 fAphi[i - 1] = (
fAphi[i - 1] +
f[jphi - 1]) / (
float)2.;
3762 if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
3774 if (iphi > nphi)
goto L400;
3775 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
3776 if (iordr == 0) {ia = iz; ib = iphi;}
3777 else {ia = iphi; ib = iz;}
3779 for (i = 1; i <= 4; ++i) {
3781 if (iordr == 0 && i == 2) j = 4;
3782 if (iordr == 0 && i == 4) j = 2;
3785 xyz[j*3 - 1] =
f[jz + i*3 - 4];
3786 ttt[j - 1] =
tt[i - 1];
3790 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3795 if (iphi == 0) iphi = kphi;
3796 if (iphi > kphi) iphi = 1;
3797 if (iphi != iphi2)
goto L100;
3798 if (incr == 0)
return;
3823 static Int_t iface[4] = { 1,2,3,4 };
3825 Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
3826 Int_t i, j, incrth, ith, jth, kth, nth, mth, ith1, ith2;
3827 Int_t ia, ib, icodes[3];
3836 Error(
"SurfaceSpherical",
"no TView in current pad");
3855 if (
fAphi.empty()) {
3856 Error(
"SurfaceSpherical",
"failed to allocate array fAphi[%d]",
fNaphi);
3861 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
3867 if (mth == 0) mth = 1;
3868 if (iordr == 0) ia = mth;
3869 if (iordr != 0) ib = mth;
3870 for (i = 1; i <= nphi; ++i) {
3871 if (iordr == 0) ib = i;
3872 if (iordr != 0) ia = i;
3874 if (i == 1)
fAphi[0] =
f[jphi - 1];
3875 fAphi[i - 1] = (
fAphi[i - 1] +
f[jphi - 1]) / (
float)2.;
3881 if (iordr == 0) ib = 1;
3882 if (iordr != 0) ia = 1;
3883 for (i = 1; i <= nth; ++i) {
3884 if (iordr == 0) ia = i;
3885 if (iordr != 0) ib = i;
3888 if (i == 1)
fAphi[0] =
f[jth - 1];
3889 fAphi[i - 1] = (
fAphi[i - 1] +
f[jth - 1]) / (
float)2.;
3900 if (iphi > nphi)
goto L500;
3903 if (iordr == 0) {ia = mth; ib = iphi;}
3904 else {ia = iphi;ib = mth;}
3907 phi = (
f[jphi - 1] +
f[jphi + 5]) / (
float)2.;
3912 if (ith > nth)
goto L400;
3913 if (iordr == 0) ia = ith;
3914 if (iordr != 0) ib = ith;
3918 for (i = 1; i <= 4; ++i) {
3920 if (iordr != 0 && i == 2) j = 4;
3921 if (iordr != 0 && i == 4) j = 2;
3926 ttt[j - 1] =
tt[i - 1];
3929 for (i = 1; i <= 4; ++i) {
3931 if (iordr != 0 && i == 2) j = 4;
3932 if (iordr != 0 && i == 4) j = 2;
3936 ttt[j - 1] =
tt[i - 1];
3941 (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
3945 if (ith == 0) ith = kth;
3946 if (ith > kth) ith = 1;
3947 if (ith != ith2)
goto L200;
3948 if (incrth == 0)
goto L500;
3959 if (iphi == 0) iphi = kphi;
3960 if (iphi > kphi) iphi = 1;
3961 if (iphi != iphi2)
goto L100;
3962 if (incr == 0)
return;
3987 if (qqa < 0 || qqa > 1 || qqd < 0 || qqd > 1 || qqs < 0 || qqs > 1 || nnqs < 1) {
3988 Error(
"SurfaceProperty",
"error in coefficients");
4017 Error(
"ImplicitFunction",
"no TF3 function provided");
4022 Int_t ix1, iy1, iz1;
4023 Int_t ix2, iy2, iz2;
4024 Int_t incr, incrx, incry, incrz;
4025 Int_t icodes[3], i, i1, i2, k, nnod, ntria;
4028 Double_t p[8][3], pf[8], pn[8][3], t[3], fsurf,
w;
4036 Error(
"ImplicitFunction",
"no TView in current pad");
4044 Double_t fgF3XClip = 0., fgF3YClip = 0., fgF3ZClip = 0.;
4047 fgF3Clipping =
kTRUE;
4048 fgF3XClip = clip[0];
4049 fgF3YClip = clip[1];
4050 fgF3ZClip = clip[2];
4054 if (*chopt ==
'B' || *chopt ==
'b') {
4063 if (tnorm[8] < 0.) incrx =-incrx;
4064 if (tnorm[9] < 0.) incry =-incry;
4065 if (tnorm[10] < 0.) incrz =-incrz;
4069 if (incrx == -1) ix1 = nx;
4070 if (incry == -1) iy1 = ny;
4071 if (incrz == -1) iz1 = nz;
4075 dx = (rmax[0]-rmin[0]) / nx;
4076 dy = (rmax[1]-rmin[1]) / ny;
4077 dz = (rmax[2]-rmin[2]) / nz;
4080 Float_t r=0.,
g=0.,
b=0., hue, light, satur, light2;
4090 light2 = 1-.5*light;
4101 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
4102 z1 = (iz-1)*dz + rmin[2];
4112 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
4113 y1 = (iy-1)*dy + rmin[1];
4136 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
4163 if (pf[0] >= -
kFdel)
goto L110;
4164 if (pf[1] >= -
kFdel)
goto L120;
4165 if (pf[2] >= -
kFdel)
goto L120;
4166 if (pf[3] >= -
kFdel)
goto L120;
4167 if (pf[4] >= -
kFdel)
goto L120;
4168 if (pf[5] >= -
kFdel)
goto L120;
4169 if (pf[6] >= -
kFdel)
goto L120;
4170 if (pf[7] >= -
kFdel)
goto L120;
4173 if (pf[1] < -
kFdel)
goto L120;
4174 if (pf[2] < -
kFdel)
goto L120;
4175 if (pf[3] < -
kFdel)
goto L120;
4176 if (pf[4] < -
kFdel)
goto L120;
4177 if (pf[5] < -
kFdel)
goto L120;
4178 if (pf[6] < -
kFdel)
goto L120;
4179 if (pf[7] < -
kFdel)
goto L120;
4194 pn[0][0] = (pf[1] - pf[0]) / dx;
4195 pn[3][0] = (pf[2] - pf[3]) / dx;
4196 pn[4][0] = (pf[5] - pf[4]) / dx;
4197 pn[7][0] = (pf[6] - pf[7]) / dx;
4199 pn[0][0] = (pf[1] - f3->
Eval(
x1-dx,
y1,z1)) / (dx + dx);
4200 pn[3][0] = (pf[2] - f3->
Eval(
x1-dx,
y2,z1)) / (dx + dx);
4201 pn[4][0] = (pf[5] - f3->
Eval(
x1-dx,
y1,z2)) / (dx + dx);
4202 pn[7][0] = (pf[6] - f3->
Eval(
x1-dx,
y2,z2)) / (dx + dx);
4205 pn[1][0] = (pf[1] - pf[0]) / dx;
4206 pn[2][0] = (pf[2] - pf[3]) / dx;
4207 pn[5][0] = (pf[5] - pf[4]) / dx;
4208 pn[6][0] = (pf[6] - pf[7]) / dx;
4210 pn[1][0] = (f3->
Eval(
x2+dx,
y1,z1) - pf[0]) / (dx + dx);
4211 pn[2][0] = (f3->
Eval(
x2+dx,
y2,z1) - pf[3]) / (dx + dx);
4212 pn[5][0] = (f3->
Eval(
x2+dx,
y1,z2) - pf[4]) / (dx + dx);
4213 pn[6][0] = (f3->
Eval(
x2+dx,
y2,z2) - pf[7]) / (dx + dx);
4217 pn[0][1] = (pf[3] - pf[0]) / dy;
4218 pn[1][1] = (pf[2] - pf[1]) / dy;
4219 pn[4][1] = (pf[7] - pf[4]) / dy;
4220 pn[5][1] = (pf[6] - pf[5]) / dy;
4222 pn[0][1] = (pf[3] - f3->
Eval(
x1,
y1-dy,z1)) / (dy + dy);
4223 pn[1][1] = (pf[2] - f3->
Eval(
x2,
y1-dy,z1)) / (dy + dy);
4224 pn[4][1] = (pf[7] - f3->
Eval(
x1,
y1-dy,z2)) / (dy + dy);
4225 pn[5][1] = (pf[6] - f3->
Eval(
x2,
y1-dy,z2)) / (dy + dy);
4228 pn[2][1] = (pf[2] - pf[1]) / dy;
4229 pn[3][1] = (pf[3] - pf[0]) / dy;
4230 pn[6][1] = (pf[6] - pf[5]) / dy;
4231 pn[7][1] = (pf[7] - pf[4]) / dy;
4233 pn[2][1] = (f3->
Eval(
x2,
y2+dy,z1) - pf[1]) / (dy + dy);
4234 pn[3][1] = (f3->
Eval(
x1,
y2+dy,z1) - pf[0]) / (dy + dy);
4235 pn[6][1] = (f3->
Eval(
x2,
y2+dy,z2) - pf[5]) / (dy + dy);
4236 pn[7][1] = (f3->
Eval(
x1,
y2+dy,z2) - pf[4]) / (dy + dy);
4240 pn[0][2] = (pf[4] - pf[0]) / dz;
4241 pn[1][2] = (pf[5] - pf[1]) / dz;
4242 pn[2][2] = (pf[6] - pf[2]) / dz;
4243 pn[3][2] = (pf[7] - pf[3]) / dz;
4245 pn[0][2] = (pf[4] - f3->
Eval(
x1,
y1,z1-dz)) / (dz + dz);
4246 pn[1][2] = (pf[5] - f3->
Eval(
x2,
y1,z1-dz)) / (dz + dz);
4247 pn[2][2] = (pf[6] - f3->
Eval(
x2,
y2,z1-dz)) / (dz + dz);
4248 pn[3][2] = (pf[7] - f3->
Eval(
x1,
y2,z1-dz)) / (dz + dz);
4251 pn[4][2] = (pf[4] - pf[0]) / dz;
4252 pn[5][2] = (pf[5] - pf[1]) / dz;
4253 pn[6][2] = (pf[6] - pf[2]) / dz;
4254 pn[7][2] = (pf[7] - pf[3]) / dz;
4256 pn[4][2] = (f3->
Eval(
x1,
y1,z2+dz) - pf[0]) / (dz + dz);
4257 pn[5][2] = (f3->
Eval(
x2,
y1,z2+dz) - pf[1]) / (dz + dz);
4258 pn[6][2] = (f3->
Eval(
x2,
y2,z2+dz) - pf[2]) / (dz + dz);
4259 pn[7][2] = (f3->
Eval(
x1,
y2,z2+dz) - pf[3]) / (dz + dz);
4262 MarchingCube(fsurf,
p, pf, pn, nnod, ntria, xyz, grad, itria);
4263 if (ntria == 0)
goto L510;
4265 for ( i=1 ; i<=nnod ; i++ ) {
4266 view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
4270 ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
4271 if (ntria == 0)
goto L510;
4273 if (*chopt ==
'B' || *chopt ==
'b') incr =-1;
4275 if (incr == -1) i1 = ntria;
4276 i2 = ntria - i1 + 1;
4279 if(
x2<=fgF3XClip && y2 <=fgF3YClip && z2>=fgF3ZClip)
goto L510;
4282 for (i=i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
4318 static Int_t irota[24][8] = { { 1,2,3,4,5,6,7,8 }, { 2,3,4,1,6,7,8,5 },
4319 { 3,4,1,2,7,8,5,6 }, { 4,1,2,3,8,5,6,7 },
4320 { 6,5,8,7,2,1,4,3 }, { 5,8,7,6,1,4,3,2 },
4321 { 8,7,6,5,4,3,2,1 }, { 7,6,5,8,3,2,1,4 },
4322 { 2,6,7,3,1,5,8,4 }, { 6,7,3,2,5,8,4,1 },
4323 { 7,3,2,6,8,4,1,5 }, { 3,2,6,7,4,1,5,8 },
4324 { 5,1,4,8,6,2,3,7 }, { 1,4,8,5,2,3,7,6 },
4325 { 4,8,5,1,3,7,6,2 }, { 8,5,1,4,7,6,2,3 },
4326 { 5,6,2,1,8,7,3,4 }, { 6,2,1,5,7,3,4,8 },
4327 { 2,1,5,6,3,4,8,7 }, { 1,5,6,2,4,8,7,3 },
4328 { 4,3,7,8,1,2,6,5 }, { 3,7,8,4,2,6,5,1 },
4329 { 7,8,4,3,6,5,1,2 }, { 8,4,3,7,5,1,2,6 } };
4331 static Int_t iwhat[21] = { 1,3,5,65,50,67,74,51,177,105,113,58,165,178,
4332 254,252,250,190,205,188,181 };
4333 Int_t j, i, i1, i2, i3, ir, irt=0, k, k1, k2, incr, icase=0,
n;
4340 for ( i=1; i<=8 ; i++) {
4341 fF8[i-1] =
f[i-1] - fiso;
4343 for ( ir=1 ; ir<=24 ; ir++ ) {
4346 for ( i=1 ; i<=8 ; i++ ) {
4347 if (
fF8[irota[ir-1][i-1]-1] >= 0.) k = k + incr;
4350 if (k==0 || k==255)
return;
4351 for ( i=1 ; i<=21 ; i++ ) {
4352 if (k != iwhat[i-1])
continue;
4361 for ( i=1 ; i<=8 ; i++ ) {
4362 k = irota[irt-1][i-1];
4363 fF8[i-1] =
f[k-1] - fiso;
4364 fP8[i-1][0] =
p[k-1][0];
4365 fP8[i-1][1] =
p[k-1][1];
4366 fP8[i-1][2] =
p[k-1][2];
4367 fG8[i-1][0] =
g[k-1][0];
4368 fG8[i-1][1] =
g[k-1][1];
4369 fG8[i-1][2] =
g[k-1][2];
4374 switch ((
int)icase) {
4377 MarchingCubeCase00(1, 4, 9, 0, 0, 0, nnod, ntria, xyz, grad, itria);
4381 MarchingCubeCase00(2, 4, 9, 10, 0, 0, nnod, ntria, xyz, grad, itria);
4393 MarchingCubeCase00(6, 2, 1, 9, 8, 0, nnod, ntria, xyz, grad, itria);
4404 MarchingCubeCase00(2, 4, 8, 6, 0, 0, nnod, ntria, xyz, grad, itria);
4407 MarchingCubeCase00(1, 4, 12, 7, 6, 10, nnod, ntria, xyz, grad, itria);
4413 MarchingCubeCase00(1, 4, 8, 7, 11, 10, nnod, ntria, xyz, grad, itria);
4422 MarchingCubeCase00(1, 9, 12, 7, 6, 2, nnod, ntria, xyz, grad, itria);
4428 if (ntria == 0)
return;
4429 if (icase <= 14)
goto L500;
4430 for ( i=1; i<=ntria ; i++ ) {
4434 if (itria[i-1][2] < 0) i1 =-i1;
4435 if (itria[i-1][1] < 0) i3 =-i3;
4436 if (itria[i-1][0] < 0) i2 =-i2;
4446 if (
n > ntria)
return;
4447 for ( i=1 ; i<=3 ; i++ ) {
4450 if (i2 == 4) i2 = 1;
4457 if (i3 == 0) i3 = 3;
4464 for ( i=1 ; i<=3 ; i++ ) {
4465 itr[i-1] = itria[
n-1][i-1];
4466 itria[
n-1][i-1] = itria[ntria-1][i-1];
4469 if (ntria == 0)
return;
4470 if (itr[i2-1]*itr[i3-1] > 0)
goto L510;
4473 if (itr[i2-1] < 0) {
4477 if (itr[i3-1] < 0) {
4481 for ( j=1 ; j<=ntria ; j++ ) {
4482 for ( i=1 ; i<=3 ; i++ ) {
4483 if (itria[j-1][i-1] != k2)
continue;
4486 if (i2 == k1) itria[j-1][i-1] =-itria[j-1][i-1];
4512 static Int_t it[4][4][3] = { { { 1,2, 3 }, { 0,0, 0 }, { 0,0, 0 }, { 0,0, 0 } },
4513 { { 1,2,-3 }, {-1,3, 4 }, { 0,0, 0 }, { 0,0, 0 } },
4514 { { 1,2,-3 }, {-1,3,-4 }, {-1,4, 5 }, { 0,0, 0 } },
4515 { { 1,2,-3 }, {-1,3,-4 }, {-4,6,-1 }, { 4,5,-6 } }
4517 Int_t it2[4][3], i, j;
4529 if (ie[5] == 0) nnod = 5;
4530 if (ie[4] == 0) nnod = 4;
4531 if (ie[3] == 0) nnod = 3;
4537 for ( i=0; i<3 ; i++) {
4538 for ( j=0; j<4 ; j++) {
4539 it2[j][i] = it[ntria-1][j][i];
4552 static Int_t ie[6] = { 4,9,1, 2,11,3 };
4553 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4554 static Int_t it2[4][3] = { { 1,2,-5 }, { -1,5,6 }, { 5,-2,4 }, { -4,2,3 } };
4562 if (f0>=0. &&
fF8[0]>=0.)
goto L100;
4563 if (f0<0. &&
fF8[0]<0.)
goto L100;
4581 static Int_t ie[6] = { 4,9,1, 7,11,6 };
4582 static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
4583 static Int_t it2[6][3] = { { 1,2,4 }, { 2,3,6 }, { 3,1,5 },
4584 { 4,5,1 }, { 5,6,3 }, { 6,4,2 } };
4611 static Int_t ie[7] = { 2,4,9,10, 6,7,11 };
4612 static Int_t it1[5][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 } };
4613 static Int_t it2[3][3] = { { 1,2,-3 }, { -1,3,4 }, { 5,6,7 } };
4614 static Int_t it3[7][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 },
4615 { 1,7,-5 }, { -1,5,4 } };
4623 if (f0>=0. &&
fF8[1]>=0.)
goto L100;
4624 if (f0<0. &&
fF8[1]<0.)
goto L100;
4653 static Int_t ie[9] = { 3,12,4, 1,10,2, 11,6,7 };
4654 static Int_t it[9][9][3] = {
4655 {{ 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}},
4656 {{ 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}},
4657 {{ 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}},
4658 {{-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}},
4659 {{ 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}},
4660 {{-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}},
4661 {{ 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}},
4662 {{ 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}},
4663 {{ -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}}
4666 Int_t it2[9][3], i, j;
4677 if (
f1>=0. &&
fF8[2] <0.) icase = icase + 1;
4678 if (
f1 <0. &&
fF8[2]>=0.) icase = icase + 1;
4679 if (f2>=0. &&
fF8[2] <0.) icase = icase + 2;
4680 if (f2 <0. &&
fF8[2]>=0.) icase = icase + 2;
4681 if (f3>=0. &&
fF8[2] <0.) icase = icase + 4;
4682 if (f3 <0. &&
fF8[2]>=0.) icase = icase + 4;
4685 switch ((
int)icase) {
4706 for ( i=0; i<3 ; i++) {
4707 for ( j=0; j<9 ; j++) {
4708 it2[j][i] = it[icase-1][j][i];
4718 if (irep != 2)
goto L400;
4725 for ( i=0; i<3 ; i++) {
4726 for ( j=0; j<9 ; j++) {
4727 it2[j][i] = it[icase-1][j][i];
4741 static Int_t ie[8] = { 1,3,12,9, 5,7,11,10 };
4742 static Int_t it[6][8][3] = {
4743 {{1,2,-3}, {-1,3,4}, {5,6,-7}, {-5,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4744 {{ 9,1,2}, { 9,2,3}, { 9,3,4}, { 9,4,5}, { 9,5,6}, { 9,6,7}, { 9,7,8}, { 9,8,1}},
4745 {{ 9,1,2}, { 9,4,1}, { 9,3,4}, { 9,6,3}, { 9,5,6}, { 9,8,5}, { 9,7,8}, { 9,2,7}},
4746 {{1,2,-7}, {-1,7,8}, {5,6,-3}, {-5,3,4}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4747 {{1,2,-7}, {-1,7,8}, {2,3,-6}, {-2,6,7}, {3,4,-5}, {-3,5,6}, {4,1,-8}, {-4,8,5}},
4748 {{1,2,-3}, {-1,3,4}, {2,7,-6}, {-2,6,3}, {7,8,-5}, {-7,5,6}, {8,1,-4}, {-8,4,5}}
4750 Int_t it2[8][3], i, j;
4760 if (
f1 >= 0.) icase = icase + 1;
4761 if (f2 >= 0.) icase = icase + 2;
4762 if (icase==1 || icase==4)
goto L100;
4768 for ( i=0; i<3 ; i++) {
4769 for ( j=0; j<8 ; j++) {
4770 it2[j][i] = it[icase-1][j][i];
4781 if (irep == 0)
goto L200;
4784 if (icase == 1) icase = 5;
4785 if (icase == 4) icase = 6;
4790 for ( i=0; i<3 ; i++) {
4791 for ( j=0; j<8 ; j++) {
4792 it2[j][i] = it[icase-1][j][i];
4806 static Int_t ie[8] = { 3,12,4, 1,9,8,6,2 };
4807 static Int_t it[6][8][3] = {
4808 {{ 1,2,3}, {4,5,-6}, {-4,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4809 {{-9,1,2}, {9,2,-3}, {-9,3,4}, {9,4,-5}, {-9,5,6}, {9,6,-7}, {-9,7,8}, {9,8,-1}},
4810 {{9,1,-2}, {-9,2,6}, {9,6,-7}, {-9,7,8}, {9,8,-4}, {-9,4,5}, {9,5,-3}, {-9,3,1}},
4811 {{ 3,4,5}, {1,2,-6}, {-1,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
4812 {{ 7,8,6}, {6,8,-1}, {-6,1,2}, {3,1,-8}, {-3,8,4}, { 3,4,5}, {3,5,-6}, {-3,6,2}},
4813 {{ 7,8,6}, {6,8,-4}, {-6,4,5}, {3,4,-8}, {-3,8,1}, { 3,1,2}, {3,2,-6}, {-3,6,5}}
4815 Int_t it2[8][3], i, j;
4825 if (
f1 >= 0.) icase = icase + 1;
4826 if (f2 >= 0.) icase = icase + 2;
4827 if (icase==1 || icase==4)
goto L100;
4833 for ( i=0; i<3 ; i++) {
4834 for ( j=0; j<8 ; j++) {
4835 it2[j][i] = it[icase-1][j][i];
4846 if (irep != 1)
goto L200;
4849 if (icase == 1) icase = 5;
4850 if (icase == 4) icase = 6;
4855 for ( i=0; i<3 ; i++) {
4856 for ( j=0; j<8 ; j++) {
4857 it2[j][i] = it[icase-1][j][i];
4871 Int_t nr, nf, i, k, incr,
n, kr, icase, irep;
4872 static Int_t irota[12][8] = {
4873 {1,2,3,4,5,6,7,8}, {1,5,6,2,4,8,7,3}, {1,4,8,5,2,3,7,6},
4874 {3,7,8,4,2,6,5,1}, {3,2,6,7,4,1,5,8}, {3,4,1,2,7,8,5,6},
4875 {6,7,3,2,5,8,4,1}, {6,5,8,7,2,1,4,3}, {6,2,1,5,7,3,4,8},
4876 {8,4,3,7,5,1,2,6}, {8,5,1,4,7,6,2,3}, {8,7,6,5,4,3,2,1} };
4877 static Int_t iwhat[8] = { 63,62,54,26,50,9,1,0 };
4878 static Int_t ie[12] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
4879 static Int_t iface[6][4] = {
4880 {1,2,3,4}, {5,6,7,8}, {1,2,6,5}, {2,6,7,3}, {4,3,7,8}, {1,5,8,4} };
4881 static Int_t it1[4][3] = { {1,2,10}, {9,5,8}, {6,11,7}, {3,4,12} };
4882 static Int_t it2[4][3] = { {5,6,10}, {1,4,9}, {2,11,3}, {7,8,12} };
4883 static Int_t it3[6][3] = { {10,12,-3}, {-10,3,2}, {12,10,-1}, {-12,1,4},
4884 {9,5,8}, {6,11,7} };
4885 static Int_t it4[6][3] = { {11,9,-1}, {-11,1,2}, {9,11,-3}, {-9,3,4},
4886 {5,6,10}, {7,8,12} };
4887 static Int_t it5[10][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
4888 {13,10,1}, {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2}, {5,8,9} };
4889 static Int_t it6[10][3] = { {13,2,-10}, {-13,10,5}, {13,5,-6}, {-13,6,11},
4890 {13,11,3}, {13,3,-4}, {-13,4,9}, {13,9,-1}, {-13,1,2}, {12,7,8} };
4891 static Int_t it7[12][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
4892 {13,10,-5}, {-13,5,8}, {13,8,-9}, {-13,9,1},
4893 {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2} };
4894 static Int_t it8[6][3] = { {3,8,12}, {3,-2,-8}, {-2,5,-8}, {2,10,-5},
4895 {7,6,11}, {1,4,9} };
4896 static Int_t it9[10][3] = { {7,12,-3}, {-7,3,11}, {11,3,2}, {6,11,-2}, {-6,2,10},
4897 {6,10,5}, {7,6,-5}, {-7,5,8}, {7,8,12}, {1,4,9} };
4898 static Int_t it10[10][3] = { {9,1,-10}, {-9,10,5}, {9,5,8}, {4,9,-8}, {-4,8,12},
4899 {4,12,3}, {1,4,-3}, {-1,3,2}, {1,2,10}, {7,6,11} };
4905 for ( nr=1 ; nr<=12 ; nr++ ) {
4908 for ( nf=1 ; nf<=6 ; nf++ ) {
4909 f1 =
fF8[irota[nr-1][iface[nf-1][0]-1]-1];
4910 f2 =
fF8[irota[nr-1][iface[nf-1][1]-1]-1];
4911 f3 =
fF8[irota[nr-1][iface[nf-1][2]-1]-1];
4912 f4 =
fF8[irota[nr-1][iface[nf-1][3]-1]-1];
4913 if ((
f1*f3-f2*f4)/(
f1+f3-f2-f4) >= 0.) k = k + incr;
4916 for ( i=1 ; i<=8 ; i++ ) {
4917 if (k != iwhat[i-1])
continue;
4923 Error(
"MarchingCubeCase13",
"configuration is not found");
4928 if (icase==1 || icase==8)
goto L300;
4929 for (
n=1 ;
n<=8 ;
n++) {
4930 k = irota[kr-1][
n-1];
4932 for ( i=1 ; i<=3 ; i++ ) {
4933 xyz[
n-1][i-1] =
fP8[k-1][i-1];
4934 grad[
n-1][i-1] =
fG8[k-1][i-1];
4937 for (
n=1 ;
n<=8 ;
n++ ) {
4939 for ( i=1 ; i<=3 ; i++ ) {
4940 fP8[
n-1][i-1] = xyz[
n-1][i-1];
4941 fG8[
n-1][i-1] = grad[
n-1][i-1];
4951 switch ((
int)icase) {
4972 &xyz[nnod-1][0], &grad[nnod-1][0]);
4979 &xyz[nnod-1][0], &grad[nnod-1][0]);
4986 &xyz[nnod-1][0], &grad[nnod-1][0]);
4993 switch ((
int)(irep+1)) {
5022 for (
n=1 ;
n<=ntria ;
n++ ) {
5023 for ( i=1 ; i<=3 ; i++ ) {
5025 itria[
n-1][i-1] = k;
5049 for ( i=1 ; i<=3 ; i++ ) {
5053 for (
n=1 ;
n<=nnod ;
n++ ) {
5056 for ( i=1 ; i<=3 ; i++ ) {
5057 p[i-1] =
p[i-1] + xyz[k-1][i-1];
5058 g[i-1] =
g[i-1] + grad[k-1][i-1];
5061 for ( i=1 ; i<=3 ; i++ ) {
5062 pxyz[i-1] =
p[i-1] / nnod;
5063 pgrad[i-1] =
g[i-1] / nnod;
5085 a = (a11-a01)*(b00-b10) - (a00-a10)*(b11-b01);
5086 if (
a == 0.)
return;
5087 b = a01*(b00-b10)-(a11-a01)*b00-(a00-a10)*b01+a00*(b11-b01);
5088 c = a00*b01 - a01*b00;
5090 if (
d <= 0.)
return;
5093 s1 = (-
b+
d) / (2*
a);
5094 if (s1<0. || s1>1.)
return;
5096 s2 = (-
b-
d) / (2*
a);
5097 if (s2<0. || s2>1.)
return;
5101 if (a00 >= 0) iposa = iposa + 1;
5102 if (a01 >= 0) iposa = iposa + 2;
5103 if (a10 >= 0) iposa = iposa + 4;
5104 if (a11 >= 0) iposa = iposa + 8;
5105 if (iposa==6 || iposa==9)
goto L100;
5111 s0 = (a00-a01) / (a00+a11-a10-a01);
5112 if (
s1>=
s0 && s2<
s0)
return;
5113 if (s1<s0 && s2>=
s0)
return;
5115 if (
s1 >=
s0) irep = 2;
5119 if (b00 >= 0) iposb = iposb + 1;
5120 if (b01 >= 0) iposb = iposb + 2;
5121 if (b10 >= 0) iposb = iposb + 4;
5122 if (b11 >= 0) iposb = iposb + 8;
5123 if (iposb!=6 && iposb!=9)
return;
5124 s0 = (b00-b01) / (b00+b11-b10-b01);
5125 if (iposa != iposb)
goto L200;
5127 if (irep==1 &&
s1>
s0)
return;
5128 if (irep==2 &&
s1<
s0)
return;
5133 if (irep==1 &&
s1<
s0)
return;
5134 if (irep==2 &&
s1>
s0)
return;
5153 static Int_t iedge[12][2] = {
5154 {1,2}, {2,3}, {3,4}, {4,1}, {5,6}, {6,7}, {7,8}, {8,5}, {1,5}, {2,6}, {3,7}, {4,8} };
5156 for (
n=1 ;
n<=nnod ;
n++ ) {
5162 for ( i=1 ; i<=3 ; i++ ) {
5163 xyz[
n-1][i-1] = (
fP8[n2-1][i-1]-
fP8[n1-1][i-1])*t +
fP8[n1-1][i-1];
5164 grad[
n-1][i-1] = (
fG8[n2-1][i-1]-
fG8[n1-1][i-1])*t +
fG8[n1-1][i-1];
5185 Int_t n, nf, i1, i2, i3, i, icur, k, itst, kface, kf, irep;
5195 for (
n=1 ;
n<=nface ;
n++ ) {
5219 for ( i=1 ; i<=3 ; i++ ) {
5220 wmin = xyz[i1-1][i-1];
5221 wmax = xyz[i1-1][i-1];
5222 if (
wmin > xyz[i2-1][i-1])
wmin = xyz[i2-1][i-1];
5223 if (
wmax < xyz[i2-1][i-1])
wmax = xyz[i2-1][i-1];
5224 if (
wmin > xyz[i3-1][i-1])
wmin = xyz[i3-1][i-1];
5225 if (
wmax < xyz[i3-1][i-1])
wmax = xyz[i3-1][i-1];
5226 dface[
n-1][i-1] =
wmin;
5227 dface[
n-1][i+2] =
wmax;
5230 for ( i=1 ; i<=3 ; i++ ) {
5231 v[0][i-1] = xyz[i2-1][i-1] - xyz[i1-1][i-1];
5232 v[1][i-1] = xyz[i3-1][i-1] - xyz[i2-1][i-1];
5234 a = (
v[0][1]*
v[1][2] -
v[0][2]*
v[1][1]);
5235 b = (
v[0][2]*
v[1][0] -
v[0][0]*
v[1][2]);
5236 c = (
v[0][0]*
v[1][1] -
v[0][1]*
v[1][0]);
5245 abcd[
n-1][3] =-(
a*xyz[i1-1][0] +
b*xyz[i1-1][1] +
c*xyz[i1-1][2]);
5248 if (nf <= 1)
return;
5251 for ( icur=2 ; icur<=nface ; icur++ ) {
5253 zcur = dface[k-1][2];
5254 for ( itst=icur-1 ; itst>=1 ; itst-- ) {
5256 if (zcur < dface[k-1][2])
break;
5258 iorder[itst-1] = iorder[itst];
5266 if (kface == 1)
goto L900;
5267 nf = iorder[kface-1];
5268 if (nf < 0) nf =-nf;
5269 abcdn[0] = abcd[nf-1][0];
5270 abcdn[1] = abcd[nf-1][1];
5271 abcdn[2] = abcd[nf-1][2];
5272 abcdn[3] = abcd[nf-1][3];
5278 for ( k=kface-1 ; k>=1 ; k-- ) {
5280 if (kf < 0) kf =-kf;
5281 if (dface[nf-1][5] > dface[kf-1][2]+
kDel)
goto L400;
5282 if (iorder[k-1] > 0)
goto L900;
5287 if (dface[kf-1][0] >= dface[nf-1][3]-
kDel)
goto L800;
5288 if (dface[kf-1][3] <= dface[nf-1][0]+
kDel)
goto L800;
5289 if (dface[kf-1][1] >= dface[nf-1][4]-
kDel)
goto L800;
5290 if (dface[kf-1][4] <= dface[nf-1][1]+
kDel)
goto L800;
5296 if (abcdn[0]*xyz[kk[0]-1][0]+abcdn[1]*xyz[kk[0]-1][1]+
5297 abcdn[2]*xyz[kk[0]-1][2]+abcdn[3] < -
kDel)
goto L500;
5298 if (abcdn[0]*xyz[kk[1]-1][0]+abcdn[1]*xyz[kk[1]-1][1]+
5299 abcdn[2]*xyz[kk[1]-1][2]+abcdn[3] < -
kDel)
goto L500;
5300 if (abcdn[0]*xyz[kk[2]-1][0]+abcdn[1]*xyz[kk[2]-1][1]+
5301 abcdn[2]*xyz[kk[2]-1][2]+abcdn[3] < -
kDel)
goto L500;
5306 abcdk[0] = abcd[kf-1][0];
5307 abcdk[1] = abcd[kf-1][1];
5308 abcdk[2] = abcd[kf-1][2];
5309 abcdk[3] = abcd[kf-1][3];
5310 if (abcdk[0]*xyz[nn[0]-1][0]+abcdk[1]*xyz[nn[0]-1][1]+
5311 abcdk[2]*xyz[nn[0]-1][2]+abcdk[3] >
kDel)
goto L600;
5312 if (abcdk[0]*xyz[nn[1]-1][0]+abcdk[1]*xyz[nn[1]-1][1]+
5313 abcdk[2]*xyz[nn[1]-1][2]+abcdk[3] >
kDel)
goto L600;
5314 if (abcdk[0]*xyz[nn[2]-1][0]+abcdk[1]*xyz[nn[2]-1][1]+
5315 abcdk[2]*xyz[nn[2]-1][2]+abcdk[3] >
kDel)
goto L600;
5321 for ( i=1 ; i<=3 ; i++ ) {
5324 if (i != 3) i2 = kk[i];
5326 if ( irep<0 )
goto L700;
5327 if ( irep==0 )
continue;
5328 if ( irep>0 )
goto L800;
5331 for ( i=1 ; i<=3 ; i++ ) {
5334 if (i != 3) i2 = nn[i];
5336 if ( irep<0 )
goto L800;
5337 if ( irep==0 )
continue;
5338 if ( irep>0 )
goto L700;
5345 for ( i=k+1 ; i<=kface ; i++ ) {
5346 iorder[i-2] = iorder[i-1];
5348 iorder[kface-1] =-kf;
5349 if (kf > 0)
goto L300;
5357 if (iorder[kface-1] < 0) iorder[kface-1] =-iorder[kface-1];
5359 if (kface > 0)
goto L300;
5377 Int_t k, k1, k2, ixy, i;
5378 Double_t a,
b,
c, d1, d2, dd,
xy, tmin, tmax, tmid,
x,
y, z;
5384 delta[0] = xyz[i2-1][0] - xyz[i1-1][0];
5385 delta[1] = xyz[i2-1][1] - xyz[i1-1][1];
5386 delta[2] = xyz[i2-1][2] - xyz[i1-1][2];
5392 c =-(
a*xyz[i1-1][0] +
b*xyz[i1-1][1]);
5393 d[0] =
a*xyz[iface[0]-1][0] +
b*xyz[iface[0]-1][1] +
c;
5394 d[1] =
a*xyz[iface[1]-1][0] +
b*xyz[iface[1]-1][1] +
c;
5395 d[2] =
a*xyz[iface[2]-1][0] +
b*xyz[iface[2]-1][1] +
c;
5397 for ( i=1 ; i<=3 ; i++ ) {
5401 if (
d[k1-1]>=0. &&
d[k2-1]>=0.)
continue;
5402 if (
d[k1-1] <0. &&
d[k2-1] <0.)
continue;
5403 d1 =
d[k1-1] / (
d[k1-1] -
d[k2-1]);
5404 d2 =
d[k2-1] / (
d[k1-1] -
d[k2-1]);
5405 xy = d1*xyz[iface[k2-1]-1][ixy-1] - d2*xyz[iface[k1-1]-1][ixy-1];
5407 t[k-1] = (
xy-xyz[i1-1][ixy-1]) / delta[ixy-1];
5408 if (k == 2)
goto L200;
5416 if (tmin>1. || tmax<0)
return;
5417 if (tmin < 0.) tmin = 0.;
5418 if (tmax > 1.) tmax = 1.;
5419 tmid = (tmin + tmax) / 2.;
5420 x = delta[0]*tmid + xyz[i1-1][0];
5421 y = delta[1]*tmid + xyz[i1-1][1];
5422 z = delta[2]*tmid + xyz[i1-1][2];
5423 dd = abcd[0]*
x + abcd[1]*
y + abcd[2]*z + abcd[3];
5424 if (dd >
del)
goto L997;
5425 if (dd <-
del)
goto L998;
5457 Double_t p0[3], p1[3], p2[3], p3[3], t[3];
5460 Int_t i, i1, i2, j, ibase, nnod, knod, ntria, ktria, iopt, iready;
5461 Int_t ixcrit, iycrit, izcrit, incrx, incry, incrz, incr;
5462 Int_t ix, ix1=0, ix2=0, iy, iy1=0, iy2=0, iz, iz1=0, iz2=0, k, kx, ky, kz, isurf, nsurf;
5468 static Int_t ind[8][3] = { { 0,0,0 }, { 1,0,0 }, { 1,0,1 }, { 0,0,1 },
5469 { 0,1,0 }, { 1,1,0 }, { 1,1,1 }, { 0,1,1 } };
5478 Error(
"ImplicitFunction",
"no TView in current pad");
5483 if (nsurf >
kNiso) {
5484 Warning(
"IsoSurface",
"Number of iso-surfaces too large. Increase kNiso");
5487 if (*chopt ==
'B' || *chopt ==
'b') iopt = 1;
5511 if (p1[2] < p0[2]) ixcrit = 1;
5512 if (p2[2] < p0[2]) iycrit = 1;
5513 if (p3[2] < p0[2]) izcrit = 1;
5522 if (iopt == 1) iz1 = 1;
5523 if (iopt == 1) iz2 = izcrit-1;
5524 if (iopt == 2) iz1 = izcrit;
5525 if (iopt == 2) iz2 = nz - 1;
5527 if (iopt == 1) iz1 = nz - 1;
5528 if (iopt == 1) iz2 = izcrit;
5529 if (iopt == 2) iz1 = izcrit-1;
5530 if (iopt == 2) iz2 = 1;
5532 for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
5535 if (iopt == 1) iy1 = 1;
5536 if (iopt == 1) iy2 = iycrit-1;
5537 if (iopt == 2) iy1 = iycrit;
5538 if (iopt == 2) iy2 = ny - 1;
5540 if (iopt == 1) iy1 = ny - 1;
5541 if (iopt == 1) iy2 = iycrit;
5542 if (iopt == 2) iy1 = iycrit-1;
5543 if (iopt == 2) iy2 = 1;
5545 for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
5548 if (iopt == 1) ix1 = 1;
5549 if (iopt == 1) ix2 = ixcrit-1;
5550 if (iopt == 2) ix1 = ixcrit;
5551 if (iopt == 2) ix2 = nx - 1;
5553 if (iopt == 1) ix1 = nx - 1;
5554 if (iopt == 1) ix2 = ixcrit;
5555 if (iopt == 2) ix1 = ixcrit-1;
5556 if (iopt == 2) ix2 = 1;
5558 for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
5562 for ( isurf=1 ; isurf<=nsurf ; isurf++ ) {
5600 if (iready !=0)
goto L310;
5602 for ( i=1 ; i<=8 ; i++ ) {
5603 kx = ix + ind[i-1][0];
5604 ky = iy + ind[i-1][1];
5605 kz = iz + ind[i-1][2];
5606 p[i-1][0] =
x[kx-1];
5607 p[i-1][1] =
y[ky-1];
5608 p[i-1][2] = z[kz-1];
5615 }
else if (kx == nx) {
5620 d1 =
x[kx-1] -
x[kx-2];
5621 d2 =
x[kx] -
x[kx-1];
5631 pn[i-1][0] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5639 }
else if (ky == ny) {
5644 d1 =
y[ky-1] -
y[ky-2];
5645 d2 =
y[ky] -
y[ky-1];
5655 pn[i-1][1] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5663 }
else if (kz == nz) {
5668 d1 = z[kz-1] - z[kz-2];
5669 d2 = z[kz] - z[kz-1];
5679 pn[i-1][2] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
5690 xyz_tmp, grad_tmp, itria_tmp);
5692 for(
l=0 ;
l<knod ;
l++) {
5693 xyz[nnod+
l][0] = xyz_tmp[
l][0];
5694 xyz[nnod+
l][1] = xyz_tmp[
l][1];
5695 xyz[nnod+
l][2] = xyz_tmp[
l][2];
5696 grad[nnod+
l][0] = grad_tmp[
l][0];
5697 grad[nnod+
l][1] = grad_tmp[
l][1];
5698 grad[nnod+
l][2] = grad_tmp[
l][2];
5700 for(
l=0 ;
l<ktria ;
l++) {
5701 itria[ntria+
l][0] = itria_tmp[
l][0];
5702 itria[ntria+
l][1] = itria_tmp[
l][1];
5703 itria[ntria+
l][2] = itria_tmp[
l][2];
5706 for ( i=ntria+1 ; i<=ntria+ktria ; i++ ) {
5707 for ( j=1 ; j<=3 ; j++ ){
5709 if (itria[i-1][j-1] < 0) ibase =-nnod;
5710 itria[i-1][j-1] = itria[i-1][j-1] + ibase;
5715 ntria = ntria + ktria;
5719 if (ntria == 0)
continue;
5720 for ( i=1 ; i<=nnod ; i++ ) {
5721 view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
5725 ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
5726 if (ntria == 0)
continue;
5728 if (iopt == 1) incr = -1;
5730 if (incr == -1) i1 = ntria;
5731 i2 = ntria - i1 + 1;
5732 for (i = i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
5737 icodes[0] = iattr[k-1];
5738 icodes[1] = iattr[k-1];
5739 icodes[2] = iattr[k-1];
5744 if (incrx < 0)
goto L130;
5747 if (incry < 0)
goto L120;
5750 if (incrz < 0)
goto L110;
5766 Error(
"ImplicitFunction",
"no TView in current pad");
5773 for ( i=1 ; i<=
np ; i++) {
5776 view->
WCtoNDC(&xyz[k-1][0], &p3[i-1][0]);
short Style_t
Style number (short)
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
short Width_t
Line width (short)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
winID h TVirtualViewer3D TVirtualGLPainter p
winID h TVirtualViewer3D vv
Option_t Option_t SetLineWidth
Option_t Option_t SetFillStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t SetLineColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char FillPolygon
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TH1 * gCurrentHist
R__EXTERN Hoption_t Hoption
const Int_t kF3FillColor2
const Double_t kEpsFaceMode2
const Int_t kF3FillColor1
R__EXTERN TStyle * gStyle
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual void Modify()
Change current fill area attributes if necessary.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void Modify()
Change current line attributes if necessary.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
The color creation and management class.
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
Initialize this color and its "dark" and "bright" associated colors.
static void RGBtoHLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
static void HLStoRGB(Float_t h, Float_t l, Float_t s, Float_t &r, Float_t &g, Float_t &b)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
TF3 defines a 3D Function with Parameters.
virtual const Double_t * GetClippingBox() const
TH1 is the base class of all histogram classes in ROOT.
TVirtualHistPainter * GetPainter(Option_t *option="")
Return pointer to painter.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
The histogram painter class.
static Int_t ProjectSinusoidal2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function code for sinusoidal projection from Ernst-Jan Buis Source https://en....
static Int_t ProjectMollweide2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
static Int_t ProjectAitoff2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
static Int_t ProjectParabolic2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function code for parabolic projection from Ernst-Jan Buis.
static Int_t ProjectMercator2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
Bool_t IsInside(Int_t x, Int_t y) override
Return kTRUE if the cell ix, iy is inside one of the graphical cuts.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
std::vector< Int_t > fColorMain
void MarchingCubeCase06(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 6.
Int_t fSystem
Coordinate system.
void DrawFaceMove3(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 3rd variant for "MOVING SCREEN" algorithm (draw level lines only)
void SetDrawFace(DrawFaceFunc_t pointer)
Store pointer to current algorithm to draw faces.
void MarchingCubeSetTriangles(Int_t ntria, Int_t it[][3], Int_t itria[48][3])
Set triangles (if parameter IALL=1, all edges will be visible)
void IsoSurface(Int_t ns, Double_t *s, Int_t nx, Int_t ny, Int_t nz, Double_t *x, Double_t *y, Double_t *z, const char *chopt)
Draw set of iso-surfaces for a scalar function defined on a grid.
Double_t fRmax[3]
Upper limits of lego.
std::vector< Int_t > fRaster
Pointer to raster buffer.
void DrawLevelLines(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw level lines without hidden line removal.
void ClearRaster()
Clear screen.
std::vector< Int_t > fColorDark
void MarchingCubeFindNodes(Int_t nnod, Int_t *ie, Double_t xyz[52][3], Double_t grad[52][3])
Find nodes and normales.
DrawFaceFunc_t fDrawFace
Pointer to face drawing function.
void SetLegoFunction(LegoFunc_t pointer)
Store pointer to current lego function.
void SurfaceCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in cylindrical coordinates.
void MarchingCubeMiddlePoint(Int_t nnod, Double_t xyz[52][3], Double_t grad[52][3], Int_t it[][3], Double_t *pxyz, Double_t *pgrad)
Find middle point of a polygon.
Double_t fFunLevel[NumOfColorLevels+1]
std::vector< Int_t > fEdgeStyle
void SurfaceFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t)
Service function for Surfaces.
void MarchingCubeCase03(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 3.
void LegoCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots in cylindrical coordinates.
Int_t fIc3
Base colour for the 3rd Iso Surface.
void SideVisibilityDecode(Double_t val, Int_t &iv1, Int_t &iv2, Int_t &iv3, Int_t &iv4, Int_t &iv5, Int_t &iv6, Int_t &ir)
Decode side visibilities and order along R for sector.
void MarchingCubeCase12(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 12.
void FindLevelLines(Int_t np, Double_t *f, Double_t *t)
Find level lines for face.
void FillPolygonBorder(Int_t nn, Double_t *xy)
Fill a polygon including border ("RASTER SCREEN")
Double_t fF8[8]
Function values.
void FindVisibleDraw(Double_t *r1, Double_t *r2)
Find visible parts of line (draw line)
static const Int_t NumOfSlices
Int_t fNaphi
Size of fAphi.
void LegoSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots spheric coordinates.
void SurfaceCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
Draw surface in cartesian coordinate system.
void SurfaceProperty(Double_t qqa, Double_t qqd, Double_t qqs, Int_t nnqs, Int_t &irep)
Set surface property coefficients.
void InitMoveScreen(Double_t xmin, Double_t xmax)
Initialize "MOVING SCREEN" method.
Double_t fYls[NumOfLights]
void FindVisibleLine(Double_t *p1, Double_t *p2, Int_t ntmax, Int_t &nt, Double_t *t)
Find visible part of a line ("RASTER SCREEN")
void ZDepth(Double_t xyz[52][3], Int_t &nface, Int_t iface[48][3], Double_t dface[48][6], Double_t abcd[48][4], Int_t *iorder)
Z-depth algorithm for set of triangles.
Double_t fU[NumOfSlices *2]
void LegoCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
Draw stack of lego-plots in cartesian coordinates.
Int_t fNxrast
Number of pixels in x.
Int_t fNStack
Number of histograms in the stack to be painted.
Double_t fRmin[3]
Lower limits of lego.
void DrawFaceMode1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
Draw face - 1st variant (2 colors: 1st for external surface, 2nd for internal)
TPainter3dAlgorithms()
Lego default constructor.
void SideVisibilityEncode(Int_t iopt, Double_t phi1, Double_t phi2, Double_t &val)
Encode side visibilities and order along R for sector.
void LightSource(Int_t nl, Double_t yl, Double_t xscr, Double_t yscr, Double_t zscr, Int_t &irep)
Set light source.
void MarchingCubeCase04(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 4.
Int_t fJmask[30]
Indices of subsets of n-bit masks (n is from 1 to 30)
void MarchingCubeCase00(Int_t k1, Int_t k2, Int_t k3, Int_t k4, Int_t k5, Int_t k6, Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consideration of trivial cases: 1,2,5,8,9,11,14.
void GouraudFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t)
Find part of surface with luminosity in the corners.
Int_t fNcolor
Number of colours per Iso surface.
Int_t fColorLevel[NumOfColorLevels+2]
void DrawFaceMove1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 1st variant for "MOVING SCREEN" algorithm (draw face with level lines)
void FillPolygon(Int_t n, Double_t *p, Double_t *f)
Fill polygon with function values at vertexes.
void SetSurfaceFunction(SurfaceFunc_t pointer)
Store pointer to current surface function.
void SurfacePolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in polar coordinates.
~TPainter3dAlgorithms() override
destructor
std::vector< Double_t > fAphi
Double_t fXrast
Minimal x.
void SurfaceSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw surface in spheric coordinates.
void MarchingCubeCase07(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 7.
void BackBox(Double_t ang)
Draw back surfaces of surrounding box.
void ColorFunction(Int_t nl, Double_t *fl, Int_t *icl, Int_t &irep)
Set correspondence between function and color levels.
void DrawFaceRaster2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 2nd variant for "RASTER SCREEN" algorithm (draw face for stacked lego plot)
void MarchingCubeCase10(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 10.
Double_t fD[NumOfSlices *2]
Double_t fP8[8][3]
Vertices.
Double_t fYrast
Minimal y.
Double_t fPlines[NumOfLevelLines *6]
Double_t fVls[NumOfLights *3]
void LegoPolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots in polar coordinates.
void SetEdgeAtt(Color_t color=1, Style_t style=1, Width_t width=1, Int_t n=0)
void DrawFaceGouraudShaded(Int_t *icodes, Double_t xyz[][3], Int_t np, Int_t *iface, Double_t *t)
Draw the faces for the Gouraud Shaded Iso surfaces.
Int_t fIc2
Base colour for the 2nd Iso Surface.
void MarchingCubeCase13(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
Consider case No 13.
std::vector< Int_t > fEdgeWidth
void InitRaster(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Int_t nx, Int_t ny)
Initialize hidden lines removal algorithm (RASTER SCREEN)
void DefineGridLevels(Int_t ndivz)
Define the grid levels drawn in the background of surface and lego plots.
void LegoFunction(Int_t ia, Int_t ib, Int_t &nv, Double_t *ab, Double_t *vv, Double_t *t)
Service function for Legos.
Int_t fLevelLine[NumOfLevelLines]
Double_t fFmin
IsoSurface minimum function value.
void MarchingCube(Double_t fiso, Double_t p[8][3], Double_t f[8], Double_t g[8][3], Int_t &nnod, Int_t &ntria, Double_t xyz[][3], Double_t grad[][3], Int_t itria[][3])
Topological decider for "Marching Cubes" algorithm Find set of triangles approximating the iso-surfac...
Int_t fMask[465]
Set of masks (30+29+28+...+1)=465.
void ModifyScreen(Double_t *r1, Double_t *r2)
Modify SCREEN.
Int_t fMesh
(=1 if mesh to draw, o otherwise)
SurfaceFunc_t fSurfaceFunction
Pointer to surface function.
void DrawFaceMove2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 2nd variant for "MOVING SCREEN" algorithm (draw face for stacked lego plot)
Int_t fIfrast
Flag, if it not zero them the algorithm is off.
LegoFunc_t fLegoFunction
Pointer to lego function.
void SetColorMain(Color_t color, Int_t n=0)
Store color for stack number n.
void Spectrum(Int_t nl, Double_t fmin, Double_t fmax, Int_t ic, Int_t idc, Int_t &irep)
Set Spectrum.
std::vector< Int_t > fEdgeColor
Double_t fG8[8][3]
Function gradients.
void TestEdge(Double_t del, Double_t xyz[52][3], Int_t i1, Int_t i2, Int_t iface[3], Double_t abcd[4], Int_t &irep)
Test edge against face (triangle)
Int_t fNyrast
Number of pixels in y.
void DrawFaceRaster1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
Draw face - 1st variant for "RASTER SCREEN" algorithm (draw face with level lines)
void DrawFaceMode3(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
Draw face - 3rd option (draw face for stacked lego plot)
void FrontBox(Double_t ang)
Draw front surfaces of surrounding box & axes.
void SetColorDark(Color_t color, Int_t n=0)
Store dark color for stack number n.
void DrawFaceMode2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
Draw face - 2nd option (fill in correspondence with function levels)
void FindPartEdge(Double_t *p1, Double_t *p2, Double_t f1, Double_t f2, Double_t fmin, Double_t fmax, Int_t &kpp, Double_t *pp)
Find part of edge where function defined on this edge has value from fmin to fmax
Int_t fIc1
Base colour for the 1st Iso Surface.
void ImplicitFunction(TF3 *f3, Double_t *rmin, Double_t *rmax, Int_t nx, Int_t ny, Int_t nz, const char *chopt)
Draw implicit function FUN(X,Y,Z) = 0 in cartesian coordinates using hidden surface removal algorithm...
Double_t fFmax
IsoSurface maximum function value.
void MarchingCubeSurfacePenetration(Double_t a00, Double_t a10, Double_t a11, Double_t a01, Double_t b00, Double_t b10, Double_t b11, Double_t b01, Int_t &irep)
Check for surface penetration ("bottle neck")
void Luminosity(TView *view, Double_t *anorm, Double_t &flum)
Find surface luminosity at given point.
Float_t GetLegoInnerR() const
virtual Double_t * GetRmax()=0
virtual Double_t * GetRmin()=0
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
static TView * CreateView(Int_t system=1, const Double_t *rmin=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.
virtual void FindPhiSectors(Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2)=0
virtual Double_t * GetTnorm()=0
virtual void FindThetaSectors(Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2)=0
virtual void SetRange(const Double_t *min, const Double_t *max)=0
virtual void FindNormal(Double_t x, Double_t y, Double_t z, Double_t &zn)=0
virtual void AxisVertex(Double_t ang, Double_t *av, Int_t &ix1, Int_t &ix2, Int_t &iy1, Int_t &iy2, Int_t &iz1, Int_t &iz2)=0
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)=0
virtual Double_t * GetTN()=0
virtual void NormalWCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual TList * GetStack() const =0
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Histograms' drawing options structure.
int Proj
"AITOFF", "MERCATOR", "SINUSOIDAL" and "PARABOLIC" projections for 2d plots.
int Logx
log scale in X. Also set by histogram option
int MinimumZero
"MIN0" or gStyle->GetHistMinimumZero()
int Zero
"0" if selected with any LEGO option the empty bins are not drawn.
int Logz
log scale in Z. Also set by histogram option
int Surf
"SURF" and "SURFn" Draw as a Surface ((1 <= n <= 4).
int Logy
log scale in Y. Also set by histogram option
int System
"POL", "CYL", "SPH" and "PSR" Type of coordinate system for 3D plots.
Histogram parameters structure.
Double_t baroffset
Offset of bin for bars or legos [0,1].
Double_t xmin
Minimum value along X.
Int_t ylast
Last bin number along Y.
Int_t xfirst
First bin number along X.
Double_t zmin
Minimum value along Z.
Double_t ymin
Minimum value along y.
Double_t ymax
Maximum value along y.
Double_t factor
Multiplication factor (normalization)
Int_t xlast
Last bin number along X.
Double_t barwidth
Width of bin for bars and legos [0,1].
Double_t zmax
Maximum value along Z.
Double_t xmax
Maximum value along X.
Int_t yfirst
First bin number along Y.