117   for (i=0;i<3;i++)       { 
fRmin[i] = 0; 
fRmax[i] = 1; }
 
  118   for (i=0;i<4;i++)       { 
fYls[i] = 0; }
 
  120   for (i=0;i<30;i++)      { 
fJmask[i] = 0; }
 
  122   for (i=0;i<465;i++)     { 
fMask[i] = 0; }
 
  124   for (i=0;i<1200;i++)    { 
fPlines[i] = 0.; }
 
  125   for (i=0;i<200;i++)     { 
fT[i] = 0.; }
 
  127   for (i=0;i<12;i++)      { 
fVls[i] = 0.; }
 
  128   for (i=0;i<257;i++)     { 
fFunLevel[i] = 0.; }
 
  129   for (i=0;i<8;i++)       { 
fF8[i] = 0.; }
 
  201   for (i=0;i<3;i++)       { 
fRmin[i] = rmin[i]; 
fRmax[i] = rmax[i]; }
 
  202   for (i=0;i<4;i++)       { 
fYls[i] = 0; }
 
  204   for (i=0;i<30;i++)      { 
fJmask[i] = 0; }
 
  206   for (i=0;i<465;i++)     { 
fMask[i] = 0; }
 
  208   for (i=0;i<1200;i++)    { 
fPlines[i] = 0.; }
 
  209   for (i=0;i<200;i++)     { 
fT[i] = 0.; }
 
  211   for (i=0;i<12;i++)      { 
fVls[i] = 0.; }
 
  212   for (i=0;i<257;i++)     { 
fFunLevel[i] = 0.; }
 
  213   for (i=0;i<8;i++)       { 
fF8[i] = 0.; }
 
  270   static Int_t iface1[4] = { 1, 4, 8, 5 };
 
  271   static Int_t iface2[4] = { 4, 3, 7, 8 };
 
  276      Error(
"BackBox", 
"no TView in current pad");
 
  282   Int_t ix1, ix2, iy1, iy2, iz1, iz2;
 
  285   view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
 
  286   for (
Int_t i = 0; i < 8; ++i) {
 
  287      r[i*3 + 0] = av[i*3 + 0] + av[i*3 + 1]*cosa;
 
  288      r[i*3 + 1] = av[i*3 + 1]*sina;
 
  289      r[i*3 + 2] = av[i*3 + 2];
 
  293   Int_t icodes[3] = { 0, 0, 0 };
 
  295   tt[0] = 
r[(iface1[0]-1)*3 + 2];
 
  296   tt[1] = 
r[(iface1[1]-1)*3 + 2];
 
  297   tt[2] = 
r[(iface1[2]-1)*3 + 2];
 
  298   tt[3] = 
r[(iface1[3]-1)*3 + 2];
 
  300   tt[0] = 
r[(iface2[0]-1)*3 + 2];
 
  301   tt[1] = 
r[(iface2[1]-1)*3 + 2];
 
  302   tt[2] = 
r[(iface2[2]-1)*3 + 2];
 
  303   tt[3] = 
r[(iface2[3]-1)*3 + 2];
 
  314   static Int_t iface1[4] = { 1, 2, 6, 5 };
 
  315   static Int_t iface2[4] = { 2, 3, 7, 6 };
 
  320      Error(
"FrontBox", 
"no TView in current pad");
 
  326   Int_t ix1, ix2, iy1, iy2, iz1, iz2;
 
  329   view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
 
  330   for (
Int_t i = 0; i < 8; ++i) {
 
  331      r[i*3 + 0] = av[i*3 + 0] + av[i*3 + 1]*cosa;
 
  332      r[i*3 + 1] = av[i*3 + 1]*sina;
 
  333      r[i*3 + 2] = av[i*3 + 2];
 
  342   for (
Int_t i = 0; i < 4; ++i) {
 
  343      Int_t k = iface1[i] - 1;
 
  347   gPad->PaintPolyLine(4, 
x, 
y);
 
  348   for (
Int_t i = 0; i < 4; ++i) {
 
  349      Int_t k = iface2[i] - 1;
 
  353   gPad->PaintPolyLine(4, 
x, 
y);
 
  377   static const char *where = 
"ColorFunction";
 
  386   if (nl < 0 || nl > 256) {
 
  387      Error(where, 
"illegal number of levels (%d)", nl);
 
  392   for (
Int_t i = 1; i < nl; ++i) {
 
  393      if (fl[i] <= fl[i - 1]) {
 
  400   for (
Int_t i = 0; i < nl; ++i) {
 
  423      Error(
"GridLevels", 
"no TView in current pad");
 
  429   Double_t binLow = 0, binHigh = 0, binWidth = 0;
 
  432   if (!rmin || !rmax) 
return;
 
  435                               binLow, binHigh, nbins, binWidth, 
" ");
 
  440      binWidth = (binHigh - binLow)/nbins;
 
  468   for (
Int_t i = 0; i < np; ++i) {
 
  470      if (k < 0) { k = -k; ifneg = 
true; }
 
  471      view->
WCtoNDC(&xyz[(k-1)*3], p3);
 
  472      x[i] = p3[0]; 
y[i] = p3[1];
 
  474   x[np] = 
x[0]; 
y[np] = 
y[0];
 
  478   for (
Int_t i = 0; i < np; ++i) {
 
  479      z += 
y[i]*
x[i+1] - 
x[i]*
y[i+1];
 
  486   gPad->PaintFillArea(np, 
x, 
y);
 
  492      for (
Int_t i = 0; i < np; ++i) { 
 
  493         if (iface[i] > 0) 
gPad->PaintPolyLine(2, &
x[i], &
y[i]);
 
  496      gPad->PaintPolyLine(np+1, 
x, 
y); 
 
  516   Double_t x[12+1] = {0}, 
y[12+1] = {0}, p3[3*12];
 
  517   for (
Int_t i = 0; i < np; ++i) {
 
  519      view->
WCtoNDC(&xyz[(k-1)*3], &p3[i*3]);
 
  520      x[i] = p3[i*3+0]; 
y[i] = p3[i*3+1];
 
  522   x[np] = 
x[0]; 
y[np] = 
y[0];
 
  530      Double_t ttt[5] = { t[0], t[1], t[2], t[3], t[0] };
 
  531      for (
Int_t i = 0; i<3; ++i) { p3[3*4+i] = p3[i]; }
 
  532      Int_t k1 = 0, k2 = 2;
 
  533      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]);
 
  534      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]);
 
  535      if (z1 > z2) { k1 = 2; k2 = 0; }
 
  538         gPad->PaintPolyLine(3, &
x[k1], &
y[k1]);
 
  542         gPad->PaintPolyLine(3, &
x[k2], &
y[k2]);
 
  544            x[1] = 
x[2]; 
y[1] = 
y[2];
 
  545            gPad->PaintPolyLine(2, &
x[0], &
y[0]);
 
  551         gPad->PaintPolyLine(np+1, 
x, 
y);
 
  573   for (
Int_t i = 0; i < np; ++i) {
 
  575      view->
WCtoNDC(&xyz[(k-1)*3], p3);
 
  576      x[i] = p3[0]; 
y[i] = p3[1];
 
  578   x[np] = 
x[0]; 
y[np] = 
y[0];
 
  584   if (icodes[3] == 1) icol = 
fColorMain[icodes[2] - 1];
 
  585   if (icodes[3] == 2) icol = 
fColorDark[icodes[2] - 1];
 
  586   if (icodes[3] == 3) icol = 
fColorMain[icodes[2] - 1];
 
  587   if (icodes[3] == 4) icol = 
fColorDark[icodes[2] - 1];
 
  591   gPad->PaintFillArea(np, 
x, 
y);
 
  599      gPad->PaintPolyLine(np+1, 
x, 
y);
 
  621   for (
Int_t i = 0; i < np; ++i) {
 
  623      p3[i*3 + 0] = xyz[(k-1)*3 + 0];
 
  624      p3[i*3 + 1] = xyz[(k-1)*3 + 1];
 
  625      p3[i*3 + 2] = xyz[(k-1)*3 + 2];
 
  634   if (icodes[2] == 0) {  
 
  648      for (
Int_t it = 0; it < 
fNT; ++it) {
 
  649         x[0] = p1[0] + xdel*
fT[2*it + 0];
 
  650         y[0] = p1[1] + ydel*
fT[2*it + 0];
 
  651         x[1] = p1[0] + xdel*
fT[2*it + 1];
 
  652         y[1] = p1[1] + ydel*
fT[2*it + 1];
 
  653         gPad->PaintPolyLine(2, 
x, 
y);
 
  658   if (icodes[2] == 0) {  
 
  668   for (
Int_t i = 0; i < np; ++i) {
 
  670      Int_t i2 = (i == np-1) ? 0 : i + 1;
 
  676      for (
Int_t it = 0; it < 
fNT; ++it) {
 
  677         x[0] = p1[0] + xdel*
fT[2*it + 0];
 
  678         y[0] = p1[1] + ydel*
fT[2*it + 0];
 
  679         x[1] = p1[0] + xdel*
fT[2*it + 1];
 
  680         y[1] = p1[1] + ydel*
fT[2*it + 1];
 
  681         gPad->PaintPolyLine(2, 
x, 
y);
 
  686   for (
Int_t i = 0; i < np; ++i) {
 
  688      Int_t i2 = (i == np-1) ? 0 : i + 1;
 
  710   for (
Int_t i = 0; i < np; ++i) {
 
  712      p3[i*3 + 0] = xyz[(k-1)*3 + 0];
 
  713      p3[i*3 + 1] = xyz[(k-1)*3 + 1];
 
  714      p3[i*3 + 2] = xyz[(k-1)*3 + 2];
 
  719   if (icodes[2] == 0) {  
 
  729   for (
Int_t i = 0; i < np; ++i) {
 
  731      Int_t i2 = (i == np-1) ? 0 : i + 1;
 
  737      for (
Int_t it = 0; it < 
fNT; ++it) {
 
  738         x[0] = p1[0] + xdel*
fT[2*it + 0];
 
  739         y[0] = p1[1] + ydel*
fT[2*it + 0];
 
  740         x[1] = p1[0] + xdel*
fT[2*it + 1];
 
  741         y[1] = p1[1] + ydel*
fT[2*it + 1];
 
  742         gPad->PaintPolyLine(2, 
x, 
y);
 
  747   for (
Int_t i = 0; i < np; ++i) {
 
  749      Int_t i2 = (i == np-1) ? 0 : i + 1;
 
  771   if (icodes[2] == 0) {  
 
  783   Double_t p3[3*12] = {0}, ttt[12] = {0};
 
  784   for (
Int_t i = 0; i < np; ++i) {
 
  786      p3[i*3 + 0] = xyz[(k-1)*3 + 0];
 
  787      p3[i*3 + 1] = xyz[(k-1)*3 + 1];
 
  788      p3[i*3 + 2] = xyz[(k-1)*3 + 2];
 
  793   Int_t npol[2] = { np, 0 }; 
 
  794   Int_t ipol[2] = {  0, 0 }; 
 
  795   if (np == 4 && icodes[2] != 0) {
 
  800      npol[0] = 3;  npol[1] = 3;
 
  801      ipol[0] = 0;  ipol[1] = 2;
 
  805   for (
Int_t kpol = 0; kpol < 2; ++kpol) {
 
  806      if (npol[kpol] == 0) 
continue;
 
  807      Int_t nv = npol[kpol];
 
  808      Int_t iv = ipol[kpol];
 
  820         for (
Int_t it = 0; it < 
fNT; ++it) {
 
  821            x[0] = p1[0] + xdel*
fT[2*it + 0];
 
  822            y[0] = p1[1] + ydel*
fT[2*it + 0];
 
  823            x[1] = p1[0] + xdel*
fT[2*it + 1];
 
  824            y[1] = p1[1] + ydel*
fT[2*it + 1];
 
  825            gPad->PaintPolyLine(2, 
x, 
y);
 
  831   for (
Int_t i = 0; i < np; ++i) {
 
  833      Int_t i2 = (i == np - 1) ? 0 : i1 + 1;
 
  855   if (icodes[2] == 0) {  
 
  867   Double_t p3[3*12] = {0}, ttt[12] = {0};
 
  868   for (
Int_t i = 0; i < np; ++i) {
 
  870      p3[i*3 + 0] = xyz[(k-1)*3 + 0];
 
  871      p3[i*3 + 1] = xyz[(k-1)*3 + 1];
 
  872      p3[i*3 + 2] = xyz[(k-1)*3 + 2];
 
  877   Int_t npol[2] = { np, 0 }; 
 
  878   Int_t ipol[2] = {  0, 0 }; 
 
  879   if (np == 4 && icodes[2] != 0) {
 
  884      npol[0] = 3;  npol[1] = 3;
 
  885      ipol[0] = 0;  ipol[1] = 2;
 
  889   for (
Int_t kpol = 0; kpol < 2; ++kpol) {
 
  890      if (npol[kpol] == 0) 
continue;
 
  891      Int_t nv = npol[kpol];
 
  892      Int_t iv = ipol[kpol];
 
  901         x[0] = p1[0]; 
y[0] = p1[1];
 
  902    x[1] = p2[0]; 
y[1] = p2[1];
 
  903         gPad->PaintPolyLine(2, 
x, 
y);
 
  924   Double_t p3[3*12] = {0}, pp[2*12] = {0};
 
  925   for (
Int_t i = 0; i < np; ++i) {
 
  928      p3[i*3 + 0] = xyz[(k-1)*3 + 0];
 
  929      p3[i*3 + 1] = xyz[(k-1)*3 + 1];
 
  930      p3[i*3 + 2] = xyz[(k-1)*3 + 2];
 
  943   if (icodes[2] == 0) {  
 
  957      for (
Int_t it = 0; it < 
fNT; ++it) {
 
  958         x[0] = p1[0] + xdel*
fT[2*it + 0];
 
  959         y[0] = p1[1] + ydel*
fT[2*it + 0];
 
  960         x[1] = p1[0] + xdel*
fT[2*it + 1];
 
  961         y[1] = p1[1] + ydel*
fT[2*it + 1];
 
  962         gPad->PaintPolyLine(2, 
x, 
y);
 
  967   if (icodes[2] == 0) {  
 
  977   for (
Int_t i = 0; i < np; ++i) {
 
  978      if (iface[i] < 0) 
continue;
 
  980      Int_t i2 = (i == np-1) ? 0 : i + 1;
 
  982      Double_t xdel = pp[2*i2 + 0] - pp[2*i1 + 0];
 
  983      Double_t ydel = pp[2*i2 + 1] - pp[2*i1 + 1];
 
  984      for (
Int_t it = 0; it < 
fNT; ++it) {
 
  985         x[0] = pp[2*i1 + 0] + xdel*
fT[2*it + 0];
 
  986         y[0] = pp[2*i1 + 1] + ydel*
fT[2*it + 0];
 
  987         x[1] = pp[2*i1 + 0] + xdel*
fT[2*it + 1];
 
  988         y[1] = pp[2*i1 + 1] + ydel*
fT[2*it + 1];
 
  989         gPad->PaintPolyLine(2, 
x, 
y);
 
 1014   for (
Int_t i = 0; i < np; ++i) {
 
 1018      view->
WCtoNDC(&xyz[(k-1)*3], p);
 
 1028   for (
Int_t i = 0; i < np; ++i) {
 
 1029      if (iface[i] < 0) 
continue;
 
 1031      Int_t i2 = (i == np-1) ? 0 : i + 1;
 
 1033      Double_t xdel = pp[2*i2 + 0] - pp[2*i1 + 0];
 
 1034      Double_t ydel = pp[2*i2 + 1] - pp[2*i1 + 1];
 
 1035      for (
Int_t it = 0; it < 
fNT; ++it) {
 
 1036         x[0] = pp[2*i1 + 0] + xdel*
fT[2*it + 0];
 
 1037         y[0] = pp[2*i1 + 1] + ydel*
fT[2*it + 0];
 
 1038         x[1] = pp[2*i1 + 0] + xdel*
fT[2*it + 1];
 
 1039         y[1] = pp[2*i1 + 1] + ydel*
fT[2*it + 1];
 
 1040         gPad->PaintPolyLine(2, 
x, 
y);
 
 1061   Int_t ilev, i, k, icol, i1, i2, nl, np;
 
 1072      Error(
"FillPolygon", 
"illegal number of vertices in polygon (%d)", 
n);
 
 1082   if (nl < 0) nl = -nl;
 
 1085   for (i = 2; i <= np; ++i) {
 
 1086      if (fmin > 
f[i]) fmin = 
f[i];
 
 1087      if (fmax < 
f[i]) fmax = 
f[i];
 
 1090   if (fmin < funmin) funmin = fmin - 1;
 
 1092   if (fmax > funmax) funmax = fmax + 1;
 
 1096   for (ilev = 1; ilev <= nl+1; ++ilev) {
 
 1099      if (ilev == nl + 1) f2 = funmax;
 
 1101      if (fmax < 
f1)  
return;
 
 1102      if (fmin > f2)  
continue;
 
 1105      for (i = 1; i <= np; ++i) {
 
 1108         if (i == np) i2 = 1;
 
 1112      if (k < 3) 
continue;
 
 1113      for (i = 1; i <= k; ++i) {
 
 1119         icol=
gPad->GetFillColor();
 
 1126      gPad->PaintFillArea(k, 
x, 
y);
 
 1139      i, j, k, 
n, ibase, t, 
x, 
y, xscan[24]        ,
 
 1141      ib, nb, dx, dy, iw, nx, xx, yy, signdx, nstart, xx1, xx2, nxa, nxb;
 
 1152   for (i = 1; i <= 
n; ++i) {
 
 1163   for (i = 1; i <= 
n; ++i) {
 
 1164      if (
ymin > y1[i - 1])   
ymin = y1[i - 1];
 
 1165      if (
ymax < y1[i - 1])   
ymax = y1[i - 1];
 
 1166      if (y1[i - 1] <= y1[i]) {
x2[i - 1] = 
x1[i]; y2[i - 1] = y1[i];}
 
 1168         x2[i - 1] = 
x1[i - 1];
 
 1169         y2[i - 1] = y1[i - 1];
 
 1175   if (
ymax < 0)        
return;
 
 1179   for (i = 1; i < 
n; ++i) {
 
 1180      if (y1[i] >= y1[i - 1]) 
continue;
 
 1183      for (j = i - 1; j >= 1; --j) {
 
 1184         if (
y < y1[j - 1]) 
continue;
 
 1191      for (j = i; j >= k; --j) {
 
 1204   for (i = 1; i <= 
n; ++i) {
 
 1205      xcur[i - 1] = 
x1[i - 1];
 
 1206      dy = y2[i - 1] - y1[i - 1];
 
 1207      dx = 
x2[i - 1] - 
x1[i - 1];
 
 1209      if (dx < 0)   signdx = -1;
 
 1210      if (dx < 0)   dx = -dx;
 
 1212         t = -(dy + 1) / 2 + dx;
 
 1215            xnex[i - 1] = xcur[i - 1];
 
 1217            test[i - 1] = t - dy;
 
 1218            xnex[i - 1] = xcur[i - 1] + signdx;
 
 1220      } 
else if (dy != 0) {
 
 1221         step = (dx - 1) / (dy + dy) + 1;
 
 1222         test[i - 1] = step*dy - (dx + 1) / 2 - dx;
 
 1223         xnex[i - 1] = xcur[i - 1] + signdx*step;
 
 1229   for (yscan = 
ymin; yscan <= 
ymax; ++yscan) {
 
 1233      for (i = nstart; i <= 
n; ++i) {
 
 1234         if (y1[i - 1] > yscan) 
goto L500;
 
 1235         if (y2[i - 1] <= yscan) {
 
 1236            if (i == nstart)       ++nstart;
 
 1237            if (y2[i - 1] != yscan)
continue;
 
 1239            if (
x2[i - 1] >= xcur[i - 1]) {
 
 1240               xscan[2*nxb - 2] = xcur[i - 1];
 
 1241               xscan[2*nxb - 1] = 
x2[i - 1];
 
 1243               xscan[2*nxb - 2] = 
x2[i - 1];
 
 1244               xscan[2*nxb - 1] = xcur[i - 1];
 
 1252         dy = y2[i - 1] - y1[i - 1];
 
 1253         dx = 
x2[i - 1] - 
x1[i - 1];
 
 1256            xscan[2*nxa - 2] = xcur[i - 1];
 
 1257            xscan[2*nxa - 1] = xnex[i - 1];
 
 1258            if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
 
 1264            xscan[2*nxa - 2] = xnex[i - 1];
 
 1265            xscan[2*nxa - 1] = xcur[i - 1];
 
 1266            if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
 
 1270         xcur[i - 1] = xnex[i - 1];
 
 1273            if (
test[i - 1] < 0) 
continue;
 
 1275            xnex[i - 1] += signdx;
 
 1279         t = 
test[i - 1] + step*dy;
 
 1281            test[i - 1] = t - dx;
 
 1282            xnex[i - 1] += signdx*step;
 
 1284            test[i - 1] = t + dy - dx;
 
 1285            xnex[i - 1] += signdx*(step + 1);
 
 1291      if (yscan < 0) 
continue;
 
 1294         for (i = 1; i < nxa; ++i) {
 
 1295            for (j = i; j >= 1; --j) {
 
 1296               if (xscan[2*j] >= xscan[2*j - 2]) 
continue;
 
 1298               xscan[2*j] = xscan[2*j - 2];
 
 1301               xscan[2*j + 1] = xscan[2*j - 1];
 
 1305         for (i = 1; i <= nxa; i += 2) {
 
 1307            xscan[2*nx - 2] = xscan[2*i - 2];
 
 1309            if (xscan[2*i - 1] > 
x) 
x = xscan[2*i - 1];
 
 1310            xscan[2*nx - 1] = 
x;
 
 1314         for (i = nxb; i <= 
kLmax; ++i) {
 
 1316            xscan[2*nx - 2] = xscan[2*i - 2];
 
 1317            xscan[2*nx - 1] = xscan[2*i - 1];
 
 1322         xx1 = xscan[2*nx - 2];
 
 1323         xx2 = xscan[2*nx - 1];
 
 1327            if ((xscan[2*k - 2] <= xx2 + 1) && (xscan[2*k - 1] >= xx1 - 1)) {
 
 1328               if (xscan[2*k - 2] < xx1)     xx1 = xscan[2*k - 2];
 
 1329               if (xscan[2*k - 1] > xx2)     xx2 = xscan[2*k - 1];
 
 1330               xscan[2*k - 2] = xscan[2*nx - 2];
 
 1331               xscan[2*k - 1] = xscan[2*nx - 1];
 
 1335         if (xx1 < 0)        xx1 = 0;
 
 1337         nbit = xx2 - xx1 + 1;
 
 1340         ib = kbit - iw*30 + 1;
 
 1343         if (nb > nbit) nb = nbit;
 
 1377   for (
Int_t i = 1; i < np; ++i) {
 
 1378      if (t[i] < tmin) tmin = t[i];
 
 1379      if (t[i] > tmax) tmax = t[i];
 
 1385   for (
Int_t il = 1; il <= nl; ++il) {
 
 1386      if (tmin >= 
fFunLevel[il - 1]) 
continue;
 
 1392      for (
Int_t i = 0; i < np; ++i) {
 
 1394         Int_t i2 = (i == np-1) ? 0 : i+1;
 
 1397         if (d1 == 0) d1 = 1
e-99;
 
 1398         if (d2 == 0) d2 = 1
e-99;
 
 1399         if (d1*d2 > 0) 
continue;
 
 1403         d1 /= t[i2] - t[i1];
 
 1404         d2 /= t[i2] - t[i1];
 
 1411         Error(
"FindLevelLines", 
"number of points for line not equal 2");
 
 1444   if (
f1 < fmin)  k1 = -2;
 
 1445   if (
f1 == fmin) k1 = -1;
 
 1446   if (
f1 == fmax) k1 = 1;
 
 1447   if (
f1 > fmax)  k1 = 2;
 
 1449   if (f2 < fmin)  k2 = -2;
 
 1450   if (f2 == fmin) k2 = -1;
 
 1451   if (f2 == fmax) k2 = 1;
 
 1452   if (f2 > fmax)  k2 = 2;
 
 1453   kk = (k1 + 2)*5 + (k2 + 2) + 1;
 
 1488   pp[kpp*3 + 1] = p1[1];
 
 1489   pp[kpp*3 + 2] = p1[2];
 
 1490   pp[kpp*3 + 3] = p1[3];
 
 1496   d1 = (fmin - 
f1) / (
f1 - f2);
 
 1497   d2 = (fmin - f2) / (
f1 - f2);
 
 1498   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
 
 1499   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
 
 1500   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
 
 1506   d1 = (fmax - 
f1) / (
f1 - f2);
 
 1507   d2 = (fmax - f2) / (
f1 - f2);
 
 1508   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
 
 1509   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
 
 1510   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
 
 1516   pp[kpp*3 + 1] = p1[1];
 
 1517   pp[kpp*3 + 2] = p1[2];
 
 1518   pp[kpp*3 + 3] = p1[3];
 
 1520   d1 = (fmin - 
f1) / (
f1 - f2);
 
 1521   d2 = (fmin - f2) / (
f1 - f2);
 
 1522   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
 
 1523   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
 
 1524   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
 
 1530   pp[kpp*3 + 1] = p1[1];
 
 1531   pp[kpp*3 + 2] = p1[2];
 
 1532   pp[kpp*3 + 3] = p1[3];
 
 1534   d1 = (fmax - 
f1) / (
f1 - f2);
 
 1535   d2 = (fmax - f2) / (
f1 - f2);
 
 1536   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
 
 1537   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
 
 1538   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
 
 1544   d1 = (fmin - 
f1) / (
f1 - f2);
 
 1545   d2 = (fmin - f2) / (
f1 - f2);
 
 1546   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
 
 1547   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
 
 1548   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
 
 1550   d1 = (fmax - 
f1) / (
f1 - f2);
 
 1551   d2 = (fmax - f2) / (
f1 - f2);
 
 1552   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
 
 1553   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
 
 1554   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
 
 1560   d1 = (fmax - 
f1) / (
f1 - f2);
 
 1561   d2 = (fmax - f2) / (
f1 - f2);
 
 1562   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
 
 1563   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
 
 1564   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
 
 1566   d1 = (fmin - 
f1) / (
f1 - f2);
 
 1567   d2 = (fmin - f2) / (
f1 - f2);
 
 1568   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
 
 1569   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
 
 1570   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
 
 1582   Int_t i, icase, i1, i2, icase1, icase2, iv, ifback;
 
 1585   Double_t tt, uu, ww, yy, yy1, yy2, yy1d, yy2d;
 
 1597         x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3]  + tn[3];
 
 1598         x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3]  + tn[3];
 
 1599         y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3]  + tn[7];
 
 1600         y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3]  + tn[7];
 
 1601         z1 = tn[8]*r1[1] + tn[9]*r1[2] + tn[10]*r1[3] + tn[11];
 
 1602         z2 = tn[8]*r2[1] + tn[9]*r2[2] + tn[10]*r2[3] + tn[11];
 
 1604         Error(
"FindVisibleDraw", 
"invalid TView in current pad");
 
 1608      Error(
"FindVisibleDraw", 
"no TView in current pad");
 
 1634      dy = (y2 - y1) / di;
 
 1637      for (i = i1; i <= i2 - 1; ++i) {
 
 1638         yy1 = y1 + dy*(i - i1);
 
 1640         yy1u = yy1 - 
fU[2*i - 2];
 
 1641         yy1d = yy1 - 
fD[2*i - 2];
 
 1642         yy2u = yy2 - 
fU[2*i - 1];
 
 1643         yy2d = yy2 - 
fD[2*i - 1];
 
 1647         if (yy1u >  kEpsil) icase1 = 0;
 
 1648         if (yy1d < -kEpsil) icase1 = 2;
 
 1649         if ((icase1 == 0 || icase1 == 2) && iv <= 0) {
 
 1654         if (icase1 == 1 && iv >= 0) {
 
 1660         if (yy2u >  kEpsil) icase2 = 0;
 
 1661         if (yy2d < -kEpsil) icase2 = 2;
 
 1662         icase = icase1*3 + icase2;
 
 1665            fT[2*
fNT - 1] = 
tt + dt*(yy1u / (yy1u - yy2u));
 
 1668            fT[2*
fNT - 1] = 
tt + dt*(yy1u / (yy1u - yy2u));
 
 1670            fT[2*
fNT - 2] = 
tt + dt*(yy1d / (yy1d - yy2d));
 
 1675            fT[2*
fNT - 2] = 
tt + dt*(yy1u / (yy1u - yy2u));
 
 1680            fT[2*
fNT - 2] = 
tt + dt*(yy1d / (yy1d - yy2d));
 
 1683            fT[2*
fNT - 1] = 
tt + dt*(yy1d / (yy1d - yy2d));
 
 1685            fT[2*
fNT - 2] = 
tt + dt*(yy1u / (yy1u - yy2u));
 
 1689            fT[2*
fNT - 1] = 
tt + dt*(yy1d / (yy1d - yy2d));
 
 1691         if (
fNT + 1 >= 100) 
break;
 
 1693      if (iv > 0) 
fT[2*
fNT - 1] = 1;
 
 1701         if (y2 == y1) { 
fNT = 0; 
return;}
 
 1702         ifback = 1 - ifback;
 
 1710         if (uu < 
fU[2*i1 - 3]) uu = 
fU[2*i1 - 3];
 
 1711         if (dd > 
fD[2*i1 - 3]) dd = 
fD[2*i1 - 3];
 
 1714      if (y1 <  uu && y2 >  dd) {
 
 1715         if (y1 >= dd && y2 <= uu) {
fNT = 0; 
return;}
 
 1720            fT[2*
fNT - 1] = (dd - y1) / (y2 - y1);
 
 1724            fT[2*
fNT - 2] = (uu - y1) / (y2 - y1);
 
 1730   if (ifback == 0) 
return;
 
 1731   if (
fNT == 0)    
return;
 
 1732   for (i = 1; i <= 
fNT; ++i) {
 
 1733      fT[2*i - 2] = 1 - 
fT[2*i - 2];
 
 1734      fT[2*i - 1] = 1 - 
fT[2*i - 1];
 
 1752   Int_t i, incrx, ivis, 
x1, y1, 
x2, y2, ib, kb, dx, dy, iw, ix, iy, ifinve, dx2, dy2;
 
 1786   if (
x1 < 0 && 
x2 < 0)               
return;
 
 1798   if (dy > dx) 
goto L200;
 
 1802   ddtt = dt*(float).5;
 
 1807   for (ix = 
x1; incrx < 0 ? ix >= 
x2 : ix <= 
x2; ix += incrx) {
 
 1816      if (iy < 0)        
goto L110;
 
 1818      if (ix < 0)        
goto L110;
 
 1821      ib = kb - iw*30 + 1;
 
 1823      if (ivis > 0)      
continue;
 
 1829      if (ivis == 0) 
continue;
 
 1832      if (nt == ntmax)  
goto L300;
 
 1834   if (ivis > 0) t[2*nt + 2] = tcur + dt + ddtt;
 
 1840   ddtt = dt*(float).5;
 
 1846   for (iy = y1; iy <= y2; ++iy) {
 
 1855      if (iy < 0)        
goto L210;
 
 1856      if (ix < 0)        
goto L210;
 
 1859      ib = kb - iw*30 + 1;
 
 1861      if (ivis > 0) 
continue;
 
 1867      if (ivis == 0) 
continue;
 
 1870      if (nt == ntmax) 
goto L300;
 
 1872   if (ivis > 0) t[2*nt + 2] = tcur + dt;
 
 1876   if (nt == 0) 
return;
 
 1878   if (t[3] <= dt) t[3] = 0;
 
 1879   if (t[2*nt + 2] >= 1 - dt) t[2*nt + 2] = 1;
 
 1880   if (ifinve == 0) 
return;
 
 1881   for (i = 1; i <= nt; ++i) {
 
 1884      t[2*i + 1] = 1 - t2;
 
 1885      t[2*i + 2] = 1 - 
t1;
 
 1901   Int_t incrx[3], incry[3];
 
 1925   if (ixt == 1) incrx[0] = 0;
 
 1930   if (iyt == 1) incry[0] = 0;
 
 1935   for (j = 1; j <= 3; ++j) {
 
 1936      for (i = 1; i <= 3; ++i) {
 
 1937         i1 = ia + incrx[i - 1];
 
 1938         i2 = ib + incry[j - 1];
 
 1944   for (k = 1; k <= 4; ++k) {
 
 1945      for (i = 1; i <= 3; ++i) {
 
 1946         face[i + k*3] = 
f[i + (k + 32)*3 - 52];
 
 1951   for (j = 1; j <= 3; ++j) {
 
 1952      for (i = 1; i <= 3; ++i) {
 
 1953         for (k = 1; k <= 4; ++k) {
 
 1955               phi = 
f[iphi + (k + ((i + j*3) << 2))*3 - 52]*
rad;
 
 1956               r = 
f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
 
 1959               z[k + ((i + j*3) << 2) - 17] = 
f[(k + ((i + j*3) << 2))*3 - 49];
 
 1961               phi = 
f[iphi + (k + ((i + j*3) << 2))*3 - 52]*
rad;
 
 1962               r = 
f[(k + ((i + j*3) << 2))*3 - 49];
 
 1965               z[k + ((i + j*3) << 2) - 17] = 
f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
 
 1967               phi = 
f[iphi + (k + ((i + j*3) << 2))*3 - 52]*
rad;
 
 1968               th = 
f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*
rad;
 
 1969               r = 
f[(k + ((i + j*3) << 2))*3 - 49];
 
 1974               phi = 
f[iphi + (k + ((i + j*3) << 2))*3 - 52]*
rad;
 
 1975               th = 
f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*
rad;
 
 1976               r = 
f[(k + ((i + j*3) << 2))*3 - 49];
 
 1981               x[k + ((i + j*3) << 2) - 17] = 
f[(k + ((i + j*3) << 2))*3 - 51];
 
 1982               y[k + ((i + j*3) << 2) - 17] = 
f[(k + ((i + j*3) << 2))*3 - 50];
 
 1983               z[k + ((i + j*3) << 2) - 17] = 
f[(k + ((i + j*3) << 2))*3 - 49];
 
 1986         x1 = 
x[((i + j*3) << 2) - 14] - 
x[((i + j*3) << 2) - 16];
 
 1987         x2 = 
x[((i + j*3) << 2) - 13] - 
x[((i + j*3) << 2) - 15];
 
 1988         y1 = 
y[((i + j*3) << 2) - 14] - 
y[((i + j*3) << 2) - 16];
 
 1989         y2 = 
y[((i + j*3) << 2) - 13] - 
y[((i + j*3) << 2) - 15];
 
 1990         z1 = z[((i + j*3) << 2) - 14] - z[((i + j*3) << 2) - 16];
 
 1991         z2 = z[((i + j*3) << 2) - 13] - z[((i + j*3) << 2) - 15];
 
 1992         an[(i + j*3)*3 - 12] = y1*z2 - y2*z1;
 
 1993         an[(i + j*3)*3 - 11] = z1*
x2 - z2*
x1;
 
 1994         an[(i + j*3)*3 - 10] = 
x1*y2 - 
x2*y1;
 
 1995         s = 
TMath::Sqrt(an[(i + j*3)*3 - 12]*an[(i + j*3)*3 - 12] + an[
 
 1996                        (i + j*3)*3 - 11]*an[(i + j*3)*3 - 11] + an[(i
 
 1997                        + j*3)*3 - 10]*an[(i + j*3)*3 - 10]);
 
 1999         an[(i + j*3)*3 - 12] /= 
s;
 
 2000         an[(i + j*3)*3 - 11] /= 
s;
 
 2001         an[(i + j*3)*3 - 10] /= 
s;
 
 2006   for (j = 1; j <= 2; ++j) {
 
 2007      for (i = 1; i <= 2; ++i) {
 
 2008         for (k = 1; k <= 3; ++k) {
 
 2009            bn[k + (i + 2*j)*3 - 10] = an[k + (i + j*3)*3 - 13]
 
 2010              + an[k + (i + 1 + j*3)*3 - 13] + an[k + (i + 1 +
 
 2011                          (j + 1)*3)*3 - 13] + an[k + (i + (j + 1)*3)*3 - 13];
 
 2035      fU[2*i + 0] = -VERY_BIG;
 
 2036      fU[2*i + 1] = -VERY_BIG;
 
 2037      fD[2*i + 0] =  VERY_BIG;
 
 2038      fD[2*i + 1] =  VERY_BIG;
 
 2054   Int_t i, j, k, ib, nb;
 
 2064   Int_t buffersize = nx*ny/30 + 1;
 
 2070   for (i = 1; i <= 30; ++i) {
 
 2073      fMask[i - 1] = pow2;
 
 2077   for (nb = 2; nb <= 30; ++nb) {
 
 2078      for (ib = 1; ib <= 30 - nb + 1; ++ib) {
 
 2080         for (i = ib; i <= ib + nb - 1; ++i) k = k | 
fMask[i - 1];
 
 2095   Int_t i, j, ixt, iyt;
 
 2097   Double_t xlab1l, xlab2l, ylab1l, ylab2l;
 
 2163      ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
 
 2164      ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
 
 2165      ab[4] = (ab[4] - yval1l) / (yval2l - yval1l);
 
 2166      ab[8] = (ab[8] - yval1l) / (yval2l - yval1l);
 
 2168      ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
 
 2169      ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
 
 2171      ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
 
 2172      ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
 
 2173      ab[4] = 180*(ab[4] - ylab1l) / (ylab2l - ylab1l);
 
 2174      ab[8] = 180*(ab[8] - ylab1l) / (ylab2l - ylab1l);
 
 2176      ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
 
 2177      ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
 
 2178      ab[4] = (180 - dangle*2)*(ab[4] - ylab1l) / (ylab2l - ylab1l) + dangle;
 
 2179      ab[8] = (180 - dangle*2)*(ab[8] - ylab1l) / (ylab2l - ylab1l) + dangle;
 
 2205   if (stack) nids = stack->
GetSize();
 
 2207      for (i = 2; i <= nids + 1; ++i) {
 
 2216   for (i = 2; i <= nv; ++i) {
 
 2232         if (vv[i] < vv[i - 1]) {
 
 2244      for (i = 1; i <= nv; ++i) {
 
 2245         vv[i] = (1 - rinrad)*((vv[i] - 
Hparam.
zmin) /
 
 2250   for (i = 1; i <= nv; ++i) {
 
 2251      for (j = 1; j <= 4; ++j) t[j + (i << 2)] = vv[i];
 
 2267   Int_t icodes[4], iface[4];
 
 2269   Int_t firstStackNumberDrawn=-1 ;  
 
 2274      Error(
"LegoCartesian", 
"no TView in current pad");
 
 2293   Int_t incrx = (tnorm[8] < 0.) ? -1 : +1;
 
 2294   Int_t incry = (tnorm[9] < 0.) ? -1 : +1;
 
 2295   if (*chopt != 
'B' && *chopt != 
'b') { 
 
 2296     incrx = -incrx; incry = -incry;
 
 2298   Int_t ix1 = (incrx == +1) ? 1 : nx;
 
 2299   Int_t iy1 = (incry == +1) ? 1 : ny;
 
 2300   Int_t ix2 = (incrx == +1) ? nx : 1;
 
 2301   Int_t iy2 = (incry == +1) ? ny : 1;
 
 2305   Int_t ivis[6] = { 0,0,0,0,0,0 };
 
 2307   if (zn < 0) ivis[0] = 1;
 
 2308   if (zn > 0) ivis[2] = 1;
 
 2310   if (zn > 0) ivis[1] = 1;
 
 2311   if (zn < 0) ivis[3] = 1;
 
 2313   if (zn > 0) ivis[5] = 1;
 
 2314   if (zn < 0) ivis[4] = 1;
 
 2319   for (
Int_t iy = iy1; iy != iy2+incry; iy += incry) {
 
 2320      for (
Int_t ix = ix1; ix != ix2+incrx; ix += incrx) {
 
 2321         if (!painter->
IsInside(ix,iy)) 
continue;
 
 2323         if (nv < 2 || nv > vSize) 
continue;
 
 2326            for (
Int_t iv = 1; iv < nv; ++iv) { total_content += 
v[iv]; }
 
 2331         for (
Int_t i = 1; i <= 4; ++i) {
 
 2332            xyz[i*3 - 3] = 
xy[2*i - 2];
 
 2333            xyz[i*3 - 2] = 
xy[2*i - 1];
 
 2334            xyz[(i + 4)*3 - 3] = xyz[i*3 - 3];
 
 2335            xyz[(i + 4)*3 - 2] = xyz[i*3 - 2];
 
 2338         firstStackNumberDrawn = -1;
 
 2339         for (
Int_t iv = 1; iv < nv; ++iv) {
 
 2340            for (
Int_t i = 1; i <= 4; ++i) {
 
 2341               xyz[i*3 - 1] = 
v[iv - 1];
 
 2342               xyz[(i + 4)*3 - 1] = 
v[iv];
 
 2344            if (
v[iv - 1] == 
v[iv]) 
continue;
 
 2346            for (
Int_t i = 1; i <= 4; ++i) {
 
 2347               if (ivis[i - 1] == 0) 
continue;
 
 2356               tface[0] = 
tt[k1 + (iv << 2) - 5];
 
 2357               tface[1] = 
tt[k2 + (iv << 2) - 5];
 
 2358               tface[2] = 
tt[k2 + ((iv + 1) << 2) - 5];
 
 2359               tface[3] = 
tt[k1 + ((iv + 1) << 2) - 5];
 
 2361               (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2363            if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn = 
fEdgeIdx;
 
 2369            for (
Int_t i = 1; i <= 4; ++i) {
 
 2370               xyz[i*3 - 1] = 
v[0];
 
 2371               iface[i - 1] = 5 - i;
 
 2372               tface[i - 1] = 
tt[5 - i - 1];
 
 2379            (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2385            for (
Int_t i = 1; i <= 4; ++i) {
 
 2386               iface[i - 1] = i + 4;
 
 2387               tface[i - 1] = 
tt[i + (nv << 2) - 5];
 
 2392               if ( nv > 2 && (
v[nv-1] == 
v[nv-2])) {
 
 2393                  for (
Int_t iv = nv-1; iv > 2; --iv) {
 
 2394                     if (
v[nv-1] == 
v[iv-1]) {
 
 2401            (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2425   Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
 
 2427   Int_t incrr, k1, k2, ia, ib, ir1, ir2;
 
 2429   Int_t ir, jr, iv, nr, nv, icodes[4];
 
 2433   Int_t firstStackNumberDrawn=-1 ;  
 
 2437      Error(
"LegoPolar", 
"no TView in current pad");
 
 2458      Error(
"LegoPolar", 
"failed to allocate array fAphi[%d]", 
fNaphi);
 
 2463   if (*chopt == 
'B' || *chopt == 
'b') iopt = 1;
 
 2481   if (iordr == 0) ia = nr;
 
 2482   if (iordr != 0) ib = nr;
 
 2483   for (i = 1; i <= nphi; ++i) {
 
 2484      if (iordr == 0) ib = i;
 
 2485      if (iordr != 0) ia = i;
 
 2487      if (i == 1) 
fAphi[0] = ab[jphi - 1];
 
 2488      fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
 
 2489      fAphi[i] = ab[jphi + 3];
 
 2495   for (i = 1; i <= nphi; ++i) {
 
 2506   if (iphi > nphi) 
goto L300;
 
 2511   if (incrr < 0) ir1 = nr;
 
 2514   for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
 
 2515      if (iordr == 0) { ia = ir;   ib = iphi; }
 
 2516      else            { ia = iphi; ib = ir; }
 
 2518      if (nv < 2 || nv > vSize) 
continue;
 
 2521         for (iv = 1; iv < nv; ++iv) total_content += 
v[iv];
 
 2522         if (total_content==0) 
continue;
 
 2526      for (i = 1; i <= 4; ++i) {
 
 2528         if (iordr != 0 && i == 2) j = 4;
 
 2529         if (iordr != 0 && i == 4) j = 2;
 
 2530         xyz[j*3 - 3] = ab[jr + 2*i - 3]*
TMath::Cos(ab[jphi + 2*i - 3]*
kRad);
 
 2531         xyz[j*3 - 2] = ab[jr + 2*i - 3]*
TMath::Sin(ab[jphi + 2*i - 3]*
kRad);
 
 2532         xyz[(j + 4)*3 - 3] = xyz[j*3 - 3];
 
 2533         xyz[(j + 4)*3 - 2] = xyz[j*3 - 2];
 
 2536      firstStackNumberDrawn = -1;
 
 2537      for (iv = 1; iv < nv; ++iv) {
 
 2538         for (i = 1; i <= 4; ++i) {
 
 2539            xyz[i*3 - 1] = 
v[iv - 1];
 
 2540            xyz[(i + 4)*3 - 1] = 
v[iv];
 
 2542         if (
v[iv - 1] >= 
v[iv]) 
continue;
 
 2544         for (i = 1; i <= 4; ++i) {
 
 2545            if (ivis[i - 1] == 0) 
continue;
 
 2549            if (xyz[k1*3 - 3] == xyz[k2*3 - 3] && xyz[k1*3 - 2] ==
 
 2550                xyz[k2*3 - 2]) 
continue;
 
 2555            tface[0] = 
tt[k1 + (iv << 2) - 5];
 
 2556            tface[1] = 
tt[k2 + (iv << 2) - 5];
 
 2557            tface[2] = 
tt[k2 + ((iv + 1) << 2) - 5];
 
 2558            tface[3] = 
tt[k1 + ((iv + 1) << 2) - 5];
 
 2561            (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2563         if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn = 
fEdgeIdx;
 
 2569         for (i = 1; i <= 4; ++i) {
 
 2570            xyz[i*3 - 1] = 
v[0];
 
 2571            iface[i - 1] = 5 - i;
 
 2572            tface[i - 1] = 
tt[5 - i - 1];
 
 2579         (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2585         for (i = 1; i <= 4; ++i) {
 
 2586            iface[i - 1] = i + 4;
 
 2587            tface[i - 1] = 
tt[i + (nv << 2) - 5];
 
 2592            if ( nv > 2 && (
v[nv-1] == 
v[nv-2])) {
 
 2593               for (iv = nv-1; iv>2; iv--) {
 
 2594                  if (
v[nv-1] == 
v[iv-1]) {
 
 2601         (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2608   if (iphi == 0)      iphi = kphi;
 
 2609   if (iphi > kphi)    iphi = 1;
 
 2610   if (iphi != iphi2)  
goto L100;
 
 2641   Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
 
 2644   Int_t ia, ib, idummy, iz1, iz2, nz, incrz, k1, k2, nv;
 
 2645   Int_t iv, iz, jz, icodes[4];
 
 2651   Int_t firstStackNumberDrawn=-1 ;  
 
 2655      Error(
"LegoCylindrical", 
"no TView in current pad");
 
 2676      Error(
"LegoCylindrical", 
"failed to allocate array fAphi[%d]", 
fNaphi);
 
 2681   if (*chopt == 
'B' || *chopt == 
'b') iopt = 1;
 
 2699   if (iordr == 0) ia = nz;
 
 2700   if (iordr != 0) ib = nz;
 
 2701   for (i = 1; i <= nphi; ++i) {
 
 2702      if (iordr == 0) ib = i;
 
 2703      if (iordr != 0) ia = i;
 
 2705      if (i == 1)  
fAphi[0] = ab[jphi - 1];
 
 2706      fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
 
 2707      fAphi[i] = ab[jphi + 3];
 
 2713   for (i = 1; i <= nphi; ++i) {
 
 2714      if (iordr == 0) ib = i;
 
 2715      if (iordr != 0) ia = i;
 
 2724   if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
 
 2734   if (iphi > nphi) 
goto L400;
 
 2738   for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
 
 2739      if (iordr == 0) {ia = iz;   ib = iphi;}
 
 2740      else            {ia = iphi; ib = iz;}
 
 2742      if (nv < 2 || nv > vSize) 
continue;
 
 2745      for (i = 1; i <= 4; ++i) {
 
 2747         if (iordr != 0 && i == 2) j = 4;
 
 2748         if (iordr != 0 && i == 4) j = 2;
 
 2751         xyz[j*3 - 1] = ab[jz + 2*i - 3];
 
 2752         xyz[(j + 4)*3 - 1] = ab[jz + 2*i - 3];
 
 2755      firstStackNumberDrawn = -1;
 
 2756      for (iv = 1; iv < nv; ++iv) {
 
 2757         for (i = 1; i <= 4; ++i) {
 
 2758            xyz[i*3 - 3] = 
v[iv - 1]*cosphi[i - 1];
 
 2759            xyz[i*3 - 2] = 
v[iv - 1]*sinphi[i - 1];
 
 2760            xyz[(i + 4)*3 - 3] = 
v[iv]*cosphi[i - 1];
 
 2761            xyz[(i + 4)*3 - 2] = 
v[iv]*sinphi[i - 1];
 
 2763         if (
v[iv - 1] >= 
v[iv]) 
continue;
 
 2765         for (i = 1; i <= 4; ++i) {
 
 2766            if (ivis[i - 1] == 0) 
continue;
 
 2774            tface[0] = 
tt[k1 + (iv << 2) - 5];
 
 2775            tface[1] = 
tt[k2 + (iv << 2) - 5];
 
 2776            tface[2] = 
tt[k2 + ((iv + 1) << 2) - 5];
 
 2777            tface[3] = 
tt[k1 + ((iv + 1) << 2) - 5];
 
 2780            (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2782         if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn = 
fEdgeIdx;
 
 2785      if (ivis[4] != 0 && 
v[0] > 0) {
 
 2788         for (i = 1; i <= 4; ++i) {
 
 2789            xyz[i*3 - 3] = 
v[0]*cosphi[i - 1];
 
 2790            xyz[i*3 - 2] = 
v[0]*sinphi[i - 1];
 
 2792            tface[i - 1] = 
tt[i - 1];
 
 2799         (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2802      if (ivis[5] != 0 && 
v[nv - 1] > 0) {
 
 2805         for (i = 1; i <= 4; ++i) {
 
 2806            iface[i - 1] = 5 - i + 4;
 
 2807            tface[i - 1] = 
tt[5 - i + (nv << 2) - 5];
 
 2812            if ( nv > 2 && (
v[nv-1] == 
v[nv-2])) {
 
 2813               for (iv = nv-1; iv>2; iv--) {
 
 2814                  if (
v[nv-1] == 
v[iv-1]) {
 
 2821         (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 2828   if (iphi == 0)     iphi = kphi;
 
 2829   if (iphi > kphi)   iphi = 1;
 
 2830   if (iphi != iphi2) 
goto L100;
 
 2860   Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
 
 2863   Int_t k1, k2, ia, ib, incrth, ith, jth, kth, nth, mth, ith1, ith2, nv;
 
 2866   Int_t iv, icodes[4];
 
 2873   Int_t firstStackNumberDrawn=-1 ;  
 
 2877      Error(
"LegoSpherical", 
"no TView in current pad");
 
 2898      Error(
"LegoSpherical", 
"failed to allocate array fAphi[%d]", 
fNaphi);
 
 2903   if (*chopt == 
'B' || *chopt == 
'b') iopt = 1;
 
 2922   if (mth == 0)    mth = 1;
 
 2923   if (iordr == 0) ia = mth;
 
 2924   if (iordr != 0) ib = mth;
 
 2925   for (i = 1; i <= nphi; ++i) {
 
 2926      if (iordr == 0) ib = i;
 
 2927      if (iordr != 0) ia = i;
 
 2929      if (i == 1)  
fAphi[0] = ab[jphi - 1];
 
 2930      fAphi[i - 1] = (
fAphi[i - 1] + ab[jphi - 1]) / (
float)2.;
 
 2931      fAphi[i] = ab[jphi + 3];
 
 2936   if (iordr == 0) ib = 1;
 
 2937   if (iordr != 0) ia = 1;
 
 2938   for (i = 1; i <= nth; ++i) {
 
 2939      if (iordr == 0) ia = i;
 
 2940      if (iordr != 0) ib = i;
 
 2942      if (i == 1) 
fAphi[0] = ab[jth - 1];
 
 2943      fAphi[i - 1] = (
fAphi[i - 1] + ab[jth - 1]) / (
float)2.;
 
 2944      fAphi[i] = ab[jth + 3];
 
 2953   if (iphi > nphi) 
goto L500;
 
 2956   if (!iordr) {ia = mth;        ib = iphi; }
 
 2957   else        {ia = iphi;ib = mth;  }
 
 2959   phi = (ab[jphi - 1] + ab[jphi + 3]) / (
float)2.;
 
 2964   if (ith > nth)   
goto L400;
 
 2965   if (iordr == 0) ia = ith;
 
 2966   if (iordr != 0) ib = ith;
 
 2968   if (nv < 2 || nv > vSize) 
goto L400;
 
 2971   for (i = 1; i <= 6; ++i) ivis[i - 1] = 0;
 
 2973   phi1 = 
kRad*ab[jphi - 1];
 
 2974   phi2 = 
kRad*ab[jphi + 3];
 
 2978   if (zn > 0) ivis[1] = 1;
 
 2980   if (zn > 0) ivis[3] = 1;
 
 2981   phi = (phi1 + phi2) / (
float)2.;
 
 2983   if (zn > 0) ivis[0] = 1;
 
 2985   if (zn > 0) ivis[2] = 1;
 
 2986   th = (
th1 + 
th2) / (
float)2.;
 
 2987   if (ipsdr == 1) th = 
kRad*90;
 
 2989   if (zn < 0) ivis[4] = 1;
 
 2990   if (zn > 0) ivis[5] = 1;
 
 2995   for (i = 1; i <= 4; ++i) {
 
 2997      if (iordr != 0 && i == 2) j = 4;
 
 2998      if (iordr != 0 && i == 4) j = 2;
 
 3004   firstStackNumberDrawn = -1;
 
 3005   for (iv = 1; iv < nv; ++iv) {
 
 3007         for (i = 1; i <= 4; ++i) {
 
 3008            xyz[i*3 - 3] = 
v[iv - 1]*cosphi[i - 1];
 
 3009            xyz[i*3 - 2] = 
v[iv - 1]*sinphi[i - 1];
 
 3010            xyz[i*3 - 1] = 
v[iv - 1]*costh[i - 1] / sinth[i - 1];
 
 3011            xyz[(i + 4)*3 - 3] = 
v[iv]*cosphi[i - 1];
 
 3012            xyz[(i + 4)*3 - 2] = 
v[iv]*sinphi[i - 1];
 
 3013            xyz[(i + 4)*3 - 1] = 
v[iv]*costh[i - 1] / sinth[i - 1];
 
 3016         for (i = 1; i <= 4; ++i) {
 
 3017            xyz[i*3 - 3] = 
v[iv - 1]*sinth[i - 1]*cosphi[i - 1];
 
 3018            xyz[i*3 - 2] = 
v[iv - 1]*sinth[i - 1]*sinphi[i - 1];
 
 3019            xyz[i*3 - 1] = 
v[iv - 1]*costh[i - 1];
 
 3020            xyz[(i + 4)*3 - 3] = 
v[iv]*sinth[i - 1]*cosphi[i - 1];
 
 3021            xyz[(i + 4)*3 - 2] = 
v[iv]*sinth[i - 1]*sinphi[i - 1];
 
 3022            xyz[(i + 4)*3 - 1] = 
v[iv]*costh[i - 1];
 
 3025      if (
v[iv - 1] >= 
v[iv]) 
continue;
 
 3027      for (i = 1; i <= 4; ++i) {
 
 3028         if (ivis[i - 1] == 0) 
continue;
 
 3036         tface[0] = 
tt[k1 + (iv << 2) - 5];
 
 3037         tface[1] = 
tt[k2 + (iv << 2) - 5];
 
 3038         tface[2] = 
tt[k2 + ((iv + 1) << 2) - 5];
 
 3039         tface[3] = 
tt[k1 + ((iv + 1) << 2) - 5];
 
 3042         (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 3044      if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn = 
fEdgeIdx;
 
 3047   if (ivis[4] != 0 && 
v[0] > 0) {
 
 3050      for (i = 1; i <= 4; ++i) {
 
 3052            xyz[i*3 - 3] = 
v[0]*cosphi[i - 1];
 
 3053            xyz[i*3 - 2] = 
v[0]*sinphi[i - 1];
 
 3054            xyz[i*3 - 1] = 
v[0]*costh[i - 1] / sinth[i - 1];
 
 3056            xyz[i*3 - 3] = 
v[0]*sinth[i - 1]*cosphi[i - 1];
 
 3057            xyz[i*3 - 2] = 
v[0]*sinth[i - 1]*sinphi[i - 1];
 
 3058            xyz[i*3 - 1] = 
v[0]*costh[i - 1];
 
 3060         iface[i - 1] = 5 - i;
 
 3061         tface[i - 1] = 
tt[5 - i - 1];
 
 3068      (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 3071   if (ivis[5] != 0 && 
v[nv - 1] > 0) {
 
 3074      for (i = 1; i <= 4; ++i) {
 
 3075         iface[i - 1] = i + 4;
 
 3076         tface[i - 1] = 
tt[i + 4 + 2*nv - 5];
 
 3081         if ( nv > 2 && (
v[nv-1] == 
v[nv-2])) {
 
 3082            for (iv = nv-1; iv>2; iv--) {
 
 3083               if (
v[nv-1] == 
v[iv-1]) {
 
 3090      (this->*
fDrawFace)(icodes, xyz, 4, iface, tface);
 
 3096   if (ith == 0)    ith = kth;
 
 3097   if (ith > kth)   ith = 1;
 
 3098   if (ith != ith2) 
goto L200;
 
 3099   if (incrth == 0) 
goto L500;
 
 3110   if (iphi == 0)     iphi = kphi;
 
 3111   if (iphi > kphi)   iphi = 1;
 
 3112   if (iphi != iphi2) 
goto L100;
 
 3147   if (nl < 0)       
goto L100;
 
 3148   else if (nl == 0) 
goto L200;
 
 3155   for (i = 1; i <= 4; ++i) {
 
 3162      Error(
"LightSource", 
"negative light intensity");
 
 3170   if (nl > 4 || yl < 0) {
 
 3171      Error(
"LightSource", 
"illegal light source number (nl=%d, yl=%f)", nl, yl);
 
 3177      Error(
"LightSource", 
"light source is placed at origin");
 
 3182   fVls[nl*3 - 3] = xscr / 
s;
 
 3183   fVls[nl*3 - 2] = yscr / 
s;
 
 3184   fVls[nl*3 - 1] = zscr / 
s;
 
 3188   if (
fYdl != 0) 
return;
 
 3189   for (i = 1; i <= 4; ++i) {
 
 3190      if (
fYls[i - 1] != 0) 
return;
 
 3217   if (
fLoff != 0) 
return;
 
 3221   s = 
TMath::Sqrt(vn[0]*vn[0] + vn[1]*vn[1] + vn[2]*vn[2]);
 
 3229   for (i = 1; i <= 4; ++i) {
 
 3230      if (
fYls[i - 1] <= 0) 
continue;
 
 3231      vl[0] = 
fVls[i*3 - 3];
 
 3232      vl[1] = 
fVls[i*3 - 2];
 
 3233      vl[2] = 
fVls[i*3 - 1];
 
 3234      cosn = vl[0]*vn[0] + vl[1]*vn[1] + vl[2]*vn[2];
 
 3235      if (cosn < 0) 
continue;
 
 3236      cosr = vn[1]*(vn[2]*vl[1] - vn[1]*vl[2]) - vn[0]*(vn[0]*vl[2]
 
 3237             - vn[2]*vl[0]) + vn[2]*cosn;
 
 3238      if (cosr <= 0) cosr = 0;
 
 3265         x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
 
 3266         x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
 
 3267         y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
 
 3268         y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
 
 3270         Error(
"ModifyScreen", 
"invalid TView in current pad");
 
 3274      Error(
"ModifyScreen", 
"no TView in current pad");
 
 3288   if (i1 == i2) 
return;
 
 3291   dy = (y2 - y1) / (i2 - i1);
 
 3292   for (i = i1; i <= i2 - 1; ++i) {
 
 3293      yy1 = y1 + dy*(i - i1);
 
 3295      if (
fD[2*i - 2] > yy1) 
fD[2*i - 2] = yy1;
 
 3296      if (
fD[2*i - 1] > yy2) 
fD[2*i - 1] = yy2;
 
 3297      if (
fU[2*i - 2] < yy1) 
fU[2*i - 2] = yy1;
 
 3298      if (
fU[2*i - 1] < yy2) 
fU[2*i - 1] = yy2;
 
 3400   Int_t ivis[6], i, k, num;
 
 3404   for (i = 1; i <= 6; ++i) {
 
 3407      if (k < num) 
continue;
 
 3412   if (k == 1) ir = -1;
 
 3439      Error(
"SideVisibilityEncode", 
"no TView in current pad");
 
 3444   if (zn > 0) k += 64;
 
 3445   if (zn < 0) k += 32;
 
 3447   if (zn > 0) k += 16;
 
 3450   phi = (phi1 + phi2) / (
float)2.;
 
 3454   if ((zn <= 0 && iopt == 1) || (zn > 0 && iopt == 2)) ++k;
 
 3471   static const char *where = 
"Spectrum";
 
 3478   if (nl == 0) {
fNlevel = 0; 
return; }
 
 3482      Error(where, 
"fmax (%f) less than fmin (%f)", fmax, fmin);
 
 3486   if (nl < 0 || nl > 256) {
 
 3487      Error(where, 
"illegal number of levels (%d)", nl);
 
 3492      Error(where, 
"initial color index is negative");
 
 3497      Error(where, 
"color index increment must be positive");
 
 3502   const Int_t kMAXCOL = 50;
 
 3503   delf    = (fmax - fmin) / nl;
 
 3505   for (i = 1; i <= nl+1; ++i) {
 
 3526   Int_t iface[4] = { 1,2,3,4 };
 
 3533     Error(
"SurfaceCartesian", 
"no TView in current pad");
 
 3540   Int_t incrx = (tnorm[8] < 0.) ? -1 : +1;
 
 3541   Int_t incry = (tnorm[9] < 0.) ? -1 : +1;
 
 3542   if (*chopt != 
'B' && *chopt != 
'b') { 
 
 3543      incrx = -incrx; incry = -incry;
 
 3545   Int_t ix1 = (incrx == +1) ? 1 : nx;
 
 3546   Int_t iy1 = (incry == +1) ? 1 : ny;
 
 3547   Int_t ix2 = (incrx == +1) ? nx : 1;
 
 3548   Int_t iy2 = (incry == +1) ? ny : 1;
 
 3552   for (
Int_t iy = iy1; iy != iy2+incry; iy += incry) {
 
 3553      for (
Int_t ix = ix1; ix != ix2+incrx; ix += incrx) {
 
 3554         if (!painter->
IsInside(ix,iy)) 
continue;
 
 3556         for (
Int_t i = 0; i < 4; ++i) {
 
 3557            xyz[i*3 + 0] = 
f[i*3 + 0];
 
 3558            xyz[i*3 + 1] = 
f[i*3 + 1];
 
 3559            xyz[i*3 + 2] = 
f[i*3 + 2];
 
 3594   static Int_t ixadd[4] = { 0,1,1,0 };
 
 3595   static Int_t iyadd[4] = { 0,0,1,1 };
 
 3600   Double_t xlab1l, xlab2l, ylab1l, ylab2l;
 
 3601   Int_t i, ixa, iya, icx, ixt, iyt;
 
 3634   for (i = 1; i <= 4; ++i) {
 
 3655         f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
 
 3656         f[i*3 + 2] = (
f[i*3 + 2] - yval1l) / (yval2l - yval1l);
 
 3658         f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
 
 3660         f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
 
 3661         f[i*3 + 2] = 360*(
f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l);
 
 3663         f[i*3 + 1] = 360*(
f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
 
 3664         f[i*3 + 2] = (180 - dangle*2)*(
f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l) + dangle;
 
 3687      t[i] = 
f[i * 3 + 3];
 
 3692      for (i = 1; i <= 4; ++i) 
f[i * 3 + 3] = 
fRmax[2];
 
 3696      for (i = 1; i <= 4; ++i) {
 
 3697         f[i*3 + 3] = (1 - rinrad)*((
f[i*3 + 3] - 
Hparam.
zmin) /
 
 3716   static Int_t iface[4] = { 1,2,3,4 };
 
 3721      Error(
"SurfacePolar", 
"no TView in current pad");
 
 3725   Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
 
 3727   Int_t i, j, incrr, ir1, ir2;
 
 3729   Int_t ia, ib, ir, jr, nr, icodes[3];  
 
 3751      Error(
"SurfacePolar", 
"failed to allocate array fAphi[%d]", 
fNaphi);
 
 3756   if (*chopt == 
'B' || *chopt == 
'b') iopt = 1;
 
 3761   if (iordr == 0) ia = nr;
 
 3762   if (iordr != 0) ib = nr;
 
 3763   for (i = 1; i <= nphi; ++i) {
 
 3764      if (iordr == 0) ib = i;
 
 3765      if (iordr != 0) ia = i;
 
 3767      if (i == 1) 
fAphi[0] = 
f[jphi - 1];
 
 3768      fAphi[i - 1] = (
fAphi[i - 1] + 
f[jphi - 1]) / (
float)2.;
 
 3779   if (iphi > nphi) 
goto L300;
 
 3782   if (iordr == 0) {ia = nr;         ib = iphi;}
 
 3783   else            {ia = iphi;ib = nr;}
 
 3786   phi = 
kRad*((
f[jphi - 1] + 
f[jphi + 5]) / 2);
 
 3790   if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
 
 3796   for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
 
 3797      if (iordr == 0) ia = ir;
 
 3798      if (iordr != 0) ib = ir;
 
 3801      for (i = 1; i <= 4; ++i) {
 
 3803         if (iordr != 0 && i == 2) j = 4;
 
 3804         if (iordr != 0 && i == 4) j = 2;
 
 3807         xyz[j*3 - 1] = 
f[i*3 - 1];
 
 3808         ttt[j - 1] = 
tt[i - 1];
 
 3812      (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
 
 3817   if (iphi == 0)     iphi = kphi;
 
 3818   if (iphi > kphi)   iphi = 1;
 
 3819   if (iphi != iphi2) 
goto L100;
 
 3820   if (incr == 0) 
return;
 
 3845   static Int_t iface[4] = { 1,2,3,4 };
 
 3847   Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
 
 3848   Int_t i, j, incrz, nz, iz1, iz2;
 
 3849   Int_t ia, ib, iz, jz, icodes[3];  
 
 3859      Error(
"SurfaceCylindrical", 
"no TView in current pad");
 
 3880      Error(
"SurfaceCylindrical", 
"failed to allocate array fAphi[%d]", 
fNaphi);
 
 3885   if (*chopt == 
'B' || *chopt == 
'b') iopt = 1;
 
 3890   if (iordr == 0) ia = nz;
 
 3891   if (iordr != 0) ib = nz;
 
 3892   for (i = 1; i <= nphi; ++i) {
 
 3893      if (iordr == 0) ib = i;
 
 3894      if (iordr != 0) ia = i;
 
 3896      if (i == 1) 
fAphi[0] = 
f[jphi - 1];
 
 3897      fAphi[i - 1] = (
fAphi[i - 1] + 
f[jphi - 1]) / (
float)2.;
 
 3906   if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
 
 3918   if (iphi > nphi) 
goto L400;
 
 3919   for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
 
 3920      if (iordr == 0) {ia = iz;   ib = iphi;}
 
 3921      else             {ia = iphi; ib = iz;}
 
 3923      for (i = 1; i <= 4; ++i) {
 
 3925         if (iordr == 0 && i == 2) j = 4;
 
 3926         if (iordr == 0 && i == 4) j = 2;
 
 3929         xyz[j*3 - 1] = 
f[jz + i*3 - 4];
 
 3930         ttt[j - 1] = 
tt[i - 1];
 
 3934      (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
 
 3939   if (iphi == 0)     iphi = kphi;
 
 3940   if (iphi > kphi)   iphi = 1;
 
 3941   if (iphi != iphi2) 
goto L100;
 
 3942   if (incr ==  0) 
return;
 
 3966   static Int_t iface[4] = { 1,2,3,4 };
 
 3968   Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
 
 3969   Int_t i, j, incrth, ith, jth, kth, nth, mth, ith1, ith2;
 
 3970   Int_t ia, ib, icodes[3];  
 
 3980      Error(
"SurfaceSpherical", 
"no TView in current pad");
 
 4001      Error(
"SurfaceSpherical", 
"failed to allocate array fAphi[%d]", 
fNaphi);
 
 4006   if (*chopt == 
'B' || *chopt == 
'b') iopt = 1;
 
 4012   if (mth == 0)    mth = 1;
 
 4013   if (iordr == 0) ia = mth;
 
 4014   if (iordr != 0) ib = mth;
 
 4015   for (i = 1; i <= nphi; ++i) {
 
 4016      if (iordr == 0) ib = i;
 
 4017      if (iordr != 0) ia = i;
 
 4019      if (i == 1) 
fAphi[0] = 
f[jphi - 1];
 
 4020      fAphi[i - 1] = (
fAphi[i - 1] + 
f[jphi - 1]) / (
float)2.;
 
 4026   if (iordr == 0) ib = 1;
 
 4027   if (iordr != 0) ia = 1;
 
 4028   for (i = 1; i <= nth; ++i) {
 
 4029      if (iordr == 0) ia = i;
 
 4030      if (iordr != 0) ib = i;
 
 4033      if (i == 1) 
fAphi[0] = 
f[jth - 1];
 
 4034      fAphi[i - 1] = (
fAphi[i - 1] + 
f[jth - 1]) / (
float)2.;
 
 4045   if (iphi > nphi) 
goto L500;
 
 4048   if (iordr == 0) {ia = mth; ib = iphi;}
 
 4049   else             {ia = iphi;ib = mth;}
 
 4052   phi = (
f[jphi - 1] + 
f[jphi + 5]) / (
float)2.;
 
 4057   if (ith > nth)   
goto L400;
 
 4058   if (iordr == 0) ia = ith;
 
 4059   if (iordr != 0) ib = ith;
 
 4063      for (i = 1; i <= 4; ++i) {
 
 4065         if (iordr != 0 && i == 2) j = 4;
 
 4066         if (iordr != 0 && i == 4) j = 2;
 
 4071         ttt[j - 1] = 
tt[i - 1];
 
 4074      for (i = 1; i <= 4; ++i) {
 
 4076         if (iordr != 0 && i == 2) j = 4;
 
 4077         if (iordr != 0 && i == 4) j = 2;
 
 4081         ttt[j - 1] = 
tt[i - 1];
 
 4086   (this->*
fDrawFace)(icodes, xyz, 4, iface, ttt);
 
 4090   if (ith == 0)    ith = kth;
 
 4091   if (ith > kth)   ith = 1;
 
 4092   if (ith != ith2) 
goto L200;
 
 4093   if (incrth == 0)  
goto L500;
 
 4104   if (iphi == 0)     iphi = kphi;
 
 4105   if (iphi > kphi)   iphi = 1;
 
 4106   if (iphi != iphi2) 
goto L100;
 
 4107   if (incr == 0) 
return;
 
 4132   if (qqa < 0 || qqa > 1 || qqd < 0 || qqd > 1 || qqs < 0 || qqs > 1 || nnqs < 1) {
 
 4133      Error(
"SurfaceProperty", 
"error in coefficients");
 
 4160   Int_t ix1,   iy1,   iz1;
 
 4161   Int_t ix2,   iy2,   iz2;
 
 4162   Int_t incr,  incrx, incry, incrz;
 
 4163   Int_t icodes[3], i, i1, i2, k, nnod, ntria;
 
 4166   Double_t p[8][3], pf[8], pn[8][3], t[3], fsurf, w;
 
 4175      Error(
"ImplicitFunction", 
"no TView in current pad");
 
 4182   if (*chopt == 
'B' || *chopt == 
'b') {
 
 4191   if (tnorm[8]  < 0.) incrx =-incrx;
 
 4192   if (tnorm[9]  < 0.) incry =-incry;
 
 4193   if (tnorm[10] < 0.) incrz =-incrz;
 
 4197   if (incrx == -1) ix1 = nx;
 
 4198   if (incry == -1) iy1 = ny;
 
 4199   if (incrz == -1) iz1 = nz;
 
 4203   dx  = (rmax[0]-rmin[0]) / nx;
 
 4204   dy  = (rmax[1]-rmin[1]) / ny;
 
 4205   dz  = (rmax[2]-rmin[2]) / nz;
 
 4208   Float_t r=0., 
g=0., 
b=0., hue, light, satur, light2;
 
 4218      light2 = 1-.5*light;
 
 4229   for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
 
 4230      z1     = (iz-1)*dz + rmin[2];
 
 4240      for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
 
 4241         y1      = (iy-1)*dy + rmin[1];
 
 4264         for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
 
 4291            if (pf[0] >= -
kFdel) 
goto L110;
 
 4292            if (pf[1] >= -
kFdel) 
goto L120;
 
 4293            if (pf[2] >= -
kFdel) 
goto L120;
 
 4294            if (pf[3] >= -
kFdel) 
goto L120;
 
 4295            if (pf[4] >= -
kFdel) 
goto L120;
 
 4296            if (pf[5] >= -
kFdel) 
goto L120;
 
 4297            if (pf[6] >= -
kFdel) 
goto L120;
 
 4298            if (pf[7] >= -
kFdel) 
goto L120;
 
 4301            if (pf[1] < -
kFdel) 
goto L120;
 
 4302            if (pf[2] < -
kFdel) 
goto L120;
 
 4303            if (pf[3] < -
kFdel) 
goto L120;
 
 4304            if (pf[4] < -
kFdel) 
goto L120;
 
 4305            if (pf[5] < -
kFdel) 
goto L120;
 
 4306            if (pf[6] < -
kFdel) 
goto L120;
 
 4307            if (pf[7] < -
kFdel) 
goto L120;
 
 4322               pn[0][0] = (pf[1] - pf[0]) / dx;
 
 4323               pn[3][0] = (pf[2] - pf[3]) / dx;
 
 4324               pn[4][0] = (pf[5] - pf[4]) / dx;
 
 4325               pn[7][0] = (pf[6] - pf[7]) / dx;
 
 4333               pn[1][0] = (pf[1] - pf[0]) / dx;
 
 4334               pn[2][0] = (pf[2] - pf[3]) / dx;
 
 4335               pn[5][0] = (pf[5] - pf[4]) / dx;
 
 4336               pn[6][0] = (pf[6] - pf[7]) / dx;
 
 4345               pn[0][1] = (pf[3] - pf[0]) / dy;
 
 4346               pn[1][1] = (pf[2] - pf[1]) / dy;
 
 4347               pn[4][1] = (pf[7] - pf[4]) / dy;
 
 4348               pn[5][1] = (pf[6] - pf[5]) / dy;
 
 4356               pn[2][1] = (pf[2] - pf[1]) / dy;
 
 4357               pn[3][1] = (pf[3] - pf[0]) / dy;
 
 4358               pn[6][1] = (pf[6] - pf[5]) / dy;
 
 4359               pn[7][1] = (pf[7] - pf[4]) / dy;
 
 4368               pn[0][2] = (pf[4] - pf[0]) / dz;
 
 4369               pn[1][2] = (pf[5] - pf[1]) / dz;
 
 4370               pn[2][2] = (pf[6] - pf[2]) / dz;
 
 4371               pn[3][2] = (pf[7] - pf[3]) / dz;
 
 4379               pn[4][2] = (pf[4] - pf[0]) / dz;
 
 4380               pn[5][2] = (pf[5] - pf[1]) / dz;
 
 4381               pn[6][2] = (pf[6] - pf[2]) / dz;
 
 4382               pn[7][2] = (pf[7] - pf[3]) / dz;
 
 4390            MarchingCube(fsurf, p, pf, pn, nnod, ntria, xyz, grad, itria);
 
 4391            if (ntria == 0)   
goto L510;
 
 4393            for ( i=1 ; i<=nnod ; i++ ) {
 
 4394               view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
 
 4398            ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
 
 4399            if (ntria == 0)   
goto L510;
 
 4401            if (*chopt == 
'B' || *chopt == 
'b') incr =-1;
 
 4403            if (incr == -1) i1 = ntria;
 
 4404            i2 = ntria - i1 + 1;
 
 4410            for (i=i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
 
 4446   static Int_t irota[24][8] = { { 1,2,3,4,5,6,7,8 }, { 2,3,4,1,6,7,8,5 },
 
 4447                                 { 3,4,1,2,7,8,5,6 }, { 4,1,2,3,8,5,6,7 },
 
 4448                                 { 6,5,8,7,2,1,4,3 }, { 5,8,7,6,1,4,3,2 },
 
 4449                                 { 8,7,6,5,4,3,2,1 }, { 7,6,5,8,3,2,1,4 },
 
 4450                                 { 2,6,7,3,1,5,8,4 }, { 6,7,3,2,5,8,4,1 },
 
 4451                                 { 7,3,2,6,8,4,1,5 }, { 3,2,6,7,4,1,5,8 },
 
 4452                                 { 5,1,4,8,6,2,3,7 }, { 1,4,8,5,2,3,7,6 },
 
 4453                                 { 4,8,5,1,3,7,6,2 }, { 8,5,1,4,7,6,2,3 },
 
 4454                                 { 5,6,2,1,8,7,3,4 }, { 6,2,1,5,7,3,4,8 },
 
 4455                                 { 2,1,5,6,3,4,8,7 }, { 1,5,6,2,4,8,7,3 },
 
 4456                                 { 4,3,7,8,1,2,6,5 }, { 3,7,8,4,2,6,5,1 },
 
 4457                                 { 7,8,4,3,6,5,1,2 }, { 8,4,3,7,5,1,2,6 } };
 
 4459   static Int_t iwhat[21] = { 1,3,5,65,50,67,74,51,177,105,113,58,165,178,
 
 4460                              254,252,250,190,205,188,181 };
 
 4461   Int_t j, i, i1, i2, i3, ir, irt=0, k, k1, k2, incr, icase=0, 
n;
 
 4468   for ( i=1; i<=8 ; i++) {
 
 4469      fF8[i-1] = 
f[i-1] - fiso;
 
 4471   for ( ir=1 ; ir<=24 ; ir++ ) {
 
 4474      for ( i=1 ; i<=8 ; i++ ) {
 
 4475         if (
fF8[irota[ir-1][i-1]-1] >= 0.) k = k + incr;
 
 4478      if (k==0 || k==255) 
return;
 
 4479      for ( i=1 ; i<=21 ; i++ ) {
 
 4480         if (k != iwhat[i-1]) 
continue;
 
 4489   for ( i=1 ; i<=8 ; i++ ) {
 
 4490      k        = irota[irt-1][i-1];
 
 4491      fF8[i-1] = 
f[k-1] - fiso;
 
 4492      fP8[i-1][0] = p[k-1][0];
 
 4493      fP8[i-1][1] = p[k-1][1];
 
 4494      fP8[i-1][2] = p[k-1][2];
 
 4495      fG8[i-1][0] = 
g[k-1][0];
 
 4496      fG8[i-1][1] = 
g[k-1][1];
 
 4497      fG8[i-1][2] = 
g[k-1][2];
 
 4502   switch ((
int)icase) {
 
 4505         MarchingCubeCase00(1, 4, 9, 0, 0, 0, nnod, ntria, xyz, grad, itria);
 
 4509         MarchingCubeCase00(2, 4, 9, 10, 0, 0, nnod, ntria, xyz, grad, itria);
 
 4521         MarchingCubeCase00(6, 2, 1, 9, 8, 0, nnod, ntria, xyz, grad, itria);
 
 4532         MarchingCubeCase00(2, 4, 8, 6, 0, 0, nnod, ntria, xyz, grad, itria);
 
 4535         MarchingCubeCase00(1, 4, 12, 7, 6, 10, nnod, ntria, xyz, grad, itria);
 
 4541         MarchingCubeCase00(1, 4, 8, 7, 11, 10, nnod, ntria, xyz, grad, itria);
 
 4550         MarchingCubeCase00(1, 9, 12, 7, 6, 2, nnod, ntria, xyz, grad, itria);
 
 4556   if (ntria == 0) 
return;
 
 4557   if (icase <= 14) 
goto L500;
 
 4558   for ( i=1; i<=ntria ; i++ ) {
 
 4562      if (itria[i-1][2] < 0) i1 =-i1;
 
 4563      if (itria[i-1][1] < 0) i3 =-i3;
 
 4564      if (itria[i-1][0] < 0) i2 =-i2;
 
 4574   if (
n > ntria) 
return;
 
 4575   for ( i=1 ; i<=3 ; i++ ) {
 
 4578      if (i2 == 4) i2 = 1;
 
 4585      if (i3 == 0) i3 = 3;
 
 4592   for ( i=1 ; i<=3 ; i++ ) {
 
 4593      itr[i-1] = itria[
n-1][i-1];
 
 4594      itria[
n-1][i-1] = itria[ntria-1][i-1];
 
 4597   if (ntria == 0) 
return;
 
 4598   if (itr[i2-1]*itr[i3-1] > 0) 
goto L510;
 
 4601   if (itr[i2-1] < 0) {
 
 4605   if (itr[i3-1] < 0) {
 
 4609   for ( j=1 ; j<=ntria ; j++ ) {
 
 4610      for ( i=1 ; i<=3 ; i++ ) {
 
 4611         if (itria[j-1][i-1] != k2) 
continue;
 
 4614         if (i2 == k1) itria[j-1][i-1] =-itria[j-1][i-1];
 
 4635   static Int_t it[4][4][3] = { { { 1,2, 3 }, { 0,0, 0 }, { 0,0, 0 }, { 0,0, 0 } },
 
 4636                                { { 1,2,-3 }, {-1,3, 4 }, { 0,0, 0 }, { 0,0, 0 } },
 
 4637                                { { 1,2,-3 }, {-1,3,-4 }, {-1,4, 5 }, { 0,0, 0 } },
 
 4638                                { { 1,2,-3 }, {-1,3,-4 }, {-4,6,-1 }, { 4,5,-6 } }
 
 4640   Int_t it2[4][3], i, j;
 
 4652   if (ie[5] == 0) nnod = 5;
 
 4653   if (ie[4] == 0) nnod = 4;
 
 4654   if (ie[3] == 0) nnod = 3;
 
 4660   for ( i=0; i<3 ; i++) {
 
 4661      for ( j=0; j<4 ; j++) {
 
 4662         it2[j][i] = it[ntria-1][j][i];
 
 4675   static Int_t ie[6]     = { 4,9,1, 2,11,3 };
 
 4676   static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
 
 4677   static Int_t it2[4][3] = { { 1,2,-5 }, { -1,5,6 }, { 5,-2,4 }, { -4,2,3 } };
 
 4685   if (f0>=0. && 
fF8[0]>=0.) 
goto L100;
 
 4686   if (f0<0. && 
fF8[0]<0.) 
goto L100;
 
 4704   static Int_t ie[6]     = { 4,9,1, 7,11,6 };
 
 4705   static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
 
 4706   static Int_t it2[6][3] = { { 1,2,4 }, { 2,3,6 }, { 3,1,5 },
 
 4707                              { 4,5,1 }, { 5,6,3 }, { 6,4,2 } };
 
 4734   static Int_t ie[7]     = { 2,4,9,10, 6,7,11 };
 
 4735   static Int_t it1[5][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 } };
 
 4736   static Int_t it2[3][3] = { { 1,2,-3 }, { -1,3,4 }, { 5,6,7 } };
 
 4737   static Int_t it3[7][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 },
 
 4738                              { 1,7,-5 }, { -1,5,4 } };
 
 4746   if (f0>=0. && 
fF8[1]>=0.) 
goto L100;
 
 4747   if (f0<0. && 
fF8[1]<0.) 
goto L100;
 
 4776   static Int_t ie[9] = { 3,12,4, 1,10,2, 11,6,7 };
 
 4777   static Int_t it[9][9][3] = {
 
 4778   {{  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}},
 
 4779   {{  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}},
 
 4780   {{  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}},
 
 4781   {{-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}},
 
 4782   {{  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}},
 
 4783   {{-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}},
 
 4784   {{ 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}},
 
 4785   {{  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}},
 
 4786   {{ -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}}
 
 4789   Int_t it2[9][3], i, j;
 
 4800   if (
f1>=0. && 
fF8[2] <0.) icase = icase + 1;
 
 4801   if (
f1 <0. && 
fF8[2]>=0.) icase = icase + 1;
 
 4802   if (f2>=0. && 
fF8[2] <0.) icase = icase + 2;
 
 4803   if (f2 <0. && 
fF8[2]>=0.) icase = icase + 2;
 
 4804   if (f3>=0. && 
fF8[2] <0.) icase = icase + 4;
 
 4805   if (f3 <0. && 
fF8[2]>=0.) icase = icase + 4;
 
 4808   switch ((
int)icase) {
 
 4829   for ( i=0; i<3 ; i++) {
 
 4830      for ( j=0; j<9 ; j++) {
 
 4831         it2[j][i] = it[icase-1][j][i];
 
 4841   if (irep != 2) 
goto L400;
 
 4848   for ( i=0; i<3 ; i++) {
 
 4849      for ( j=0; j<9 ; j++) {
 
 4850         it2[j][i] = it[icase-1][j][i];
 
 4864   static Int_t ie[8] = { 1,3,12,9, 5,7,11,10 };
 
 4865   static Int_t it[6][8][3] = {
 
 4866   {{1,2,-3}, {-1,3,4}, {5,6,-7}, {-5,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
 
 4867   {{ 9,1,2}, { 9,2,3}, { 9,3,4}, { 9,4,5}, { 9,5,6}, { 9,6,7}, { 9,7,8}, { 9,8,1}},
 
 4868   {{ 9,1,2}, { 9,4,1}, { 9,3,4}, { 9,6,3}, { 9,5,6}, { 9,8,5}, { 9,7,8}, { 9,2,7}},
 
 4869   {{1,2,-7}, {-1,7,8}, {5,6,-3}, {-5,3,4}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
 
 4870   {{1,2,-7}, {-1,7,8}, {2,3,-6}, {-2,6,7}, {3,4,-5}, {-3,5,6}, {4,1,-8}, {-4,8,5}},
 
 4871   {{1,2,-3}, {-1,3,4}, {2,7,-6}, {-2,6,3}, {7,8,-5}, {-7,5,6}, {8,1,-4}, {-8,4,5}}
 
 4873   Int_t it2[8][3], i, j;
 
 4883   if (
f1 >= 0.) icase = icase + 1;
 
 4884   if (f2 >= 0.) icase = icase + 2;
 
 4885   if (icase==1 || icase==4) 
goto L100;
 
 4891   for ( i=0; i<3 ; i++) {
 
 4892      for ( j=0; j<8 ; j++) {
 
 4893         it2[j][i] = it[icase-1][j][i];
 
 4904   if (irep == 0) 
goto L200;
 
 4907   if (icase == 1) icase = 5;
 
 4908   if (icase == 4) icase = 6;
 
 4913   for ( i=0; i<3 ; i++) {
 
 4914      for ( j=0; j<8 ; j++) {
 
 4915         it2[j][i] = it[icase-1][j][i];
 
 4929   static Int_t ie[8] = { 3,12,4, 1,9,8,6,2 };
 
 4930   static Int_t it[6][8][3] = {
 
 4931   {{ 1,2,3},  {4,5,-6}, {-4,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
 
 4932   {{-9,1,2},  {9,2,-3}, {-9,3,4}, {9,4,-5}, {-9,5,6}, {9,6,-7}, {-9,7,8}, {9,8,-1}},
 
 4933   {{9,1,-2},  {-9,2,6}, {9,6,-7}, {-9,7,8}, {9,8,-4}, {-9,4,5}, {9,5,-3}, {-9,3,1}},
 
 4934   {{ 3,4,5},  {1,2,-6}, {-1,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
 
 4935   {{ 7,8,6},  {6,8,-1}, {-6,1,2}, {3,1,-8}, {-3,8,4}, { 3,4,5}, {3,5,-6}, {-3,6,2}},
 
 4936   {{ 7,8,6},  {6,8,-4}, {-6,4,5}, {3,4,-8}, {-3,8,1}, { 3,1,2}, {3,2,-6}, {-3,6,5}}
 
 4938   Int_t it2[8][3], i, j;
 
 4948   if (
f1 >= 0.) icase = icase + 1;
 
 4949   if (f2 >= 0.) icase = icase + 2;
 
 4950   if (icase==1 || icase==4) 
goto L100;
 
 4956   for ( i=0; i<3 ; i++) {
 
 4957      for ( j=0; j<8 ; j++) {
 
 4958         it2[j][i] = it[icase-1][j][i];
 
 4969   if (irep != 1) 
goto L200;
 
 4972   if (icase == 1) icase = 5;
 
 4973   if (icase == 4) icase = 6;
 
 4978   for ( i=0; i<3 ; i++) {
 
 4979      for ( j=0; j<8 ; j++) {
 
 4980         it2[j][i] = it[icase-1][j][i];
 
 4994   Int_t nr, nf, i, k, incr, 
n, kr, icase, irep;
 
 4995   static Int_t irota[12][8] = {
 
 4996         {1,2,3,4,5,6,7,8}, {1,5,6,2,4,8,7,3}, {1,4,8,5,2,3,7,6},
 
 4997         {3,7,8,4,2,6,5,1}, {3,2,6,7,4,1,5,8}, {3,4,1,2,7,8,5,6},
 
 4998         {6,7,3,2,5,8,4,1}, {6,5,8,7,2,1,4,3}, {6,2,1,5,7,3,4,8},
 
 4999         {8,4,3,7,5,1,2,6}, {8,5,1,4,7,6,2,3}, {8,7,6,5,4,3,2,1} };
 
 5000   static Int_t iwhat[8] = { 63,62,54,26,50,9,1,0 };
 
 5001   static Int_t ie[12] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
 
 5002   static Int_t iface[6][4] = {
 
 5003         {1,2,3,4}, {5,6,7,8}, {1,2,6,5}, {2,6,7,3}, {4,3,7,8}, {1,5,8,4} };
 
 5004   static Int_t it1[4][3] = { {1,2,10}, {9,5,8}, {6,11,7}, {3,4,12} };
 
 5005   static Int_t it2[4][3] = { {5,6,10}, {1,4,9}, {2,11,3}, {7,8,12} };
 
 5006   static Int_t it3[6][3] = { {10,12,-3}, {-10,3,2}, {12,10,-1}, {-12,1,4},
 
 5007         {9,5,8}, {6,11,7} };
 
 5008   static Int_t it4[6][3] = { {11,9,-1}, {-11,1,2}, {9,11,-3}, {-9,3,4},
 
 5009         {5,6,10}, {7,8,12} };
 
 5010   static Int_t it5[10][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
 
 5011         {13,10,1}, {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2}, {5,8,9} };
 
 5012   static Int_t it6[10][3] = { {13,2,-10}, {-13,10,5}, {13,5,-6}, {-13,6,11},
 
 5013         {13,11,3}, {13,3,-4}, {-13,4,9}, {13,9,-1}, {-13,1,2}, {12,7,8} };
 
 5014   static Int_t it7[12][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
 
 5015         {13,10,-5}, {-13,5,8}, {13,8,-9}, {-13,9,1},
 
 5016         {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2} };
 
 5017   static Int_t it8[6][3] = { {3,8,12}, {3,-2,-8}, {-2,5,-8}, {2,10,-5},
 
 5018         {7,6,11}, {1,4,9} };
 
 5019   static Int_t it9[10][3] = { {7,12,-3}, {-7,3,11}, {11,3,2}, {6,11,-2}, {-6,2,10},
 
 5020         {6,10,5}, {7,6,-5}, {-7,5,8}, {7,8,12}, {1,4,9} };
 
 5021   static Int_t it10[10][3] = { {9,1,-10}, {-9,10,5}, {9,5,8}, {4,9,-8}, {-4,8,12},
 
 5022         {4,12,3}, {1,4,-3}, {-1,3,2}, {1,2,10}, {7,6,11} };
 
 5028   for ( nr=1 ; nr<=12 ; nr++ ) {
 
 5031      for ( nf=1 ; nf<=6 ; nf++ ) {
 
 5032         f1 = 
fF8[irota[nr-1][iface[nf-1][0]-1]-1];
 
 5033         f2 = 
fF8[irota[nr-1][iface[nf-1][1]-1]-1];
 
 5034         f3 = 
fF8[irota[nr-1][iface[nf-1][2]-1]-1];
 
 5035         f4 = 
fF8[irota[nr-1][iface[nf-1][3]-1]-1];
 
 5036         if ((
f1*f3-f2*f4)/(
f1+f3-f2-f4) >= 0.) k = k + incr;
 
 5039      for ( i=1 ; i<=8 ; i++ ) {
 
 5040         if (k != iwhat[i-1]) 
continue;
 
 5046   Error(
"MarchingCubeCase13", 
"configuration is not found");
 
 5051   if (icase==1 || icase==8) 
goto L300;
 
 5052   for ( 
n=1 ; 
n<=8 ; 
n++) {
 
 5053      k = irota[kr-1][
n-1];
 
 5055      for ( i=1 ; i<=3 ; i++ ) {
 
 5056         xyz[
n-1][i-1] = 
fP8[k-1][i-1];
 
 5057         grad[
n-1][i-1] = 
fG8[k-1][i-1];
 
 5060   for ( 
n=1 ; 
n<=8 ; 
n++ ) {
 
 5062      for ( i=1 ; i<=3 ; i++ ) {
 
 5063         fP8[
n-1][i-1] = xyz[
n-1][i-1];
 
 5064         fG8[
n-1][i-1] = grad[
n-1][i-1];
 
 5074   switch ((
int)icase) {
 
 5095                                 &xyz[nnod-1][0], &grad[nnod-1][0]);
 
 5102                                 &xyz[nnod-1][0], &grad[nnod-1][0]);
 
 5109                                 &xyz[nnod-1][0], &grad[nnod-1][0]);
 
 5116         switch ((
int)(irep+1)) {
 
 5145   for ( 
n=1 ; 
n<=ntria ; 
n++ ) {
 
 5146      for ( i=1 ; i<=3 ; i++ ) {
 
 5148         itria[
n-1][i-1] = k;
 
 5172   for ( i=1 ; i<=3 ; i++ ) {
 
 5176   for ( 
n=1 ; 
n<=nnod ; 
n++ ) {
 
 5179      for ( i=1 ; i<=3 ; i++ ) {
 
 5180         p[i-1] = p[i-1] + xyz[k-1][i-1];
 
 5181         g[i-1] = 
g[i-1] + grad[k-1][i-1];
 
 5184   for ( i=1 ; i<=3 ; i++ ) {
 
 5185      pxyz[i-1] = p[i-1] / nnod;
 
 5186      pgrad[i-1] = 
g[i-1] / nnod;
 
 5208   a = (
a11-a01)*(b00-b10) - (a00-a10)*(b11-b01);
 
 5209   if (
a == 0.) 
return;
 
 5210   b = a01*(b00-b10)-(
a11-a01)*b00-(a00-a10)*b01+a00*(b11-b01);
 
 5211   c = a00*b01 - a01*b00;
 
 5213   if (
d <= 0.) 
return;
 
 5216   s1 = (-
b+
d) / (2*
a);
 
 5217   if (s1<0. || s1>1.) 
return;
 
 5219   s2 = (-
b-
d) / (2*
a);
 
 5220   if (s2<0. || s2>1.) 
return;
 
 5224   if (a00 >= 0) iposa = iposa + 1;
 
 5225   if (a01 >= 0) iposa = iposa + 2;
 
 5226   if (a10 >= 0) iposa = iposa + 4;
 
 5227   if (
a11 >= 0) iposa = iposa + 8;
 
 5228   if (iposa==6 || iposa==9) 
goto L100;
 
 5234   s0 = (a00-a01) / (a00+
a11-a10-a01);
 
 5235   if (
s1>=
s0 && s2<
s0) 
return;
 
 5236   if (s1<s0 && s2>=
s0) 
return;
 
 5238   if (
s1 >= 
s0) irep = 2;
 
 5242   if (b00 >= 0) iposb = iposb + 1;
 
 5243   if (b01 >= 0) iposb = iposb + 2;
 
 5244   if (b10 >= 0) iposb = iposb + 4;
 
 5245   if (b11 >= 0) iposb = iposb + 8;
 
 5246   if (iposb!=6 && iposb!=9)  
return;
 
 5247   s0 = (b00-b01) / (b00+b11-b10-b01);
 
 5248   if (iposa != iposb) 
goto L200;
 
 5250   if (irep==1 && 
s1>
s0) 
return;
 
 5251   if (irep==2 && 
s1<
s0) 
return;
 
 5256   if (irep==1 && 
s1<
s0) 
return;
 
 5257   if (irep==2 && 
s1>
s0) 
return;
 
 5276   static Int_t iedge[12][2] = {
 
 5277         {1,2}, {2,3}, {3,4}, {4,1}, {5,6}, {6,7}, {7,8}, {8,5}, {1,5}, {2,6}, {3,7}, {4,8} };
 
 5279   for ( 
n=1 ; 
n<=nnod ; 
n++ ) {
 
 5285      for ( i=1 ; i<=3 ; i++ ) {
 
 5286         xyz[
n-1][i-1] = (
fP8[n2-1][i-1]-
fP8[n1-1][i-1])*t + 
fP8[n1-1][i-1];
 
 5287         grad[
n-1][i-1] = (
fG8[n2-1][i-1]-
fG8[n1-1][i-1])*t + 
fG8[n1-1][i-1];
 
 5308   Int_t n, nf, i1, i2, i3, i, icur, k, itst, kface, kf, irep;
 
 5318   for ( 
n=1 ; 
n<=nface ; 
n++ ) {
 
 5342      for ( i=1 ; i<=3 ; i++ ) {
 
 5343         wmin = xyz[i1-1][i-1];
 
 5344         wmax = xyz[i1-1][i-1];
 
 5345         if (wmin > xyz[i2-1][i-1]) wmin = xyz[i2-1][i-1];
 
 5346         if (wmax < xyz[i2-1][i-1]) wmax = xyz[i2-1][i-1];
 
 5347         if (wmin > xyz[i3-1][i-1]) wmin = xyz[i3-1][i-1];
 
 5348         if (wmax < xyz[i3-1][i-1]) wmax = xyz[i3-1][i-1];
 
 5349         dface[
n-1][i-1] = wmin;
 
 5350         dface[
n-1][i+2] = wmax;
 
 5353      for ( i=1 ; i<=3 ; i++ ) {
 
 5354         v[0][i-1] = xyz[i2-1][i-1] - xyz[i1-1][i-1];
 
 5355         v[1][i-1] = xyz[i3-1][i-1] - xyz[i2-1][i-1];
 
 5357      a = (
v[0][1]*
v[1][2] - 
v[0][2]*
v[1][1]);
 
 5358      b = (
v[0][2]*
v[1][0] - 
v[0][0]*
v[1][2]);
 
 5359      c = (
v[0][0]*
v[1][1] - 
v[0][1]*
v[1][0]);
 
 5368      abcd[
n-1][3] =-(
a*xyz[i1-1][0] + 
b*xyz[i1-1][1] + 
c*xyz[i1-1][2]);
 
 5371   if (nf <= 1) 
return;
 
 5374   for ( icur=2 ; icur<=nface ; icur++ ) {
 
 5376      zcur = dface[k-1][2];
 
 5377      for ( itst=icur-1 ; itst>=1 ; itst-- ) {
 
 5379         if (zcur < dface[k-1][2]) 
break;
 
 5381         iorder[itst-1] = iorder[itst];
 
 5389   if (kface == 1) 
goto L900;
 
 5390   nf = iorder[kface-1];
 
 5391   if (nf < 0) nf =-nf;
 
 5392   abcdn[0] = abcd[nf-1][0];
 
 5393   abcdn[1] = abcd[nf-1][1];
 
 5394   abcdn[2] = abcd[nf-1][2];
 
 5395   abcdn[3] = abcd[nf-1][3];
 
 5401   for ( k=kface-1 ; k>=1 ; k-- ) {
 
 5403      if (kf < 0) kf =-kf;
 
 5404      if (dface[nf-1][5] > dface[kf-1][2]+
kDel) 
goto L400;
 
 5405      if (iorder[k-1] > 0) 
goto L900;
 
 5410      if (dface[kf-1][0] >= dface[nf-1][3]-
kDel) 
goto L800;
 
 5411      if (dface[kf-1][3] <= dface[nf-1][0]+
kDel) 
goto L800;
 
 5412      if (dface[kf-1][1] >= dface[nf-1][4]-
kDel) 
goto L800;
 
 5413      if (dface[kf-1][4] <= dface[nf-1][1]+
kDel) 
goto L800;
 
 5419      if (abcdn[0]*xyz[kk[0]-1][0]+abcdn[1]*xyz[kk[0]-1][1]+
 
 5420          abcdn[2]*xyz[kk[0]-1][2]+abcdn[3] < -
kDel) 
goto L500;
 
 5421      if (abcdn[0]*xyz[kk[1]-1][0]+abcdn[1]*xyz[kk[1]-1][1]+
 
 5422          abcdn[2]*xyz[kk[1]-1][2]+abcdn[3] < -
kDel) 
goto L500;
 
 5423      if (abcdn[0]*xyz[kk[2]-1][0]+abcdn[1]*xyz[kk[2]-1][1]+
 
 5424          abcdn[2]*xyz[kk[2]-1][2]+abcdn[3] < -
kDel) 
goto L500;
 
 5429      abcdk[0] = abcd[kf-1][0];
 
 5430      abcdk[1] = abcd[kf-1][1];
 
 5431      abcdk[2] = abcd[kf-1][2];
 
 5432      abcdk[3] = abcd[kf-1][3];
 
 5433      if (abcdk[0]*xyz[nn[0]-1][0]+abcdk[1]*xyz[nn[0]-1][1]+
 
 5434          abcdk[2]*xyz[nn[0]-1][2]+abcdk[3] > 
kDel) 
goto L600;
 
 5435      if (abcdk[0]*xyz[nn[1]-1][0]+abcdk[1]*xyz[nn[1]-1][1]+
 
 5436          abcdk[2]*xyz[nn[1]-1][2]+abcdk[3] > 
kDel) 
goto L600;
 
 5437      if (abcdk[0]*xyz[nn[2]-1][0]+abcdk[1]*xyz[nn[2]-1][1]+
 
 5438          abcdk[2]*xyz[nn[2]-1][2]+abcdk[3] > 
kDel) 
goto L600;
 
 5444      for ( i=1 ; i<=3 ; i++ ) {
 
 5447         if (i != 3) i2 = kk[i];
 
 5449         if ( irep<0 ) 
goto L700;
 
 5450         if ( irep==0 ) 
continue;
 
 5451         if ( irep>0 ) 
goto L800;
 
 5454      for ( i=1 ; i<=3 ; i++ ) {
 
 5457         if (i != 3) i2 = nn[i];
 
 5459         if ( irep<0 ) 
goto L800;
 
 5460         if ( irep==0 ) 
continue;
 
 5461         if ( irep>0 ) 
goto L700;
 
 5468      for ( i=k+1 ; i<=kface ; i++ ) {
 
 5469         iorder[i-2] = iorder[i-1];
 
 5471      iorder[kface-1] =-kf;
 
 5472      if (kf > 0) 
goto L300;
 
 5480   if (iorder[kface-1] < 0) iorder[kface-1] =-iorder[kface-1];
 
 5482   if (kface > 0) 
goto L300;
 
 5500   Int_t k, k1, k2, ixy, i;
 
 5501   Double_t a, 
b, 
c, d1, d2, dd, 
xy, tmin, tmax, tmid, 
x, 
y, z;
 
 5507   delta[0] = xyz[i2-1][0] - xyz[i1-1][0];
 
 5508   delta[1] = xyz[i2-1][1] - xyz[i1-1][1];
 
 5509   delta[2] = xyz[i2-1][2] - xyz[i1-1][2];
 
 5515   c =-(
a*xyz[i1-1][0] + 
b*xyz[i1-1][1]);
 
 5516   d[0] = 
a*xyz[iface[0]-1][0] + 
b*xyz[iface[0]-1][1] + 
c;
 
 5517   d[1] = 
a*xyz[iface[1]-1][0] + 
b*xyz[iface[1]-1][1] + 
c;
 
 5518   d[2] = 
a*xyz[iface[2]-1][0] + 
b*xyz[iface[2]-1][1] + 
c;
 
 5520   for ( i=1 ; i<=3 ; i++ ) {
 
 5524      if (
d[k1-1]>=0. && 
d[k2-1]>=0.) 
continue;
 
 5525      if (
d[k1-1] <0. && 
d[k2-1] <0.) 
continue;
 
 5526      d1 = 
d[k1-1] / (
d[k1-1] - 
d[k2-1]);
 
 5527      d2 = 
d[k2-1] / (
d[k1-1] - 
d[k2-1]);
 
 5528      xy = d1*xyz[iface[k2-1]-1][ixy-1] - d2*xyz[iface[k1-1]-1][ixy-1];
 
 5530      t[k-1] = (
xy-xyz[i1-1][ixy-1]) / delta[ixy-1];
 
 5531      if (k == 2) 
goto L200;
 
 5539   if (tmin>1. || tmax<0) 
return;
 
 5540   if (tmin < 0.) tmin = 0.;
 
 5541   if (tmax > 1.) tmax = 1.;
 
 5542   tmid = (tmin + tmax) / 2.;
 
 5543   x = delta[0]*tmid + xyz[i1-1][0];
 
 5544   y = delta[1]*tmid + xyz[i1-1][1];
 
 5545   z = delta[2]*tmid + xyz[i1-1][2];
 
 5546   dd = abcd[0]*
x + abcd[1]*
y + abcd[2]*z + abcd[3];
 
 5547   if (dd > del) 
goto L997;
 
 5548   if (dd <-del) 
goto L998;
 
 5579   Double_t p0[3], p1[3], p2[3], p3[3], t[3];
 
 5580   Double_t fsurf, w, d1, d2, df1, df2;
 
 5582   Int_t i, i1, i2, j, ibase, nnod, knod, ntria, ktria, iopt, iready;
 
 5583   Int_t ixcrit, iycrit, izcrit, incrx, incry, incrz, incr;
 
 5584   Int_t ix, ix1=0, ix2=0, iy, iy1=0, iy2=0, iz, iz1=0, iz2=0, k, kx, ky, kz, isurf, nsurf;
 
 5590   static Int_t ind[8][3] = { { 0,0,0 }, { 1,0,0 }, { 1,0,1 }, { 0,0,1 },
 
 5591                              { 0,1,0 }, { 1,1,0 }, { 1,1,1 }, { 0,1,1 } };
 
 5602      Error(
"ImplicitFunction", 
"no TView in current pad");
 
 5607   if (nsurf > 
kNiso) {
 
 5608      Warning(
"IsoSurface",
"Number of iso-surfaces too large. Increase kNiso");
 
 5611   if (*chopt == 
'B' || *chopt == 
'b') iopt = 1;
 
 5635   if (p1[2] < p0[2]) ixcrit = 1;
 
 5636   if (p2[2] < p0[2]) iycrit = 1;
 
 5637   if (p3[2] < p0[2]) izcrit = 1;
 
 5646      if (iopt == 1) iz1 = 1;
 
 5647      if (iopt == 1) iz2 = izcrit-1;
 
 5648      if (iopt == 2) iz1 = izcrit;
 
 5649      if (iopt == 2) iz2 = nz - 1;
 
 5651      if (iopt == 1) iz1 = nz - 1;
 
 5652      if (iopt == 1) iz2 = izcrit;
 
 5653      if (iopt == 2) iz1 = izcrit-1;
 
 5654      if (iopt == 2) iz2 = 1;
 
 5656   for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
 
 5659         if (iopt == 1) iy1 = 1;
 
 5660         if (iopt == 1) iy2 = iycrit-1;
 
 5661         if (iopt == 2) iy1 = iycrit;
 
 5662         if (iopt == 2) iy2 = ny - 1;
 
 5664         if (iopt == 1) iy1 = ny - 1;
 
 5665         if (iopt == 1) iy2 = iycrit;
 
 5666         if (iopt == 2) iy1 = iycrit-1;
 
 5667         if (iopt == 2) iy2 = 1;
 
 5669      for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
 
 5672            if (iopt == 1) ix1 = 1;
 
 5673            if (iopt == 1) ix2 = ixcrit-1;
 
 5674            if (iopt == 2) ix1 = ixcrit;
 
 5675            if (iopt == 2) ix2 = nx - 1;
 
 5677            if (iopt == 1) ix1 = nx - 1;
 
 5678            if (iopt == 1) ix2 = ixcrit;
 
 5679            if (iopt == 2) ix1 = ixcrit-1;
 
 5680            if (iopt == 2) ix2 = 1;
 
 5682         for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
 
 5686            for ( isurf=1 ; isurf<=nsurf ; isurf++ ) {
 
 5724               if (iready !=0) 
goto L310;
 
 5726               for ( i=1 ; i<=8 ; i++ ) {
 
 5727                  kx = ix + ind[i-1][0];
 
 5728                  ky = iy + ind[i-1][1];
 
 5729                  kz = iz + ind[i-1][2];
 
 5730                  p[i-1][0] = 
x[kx-1];
 
 5731                  p[i-1][1] = 
y[ky-1];
 
 5732                  p[i-1][2] = z[kz-1];
 
 5739                  } 
else if (kx == nx) {
 
 5744                     d1 = 
x[kx-1] - 
x[kx-2];
 
 5745                     d2 = 
x[kx] - 
x[kx-1];
 
 5755                        pn[i-1][0] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
 
 5763                  } 
else if (ky == ny) {
 
 5768                     d1 = 
y[ky-1] - 
y[ky-2];
 
 5769                     d2 = 
y[ky] - 
y[ky-1];
 
 5779                        pn[i-1][1] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
 
 5787                  } 
else if (kz == nz) {
 
 5792                     d1 = z[kz-1] - z[kz-2];
 
 5793                     d2 = z[kz] - z[kz-1];
 
 5803                        pn[i-1][2] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
 
 5814                            xyz_tmp, grad_tmp, itria_tmp);
 
 5816               for( 
l=0 ; 
l<knod ; 
l++) {
 
 5817                  xyz[nnod+
l][0] = xyz_tmp[
l][0];
 
 5818                  xyz[nnod+
l][1] = xyz_tmp[
l][1];
 
 5819                  xyz[nnod+
l][2] = xyz_tmp[
l][2];
 
 5820                  grad[nnod+
l][0] = grad_tmp[
l][0];
 
 5821                  grad[nnod+
l][1] = grad_tmp[
l][1];
 
 5822                  grad[nnod+
l][2] = grad_tmp[
l][2];
 
 5824               for( 
l=0 ; 
l<ktria ; 
l++) {
 
 5825                  itria[ntria+
l][0] = itria_tmp[
l][0];
 
 5826                  itria[ntria+
l][1] = itria_tmp[
l][1];
 
 5827                  itria[ntria+
l][2] = itria_tmp[
l][2];
 
 5830               for ( i=ntria+1 ; i<=ntria+ktria ; i++ ) {
 
 5831                 for ( j=1 ; j<=3 ; j++ ){
 
 5833                     if (itria[i-1][j-1] < 0) ibase =-nnod;
 
 5834                     itria[i-1][j-1] = itria[i-1][j-1] + ibase;
 
 5839               ntria = ntria + ktria;
 
 5843            if (ntria == 0) 
continue;
 
 5844            for ( i=1 ; i<=nnod ; i++ ) {
 
 5845               view->
WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
 
 5849            ZDepth(xyzn, ntria, itria, dtria, abcd, (
Int_t*)iorder);
 
 5850            if (ntria == 0) 
continue;
 
 5852            if (iopt == 1) incr = -1;
 
 5854            if (incr == -1) i1 = ntria;
 
 5855            i2 = ntria - i1 + 1;
 
 5856            for (i = i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
 
 5861               icodes[0] = iattr[k-1];
 
 5862               icodes[1] = iattr[k-1];
 
 5863               icodes[2] = iattr[k-1];
 
 5868         if (incrx < 0) 
goto L130;
 
 5871      if (incry < 0) 
goto L120;
 
 5874   if (incrz < 0) 
goto L110;
 
 5891      Error(
"ImplicitFunction", 
"no TView in current pad");
 
 5898   for ( i=1 ; i<=np ; i++) {
 
 5901      view->
WCtoNDC(&xyz[k-1][0], &p3[i-1][0]);
 
static const double x2[5]
static const double x1[5]
include TDocParser_001 C image html pict1_TDocParser_001 png width
static Int_t gEdgeColor[kVSizeMax+1]
static Double_t gV[kVSizeMax]
static Int_t gEdgeStyle[kVSizeMax+1]
const Int_t kF3FillColor2
static Int_t gColorDark[kVSizeMax+1]
static Int_t gEdgeWidth[kVSizeMax+1]
static Double_t gTT[4 *kVSizeMax]
static Int_t gColorMain[kVSizeMax+1]
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 void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void Modify()
Change current line attributes if necessary.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
The color creation and management class.
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
Initialize this color and its associated colors.
static void RGBtoHLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
static void HLStoRGB(Float_t h, Float_t l, Float_t s, Float_t &r, Float_t &g, Float_t &b)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
A 3-Dim function with parameters.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
TVirtualHistPainter * GetPainter(Option_t *option="")
Return pointer to painter.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
The histogram painter class.
static Int_t ProjectSinusoidal2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function code from Ernst-Jan Buis.
virtual Bool_t IsInside(Int_t x, Int_t y)
Return kTRUE if the cell ix, iy is inside one of the graphical cuts.
static Int_t ProjectAitoff2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
static Int_t ProjectParabolic2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function code from Ernst-Jan Buis.
static Int_t ProjectMercator2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab)
Static function.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
The Legos and Surfaces painter class.
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
Size of fAphi.
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]
Lower limits of lego.
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 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 ClearRaster()
Clear screen.
void Luminosity(Double_t *anorm, Double_t &flum)
Find surface luminosity at given point.
void MarchingCubeFindNodes(Int_t nnod, Int_t *ie, Double_t xyz[52][3], Double_t grad[52][3])
Find nodes and normales.
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]
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 2nd 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")
void FindVisibleDraw(Double_t *r1, Double_t *r2)
Find visible parts of line (draw line)
static const Int_t NumOfSlices
void LegoSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt)
Draw stack of lego-plots spheric coordinates.
static TF3 * fgCurrentF3
Clipping plane along Y.
void SurfaceCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
Draw surface in cartesian coordinate system.
static void SetF3ClippingBoxOff()
Static function Set the implicit function clipping box "off".
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 fNStack
(=1 if mesh to draw, o otherwise)
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()
pointer to surface function
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.
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
IsoSurface maximum function value.
Int_t fColorLevel[NumOfColorLevels+2]
virtual ~TPainter3dAlgorithms()
Lego default destructor.
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.
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.
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.
Int_t * fColorMain
Coordinate system.
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]
static void SetF3(TF3 *f3)
Static function Store pointer to current implicit function.
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 1st 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.
Double_t * fAphi
Upper limits of lego.
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.
static Int_t fgF3Clipping
Base colour for the 3rd Iso Surface.
Int_t fLevelLine[NumOfLevelLines]
Double_t fFmin
Number of histograms in the stack to be painted.
void MarchingCube(Double_t fiso, Double_t p[8][3], Double_t f[8], Double_t g[8][3], Int_t &nnod, Int_t &ntria, Double_t xyz[][3], Double_t grad[][3], Int_t itria[][3])
Topological decider for "Marching Cubes" algorithm Find set of triangles approximating the iso-surfac...
static Double_t fgF3XClip
Clipping box is off (0) or on (1)
void ModifyScreen(Double_t *r1, Double_t *r2)
Modify SCREEN.
SurfaceFunc_t fSurfaceFunction
pointer to lego 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)
LegoFunc_t fLegoFunction
pointer to face drawing 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.
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)
static Double_t fgF3ZClip
Clipping plane along 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)
static Double_t fgF3YClip
Clipping plane along X.
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
Number of colours per Iso surface.
Double_t fFmax
IsoSurface minimum 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")
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
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
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.
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
static constexpr double rad
static constexpr double s
static constexpr double ns
Short_t Max(Short_t a, Short_t b)
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Short_t Min(Short_t a, Short_t b)
Double_t Log10(Double_t x)
Histogram option structure.
int Proj
1: Aitoff, 2: Mercator, 3: Sinusoidal, 4: Parabolic
int Logx
log scale in X. Also set by histogram option
int MinimumZero
"MIN0" or gStyle->GetHistMinimumZero()
int Zero
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" Draw as a Surface (SURF,Surf=1, SURF1,Surf=11, SURF2,Surf=12)
int Logy
log scale in Y. Also set by histogram option
int System
type of coordinate system(1=car,2=pol,3=cyl,4=sph,5=psr)
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