48 ClassImp (TSpectrum2Painter)
54 TSpectrum2Painter::TSpectrum2Painter(TH2* h2, Int_t bs)
55 : TNamed ("Spectrum Painter2","Miroslav Morhac Painter")
59 gPad->Range(0, 0, 1 ,1);
61 fXmax = h2->GetNbinsX() - 1;
63 fYmax = h2->GetNbinsY() - 1;
65 fMaximumXScreenResolution = bs;
67 for (i = 0;i <= fXmax; i++) {
68 for (j = 0;j <= fYmax; j++) {
69 val = h2->GetBinContent(i + 1,j + 1);
70 if (val > fZmax) fZmax = val;
74 fBx1 = gPad->XtoPixel(0.1);
75 fBx2 = gPad->XtoPixel(0.99);
76 fBy1 = gPad->YtoPixel(0.99);
77 fBy2 = gPad->YtoPixel(0.05);
79 fModeGroup = kModeGroupLightHeight;
81 fDisplayMode = kDisplayModeSurface;
83 fZscale = kZScaleLinear;
85 fNodesx = fXmax-fXmin+1;
86 fNodesy = fYmax-fYmin+1;
114 fColorAlg = kColorAlgRgbSmooth;
136 fShadow = kShadowsNotPainted;
145 fBezier = kNoBezierInterpol;
151 fPenDash = kPenStyleSolid;
153 fChanmarkEnDis = kChannelMarksNotDrawn;
155 fChanmarkColor = kBlue;
158 fChanmarkStyle = kChannelMarksStyleDot;
160 fChanlineEnDis = kChannelGridNotDrawn;
162 fChanlineColor = kRed;
164 fEnvelope =
new Short_t [fMaximumXScreenResolution];
165 fEnvelopeContour =
new Short_t [fMaximumXScreenResolution];
166 for (i=0;i<fMaximumXScreenResolution;i++) {
168 fEnvelopeContour[i] = fBy2;
177 TSpectrum2Painter::~TSpectrum2Painter()
180 for (
int i=0; i<256; i++) {
181 col = gROOT->GetColor(250+i);
184 if (fEnvelope)
delete [] fEnvelope;
185 if (fEnvelopeContour)
delete [] fEnvelopeContour;
197 void TSpectrum2Painter::Transform(Int_t it,Int_t jt,Int_t zmt)
202 p1 = fXmin+fKx*(Double_t)it;
203 p2 = fYmin+fKy*(Double_t)jt;
208 if ((zmt==0)||(zmt==-3)||(zmt==-4)) {
209 zf = fH2->GetBinContent(ix+1,iy+1);
210 }
else if (zmt==-2) zf = fZPresetValue;
211 if (zf<fZmin) zf = fZmin;
215 if (zf>=1.0) zf = log(zf);
219 if (zf>0) zf = sqrt(zf);
223 lxt = (Int_t)(fTxx*(Double_t)it+fTxy*(Double_t)jt+fVx);
224 lyt = (Int_t)(fTyx*(Double_t)it+fTyy*(Double_t)jt+fTyz*zf+fVy);
225 if (lxt<fBx1) lxt = fBx1;
226 if (lxt>fBx2) lxt = fBx2;
227 if (lyt<fBy1) lyt = fBy1;
228 if (lyt>fBy2) lyt = fBy2;
243 Double_t TSpectrum2Painter::ColorCalculation(
244 Double_t dx1, Double_t dy1, Double_t z1,
245 Double_t dx2, Double_t dy2, Double_t z2,
246 Double_t dx3, Double_t dy3, Double_t z3)
248 Double_t da,db,dc=0,dd,dl,dm,dn,xtaz,ytaz,ztaz,v=0,v1;
249 Double_t pi=3.1415927;
253 if (z1>900) z1 = 900;
255 if (z2>900) z2 = 900;
257 if (z3>900) z3 = 900;
268 if ((i==1)||(i==3)) {
279 xtaz = (dx1+dx2+dx3)/3;
280 ytaz = (dy1+dy2+dy3)/3;
282 if (fModeGroup==kModeGroupLight) {
283 dn = (Double_t)fZlight-ztaz;
284 dm = (Double_t)fYlight-ytaz;
285 dl = (Double_t)fXlight-xtaz;
286 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
287 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
288 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
289 dd = (da*da+db*db+dc*dc)*(dl*dl+dm*dm+dn*dn);
291 if (dd!=0) v = (da*dl+db*dm+dc*dn)/dd;
298 }
else if (fModeGroup==kModeGroupHeight) {
300 if (ztaz<fZmin) ztaz=fZmin;
301 if (ztaz>=fZmax) ztaz=fZmax-1;
309 if (da>=1) da=log(da);
310 if (db>=1) db=log(db);
325 }
else if (fModeGroup==kModeGroupLightHeight) {
326 dn = (Double_t)fZlight-ztaz;
327 dm = (Double_t)fYlight-ytaz;
328 dl = (Double_t)fXlight-xtaz;
329 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
330 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
331 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
332 dd = (da*da+db*db+dc*dc)*(dl*dl+dm*dm+dn*dn);
334 if (dd!=0) v = (da*dl+db*dm+dc*dn)/dd;
342 if (ztaz<fZmin) ztaz = fZmin;
343 if (ztaz>=fZmax) ztaz = fZmax-1;
351 if (da>=1) da = log(da);
352 if (db>=1) db = log(db);
353 if (da!=0) dc = db/da;
367 v = fLHweight*v+(1-fLHweight)*v1;
369 if (fShadow==kShadowsNotPainted) {
370 da = 1.0/(Double_t)fLevels;
373 da = 2.0/(Double_t)fLevels;
386 Double_t TSpectrum2Painter::ShadowColorCalculation(Double_t xtaz, Double_t ytaz,
390 Int_t sx2,sy2,sz1,sz2,skrokx,skroky,xmax,ymax;
392 Double_t pom1,pom2,sdx1=0,sdx2=0,sdy1,sdy2,spriz;
395 if (ztaz>900) ztaz = 900;
397 if (ztaz>32767) ztaz = 32767;
413 if (sx1<sx2) skrokx = 1;
415 if (sy1<sy2) skroky = 1;
419 if (TMath::Abs(pom1)>0.0000001) sdx1 = pom2/pom1;
422 sdy1 = pom2-sdx1*pom1;
425 if (TMath::Abs(pom1)>0.0000001) sdx2 = pom2/pom1;
428 sdy2 = pom2-sdx2*pom1;
431 pom2 = pom1*sdx1+sdy1;
433 for (;(sx1>(fXmin-skrokx)) && (sx1<(xmax-skrokx)) &&
434 (sy1>(fYmin-skroky)) && (sy1<(ymax-skroky)) &&
435 (spriz==0);sx1+=skrokx) {
437 pom2 = pom1*sdx1+sdy1;
439 if ((sy1>=fYmin)&&(sy1<=fYmax)) {
440 sz1 = (Int_t)(fH2->GetBinContent((Int_t)sx1+1,(Int_t)sy1+1));
441 pom2 = pom1*sdx2+sdy2;
442 sz2 = (Int_t)(pom2+shad_noise);
443 if (sz1>sz2) spriz = 1;
446 }
else if (sy1!=sy2) {
447 if (sy1<sy2) skroky = 1;
451 if (TMath::Abs(pom1)>0.0000001) sdx2 = pom2/pom1;
454 sdy2 = pom2-sdx2*pom1;
456 for (;(sy1>(fYmin-skroky)) && (sy1<(ymax-skroky)) &&
457 (spriz==0);sy1+=skroky) {
458 sz1 = (Int_t)(fH2->GetBinContent((Int_t)sx1+1,(Int_t)sy1+1));
460 pom2 = pom1*sdx2+sdy2;
461 sz2 = (Int_t)(pom2+shad_noise);
462 if (sz1>sz2) spriz=1;
475 void TSpectrum2Painter::ColorModel(
unsigned ui,
unsigned ui1,
unsigned ui2,
478 unsigned long uinc1=0,uinc2=0,uinc3=0,upom,i;
479 Double_t a,b,c,d,h,v,s,f;
481 Double_t red=0,green=0,blue=0;
483 else if (iv>255) iv = 255;
484 if (gROOT->GetColor(250+iv)) {
485 fNewColorIndex = 250+iv;
488 if (fColorAlg%2==0) {
492 if (a >= UINT_MAX) uinc1 = UINT_MAX;
493 else uinc1 = (unsigned)a;
495 i = (uinc1-upom)/256;
496 if ((i%2)==0) uinc1 = upom;
497 else uinc1 = 255-upom;
503 i = (uinc2-upom)/256;
504 if ((i%2)==0) uinc2 = upom;
505 else uinc2 = 255-upom;
511 i = (uinc3-upom)/256;
512 if ((i%2)==0) uinc3 = upom;
513 else uinc3 = 255-upom;
514 if (fColorAlg==kColorAlgCmySmooth) {
518 }
else if (fColorAlg==kColorAlgCieSmooth) {
532 uinc2 = (Int_t)green;
534 }
else if (fColorAlg==kColorAlgYiqSmooth) {
541 red = a+0.956*b+0.62*c;
542 green = a-0.272*b-0.647*c;
543 blue = a-1.108*b+1.705*c;
544 if (red>=2) red = red-2;
545 else if (red>=1) red = 2-red;
546 if (green<0) green = -green;
547 if (blue>=2) blue = blue-2;
548 else if (blue>=1) blue = 2-blue;
549 else if (blue<-1) blue = 2+blue;
550 else if (blue<0) blue = -blue;
555 uinc2 = (Int_t)green;
557 }
else if (fColorAlg==kColorAlgHvsSmooth) {
613 uinc2 = (Int_t)green;
616 ui = uinc1+uinc2*256+uinc3*65536;
617 }
else if (fColorAlg%2==1) {
633 if (fColorAlg==kColorAlgCmyModulo) {
637 }
else if (fColorAlg==kColorAlgCieModulo) {
651 uinc2 = (Int_t)green;
653 }
else if (fColorAlg==kColorAlgYiqModulo) {
660 red = a+0.956*b+0.62*c;
661 green = a-0.272*b-0.647*c;
662 blue = a-1.108*b+1.705*c;
663 if (red>=2) red = red-2;
664 else if (red>=1) red = red-1;
665 if (green<0) green = 1+green;
666 if (blue>=2) blue = blue-2;
667 else if (blue>=1) blue = blue-1;
668 else if (blue<-1) blue = 2+blue;
669 else if (blue<0) blue = 1+blue;
674 uinc2 = (Int_t)green;
676 }
else if (fColorAlg==kColorAlgHvsModulo) {
732 uinc2 = (Int_t)green;
735 ui = uinc1+uinc2*256+uinc3*65536;
743 fNewColor =
new TColor(250+iv,red,green,blue);
744 fNewColorIndex = 250+iv;
752 Int_t TSpectrum2Painter::BezC(Int_t i)
756 for (j=i+1;j<=3;j++) a = a*j;
757 for (j=1;j<=3-i;j++) a = a/j;
765 Double_t TSpectrum2Painter::BezierBlend(Int_t i,Double_t bezf)
770 for (j=1;j<=i;j++) v = v*bezf;
771 for (j=1;j<=3-i;j++) v = v*(1-bezf);
780 void TSpectrum2Painter::BezierSmoothing(Double_t bezf)
787 b = BezierBlend(i,bezf);
798 void TSpectrum2Painter::Envelope(Int_t x1,Int_t y1,Int_t x2,Int_t y2)
800 Int_t x,y,krok,xold=0,yold=0,prvy,yprv=0;
801 Double_t fx,fy,fx1,fy1;
802 if (y1<fBy1) y1 = fBy1;
803 if (y2<fBy1) y2 = fBy1;
805 if ((y1>=fEnvelope[x1]) && (y2>=fEnvelope[x1])) {
807 if (y1<=fEnvelope[x1-1]||y2<=fEnvelope[x1-1]) {
808 if (y1>fEnvelope[x1-1]) y1 = fEnvelope[x1-1];
809 if (y2>fEnvelope[x1-1]) y2 = fEnvelope[x1-1];
819 if (y1<=fEnvelope[x1+1]||y2<=fEnvelope[x1+1]) {
820 if (y1>fEnvelope[x1+1]) y1 = fEnvelope[x1+1];
821 if (y2>fEnvelope[x1+1]) y2 = fEnvelope[x1+1];
833 if ((y1<fEnvelope[x1]) && (y2<fEnvelope[x1])) {
839 if (y1<y2) fEnvelope[x1] = y1;
840 else fEnvelope[x1] = y2;
861 krok = (x1<x2)? 1:-1;
867 if (y<=fEnvelope[x]) {
873 if (yprv<=fEnvelope[x]) fYs = yprv;
874 else fYs = fEnvelope[x];
881 if (x!=x2) fEnvelope[x] = y;
892 if (y1!=y2) y += (y1<y2)? +1:-1;
901 if (((x<=x2)&&(x1<x2)) || ((x>=x2)&&(x1>x2)))
goto l1;
911 void TSpectrum2Painter::EnvelopeBars(Int_t x1,Int_t y1,Int_t x2,Int_t y2)
913 Int_t x,y,krok,xold=0,yold=0,prvy,xprv,yprv=0;
914 Double_t fx,fy,fx1,fy1;
916 if ((y1>=fEnvelope[x1]) && (y2>=fEnvelope[x1])) {
920 if ((y1<fEnvelope[x1]) && (y2<fEnvelope[x1])) {
926 if (y1<y2) fEnvelope[x1] = y1;
927 else fEnvelope[x1] = y2;
948 krok = (x1<x2)? 1:-1;
954 if (y<=fEnvelope[x]) {
968 if (x!=x2) fEnvelope[x] = y;
980 if (y1!=y2) y+=(y1<y2)? +1:-1;
989 if (((x<=x2)&&(x1<x2)) || ((x>=x2)&&(x1>x2)))
goto l1;
1000 void TSpectrum2Painter::DrawMarker(Int_t x,Int_t y,Int_t w,Int_t h,Int_t type)
1002 TLine *line=
new TLine();
1003 TEllipse *ellipse=
new TEllipse();
1004 line->SetLineColor(fChanmarkColor);
1005 line->SetLineWidth(1);
1006 line->SetLineStyle(kPenStyleSolid);
1007 ellipse->SetLineColor(fChanmarkColor);
1008 ellipse->SetLineWidth(1);
1009 ellipse->SetLineStyle(kPenStyleSolid);
1011 case kChannelMarksStyleDot:
1012 ellipse->SetX1(gPad->PixeltoX(x));
1013 ellipse->SetY1(gPad->PixeltoY(y)+1);
1014 ellipse->SetR1(gPad->PixeltoX(w/2));
1015 ellipse->SetR2(gPad->PixeltoY(h/2));
1016 ellipse->SetPhimin(0);
1017 ellipse->SetPhimax(360);
1018 ellipse->SetTheta(0);
1021 case kChannelMarksStyleCross:
1022 line->PaintLine(gPad->PixeltoX(x-w/2),gPad->PixeltoY(y)+1,
1023 gPad->PixeltoX(x+w/2),gPad->PixeltoY(y)+1);
1024 line->PaintLine(gPad->PixeltoX(x) ,gPad->PixeltoY(y-h/2)+1,
1025 gPad->PixeltoX(x) ,gPad->PixeltoY(y+h/2+1)+1);
1027 case kChannelMarksStyleStar:
1028 line->PaintLine(gPad->PixeltoX(x-w/2) ,gPad->PixeltoY(y)+1,
1029 gPad->PixeltoX(x+w/2+1),gPad->PixeltoY(y)+1);
1030 line->PaintLine(gPad->PixeltoX(x) ,gPad->PixeltoY(y-h/2)+1,
1031 gPad->PixeltoX(x) ,gPad->PixeltoY(y+h/2+1)+1);
1032 line->PaintLine(gPad->PixeltoX(x-w/2) ,gPad->PixeltoY(y-h/2)+1,
1033 gPad->PixeltoX(x+w/2+1),gPad->PixeltoY(y+h/2+1)+1);
1034 line->PaintLine(gPad->PixeltoX(x-w/2) ,gPad->PixeltoY(y+h/2)+1,
1035 gPad->PixeltoX(x+w/2+1),gPad->PixeltoY(y-h/2-1)+1);
1037 case kChannelMarksStyleRectangle:
1038 line->PaintLine(gPad->PixeltoX(x-w/2),gPad->PixeltoY(y-h/2)+1,
1039 gPad->PixeltoX(x-w/2),gPad->PixeltoY(y+h/2)+1);
1040 line->PaintLine(gPad->PixeltoX(x-w/2),gPad->PixeltoY(y+h/2)+1,
1041 gPad->PixeltoX(x+w/2),gPad->PixeltoY(y+h/2)+1);
1042 line->PaintLine(gPad->PixeltoX(x+w/2),gPad->PixeltoY(y+h/2)+1,
1043 gPad->PixeltoX(x+w/2),gPad->PixeltoY(y-h/2)+1);
1044 line->PaintLine(gPad->PixeltoX(x+w/2),gPad->PixeltoY(y-h/2)+1,
1045 gPad->PixeltoX(x-w/2),gPad->PixeltoY(y-h/2)+1);
1047 case kChannelMarksStyleX:
1048 line->PaintLine(gPad->PixeltoX(x-w/2) ,gPad->PixeltoY(y-h/2)+1,
1049 gPad->PixeltoX(x+w/2+1),gPad->PixeltoY(y+h/2+1)+1);
1050 line->PaintLine(gPad->PixeltoX(x-w/2) ,gPad->PixeltoY(y+h/2)+1,
1051 gPad->PixeltoX(x+w/2+1),gPad->PixeltoY(y-h/2-1)+1);
1053 case kChannelMarksStyleDiamond:
1054 line->PaintLine(gPad->PixeltoX(x) ,gPad->PixeltoY(y-h/2)+1,
1055 gPad->PixeltoX(x-w/2),gPad->PixeltoY(y)+1);
1056 line->PaintLine(gPad->PixeltoX(x-w/2),gPad->PixeltoY(y)+1,
1057 gPad->PixeltoX(x) ,gPad->PixeltoY(y+h/2)+1);
1058 line->PaintLine(gPad->PixeltoX(x) ,gPad->PixeltoY(y+h/2)+1,
1059 gPad->PixeltoX(x+w/2),gPad->PixeltoY(y)+1);
1060 line->PaintLine(gPad->PixeltoX(x+w/2),gPad->PixeltoY(y)+1,
1061 gPad->PixeltoX(x) ,gPad->PixeltoY(y-h/2)+1);
1063 case kChannelMarksStyleTriangle:
1064 line->PaintLine(gPad->PixeltoX(x) ,gPad->PixeltoY(y-h/2)+1,
1065 gPad->PixeltoX(x-w/2),gPad->PixeltoY(y+h/2)+1);
1066 line->PaintLine(gPad->PixeltoX(x-w/2),gPad->PixeltoY(y+h/2)+1,
1067 gPad->PixeltoX(x+w/2),gPad->PixeltoY(y+h/2)+1);
1068 line->PaintLine(gPad->PixeltoX(x+w/2),gPad->PixeltoY(y+h/2)+1,
1069 gPad->PixeltoX(x) ,gPad->PixeltoY(y-h/2)+1);
1083 void TSpectrum2Painter::Slice(Double_t xr, Double_t yr, Double_t xs,
1084 Double_t ys, TLine *line)
1086 Int_t krok,xi,yi,xj,yj,a,b,as,bs,pr,ae,be;
1087 Double_t fx,fy,fx1,fy1;
1088 xi = (Int_t)(fTxx*(xr-fXmin)/fKx+fTxy*(yr-fYmin)/fKy+fVx);
1089 xj = (Int_t)(fTxx*(xs-fXmin)/fKx+fTxy*(ys-fYmin)/fKy+fVx);
1090 yi = (Int_t)(fTyx*(xr-fXmin)/fKx+fTyy*(yr-fYmin)/fKy+fTyz*fZ+fVy);
1091 yj = (Int_t)(fTyx*(xs-fXmin)/fKx+fTyy*(ys-fYmin)/fKy+fTyz*fZ+fVy);
1099 krok = (xi<xj)? 1:-1;
1101 if (b<=fEnvelope[a]) {
1102 fEnvelopeContour[a] = b;
1116 if (yi!=yj) b += (yi<yj)? +1:-1;
1132 line->PaintLine(gPad->PixeltoX(as),gPad->PixeltoY(bs)+1,
1133 gPad->PixeltoX(ae),gPad->PixeltoY(be)+1);
1143 void TSpectrum2Painter::CopyEnvelope(Double_t xr, Double_t xs, Double_t yr,
1147 xi = (Int_t)(fTxx*(xr-fXmin)/fKx+fTxy*(yr-fYmin)/fKy+fVx);
1148 xj = (Int_t)(fTxx*(xs-fXmin)/fKx+fTxy*(ys-fYmin)/fKy+fVx);
1150 for (a=xi;a<=xj;a++) {
1151 if (fEnvelopeContour[a]<fEnvelope[a])
1152 fEnvelope[a] = fEnvelopeContour[a];
1153 fEnvelopeContour[a] = fBy2;
1156 for (a=xj;a<=xi;a++) {
1157 if (fEnvelopeContour[a]<fEnvelope[a])
1158 fEnvelope[a] = fEnvelopeContour[a];
1159 fEnvelopeContour[a] = fBy2;
1582 void TSpectrum2Painter::Paint(Option_t * )
1586 Int_t turni,turnj,w1,w2,x,y;
1587 Int_t q1=0,q2=0,qv=0,smer=0,flag=0,i=0,j=0,x1=0,y1=0,x2=0,y2=0,x3=0,y3=0,x4=0,y4=0,uhl=0,xp1=0,yp1=0,xp2=0,yp2=0;
1588 Int_t ix5,iy5,x6,y6,x7,y7,y8,x1d,y1d,x2d=0,y2d=0;
1589 Int_t i1=0,i2=0,i3=0,i4=0,j1=0,j2=0,j3=0,j4=0;
1590 Int_t s1=0,s2=0,s3=0,s4=0,t1=0,t2=0,t3=0,t4=0;
1591 Double_t dx1,dx2,dx3,dx4,dy1,dy2,dy3,dy4,z1,z2,z3,z4,zl,zh;
1592 Double_t xa,xb=0,ya,yb=0,x5=0,y5=0;
1593 Double_t da=0,db=0,dc=0,dd=0,xtaz,ytaz,ztaz,v,shad_noise;
1594 Int_t iv=0,ekv,stvor,sx1,sx2,sx3,sx4,sx5,sy1,sy2,sy3,sy4,sy5;
1595 Double_t pom1,pom2,sdx1,sdy1,sdx2=0,sdy2,sdx3,sdy3,sdy4,spriz;
1596 Int_t sr1=0,sr2=0,sr3=0,sr4=0,sr5=0,sr6=0,sr7=0,sr8=0;
1597 Int_t tr1=0,tr2=0,tr3=0,tr4=0,tr5=0,tr6=0,tr7=0,tr8=0;
1598 Int_t il,iv1=0,iv2=0,iv3=0,iv4=0;
1599 Double_t v1=0,v2=0,v3=0,v4=0,dxr1,dxr2,dyr1,dyr2,zr1,zr2,bezf;
1600 Double_t dcount_reg,z1l,z2l,z3l,z4l,sdx2p,sdy2p,dap,dbp,dcp,ddp;
1601 Int_t sx1p,sy1p,sx3p,uip=0;
1602 Double_t bezx1,bezy1,bezx2,bezy2;
1603 Double_t p000x,p000y,p100x,p100y,p010x,p010y,p110x,p110y;
1604 Double_t p001x,p001y,p101x,p101y,p011x,p011y,p111x,p111y;
1605 Int_t ibezx1=0,ibezy1=0,ibezx2,ibezy2;
1606 unsigned ui1,ui2,ui3;
1607 Double_t fi,alfa,beta,x3max,y3max,mul,movx,movy;
1608 Double_t xmin,xmax,ymin,ymax,zmin,zmax,mx,my,mz;
1609 Double_t mxx,mxy,myx,myy,myz,px,py,kx,ky;
1610 Double_t bxl,bxh,byl,byh,xd,yd,a,b,rotx,roty;
1611 TLine *line =
new TLine();
1612 TBox *box =
new TBox();
1614 pen_col = (TColor*)(gROOT->GetListOfColors()->At(fPenColor));
1615 ui1 = (Int_t)(256*pen_col->GetRed());
1616 ui2 = (Int_t)(256*pen_col->GetGreen());
1617 ui3 = (Int_t)(256*pen_col->GetBlue());
1619 if (fBx2>=fMaximumXScreenResolution) {
1620 printf(
"The canvas size exceed the maximum X screen resolution.\n");
1621 printf(
"Use the option bf() to increase the buffer size (it should be greater than %d).\n",fBx2);
1625 for (i=fBx1;i<fBx2;i++) {
1626 fEnvelope[i] = fBy2;
1627 fEnvelopeContour[i] = fBy2;
1633 fBx1 = gPad->XtoPixel(0.1);
1634 fBx2 = gPad->XtoPixel(0.99);
1635 fBy1 = gPad->YtoPixel(0.99);
1636 fBy2 = gPad->YtoPixel(0.05);
1637 fXmin = fH2->GetXaxis()->GetFirst();
1638 fXmax = fH2->GetXaxis()->GetLast();
1639 fYmin = fH2->GetYaxis()->GetFirst();
1640 fYmax = fH2->GetYaxis()->GetLast();
1641 fZmax = fH2->GetMaximum();
1642 fZmin = fH2->GetMinimum();
1655 fi = (fViewAngle*3.1415927)/180;
1656 alfa = (fAlpha*3.1415927)/180;
1657 beta = (fBeta*3.1415927)/180;
1658 rotx = (-1)*a*cos(fi)+b*sin(fi)+xd*TMath::Abs(cos(fi))+yd*TMath::Abs(sin(fi));
1659 roty = (-1)*a*sin(fi)-b*cos(fi)+xd*TMath::Abs(sin(fi))+yd*TMath::Abs(cos(fi));
1660 x3max = (xmax-xmin)*TMath::Abs(cos(fi))+(ymax-ymin)*TMath::Abs(sin(fi));
1661 y3max = (xmax-xmin)*TMath::Abs(sin(fi))+(ymax-ymin)*TMath::Abs(cos(fi));
1666 mx = (bxh-bxl)/(x3max*(cos(alfa)+cos(beta)));
1667 my = (bxh-bxl)/(y3max*(cos(alfa)+cos(beta)));
1668 mul = (byh-byl)/(bxh-bxl);
1669 movx = bxl+my*cos(alfa)*y3max;
1670 mxx = mx*cos(beta)*cos(fi)-my*cos(alfa)*sin(fi);
1671 mxy = (-1)*mx*cos(beta)*sin(fi)-my*cos(alfa)*cos(fi);
1672 myx = mul*(mx*sin(beta)*cos(fi)+my*sin(alfa)*sin(fi));
1673 myy = mul*((-1)*mx*sin(beta)*sin(fi)+my*sin(alfa)*cos(fi));
1674 px = rotx*mx*cos(beta)-roty*my*cos(alfa)+movx;
1675 kx = (xmax-xmin)/(fNodesx-1);
1676 ky = (ymax-ymin)/(fNodesy-1);
1687 fVx = mxx*xmin+mxy*ymin+px;
1688 if (fZscale==kZScaleLinear) {
1689 mz = (bxh-bxl)*(cos(alfa)+cos(beta)-sin(alfa)-sin(beta));
1690 mz = mz/((zmax-zmin)*(cos(alfa)+cos(beta)));
1691 movy = byl+mul*mz*zmax;
1693 py = mul*(rotx*mx*sin(beta)+roty*my*sin(alfa))+movy;
1695 fVy = myx*xmin+myy*ymin+py;
1696 fNuSli = (zmax-zmin)/(Double_t)fContWidth;
1697 }
else if (fZscale==kZScaleLog) {
1698 if (zmin>=1) zmin = log(zmin);
1700 if (zmax>=1) zmax = log(zmax);
1702 if ((zmax-zmin)<0.000001) zmax = zmin+0.000001;
1703 mz = (bxh-bxl)*(cos(alfa)+cos(beta)-sin(alfa)-sin(beta));
1704 mz = mz/((zmax-zmin)*(cos(alfa)+cos(beta)));
1705 movy = byl+mul*mz*zmax;
1707 py = mul*(rotx*mx*sin(beta)+roty*my*sin(alfa))+movy;
1709 fVy = myx*xmin+myy*ymin+py;
1710 fNuSli = (zmax-zmin)/(Double_t)fContWidth;
1711 }
else if (fZscale==kZScaleSqrt) {
1712 if (zmin>=1) zmin = sqrt(zmin);
1714 if (zmax>=1) zmax = sqrt(zmax);
1716 if ((zmax-zmin)<0.000001) zmax = zmin+0.000001;
1717 mz = (bxh-bxl)*(cos(alfa)+cos(beta)-sin(alfa)-sin(beta));
1718 mz = mz/((zmax-zmin)*(cos(alfa)+cos(beta)));
1719 movy = byl+mul*mz*zmax;
1721 py = mul*(rotx*mx*sin(beta)+roty*my*sin(alfa))+movy;
1723 fVy = myx*xmin+myy*ymin+py;
1724 fNuSli = (zmax-zmin)/(Double_t)fContWidth;
1728 dcount_reg=fContWidth;
1731 dcount_reg=log(dcount_reg);
1734 dcount_reg=sqrt(dcount_reg);
1744 p000x = gPad->PixeltoX(fXt);
1745 p000y = gPad->PixeltoY(fYt)+1;
1747 p100x = gPad->PixeltoX(fXt);
1748 p100y = gPad->PixeltoY(fYt)+1;
1750 p010x = gPad->PixeltoX(fXt);
1751 p010y = gPad->PixeltoY(fYt)+1;
1752 Transform(w1,w2,-1);
1753 p110x = gPad->PixeltoX(fXt);
1754 p110y = gPad->PixeltoY(fYt)+1;
1755 fZPresetValue = fZmax;
1757 p001x = gPad->PixeltoX(fXt);
1758 p001y = gPad->PixeltoY(fYt)+1;
1760 p101x = gPad->PixeltoX(fXt);
1761 p101y = gPad->PixeltoY(fYt)+1;
1763 p011x = gPad->PixeltoX(fXt);
1764 p011y = gPad->PixeltoY(fYt)+1;
1765 Transform(w1,w2,-2);
1766 p111x = gPad->PixeltoX(fXt);
1767 p111y = gPad->PixeltoY(fYt)+1;
1768 Double_t bmin, bmax, binLow, binHigh, binWidth;
1769 Double_t axisLevel, gridDist, gridY1, gridY2;
1770 Int_t ndivx = 0, ndivy, ndivz, nbins;
1771 TGaxis *axis =
new TGaxis();
1772 TGaxis *xaxis =
new TGaxis();
1773 TGaxis *yaxis =
new TGaxis();
1774 TGaxis *zaxis =
new TGaxis();
1775 line->SetLineStyle(kPenStyleDot);
1776 if (fViewAngle==0) {
1777 axis->PaintAxis(p000x, p000y, p100x, p100y, bmin, bmax, ndivx,
"");
1778 axis->PaintAxis(p000x, p000y, p010x, p010y, bmin, bmax, ndivx,
"");
1780 axis->PaintAxis(p000x, p000y, p001x, p001y, bmin, bmax, ndivx,
"");
1782 axis->PaintAxis(p100x, p100y, p101x, p101y, bmin, bmax, ndivx,
"");
1783 axis->PaintAxis(p101x, p101y, p001x, p001y, bmin, bmax, ndivx,
"");
1784 axis->PaintAxis(p001x, p001y, p011x, p011y, bmin, bmax, ndivx,
"");
1785 if (fZscale==kZScaleLinear) {
1789 THLimitsFinder::Optimize(bmin, bmax, ndivz, binLow, binHigh,
1790 nbins, binWidth,
" ");
1791 for (i = 0; i < nbins + 1; i++) {
1792 axisLevel = binLow+i*binWidth;
1793 gridDist = (axisLevel-bmin)*(p001y-p000y)/(bmax-bmin);
1794 gridY1 = p000y + gridDist, gridY2 = p100y + gridDist;
1795 line->PaintLine(p000x,gridY1,p100x,gridY2);
1796 gridY2 = p010y + gridDist;
1797 line->PaintLine(p000x,gridY1,p010x,gridY2);
1800 }
else if (fViewAngle==90) {
1801 axis->PaintAxis(p010x, p010y, p000x, p000y, bmin, bmax, ndivx,
"");
1802 axis->PaintAxis(p010x, p010y, p110x, p110y, bmin, bmax, ndivx,
"");
1804 axis->PaintAxis(p010x, p010y, p011x, p011y, bmin, bmax, ndivx,
"");
1806 axis->PaintAxis(p000x, p000y, p001x, p001y, bmin, bmax, ndivx,
"");
1807 axis->PaintAxis(p001x, p001y, p011x, p011y, bmin, bmax, ndivx,
"");
1808 axis->PaintAxis(p011x, p011y, p111x, p111y, bmin, bmax, ndivx,
"");
1809 if (fZscale==kZScaleLinear) {
1813 THLimitsFinder::Optimize(bmin, bmax, ndivz, binLow, binHigh,
1814 nbins, binWidth,
" ");
1815 for (i = 0; i < nbins + 1; i++) {
1816 axisLevel = binLow+i*binWidth;
1817 gridDist = (axisLevel-bmin)*(p011y-p010y)/(bmax-bmin);
1818 gridY1 = p010y + gridDist, gridY2 = p000y + gridDist;
1819 line->PaintLine(p010x,gridY1,p000x,gridY2);
1820 gridY2 = p110y + gridDist;
1821 line->PaintLine(p010x,gridY1,p110x,gridY2);
1824 }
else if (fViewAngle==180) {
1825 axis->PaintAxis(p110x, p110y, p010x, p010y, bmin, bmax, ndivx,
"");
1826 axis->PaintAxis(p110x, p110y, p100x, p100y, bmin, bmax, ndivx,
"");
1828 axis->PaintAxis(p110x, p110y, p111x, p111y, bmin, bmax, ndivx,
"");
1830 axis->PaintAxis(p010x, p010y, p011x, p011y, bmin, bmax, ndivx,
"");
1831 axis->PaintAxis(p011x, p011y, p111x, p111y, bmin, bmax, ndivx,
"");
1832 axis->PaintAxis(p111x, p111y, p101x, p101y, bmin, bmax, ndivx,
"");
1833 if (fZscale==kZScaleLinear) {
1837 THLimitsFinder::Optimize(bmin, bmax, ndivz, binLow, binHigh,
1838 nbins, binWidth,
" ");
1839 for (i = 0; i < nbins + 1; i++) {
1840 axisLevel = binLow+i*binWidth;
1841 gridDist = (axisLevel-bmin)*(p111y-p110y)/(bmax-bmin);
1842 gridY1 = p110y + gridDist, gridY2 = p010y + gridDist;
1843 line->PaintLine(p110x,gridY1,p010x,gridY2);
1844 gridY2 = p100y + gridDist;
1845 line->PaintLine(p110x,gridY1,p100x,gridY2);
1848 }
else if (fViewAngle==270) {
1849 axis->PaintAxis(p100x, p100y, p110x, p110y, bmin, bmax, ndivx,
"");
1850 axis->PaintAxis(p100x, p100y, p000x, p000y, bmin, bmax, ndivx,
"");
1852 axis->PaintAxis(p100x, p100y, p101x, p101y, bmin, bmax, ndivx,
"");
1854 axis->PaintAxis(p110x, p110y, p111x, p111y, bmin, bmax, ndivx,
"");
1855 axis->PaintAxis(p111x, p111y, p101x, p101y, bmin, bmax, ndivx,
"");
1856 axis->PaintAxis(p101x, p101y, p001x, p001y, bmin, bmax, ndivx,
"");
1857 if (fZscale==kZScaleLinear) {
1861 THLimitsFinder::Optimize(bmin, bmax, ndivz, binLow, binHigh,
1862 nbins, binWidth,
" ");
1863 for (i = 0; i < nbins + 1; i++) {
1864 axisLevel = binLow+i*binWidth;
1865 gridDist = (axisLevel-bmin)*(p101y-p100y)/(bmax-bmin);
1866 gridY1 = p100y + gridDist, gridY2 = p110y + gridDist;
1867 line->PaintLine(p100x,gridY1,p110x,gridY2);
1868 gridY2 = p000y + gridDist;
1869 line->PaintLine(p100x,gridY1,p000x,gridY2);
1875 line->ResetAttLine(
"");
1876 line->SetLineColor(fPenColor);
1877 line->SetLineWidth(fPenWidth);
1878 line->SetLineStyle(fPenDash);
1887 if (x2>=x1) turnj = 1;
1888 if (x3>=x2) turni = 1;
1916 if (smer==0) q1 -= 1;
1920 if (smer==0) q2 += 1;
1944 switch (fDisplayMode) {
1945 case kDisplayModePoints:
1946 if (fModeGroup==kModeGroupSimple) {
1947 Envelope(x1,y1,x2,y2);
1948 if (y1<=fEnvelope[x1]) {
1949 line->PaintLine(gPad->PixeltoX(x1) ,gPad->PixeltoY(y1)+1,
1950 gPad->PixeltoX(x1+1),gPad->PixeltoY(y1)+1);
1952 if (y2<=fEnvelope[x2]) {
1953 line->PaintLine(gPad->PixeltoX(x2) ,gPad->PixeltoY(y2)+1,
1954 gPad->PixeltoX(x2+1),gPad->PixeltoY(y2)+1);
1957 if ((q1!=q2||smer!=0) && flag==1) {
1966 if (fShading==kShaded) {
1968 tr1 = (Int_t)TMath::Max(t1-1,0);
1970 tr2 = (Int_t)TMath::Max(t2-1,0);
1971 sr3 = (Int_t)TMath::Max(s2-1,0);
1973 sr4 = (Int_t)TMath::Max(s3-1,0);
1990 i1 = (Int_t)TMath::Max(w1-s1,0);
1991 i2 = (Int_t)TMath::Max(w1-s2,0);
1992 i3 = (Int_t)TMath::Max(w1-s3,0);
1993 i4 = (Int_t)TMath::Max(w1-s4,0);
1994 if (fShading==kShaded) {
1995 sr1 = (Int_t)TMath::Max(w1-sr1,0);
1996 sr2 = (Int_t)TMath::Max(w1-sr2,0);
1997 sr3 = (Int_t)TMath::Max(w1-sr3,0);
1998 sr4 = (Int_t)TMath::Max(w1-sr4,0);
1999 sr5 = (Int_t)TMath::Max(w1-sr5,0);
2000 sr6 = (Int_t)TMath::Max(w1-sr6,0);
2001 sr7 = (Int_t)TMath::Max(w1-sr7,0);
2002 sr8 = (Int_t)TMath::Max(w1-sr8,0);
2011 j1 = (Int_t)TMath::Max(w2-t1,0);
2012 j2 = (Int_t)TMath::Max(w2-t2,0);
2013 j3 = (Int_t)TMath::Max(w2-t3,0);
2014 j4 = (Int_t)TMath::Max(w2-t4,0);
2015 if (fShading==kShaded) {
2016 tr1 = (Int_t)TMath::Max(w2-tr1,0);
2017 tr2 = (Int_t)TMath::Max(w2-tr2,0);
2018 tr3 = (Int_t)TMath::Max(w2-tr3,0);
2019 tr4 = (Int_t)TMath::Max(w2-tr4,0);
2020 tr5 = (Int_t)TMath::Max(w2-tr5,0);
2021 tr6 = (Int_t)TMath::Max(w2-tr6,0);
2022 tr7 = (Int_t)TMath::Max(w2-tr7,0);
2023 tr8 = (Int_t)TMath::Max(w2-tr8,0);
2050 Envelope(x1,y1,x2,y2);
2051 Envelope(x2,y2,x3,y3);
2052 xtaz = (dx1+dx2+dx4)/3;
2053 ytaz = (dy1+dy2+dy4)/3;
2054 ztaz = (z1+z2+z4)/3;
2055 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx4,dy4,z4);
2056 if (fShading==kShaded) {
2057 if (fShadow==kShadowsNotPainted) {
2058 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
2059 else Transform(sr1,tr1,0);
2063 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
2064 else Transform(sr8,tr8,0);
2068 v = v+ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1);
2069 v = v+ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2);
2070 v = v+ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4);
2072 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
2073 else Transform(sr3,tr3,0);
2077 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
2078 else Transform(sr2,tr2,0);
2082 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3);
2083 v = v+ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3);
2084 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
2085 v = v+ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1);
2087 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
2088 else Transform(sr5,tr5,0);
2092 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
2093 else Transform(sr4,tr4,0);
2097 v = ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
2098 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1);
2099 v = v+ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
2100 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3);
2102 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
2103 else Transform(sr7,tr7,0);
2107 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
2108 else Transform(sr6,tr6,0);
2112 v = ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4);
2113 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2);
2114 v = v+ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
2115 v = v+ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1);
2118 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
2121 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
2122 else Transform(sr1,tr1,0);
2126 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
2127 else Transform(sr8,tr8,0);
2131 da = (dxr1+dx2+dx1)/3;
2132 db = (dyr1+dy2+dy1)/3;
2134 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2135 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
2136 da = (dxr1+dxr2+dx1)/3;
2137 db = (dyr1+dyr2+dy1)/3;
2138 dc = (zr1+zr2+z1)/3;
2139 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2140 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2)+spriz)/2;
2141 da = (dxr2+dx1+dx4)/3;
2142 db = (dyr2+dy1+dy4)/3;
2144 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2145 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4)+spriz)/2;
2147 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
2148 else Transform(sr3,tr3,0);
2152 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
2153 else Transform(sr2,tr2,0);
2157 da = (dx1+dx2+dx3)/3;
2158 db = (dy1+dy2+dy3)/3;
2160 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2161 v = (ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3)+spriz)/2;
2162 da = (dx2+dxr1+dx3)/3;
2163 db = (dy2+dyr1+dy3)/3;
2165 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2166 v = v+(ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3)+spriz)/2;
2167 da = (dx2+dxr2+dxr1)/3;
2168 db = (dy2+dyr2+dyr1)/3;
2169 dc = (z2+zr2+zr1)/3;
2170 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2171 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
2172 da = (dxr2+dx2+dx1)/3;
2173 db = (dyr2+dy2+dy1)/3;
2175 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2176 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
2178 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
2179 else Transform(sr5,tr5,0);
2183 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
2184 else Transform(sr4,tr4,0);
2188 da = (dx2+dx3+dx4)/3;
2189 db = (dy2+dy3+dy4)/3;
2191 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2192 v = (ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
2193 da = (dx4+dx3+dxr1)/3;
2194 db = (dy4+dy3+dyr1)/3;
2196 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2197 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1)+spriz)/2;
2198 da = (dx3+dxr2+dxr1)/3;
2199 db = (dy3+dyr2+dyr1)/3;
2200 dc = (z3+zr2+zr1)/3;
2201 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2202 v = v+(ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
2203 da = (dx2+dxr2+dx3)/3;
2204 db = (dy2+dyr2+dy3)/3;
2206 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2207 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3)+spriz)/2;
2209 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
2210 else Transform(sr7,tr7,0);
2214 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
2215 else Transform(sr6,tr6,0);
2219 da = (dx1+dx3+dx4)/3;
2220 db = (dy1+dy3+dy4)/3;
2222 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2223 v = (ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
2224 da = (dx4+dx3+dxr2)/3;
2225 db = (dy4+dy3+dyr2)/3;
2227 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2228 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2)+spriz)/2;
2229 da = (dx4+dxr2+dxr1)/3;
2230 db = (dy4+dyr2+dyr1)/3;
2231 dc = (z4+zr2+zr1)/3;
2232 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2233 v = v+(ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
2234 da = (dx1+dx4+dxr1)/3;
2235 db = (dy1+dy4+dyr1)/3;
2237 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2238 v = v+(ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1)+spriz)/2;
2243 if (fShadow==kShadowsNotPainted) {
2244 if (fShading==kNotShaded) {
2246 iv = fLevels-(Int_t)v;
2249 iv1 = fLevels-(Int_t)v1;
2251 iv2 = fLevels-(Int_t)v2;
2253 iv4 = fLevels-(Int_t)v4;
2256 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
2257 if (fShading==kNotShaded) {
2259 iv = fLevels-(Int_t)(v+0.5);
2262 iv1 = fLevels-(Int_t)v1;
2264 iv2 = fLevels-(Int_t)v2;
2266 iv4 = fLevels-(Int_t)v4;
2269 if (fShading==kNotShaded) {
2270 ColorModel(iv,ui1,ui2,ui3);
2271 line->SetLineColor(fNewColorIndex);
2272 if (fEnvelope[x1]>=y1) {
2273 line->PaintLine(gPad->PixeltoX(x1),gPad->PixeltoY(y1)+1,gPad->PixeltoX(x1+1),gPad->PixeltoY(y1)+1);
2276 if (fEnvelope[x2]>=y2) {
2277 line->PaintLine(gPad->PixeltoX(x2),gPad->PixeltoY(y2)+1,gPad->PixeltoX(x2+1),gPad->PixeltoY(y2)+1);
2280 if (fEnvelope[x4]>=y4) {
2281 line->PaintLine(gPad->PixeltoX(x4),gPad->PixeltoY(y4)+1,gPad->PixeltoX(x4+1),gPad->PixeltoY(y4)+1);
2285 if (fEnvelope[x1]>=y1) {
2287 ColorModel(iv,ui1,ui2,ui3);
2288 line->SetLineColor(fNewColorIndex);
2289 line->PaintLine(gPad->PixeltoX(x1),gPad->PixeltoY(y1)+1,gPad->PixeltoX(x1+1),gPad->PixeltoY(y1)+1);
2292 if (fEnvelope[x2]>=y2) {
2294 ColorModel(iv,ui1,ui2,ui3);
2295 line->SetLineColor(fNewColorIndex);
2296 line->PaintLine(gPad->PixeltoX(x2),gPad->PixeltoY(y2)+1,gPad->PixeltoX(x2+1),gPad->PixeltoY(y2)+1);
2299 if (fEnvelope[x4]>=y4) {
2301 ColorModel(iv,ui1,ui2,ui3);
2302 line->SetLineColor(fNewColorIndex);
2303 line->PaintLine(gPad->PixeltoX(x4),gPad->PixeltoY(y4)+1,gPad->PixeltoX(x4+1),gPad->PixeltoY(y4)+1);
2307 xtaz = (dx3+dx2+dx4)/3;
2308 ytaz = (dy3+dy2+dy4)/3;
2309 ztaz = (z3+z2+z4)/3;
2310 if (fShading==kNotShaded) v=ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
2312 if (fShadow==kShadowsNotPainted) {
2313 if (fShading==kNotShaded) {
2315 iv = fLevels-(Int_t)v;
2318 iv3 = fLevels-(Int_t)v3;
2321 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
2322 if (fShading==kNotShaded) {
2324 iv = fLevels-(Int_t)v;
2325 iv = (Int_t)(iv-fLevels*spriz/2);
2328 iv3 = fLevels-(Int_t)v3;
2331 if (fShading==kNotShaded) {
2332 ColorModel(iv,ui1,ui2,ui3);
2333 line->ResetAttLine(
"");
2334 line->SetLineColor(fNewColorIndex);
2335 if (fEnvelope[x3]>=y3) {
2336 line->PaintLine(gPad->PixeltoX(x3),gPad->PixeltoY(y3)+1,gPad->PixeltoX(x3+1),gPad->PixeltoY(y3)+1);
2340 if (fEnvelope[x3]>=y3) {
2342 ColorModel(iv,ui1,ui2,ui3);
2343 line->ResetAttLine(
"");
2344 line->SetLineColor(fNewColorIndex);
2345 line->PaintLine(gPad->PixeltoX(x3),gPad->PixeltoY(y3)+1,gPad->PixeltoX(x3+1),gPad->PixeltoY(y3)+1);
2352 case kDisplayModeGrid:
2353 if (fBezier==kNoBezierInterpol) {
2354 if (fModeGroup==kModeGroupSimple) {
2355 Envelope(x1,y1,x2,y2);
2361 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
2364 if ((q1!=q2||smer!=0)&&flag==1) {
2373 if (fShading==kShaded) {
2375 tr1 = (Int_t)TMath::Max(t1-1,0);
2377 tr2 = (Int_t)TMath::Max(t2-1,0);
2378 sr3 = (Int_t)TMath::Max(s2-1,0);
2380 sr4 = (Int_t)TMath::Max(s3-1,0);
2397 i1 = (Int_t)TMath::Max(w1-s1,0);
2398 i2 = (Int_t)TMath::Max(w1-s2,0);
2399 i3 = (Int_t)TMath::Max(w1-s3,0);
2400 i4 = (Int_t)TMath::Max(w1-s4,0);
2401 if (fShading==kShaded) {
2402 sr1 = (Int_t)TMath::Max(w1-sr1,0);
2403 sr2 = (Int_t)TMath::Max(w1-sr2,0);
2404 sr3 = (Int_t)TMath::Max(w1-sr3,0);
2405 sr4 = (Int_t)TMath::Max(w1-sr4,0);
2406 sr5 = (Int_t)TMath::Max(w1-sr5,0);
2407 sr6 = (Int_t)TMath::Max(w1-sr6,0);
2408 sr7 = (Int_t)TMath::Max(w1-sr7,0);
2409 sr8 = (Int_t)TMath::Max(w1-sr8,0);
2418 j1 = (Int_t)TMath::Max(w2-t1,0);
2419 j2 = (Int_t)TMath::Max(w2-t2,0);
2420 j3 = (Int_t)TMath::Max(w2-t3,0);
2421 j4 = (Int_t)TMath::Max(w2-t4,0);
2422 if (fShading==kShaded) {
2423 tr1 = (Int_t)TMath::Max(w2-tr1,0);
2424 tr2 = (Int_t)TMath::Max(w2-tr2,0);
2425 tr3 = (Int_t)TMath::Max(w2-tr3,0);
2426 tr4 = (Int_t)TMath::Max(w2-tr4,0);
2427 tr5 = (Int_t)TMath::Max(w2-tr5,0);
2428 tr6 = (Int_t)TMath::Max(w2-tr6,0);
2429 tr7 = (Int_t)TMath::Max(w2-tr7,0);
2430 tr8 = (Int_t)TMath::Max(w2-tr8,0);
2457 Envelope(x1,y1,x2,y2);
2458 Envelope(x2,y2,x3,y3);
2459 xtaz = (dx1+dx2+dx4)/3;
2460 ytaz = (dy1+dy2+dy4)/3;
2461 ztaz = (z1+z2+z4)/3;
2462 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx4,dy4,z4);
2463 if (fShading==kShaded) {
2464 if (fShadow==kShadowsNotPainted) {
2465 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
2466 else Transform(sr1,tr1,0);
2470 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
2471 else Transform(sr8,tr8,0);
2475 v = v+ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1);
2476 v = v+ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2);
2477 v = v+ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4);
2479 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
2480 else Transform(sr3,tr3,0);
2484 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
2485 else Transform(sr2,tr2,0);
2489 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3);
2490 v = v+ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3);
2491 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
2492 v = v+ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1);
2494 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
2495 else Transform(sr5,tr5,0);
2499 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
2500 else Transform(sr4,tr4,0);
2504 v = ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
2505 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1);
2506 v = v+ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
2507 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3);
2509 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
2510 else Transform(sr7,tr7,0);
2514 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
2515 else Transform(sr6,tr6,0);
2519 v = ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4);
2520 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2);
2521 v = v+ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
2522 v = v+ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1);
2525 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
2528 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
2529 else Transform(sr1,tr1,0);
2533 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
2534 else Transform(sr8,tr8,0);
2538 da = (dxr1+dx2+dx1)/3;
2539 db = (dyr1+dy2+dy1)/3;
2541 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2542 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
2543 da = (dxr1+dxr2+dx1)/3;
2544 db = (dyr1+dyr2+dy1)/3;
2545 dc = (zr1+zr2+z1)/3;
2546 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2547 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2)+spriz)/2;
2548 da = (dxr2+dx1+dx4)/3;
2549 db = (dyr2+dy1+dy4)/3;
2551 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2552 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4)+spriz)/2;
2554 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
2555 else Transform(sr3,tr3,0);
2559 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
2560 else Transform(sr2,tr2,0);
2564 da = (dx1+dx2+dx3)/3;
2565 db = (dy1+dy2+dy3)/3;
2567 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2568 v = (ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3)+spriz)/2;
2569 da = (dx2+dxr1+dx3)/3;
2570 db = (dy2+dyr1+dy3)/3;
2572 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2573 v = v+(ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3)+spriz)/2;
2574 da = (dx2+dxr2+dxr1)/3;
2575 db = (dy2+dyr2+dyr1)/3;
2576 dc = (z2+zr2+zr1)/3;
2577 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2578 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
2579 da = (dxr2+dx2+dx1)/3;
2580 db = (dyr2+dy2+dy1)/3;
2582 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2583 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
2585 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
2586 else Transform(sr5,tr5,0);
2590 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
2591 else Transform(sr4,tr4,0);
2595 da = (dx2+dx3+dx4)/3;
2596 db = (dy2+dy3+dy4)/3;
2598 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2599 v = (ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
2600 da = (dx4+dx3+dxr1)/3;
2601 db = (dy4+dy3+dyr1)/3;
2603 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2604 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1)+spriz)/2;
2605 da = (dx3+dxr2+dxr1)/3;
2606 db = (dy3+dyr2+dyr1)/3;
2607 dc = (z3+zr2+zr1)/3;
2608 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2609 v = v+(ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
2610 da = (dx2+dxr2+dx3)/3;
2611 db = (dy2+dyr2+dy3)/3;
2613 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2614 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3)+spriz)/2;
2616 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
2617 else Transform(sr7,tr7,0);
2621 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
2622 else Transform(sr6,tr6,0);
2626 da = (dx1+dx3+dx4)/3;
2627 db = (dy1+dy3+dy4)/3;
2629 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2630 v = (ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
2631 da = (dx4+dx3+dxr2)/3;
2632 db = (dy4+dy3+dyr2)/3;
2634 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2635 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2)+spriz)/2;
2636 da = (dx4+dxr2+dxr1)/3;
2637 db = (dy4+dyr2+dyr1)/3;
2638 dc = (z4+zr2+zr1)/3;
2639 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2640 v = v+(ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
2641 da = (dx1+dx4+dxr1)/3;
2642 db = (dy1+dy4+dyr1)/3;
2644 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
2645 v = v+(ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1)+spriz)/2;
2650 if (fShadow==kShadowsNotPainted) {
2651 if (fShading==kNotShaded) {
2653 iv = fLevels-(Int_t)v;
2656 iv1 = fLevels-(Int_t)v1;
2658 iv2 = fLevels-(Int_t)v2;
2660 iv4 = fLevels-(Int_t)v4;
2663 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
2664 if (fShading==kNotShaded) {
2666 iv = fLevels-(Int_t)(v+0.5);
2669 iv1 = fLevels-(Int_t)v1;
2671 iv2 = fLevels-(Int_t)v2;
2673 iv4 = fLevels-(Int_t)v4;
2676 if (fShading==kNotShaded) {
2677 ColorModel(iv,ui1,ui2,ui3);
2678 line->SetLineColor(fNewColorIndex);
2689 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
2690 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
2691 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
2692 dd = -da*dx1-db*dy1-dc*z1;
2709 if (pom2!=0) sdx1 = pom1/pom2;
2712 sdy1 = pom1-sdx1*pom2;
2713 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
2715 sdy4 = sdx1*pom1+sdy1;
2716 sy4 = (Int_t)(sdy4);
2717 if (sy4<=fEnvelope[sx4]) {
2718 fEnvelope[sx4] = sy4;
2719 if (fShading==kNotShaded) {
2720 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2724 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
2725 else v = (iv1+iv2+iv4)/3;
2727 ColorModel(iv,ui1,ui2,ui3);
2728 line->SetLineColor(fNewColorIndex);
2729 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2733 sy4 = fEnvelope[sx4];
2734 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
2735 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2736 }
else if (sy5<=fEnvelope[sx5]) {
2739 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
2740 else v = (iv1+iv2+iv4)/3;
2742 ColorModel(iv,ui1,ui2,ui3);
2743 line->SetLineColor(fNewColorIndex);
2744 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2746 sy5 = fEnvelope[sx4];
2764 if (pom2!=0) sdx2 = pom1/pom2;
2767 sdy2 = pom1-sdx2*pom2;
2777 uip = fNewColorIndex;
2778 xtaz = (dx3+dx2+dx4)/3;
2779 ytaz = (dy3+dy2+dy4)/3;
2780 ztaz = (z3+z2+z4)/3;
2781 if (fShading==kNotShaded) v = ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
2783 if (fShadow==kShadowsNotPainted) {
2784 if (fShading==kNotShaded) {
2786 iv = fLevels-(Int_t)v;
2789 iv3 = fLevels-(Int_t)v3;
2792 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
2793 if (fShading==kNotShaded) {
2795 iv = fLevels-(Int_t)v;
2796 iv = (Int_t)(iv-fLevels*spriz/2);
2799 iv3 = fLevels-(Int_t)v3;
2802 if (fShading==kNotShaded) {
2803 ColorModel(iv,ui1,ui2,ui3);
2804 line->SetLineColor(fNewColorIndex);
2815 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
2816 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
2817 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
2818 dd = -da*dx1-db*dy1-dc*z1;
2835 if (pom2!=0) sdx1 = pom1/pom2;
2838 sdy1 = pom1-sdx1*pom2;
2839 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
2841 sdy4 = sdx1*pom1+sdy1;
2843 if (sy4<=fEnvelope[sx4]) {
2844 fEnvelope[sx4] = sy4;
2845 if (fShading==kNotShaded) {
2846 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2850 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
2851 else v = (iv1+iv2+iv4)/3;
2853 ColorModel(iv,ui1,ui2,ui3);
2854 line->SetLineColor(fNewColorIndex);
2855 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2859 sy4 = fEnvelope[sx4];
2860 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
2861 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2862 }
else if (sy5<=fEnvelope[sx5]) {
2865 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
2866 else v = (iv1+iv2+iv4)/3;
2868 ColorModel(iv,ui1,ui2,ui3);
2869 line->SetLineColor(fNewColorIndex);
2870 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2872 sy5 = fEnvelope[sx4];
2876 for (sx4=sx1p,sx5=sx1p,sy5=sy1p;sx4<=sx3p;sx4++) {
2878 sdy4 = sdx2p*pom1+sdy2p;
2880 if (sy4<=fEnvelope[sx4]) {
2882 if (fShading==kNotShaded) {
2883 line->SetLineColor(uip);
2884 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2888 if (dcp!=0) v = (-ddp-dap*dx1-dbp*dy1)/dcp;
2889 else v = (iv1+iv2+iv4)/3;
2891 ColorModel(iv,ui1,ui2,ui3);
2892 line->SetLineColor(fNewColorIndex);
2893 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2897 sy4 = fEnvelope[sx4];
2898 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
2899 line->SetLineColor(uip);
2900 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2901 }
else if (sy5<=fEnvelope[sx5]) {
2904 if (dcp!=0) v = (-ddp-dap*dx1-dbp*dy1)/dcp;
2905 else v = (iv1+iv2+iv4)/3;
2907 ColorModel(iv,ui1,ui2,ui3);
2908 line->SetLineColor(fNewColorIndex);
2909 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2911 sy5 = fEnvelope[sx4];
2930 if (pom2!=0) sdx2 = pom1/pom2;
2933 sdy2 = pom1-sdx2*pom2;
2934 for (sx4=sx2,sx5=sx2,sy5=sy2;sx4<=sx3;sx4++) {
2936 sdy4 = sdx2*pom1+sdy2;
2938 if (sy4<=fEnvelope[sx4]) {
2939 fEnvelope[sx4] = sy4;
2940 if (fShading==kNotShaded) {
2941 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2945 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
2946 else v =(iv1+iv2+iv4)/3;
2948 ColorModel(iv,ui1,ui2,ui3);
2949 line->SetLineColor(fNewColorIndex);
2950 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2954 sy4 = fEnvelope[sx4];
2955 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
2956 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2957 }
else if (sy5<=fEnvelope[sx5]) {
2960 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
2961 else v =(iv1+iv2+iv4)/3;
2963 ColorModel(iv,ui1,ui2,ui3);
2964 line->SetLineColor(fNewColorIndex);
2965 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
2967 sy5 = fEnvelope[sx4];
2974 if (((flag==0)&&(smer==0))||((flag!=0)&&(smer!=0))) {
2976 t1 = (Int_t)TMath::Max(q2-1,0);
2978 t2 = (Int_t)TMath::Min(q2+2,w2);
2979 }
else if (((flag!=0)&&(smer==0))||((flag==0)&&(smer!=0))) {
2980 s1 = (Int_t)TMath::Max(q1-1,0);
2982 s2 = (Int_t)TMath::Min(q1+2,w1);
3005 bezx1 = x1+(x2-x1)/3;
3006 bezx2 = x1+2*(x2-x1)/3;
3007 bezy1 = y1+(y2-y3)/6;
3008 bezy2 = y2-(y4-y1)/6;
3028 fBzX[1] = (Int_t)bezx1;
3029 fBzY[1] = (Int_t)bezy1;
3030 fBzX[2] = (Int_t)bezx2;
3031 fBzY[2] = (Int_t)bezy2;
3034 for (bezf=0;bezf<1.01;bezf+=0.1) {
3035 BezierSmoothing(bezf);
3037 ibezx1 = (Int_t)(fGbezx+0.5);
3038 ibezy1 = (Int_t)(fGbezy+0.5);
3042 ibezx1 = (Int_t)(fGbezx+0.5);
3043 ibezy1 = (Int_t)(fGbezy+0.5);
3044 Envelope(ibezx2,ibezy2,ibezx1,ibezy1);
3050 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3073 fBzX[1] = (Int_t)bezx1;
3074 fBzY[1] = (Int_t)bezy1;
3075 fBzX[2] = (Int_t)bezx2;
3076 fBzY[2] = (Int_t)bezy2;
3079 for (bezf=0;bezf<1.01;bezf+=0.1) {
3080 BezierSmoothing(bezf);
3082 ibezx1 = (Int_t)(fGbezx+0.5);
3083 ibezy1 = (Int_t)(fGbezy+0.5);
3087 ibezx1 = (Int_t)(fGbezx+0.5);
3088 ibezy1 = (Int_t)(fGbezy+0.5);
3089 Envelope(ibezx1,ibezy1,ibezx2,ibezy2);
3095 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3102 case kDisplayModeContours:
3103 if ((q1!=q2||smer!=0)&&flag==1) {
3113 i1 = (Int_t)TMath::Min(w1,s1);
3114 i2 = (Int_t)TMath::Min(w1,s2);
3115 i3 = (Int_t)TMath::Min(w1,s3);
3116 i4 = (Int_t)TMath::Min(w1,s4);
3118 i1 = (Int_t)TMath::Max(w1-s1,0);
3119 i2 = (Int_t)TMath::Max(w1-s2,0);
3120 i3 = (Int_t)TMath::Max(w1-s3,0);
3121 i4 = (Int_t)TMath::Max(w1-s4,0);
3124 j1 = (Int_t)TMath::Min(w2,t1);
3125 j2 = (Int_t)TMath::Min(w2,t2);
3126 j3 = (Int_t)TMath::Min(w2,t3);
3127 j4 = (Int_t)TMath::Min(w2,t4);
3129 j1 = (Int_t)TMath::Max(w2-t1,0);
3130 j2 = (Int_t)TMath::Max(w2-t2,0);
3131 j3 = (Int_t)TMath::Max(w2-t3,0);
3132 j4 = (Int_t)TMath::Max(w2-t4,0);
3154 zh = (Double_t)TMath::Max(z1,z2);
3155 zh = (Double_t)TMath::Max(zh,z3);
3156 zh = (Double_t)TMath::Max(zh,z4);
3157 zl = (Double_t)TMath::Min(z1l,z2l);
3158 zl = (Double_t)TMath::Min(zl,z3l);
3159 zl = (Double_t)TMath::Min(zl,z4l);
3160 i1 = (Int_t)(zl/dcount_reg+1);
3161 if (z1!=z2||z2!=z3||z3!=z4) {
3166 if (fZ>=1.0) fZ = log(fZ);
3170 if (fZ>0) fZ = sqrt(fZ);
3174 if (fModeGroup!=kModeGroupSimple) {
3175 v = ColorCalculation(dx1,dy1,fZ,dx2,dy2,fZ,dx4,dy4,fZ);
3177 iv = fLevels-(Int_t)v;
3178 ColorModel(iv,ui1,ui2,ui3);
3179 line->SetLineColor(fNewColorIndex);
3181 if (fZ>zh)
goto eqend;
3185 if ((z2<=fZ&&fZ<z1)||(z2<fZ&&fZ<=z1)) {
3186 xb = (fZ-z2)*(dx1-dx2)/(z1-z2)+dx2;
3189 if ((z1<=fZ&&fZ<z2)||(z1<fZ&&fZ<=z2)) {
3190 xb = (fZ-z1)*(dx2-dx1)/(z2-z1)+dx1;
3193 if (z2==fZ&&fZ==z1) {
3202 if ((z1<=fZ&&fZ<z4)||(z1<fZ&&fZ<=z4)) {
3203 ya = (fZ-z1)*(dy4-dy1)/(z4-z1)+dy1;
3206 if ((z4<=fZ&&fZ<z1)||(z4<fZ&&fZ<=z1)) {
3207 ya = (fZ-z4)*(dy1-dy4)/(z1-z4)+dy4;
3210 if (z4==fZ&&fZ==z1) {
3215 Slice(xa,ya,xb,yb,line);
3222 if ((z3<=fZ&&fZ<z4)||(z3<fZ&&fZ<=z4)) {
3223 xa = (fZ-z3)*(dx4-dx3)/(z4-z3)+dx3;
3226 if ((z4<=fZ&&fZ<z3)||(z4<fZ&&fZ<=z3)) {
3227 xa = (fZ-z4)*(dx3-dx4)/(z3-z4)+dx4;
3230 if (z4==fZ&&fZ==z3) {
3235 Slice(xa,ya,xb,yb,line);
3242 if ((z2<=fZ&&fZ<z3)||(z2<fZ&&fZ<=z3)) {
3243 ya = (fZ-z2)*(dy3-dy2)/(z3-z2)+dy2;
3246 if ((z3<=fZ&&fZ<z2)||(z3<fZ&&fZ<=z2)) {
3247 ya = (fZ-z3)*(dy2-dy3)/(z2-z3)+dy3;
3250 if (z3==fZ&&fZ==z2) {
3255 Slice(xa,ya,xb,yb,line);
3258 if (stvor==4) Slice(xa,ya,x5,y5,line);
3262 CopyEnvelope(dx1,dx3,dy1,dy3);
3266 case kDisplayModeBars:
3267 case kDisplayModeBarsX:
3268 case kDisplayModeBarsY:
3269 if ((q1!=q2||smer!=0)&&flag==1) {
3280 if (fDisplayMode==kDisplayModeBarsX) {
3281 if (s1<=w1&&s2<=w1&&s3<=w1&&s4<=w1) {
3288 i1 = (Int_t)TMath::Min(w1,s1);
3289 i2 = (Int_t)TMath::Min(w1,s2);
3290 i3 = (Int_t)TMath::Min(w1,s3);
3291 i4 = (Int_t)TMath::Min(w1,s4);
3294 if (fDisplayMode==kDisplayModeBarsX) {
3295 if (s1<=w1&&s2<=w1&&s3<=w1&&s4<=w1) {
3302 i1 = (Int_t)TMath::Max(w1-s1,0);
3303 i2 = (Int_t)TMath::Max(w1-s2,0);
3304 i3 = (Int_t)TMath::Max(w1-s3,0);
3305 i4 = (Int_t)TMath::Max(w1-s4,0);
3309 if (fDisplayMode==kDisplayModeBarsY) {
3310 if (t1<=w2&&t2<=w2&&t3<=w2&&t4<=w2) {
3317 j1 = (Int_t)TMath::Min(w2,t1);
3318 j2 = (Int_t)TMath::Min(w2,t2);
3319 j3 = (Int_t)TMath::Min(w2,t3);
3320 j4 = (Int_t)TMath::Min(w2,t4);
3323 if (fDisplayMode==kDisplayModeBarsY) {
3324 if (t1<=w2&&t2<=w2&&t3<=w2&&t4<=w2) {
3331 j1 = (Int_t)TMath::Max(w2-t1,0);
3332 j2 = (Int_t)TMath::Max(w2-t2,0);
3333 j3 = (Int_t)TMath::Max(w2-t3,0);
3334 j4 = (Int_t)TMath::Max(w2-t4,0);
3358 Transform(i1,j1,-1);
3361 Transform(i2,j2,-1);
3364 Transform(i3,j3,-1);
3367 Transform(i4,j4,-1);
3372 if ((fDisplayMode==kDisplayModeBars)&&(q1!=q2||smer!=0)&&(flag==1)) {
3373 EnvelopeBars(ix5,iy5,x6,y6);
3379 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3381 EnvelopeBars(x6,y6,x7,y7);
3387 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3389 EnvelopeBars(ix5,iy5,x1,y1);
3395 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3397 EnvelopeBars(x6,y6,x2,y2);
3403 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3405 EnvelopeBars(x7,y7,x3,y3);
3411 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3413 if (fModeGroup!=kModeGroupSimple) {
3414 v = ColorCalculation(dx1,dy1,z4,dx2,dy2,z4,dx4,dy4,z4);
3416 iv = fLevels-(Int_t)v;
3417 uip = fNewColorIndex;
3418 ColorModel(iv,ui1,ui2,ui3);
3419 line->SetLineColor(fNewColorIndex);
3455 if (pom2!=0) sdx1 = pom1/pom2;
3458 sdy1 = pom1-sdx1*pom2;
3461 if (pom2!=0) sdx2 = pom1/pom2;
3464 sdy2 = pom1-sdx2*pom2;
3467 if (pom2!=0) sdx3 = pom1/pom2;
3470 sdy3 = pom1-sdx3*pom2;
3473 for (sx4=sx1;sx4<=sx2;sx4++) {
3475 sdy4 = sdx1*pom1+sdy1;
3478 sdy4 = sdx2*pom1+sdy2;
3480 y5 = fEnvelope[sx4];
3486 if ((sy4<=y5)||(sy5<y5)) {
3487 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
3488 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
3489 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4),gPad->PixeltoY(sy5)+1);
3495 for (sx4=sx2;sx4<=sx3;sx4++) {
3497 sdy4 = sdx3*pom1+sdy3;
3500 sdy4 = sdx2*pom1+sdy2;
3502 y5 = fEnvelope[sx4];
3508 if ((sy4<=y5)||(sy5<y5)) {
3509 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
3510 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
3511 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4),gPad->PixeltoY(sy5)+1);
3518 for (sx4=sx1;sx4<=sx3;sx4++) {
3520 sdy4 = sdx2*pom1+sdy2;
3523 sdy4 = sdx1*pom1+sdy1;
3525 y5 = fEnvelope[sx4];
3531 if ((sy4<=y5)||(sy5<y5)) {
3532 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
3533 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
3534 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4),gPad->PixeltoY(sy5)+1);
3540 for (sx4=sx3;sx4<=sx2;sx4++) {
3542 sdy4 = sdx3*pom1+sdy3;
3545 sdy4 = sdx1*pom1+sdy1;
3547 y5 = fEnvelope[sx4];
3553 if ((sy4<=y5)||(sy5<y5)) {
3554 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
3555 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
3556 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4),gPad->PixeltoY(sy5)+1);
3597 if (pom2!=0) sdx1 = pom1/pom2;
3600 sdy1 = pom1-sdx1*pom2;
3603 if (pom2!=0) sdx2 = pom1/pom2;
3606 sdy2 = pom1-sdx2*pom2;
3609 if (pom2!=0) sdx3 = pom1/pom2;
3612 sdy3 = pom1-sdx3*pom2;
3615 for (sx4=sx1;sx4<=sx2;sx4++) {
3617 sdy4 = sdx1*pom1+sdy1;
3620 sdy4 = sdx2*pom1+sdy2;
3622 y5 = fEnvelope[sx4];
3628 if ((sy4<=y5)||(sy5<y5)) {
3629 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
3630 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
3631 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4),gPad->PixeltoY(sy5)+1);
3637 for (sx4=sx2;sx4<=sx3;sx4++) {
3639 sdy4 = sdx3*pom1+sdy3;
3642 sdy4 = sdx2*pom1+sdy2;
3644 y5 = fEnvelope[sx4];
3650 if ((sy4<=y5)||(sy5<y5)) {
3651 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
3652 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
3653 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4),gPad->PixeltoY(sy5)+1);
3660 for (sx4=sx1;sx4<=sx3;sx4++) {
3662 sdy4 = sdx2*pom1+sdy2;
3665 sdy4 = sdx1*pom1+sdy1;
3667 y5 = fEnvelope[sx4];
3673 if ((sy4<=y5)||(sy5<y5)) {
3674 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
3675 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
3676 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4),gPad->PixeltoY(sy5)+1);
3682 for (sx4=sx3;sx4<=sx2;sx4++) {
3684 sdy4 = sdx3*pom1+sdy3;
3687 sdy4 = sdx1*pom1+sdy1;
3689 y5 = fEnvelope[sx4];
3695 if ((sy4<=y5)||(sy5<y5)) {
3696 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
3697 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
3698 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4),gPad->PixeltoY(sy5)+1);
3704 line->SetLineColor(uip);
3706 EnvelopeBars(x1,y1,x2,y2);
3712 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3714 EnvelopeBars(x2,y2,x3,y3);
3720 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3722 EnvelopeBars(x1,y1,x4,y4);
3728 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3730 EnvelopeBars(x4,y4,x3,y3);
3736 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3738 }
else if ((fDisplayMode==kDisplayModeBarsY)&&(((flag!=0)&&(smer==0))||((flag==0)&&(smer!=0)))) {
3739 EnvelopeBars(ix5,iy5,x6,y6);
3745 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3747 EnvelopeBars(x1,y1,ix5,iy5);
3753 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3755 EnvelopeBars(x2,y2,x6,y6);
3761 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3763 if (fModeGroup!=kModeGroupSimple) {
3764 v = ColorCalculation(dx1,dy1,z4,dx2,dy2,z4,dx4,dy4,z4);
3766 iv = fLevels-(Int_t)v;
3767 uip = fNewColorIndex;
3768 ColorModel(iv,ui1,ui2,ui3);
3769 line->SetLineColor(fNewColorIndex);
3771 EnvelopeBars(x1,y1,x2,y2);
3777 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3779 if (fModeGroup!=kModeGroupSimple) {
3780 line->SetLineColor(uip);
3782 }
else if ((fDisplayMode==kDisplayModeBarsX)&&(((flag==0)&&(smer==0))||((flag!=0)&&(smer!=0)))) {
3783 EnvelopeBars(x7,y7,x6,y6);
3789 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3791 EnvelopeBars(x2,y2,x6,y6);
3797 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3799 EnvelopeBars(x3,y3,x7,y7);
3805 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3807 if (fModeGroup!=kModeGroupSimple) {
3808 v = ColorCalculation(dx1,dy1,z4,dx2,dy2,z4,dx4,dy4,z4);
3810 iv = fLevels-(Int_t)v;
3811 uip = fNewColorIndex;
3812 ColorModel(iv,ui1,ui2,ui3);
3813 line->SetLineColor(fNewColorIndex);
3815 EnvelopeBars(x3,y3,x2,y2);
3821 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3823 if (fModeGroup!=kModeGroupSimple) {
3824 line->SetLineColor(uip);
3828 case kDisplayModeLinesX:
3829 if (fModeGroup==kModeGroupSimple) {
3830 if (((flag==0)&&(smer==0))||((flag!=0)&&(smer!=0))) {
3831 if (fBezier==kNoBezierInterpol) {
3832 Envelope(x1,y1,x2,y2);
3838 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3842 t1 = (Int_t)TMath::Max(q2-1,0);
3844 t2 = (Int_t)TMath::Min(q2+2,w2);
3849 i1 = (Int_t)TMath::Max(w1-s1,0);
3850 i2 = (Int_t)TMath::Max(w1-s2,0);
3856 j1 = (Int_t)TMath::Max(w2-t1,0);
3857 j2 = (Int_t)TMath::Max(w2-t2,0);
3865 bezx1 = x1+(x2-x1)/3;
3866 bezx2 = x1+2*(x2-x1)/3;
3867 bezy1 = y1+(y2-y3)/6;
3868 bezy2 = y2-(y4-y1)/6;
3888 fBzX[1] = (Int_t)bezx1;
3889 fBzY[1] = (Int_t)bezy1;
3890 fBzX[2] = (Int_t)bezx2;
3891 fBzY[2] = (Int_t)bezy2;
3894 for (bezf=0;bezf<1.01;bezf+=0.1) {
3895 BezierSmoothing(bezf);
3897 ibezx1 = (Int_t)(fGbezx+0.5);
3898 ibezy1 = (Int_t)(fGbezy+0.5);
3902 ibezx1 = (Int_t)(fGbezx+0.5);
3903 ibezy1 = (Int_t)(fGbezy+0.5);
3904 Envelope(ibezx2,ibezy2,ibezx1,ibezy1);
3910 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3933 fBzX[1] = (Int_t)bezx1;
3934 fBzY[1] = (Int_t)bezy1;
3935 fBzX[2] = (Int_t)bezx2;
3936 fBzY[2] = (Int_t)bezy2;
3939 for (bezf=0;bezf<1.01;bezf+=0.1) {
3940 BezierSmoothing(bezf);
3942 ibezx1 = (Int_t)(fGbezx+0.5);
3943 ibezy1 = (Int_t)(fGbezy+0.5);
3947 ibezx1 = (Int_t)(fGbezx+0.5);
3948 ibezy1 = (Int_t)(fGbezy+0.5);
3949 Envelope(ibezx1,ibezy1,ibezx2,ibezy2);
3955 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
3963 if ((q1!=q2||smer!=0)&&flag==1) {
3972 if (fShading==kShaded) {
3974 tr1 = (Int_t)TMath::Max(t1-1,0);
3976 tr2 = (Int_t)TMath::Max(t2-1,0);
3977 sr3 = (Int_t)TMath::Max(s2-1,0);
3979 sr4 = (Int_t)TMath::Max(s3-1,0);
3996 i1 = (Int_t)TMath::Max(w1-s1,0);
3997 i2 = (Int_t)TMath::Max(w1-s2,0);
3998 i3 = (Int_t)TMath::Max(w1-s3,0);
3999 i4 = (Int_t)TMath::Max(w1-s4,0);
4000 if (fShading==kShaded) {
4001 sr1 = (Int_t)TMath::Max(w1-sr1,0);
4002 sr2 = (Int_t)TMath::Max(w1-sr2,0);
4003 sr3 = (Int_t)TMath::Max(w1-sr3,0);
4004 sr4 = (Int_t)TMath::Max(w1-sr4,0);
4005 sr5 = (Int_t)TMath::Max(w1-sr5,0);
4006 sr6 = (Int_t)TMath::Max(w1-sr6,0);
4007 sr7 = (Int_t)TMath::Max(w1-sr7,0);
4008 sr8 = (Int_t)TMath::Max(w1-sr8,0);
4017 j1 = (Int_t)TMath::Max(w2-t1,0);
4018 j2 = (Int_t)TMath::Max(w2-t2,0);
4019 j3 = (Int_t)TMath::Max(w2-t3,0);
4020 j4 = (Int_t)TMath::Max(w2-t4,0);
4021 if (fShading==kShaded) {
4022 tr1 = (Int_t)TMath::Max(w2-tr1,0);
4023 tr2 = (Int_t)TMath::Max(w2-tr2,0);
4024 tr3 = (Int_t)TMath::Max(w2-tr3,0);
4025 tr4 = (Int_t)TMath::Max(w2-tr4,0);
4026 tr5 = (Int_t)TMath::Max(w2-tr5,0);
4027 tr6 = (Int_t)TMath::Max(w2-tr6,0);
4028 tr7 = (Int_t)TMath::Max(w2-tr7,0);
4029 tr8 = (Int_t)TMath::Max(w2-tr8,0);
4056 Envelope(x1,y1,x2,y2);
4057 Envelope(x2,y2,x3,y3);
4058 xtaz = (dx1+dx2+dx4)/3;
4059 ytaz = (dy1+dy2+dy4)/3;
4060 ztaz = (z1+z2+z4)/3;
4061 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx4,dy4,z4);
4062 if (fShading==kShaded) {
4063 if (fShadow==kShadowsNotPainted) {
4064 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
4065 else Transform(sr1,tr1,0);
4069 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
4070 else Transform(sr8,tr8,0);
4074 v = v+ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1);
4075 v = v+ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2);
4076 v = v+ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4);
4078 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
4079 else Transform(sr3,tr3,0);
4083 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
4084 else Transform(sr2,tr2,0);
4088 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3);
4089 v = v+ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3);
4090 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
4091 v = v+ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1);
4093 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
4094 else Transform(sr5,tr5,0);
4098 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
4099 else Transform(sr4,tr4,0);
4103 v = ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
4104 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1);
4105 v = v+ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
4106 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3);
4108 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
4109 else Transform(sr7,tr7,0);
4113 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
4114 else Transform(sr6,tr6,0);
4118 v = ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4);
4119 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2);
4120 v = v+ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
4121 v = v+ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1);
4124 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
4127 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
4128 else Transform(sr1,tr1,0);
4132 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
4133 else Transform(sr8,tr8,0);
4137 da = (dxr1+dx2+dx1)/3;
4138 db = (dyr1+dy2+dy1)/3;
4140 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4141 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
4142 da = (dxr1+dxr2+dx1)/3;
4143 db = (dyr1+dyr2+dy1)/3;
4144 dc = (zr1+zr2+z1)/3;
4145 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4146 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2)+spriz)/2;
4147 da = (dxr2+dx1+dx4)/3;
4148 db = (dyr2+dy1+dy4)/3;
4150 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4151 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4)+spriz)/2;
4153 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
4154 else Transform(sr3,tr3,0);
4158 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
4159 else Transform(sr2,tr2,0);
4163 da = (dx1+dx2+dx3)/3;
4164 db = (dy1+dy2+dy3)/3;
4166 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4167 v = (ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3)+spriz)/2;
4168 da = (dx2+dxr1+dx3)/3;
4169 db = (dy2+dyr1+dy3)/3;
4171 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4172 v = v+(ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3)+spriz)/2;
4173 da = (dx2+dxr2+dxr1)/3;
4174 db = (dy2+dyr2+dyr1)/3;
4175 dc = (z2+zr2+zr1)/3;
4176 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4177 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
4178 da = (dxr2+dx2+dx1)/3;
4179 db = (dyr2+dy2+dy1)/3;
4181 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4182 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
4184 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
4185 else Transform(sr5,tr5,0);
4189 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
4190 else Transform(sr4,tr4,0);
4194 da = (dx2+dx3+dx4)/3;
4195 db = (dy2+dy3+dy4)/3;
4197 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4198 v = (ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
4199 da = (dx4+dx3+dxr1)/3;
4200 db = (dy4+dy3+dyr1)/3;
4202 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4203 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1)+spriz)/2;
4204 da = (dx3+dxr2+dxr1)/3;
4205 db = (dy3+dyr2+dyr1)/3;
4206 dc = (z3+zr2+zr1)/3;
4207 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4208 v = v+(ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
4209 da = (dx2+dxr2+dx3)/3;
4210 db = (dy2+dyr2+dy3)/3;
4212 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4213 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3)+spriz)/2;
4215 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
4216 else Transform(sr7,tr7,0);
4220 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
4221 else Transform(sr6,tr6,0);
4225 da = (dx1+dx3+dx4)/3;
4226 db = (dy1+dy3+dy4)/3;
4228 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4229 v = (ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
4230 da = (dx4+dx3+dxr2)/3;
4231 db = (dy4+dy3+dyr2)/3;
4233 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4234 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2)+spriz)/2;
4235 da = (dx4+dxr2+dxr1)/3;
4236 db = (dy4+dyr2+dyr1)/3;
4237 dc = (z4+zr2+zr1)/3;
4238 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4239 v = v+(ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
4240 da = (dx1+dx4+dxr1)/3;
4241 db = (dy1+dy4+dyr1)/3;
4243 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4244 v = v+(ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1)+spriz)/2;
4249 if (fShadow==kShadowsNotPainted) {
4250 if (fShading==kNotShaded) {
4252 iv = fLevels-(Int_t)v;
4255 iv1 = fLevels-(Int_t)v1;
4257 iv2 = fLevels-(Int_t)v2;
4259 iv4 = fLevels-(Int_t)v4;
4262 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
4263 if (fShading==kNotShaded) {
4265 iv = fLevels-(Int_t)(v+0.5);
4268 iv1 = fLevels-(Int_t)v1;
4270 iv2 = fLevels-(Int_t)v2;
4272 iv4 = fLevels-(Int_t)v4;
4275 if (fShading==kNotShaded) {
4276 ColorModel(iv,ui1,ui2,ui3);
4277 line->SetLineColor(fNewColorIndex);
4288 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
4289 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
4290 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
4291 dd = -da*dx1-db*dy1-dc*z1;
4307 if (pom2!=0) sdx2 = pom1/pom2;
4310 sdy2 = pom1-sdx2*pom2;
4320 uip = fNewColorIndex;
4321 xtaz = (dx3+dx2+dx4)/3;
4322 ytaz = (dy3+dy2+dy4)/3;
4323 ztaz = (z3+z2+z4)/3;
4324 if (fShading==kNotShaded) v=ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
4326 if (fShadow==kShadowsNotPainted) {
4327 if (fShading==kNotShaded) {
4329 iv = fLevels-(Int_t)v;
4332 iv3 = fLevels-(Int_t)v3;
4335 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
4336 if (fShading==kNotShaded) {
4338 iv = fLevels-(Int_t)v;
4339 iv = (Int_t)(iv-fLevels*spriz/2);
4342 iv3 = fLevels-(Int_t)v3;
4345 if (fShading==kNotShaded) {
4346 ColorModel(iv,ui1,ui2,ui3);
4347 line->SetLineColor(fNewColorIndex);
4358 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
4359 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
4360 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
4361 dd = -da*dx1-db*dy1-dc*z1;
4378 if (pom2!=0) sdx1 = pom1/pom2;
4381 sdy1 = pom1-sdx1*pom2;
4382 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
4384 sdy4 = sdx1*pom1+sdy1;
4386 if (sy4<=fEnvelope[sx4]) {
4387 fEnvelope[sx4] = sy4;
4388 if (fShading==kNotShaded) {
4389 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4393 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
4394 else v =(iv1+iv2+iv4)/3;
4396 ColorModel(iv,ui1,ui2,ui3);
4397 line->SetLineColor(fNewColorIndex);
4398 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4402 sy4 = fEnvelope[sx4];
4403 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
4404 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4405 }
else if (sy5<=fEnvelope[sx5]) {
4408 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
4409 else v =(iv1+iv2+iv4)/3;
4411 ColorModel(iv,ui1,ui2,ui3);
4412 line->SetLineColor(fNewColorIndex);
4413 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4415 sy5 = fEnvelope[sx4];
4419 for (sx4=sx1p,sx5=sx1p,sy5=sy1p;sx4<=sx3p;sx4++) {
4421 sdy4 = sdx2p*pom1+sdy2p;
4423 if (sy4<=fEnvelope[sx4]) {
4425 if (fShading==kNotShaded) {
4426 line->SetLineColor(uip);
4427 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4431 if (dcp!=0) v = (-ddp-dap*dx1-dbp*dy1)/dcp;
4432 else v = (iv1+iv2+iv4)/3;
4434 ColorModel(iv,ui1,ui2,ui3);
4435 line->SetLineColor(fNewColorIndex);
4436 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4440 sy4 = fEnvelope[sx4];
4441 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
4442 line->SetLineColor(uip);
4443 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4444 }
else if (sy5<=fEnvelope[sx5]) {
4447 if (dcp!=0) v = (-ddp-dap*dx1-dbp*dy1)/dcp;
4448 else v = (iv1+iv2+iv4)/3;
4450 ColorModel(iv,ui1,ui2,ui3);
4451 line->SetLineColor(fNewColorIndex);
4452 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4454 sy5 = fEnvelope[sx4];
4461 case kDisplayModeLinesY:
4462 if (fModeGroup==kModeGroupSimple) {
4463 if (((flag!=0)&&(smer==0))||((flag==0)&&(smer!=0))) {
4464 if (fBezier==kNoBezierInterpol) {
4465 Envelope(x1,y1,x2,y2);
4471 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
4474 s1 = (Int_t)TMath::Max(q1-1,0);
4476 s2 = (Int_t)TMath::Min(q1+2,w1);
4498 bezx1 = x1+(x2-x1)/3;
4499 bezx2 = x1+2*(x2-x1)/3;
4500 bezy1 = y1+(y2-y3)/6;
4501 bezy2 = y2-(y4-y1)/6;
4521 fBzX[1] = (Int_t)bezx1;
4522 fBzY[1] = (Int_t)bezy1;
4523 fBzX[2] = (Int_t)bezx2;
4524 fBzY[2] = (Int_t)bezy2;
4527 for (bezf=0;bezf<1.01;bezf+=0.1) {
4528 BezierSmoothing(bezf);
4530 ibezx1 = (Int_t)(fGbezx+0.5);
4531 ibezy1 = (Int_t)(fGbezy+0.5);
4535 ibezx1 = (Int_t)(fGbezx+0.5);
4536 ibezy1 = (Int_t)(fGbezy+0.5);
4537 Envelope(ibezx2,ibezy2,ibezx1,ibezy1);
4543 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
4566 fBzX[1] = (Int_t)bezx1;
4567 fBzY[1] = (Int_t)bezy1;
4568 fBzX[2] = (Int_t)bezx2;
4569 fBzY[2] = (Int_t)bezy2;
4572 for (bezf=0;bezf<1.01;bezf+=0.1) {
4573 BezierSmoothing(bezf);
4575 ibezx1 = (Int_t)(fGbezx+0.5);
4576 ibezy1 = (Int_t)(fGbezy+0.5);
4580 ibezx1 = (Int_t)(fGbezx+0.5);
4581 ibezy1 = (Int_t)(fGbezy+0.5);
4582 Envelope(ibezx1,ibezy1,ibezx2,ibezy2);
4588 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
4596 if ((q1!=q2||smer!=0)&&flag==1) {
4605 if (fShading==kShaded) {
4607 tr1 = (Int_t)TMath::Max(t1-1,0);
4609 tr2 = (Int_t)TMath::Max(t2-1,0);
4610 sr3 = (Int_t)TMath::Max(s2-1,0);
4612 sr4 = (Int_t)TMath::Max(s3-1,0);
4629 i1 = (Int_t)TMath::Max(w1-s1,0);
4630 i2 = (Int_t)TMath::Max(w1-s2,0);
4631 i3 = (Int_t)TMath::Max(w1-s3,0);
4632 i4 = (Int_t)TMath::Max(w1-s4,0);
4633 if (fShading==kShaded) {
4634 sr1 = (Int_t)TMath::Max(w1-sr1,0);
4635 sr2 = (Int_t)TMath::Max(w1-sr2,0);
4636 sr3 = (Int_t)TMath::Max(w1-sr3,0);
4637 sr4 = (Int_t)TMath::Max(w1-sr4,0);
4638 sr5 = (Int_t)TMath::Max(w1-sr5,0);
4639 sr6 = (Int_t)TMath::Max(w1-sr6,0);
4640 sr7 = (Int_t)TMath::Max(w1-sr7,0);
4641 sr8 = (Int_t)TMath::Max(w1-sr8,0);
4650 j1 = (Int_t)TMath::Max(w2-t1,0);
4651 j2 = (Int_t)TMath::Max(w2-t2,0);
4652 j3 = (Int_t)TMath::Max(w2-t3,0);
4653 j4 = (Int_t)TMath::Max(w2-t4,0);
4654 if (fShading==kShaded) {
4655 tr1 = (Int_t)TMath::Max(w2-tr1,0);
4656 tr2 = (Int_t)TMath::Max(w2-tr2,0);
4657 tr3 = (Int_t)TMath::Max(w2-tr3,0);
4658 tr4 = (Int_t)TMath::Max(w2-tr4,0);
4659 tr5 = (Int_t)TMath::Max(w2-tr5,0);
4660 tr6 = (Int_t)TMath::Max(w2-tr6,0);
4661 tr7 = (Int_t)TMath::Max(w2-tr7,0);
4662 tr8 = (Int_t)TMath::Max(w2-tr8,0);
4689 Envelope(x1,y1,x2,y2);
4690 Envelope(x2,y2,x3,y3);
4691 xtaz = (dx1+dx2+dx4)/3;
4692 ytaz = (dy1+dy2+dy4)/3;
4693 ztaz = (z1+z2+z4)/3;
4694 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx4,dy4,z4);
4695 if (fShading==kShaded) {
4696 if (fShadow==kShadowsNotPainted) {
4697 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
4698 else Transform(sr1,tr1,0);
4702 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
4703 else Transform(sr8,tr8,0);
4707 v = v+ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1);
4708 v = v+ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2);
4709 v = v+ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4);
4711 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
4712 else Transform(sr3,tr3,0);
4716 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
4717 else Transform(sr2,tr2,0);
4721 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3);
4722 v = v+ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3);
4723 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
4724 v = v+ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1);
4726 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
4727 else Transform(sr5,tr5,0);
4731 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
4732 else Transform(sr4,tr4,0);
4736 v = ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
4737 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1);
4738 v = v+ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
4739 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3);
4741 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
4742 else Transform(sr7,tr7,0);
4746 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
4747 else Transform(sr6,tr6,0);
4751 v = ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4);
4752 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2);
4753 v = v+ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
4754 v = v+ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1);
4757 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
4760 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
4761 else Transform(sr1,tr1,0);
4765 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
4766 else Transform(sr8,tr8,0);
4770 da = (dxr1+dx2+dx1)/3;
4771 db = (dyr1+dy2+dy1)/3;
4773 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4774 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
4775 da = (dxr1+dxr2+dx1)/3;
4776 db = (dyr1+dyr2+dy1)/3;
4777 dc = (zr1+zr2+z1)/3;
4778 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4779 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2)+spriz)/2;
4780 da = (dxr2+dx1+dx4)/3;
4781 db = (dyr2+dy1+dy4)/3;
4783 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4784 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4)+spriz)/2;
4786 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
4787 else Transform(sr3,tr3,0);
4791 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
4792 else Transform(sr2,tr2,0);
4796 da = (dx1+dx2+dx3)/3;
4797 db = (dy1+dy2+dy3)/3;
4799 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4800 v = (ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3)+spriz)/2;
4801 da = (dx2+dxr1+dx3)/3;
4802 db = (dy2+dyr1+dy3)/3;
4804 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4805 v = v+(ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3)+spriz)/2;
4806 da = (dx2+dxr2+dxr1)/3;
4807 db = (dy2+dyr2+dyr1)/3;
4808 dc = (z2+zr2+zr1)/3;
4809 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4810 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
4811 da = (dxr2+dx2+dx1)/3;
4812 db = (dyr2+dy2+dy1)/3;
4814 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4815 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
4817 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
4818 else Transform(sr5,tr5,0);
4822 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
4823 else Transform(sr4,tr4,0);
4827 da = (dx2+dx3+dx4)/3;
4828 db = (dy2+dy3+dy4)/3;
4830 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4831 v = (ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
4832 da = (dx4+dx3+dxr1)/3;
4833 db = (dy4+dy3+dyr1)/3;
4835 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4836 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1)+spriz)/2;
4837 da = (dx3+dxr2+dxr1)/3;
4838 db = (dy3+dyr2+dyr1)/3;
4839 dc = (z3+zr2+zr1)/3;
4840 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4841 v = v+(ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
4842 da = (dx2+dxr2+dx3)/3;
4843 db = (dy2+dyr2+dy3)/3;
4845 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4846 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3)+spriz)/2;
4848 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
4849 else Transform(sr7,tr7,0);
4853 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
4854 else Transform(sr6,tr6,0);
4858 da = (dx1+dx3+dx4)/3;
4859 db = (dy1+dy3+dy4)/3;
4861 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4862 v = (ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
4863 da = (dx4+dx3+dxr2)/3;
4864 db = (dy4+dy3+dyr2)/3;
4866 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4867 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2)+spriz)/2;
4868 da = (dx4+dxr2+dxr1)/3;
4869 db = (dy4+dyr2+dyr1)/3;
4870 dc = (z4+zr2+zr1)/3;
4871 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4872 v = v+(ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
4873 da = (dx1+dx4+dxr1)/3;
4874 db = (dy1+dy4+dyr1)/3;
4876 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
4877 v = v+(ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1)+spriz)/2;
4882 if (fShadow==kShadowsNotPainted) {
4883 if (fShading==kNotShaded) {
4885 iv = fLevels-(Int_t)v;
4888 iv1 = fLevels-(Int_t)v1;
4890 iv2 = fLevels-(Int_t)v2;
4892 iv4 = fLevels-(Int_t)v4;
4895 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
4896 if (fShading==kNotShaded) {
4898 iv = fLevels-(Int_t)(v+0.5);
4901 iv1 = fLevels-(Int_t)v1;
4903 iv2 = fLevels-(Int_t)v2;
4905 iv4 = fLevels-(Int_t)v4;
4908 if (fShading==kNotShaded) {
4909 ColorModel(iv,ui1,ui2,ui3);
4910 line->SetLineColor(fNewColorIndex);
4921 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
4922 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
4923 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
4924 dd = -da*dx1-db*dy1-dc*z1;
4941 if (pom2!=0) sdx1 = pom1/pom2;
4944 sdy1 = pom1-sdx1*pom2;
4945 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
4947 sdy4 = sdx1*pom1+sdy1;
4949 if (sy4<=fEnvelope[sx4]) {
4950 fEnvelope[sx4] = sy4;
4951 if (fShading==kNotShaded) {
4952 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4956 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
4957 else v =(iv1+iv2+iv4)/3;
4959 ColorModel(iv,ui1,ui2,ui3);
4960 line->SetLineColor(fNewColorIndex);
4961 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4965 sy4 = fEnvelope[sx4];
4966 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
4967 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4968 }
else if (sy5<=fEnvelope[sx5]) {
4971 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
4972 else v =(iv1+iv2+iv4)/3;
4974 ColorModel(iv,ui1,ui2,ui3);
4975 line->SetLineColor(fNewColorIndex);
4976 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
4978 sy5 = fEnvelope[sx4];
4982 xtaz = (dx3+dx2+dx4)/3;
4983 ytaz = (dy3+dy2+dy4)/3;
4984 ztaz = (z3+z2+z4)/3;
4985 if (fShading==kNotShaded) v=ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
4987 if (fShadow==kShadowsNotPainted) {
4988 if (fShading==kNotShaded) {
4990 iv = fLevels-(Int_t)v;
4993 iv3 = fLevels-(Int_t)v3;
4996 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
4997 if (fShading==kNotShaded) {
4999 iv = fLevels-(Int_t)v;
5000 iv = (Int_t)(iv-fLevels*spriz/2);
5003 iv3 = fLevels-(Int_t)v3;
5006 if (fShading==kNotShaded) {
5007 ColorModel(iv,ui1,ui2,ui3);
5008 line->SetLineColor(fNewColorIndex);
5019 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
5020 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
5021 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
5022 dd = -da*dx1-db*dy1-dc*z1;
5039 if (pom2!=0) sdx2 = pom1/pom2;
5042 sdy2 = pom1-sdx2*pom2;
5043 for (sx4=sx2,sx5=sx2,sy5=sy2;sx4<=sx3;sx4++) {
5045 sdy4 = sdx2*pom1+sdy2;
5047 if (sy4<=fEnvelope[sx4]) {
5048 fEnvelope[sx4] = sy4;
5049 if (fShading==kNotShaded) {
5050 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
5054 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5055 else v =(iv1+iv2+iv4)/3;
5057 ColorModel(iv,ui1,ui2,ui3);
5058 line->SetLineColor(fNewColorIndex);
5059 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
5063 sy4 = fEnvelope[sx4];
5064 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
5065 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
5066 }
else if (sy5<=fEnvelope[sx5]) {
5069 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5070 else v =(iv1+iv2+iv4)/3;
5072 ColorModel(iv,ui1,ui2,ui3);
5073 line->SetLineColor(fNewColorIndex);
5074 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
5076 sy5 = fEnvelope[sx4];
5083 case kDisplayModeNeedles:
5095 line->PaintLine(gPad->PixeltoX(x1),gPad->PixeltoY(y1)+1,gPad->PixeltoX(x1d),gPad->PixeltoY(y1d)+1);
5096 line->PaintLine(gPad->PixeltoX(x2),gPad->PixeltoY(y2)+1,gPad->PixeltoX(x2d),gPad->PixeltoY(y2d)+1);
5098 case kDisplayModeSurface:
5099 box->SetFillStyle(1001);
5100 if ((q1!=q2||smer!=0)&&flag==1) {
5109 if (fShading==kShaded) {
5111 tr1 = (Int_t)TMath::Max(t1-1,0);
5113 tr2 = (Int_t)TMath::Max(t2-1,0);
5114 sr3 = (Int_t)TMath::Max(s2-1,0);
5116 sr4 = (Int_t)TMath::Max(s3-1,0);
5133 i1 = (Int_t)TMath::Max(w1-s1,0);
5134 i2 = (Int_t)TMath::Max(w1-s2,0);
5135 i3 = (Int_t)TMath::Max(w1-s3,0);
5136 i4 = (Int_t)TMath::Max(w1-s4,0);
5137 if (fShading==kShaded) {
5138 sr1 = (Int_t)TMath::Max(w1-sr1,0);
5139 sr2 = (Int_t)TMath::Max(w1-sr2,0);
5140 sr3 = (Int_t)TMath::Max(w1-sr3,0);
5141 sr4 = (Int_t)TMath::Max(w1-sr4,0);
5142 sr5 = (Int_t)TMath::Max(w1-sr5,0);
5143 sr6 = (Int_t)TMath::Max(w1-sr6,0);
5144 sr7 = (Int_t)TMath::Max(w1-sr7,0);
5145 sr8 = (Int_t)TMath::Max(w1-sr8,0);
5154 j1 = (Int_t)TMath::Max(w2-t1,0);
5155 j2 = (Int_t)TMath::Max(w2-t2,0);
5156 j3 = (Int_t)TMath::Max(w2-t3,0);
5157 j4 = (Int_t)TMath::Max(w2-t4,0);
5158 if (fShading==kShaded) {
5159 tr1 = (Int_t)TMath::Max(w2-tr1,0);
5160 tr2 = (Int_t)TMath::Max(w2-tr2,0);
5161 tr3 = (Int_t)TMath::Max(w2-tr3,0);
5162 tr4 = (Int_t)TMath::Max(w2-tr4,0);
5163 tr5 = (Int_t)TMath::Max(w2-tr5,0);
5164 tr6 = (Int_t)TMath::Max(w2-tr6,0);
5165 tr7 = (Int_t)TMath::Max(w2-tr7,0);
5166 tr8 = (Int_t)TMath::Max(w2-tr8,0);
5193 Envelope(x1,y1,x2,y2);
5194 Envelope(x2,y2,x3,y3);
5195 xtaz = (dx1+dx2+dx4)/3;
5196 ytaz = (dy1+dy2+dy4)/3;
5197 ztaz = (z1+z2+z4)/3;
5198 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx4,dy4,z4);
5199 if (fShading==kShaded) {
5200 if (fShadow==kShadowsNotPainted) {
5201 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
5202 else Transform(sr1,tr1,0);
5206 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
5207 else Transform(sr8,tr8,0);
5211 v = v+ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1);
5212 v = v+ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2);
5213 v = v+ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4);
5215 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
5216 else Transform(sr3,tr3,0);
5220 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
5221 else Transform(sr2,tr2,0);
5225 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3);
5226 v = v+ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3);
5227 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
5228 v = v+ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1);
5230 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
5231 else Transform(sr5,tr5,0);
5235 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
5236 else Transform(sr4,tr4,0);
5240 v = ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
5241 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1);
5242 v = v+ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
5243 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3);
5245 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
5246 else Transform(sr7,tr7,0);
5250 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
5251 else Transform(sr6,tr6,0);
5255 v = ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4);
5256 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2);
5257 v = v+ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
5258 v = v+ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1);
5261 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
5264 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
5265 else Transform(sr1,tr1,0);
5269 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
5270 else Transform(sr8,tr8,0);
5274 da = (dxr1+dx2+dx1)/3;
5275 db = (dyr1+dy2+dy1)/3;
5277 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5278 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
5279 da = (dxr1+dxr2+dx1)/3;
5280 db = (dyr1+dyr2+dy1)/3;
5281 dc = (zr1+zr2+z1)/3;
5282 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5283 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2)+spriz)/2;
5284 da = (dxr2+dx1+dx4)/3;
5285 db = (dyr2+dy1+dy4)/3;
5287 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5288 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4)+spriz)/2;
5290 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
5291 else Transform(sr3,tr3,0);
5295 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
5296 else Transform(sr2,tr2,0);
5300 da = (dx1+dx2+dx3)/3;
5301 db = (dy1+dy2+dy3)/3;
5303 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5304 v = (ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3)+spriz)/2;
5305 da = (dx2+dxr1+dx3)/3;
5306 db = (dy2+dyr1+dy3)/3;
5308 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5309 v = v+(ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3)+spriz)/2;
5310 da = (dx2+dxr2+dxr1)/3;
5311 db = (dy2+dyr2+dyr1)/3;
5312 dc = (z2+zr2+zr1)/3;
5313 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5314 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
5315 da = (dxr2+dx2+dx1)/3;
5316 db = (dyr2+dy2+dy1)/3;
5318 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5319 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
5321 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
5322 else Transform(sr5,tr5,0);
5326 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
5327 else Transform(sr4,tr4,0);
5331 da = (dx2+dx3+dx4)/3;
5332 db = (dy2+dy3+dy4)/3;
5334 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5335 v = (ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
5336 da = (dx4+dx3+dxr1)/3;
5337 db = (dy4+dy3+dyr1)/3;
5339 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5340 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1)+spriz)/2;
5341 da = (dx3+dxr2+dxr1)/3;
5342 db = (dy3+dyr2+dyr1)/3;
5343 dc = (z3+zr2+zr1)/3;
5344 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5345 v = v+(ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
5346 da = (dx2+dxr2+dx3)/3;
5347 db = (dy2+dyr2+dy3)/3;
5349 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5350 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3)+spriz)/2;
5352 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
5353 else Transform(sr7,tr7,0);
5357 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
5358 else Transform(sr6,tr6,0);
5362 da = (dx1+dx3+dx4)/3;
5363 db = (dy1+dy3+dy4)/3;
5365 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5366 v = (ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
5367 da = (dx4+dx3+dxr2)/3;
5368 db = (dy4+dy3+dyr2)/3;
5370 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5371 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2)+spriz)/2;
5372 da = (dx4+dxr2+dxr1)/3;
5373 db = (dy4+dyr2+dyr1)/3;
5374 dc = (z4+zr2+zr1)/3;
5375 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5376 v = v+(ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
5377 da = (dx1+dx4+dxr1)/3;
5378 db = (dy1+dy4+dyr1)/3;
5380 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
5381 v = v+(ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1)+spriz)/2;
5386 if (fShadow==kShadowsNotPainted) {
5387 if (fShading==kNotShaded) {
5389 iv = fLevels-(Int_t)v;
5391 v1 = v1*fLevels+0.5;
5392 iv1 = fLevels-(Int_t)v1;
5393 v2 = v2*fLevels+0.5;
5394 iv2 = fLevels-(Int_t)v2;
5395 v4 = v4*fLevels+0.5;
5396 iv4 = fLevels-(Int_t)v4;
5399 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
5400 if (fShading==kNotShaded) {
5402 iv = fLevels-(Int_t)(v+0.5);
5405 iv1 = fLevels-(Int_t)v1;
5407 iv2 = fLevels-(Int_t)v2;
5409 iv4 = fLevels-(Int_t)v4;
5412 if (fShading==kNotShaded) {
5413 ColorModel(iv,ui1,ui2,ui3);
5414 box->SetFillColor(fNewColorIndex);
5425 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
5426 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
5427 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
5428 dd = -da*dx1-db*dy1-dc*z1;
5465 if (pom2!=0) sdx1 = pom1/pom2;
5468 sdy1 = pom1-sdx1*pom2;
5471 if (pom2!=0) sdx2 = pom1/pom2;
5474 sdy2 = pom1-sdx2*pom2;
5477 if (pom2!=0) sdx3 = pom1/pom2;
5480 sdy3 = pom1-sdx3*pom2;
5483 for (sx4=sx1;sx4<=sx2;sx4++) {
5485 sdy4 = sdx1*pom1+sdy1;
5488 sdy4 = sdx2*pom1+sdy2;
5490 y5 = fEnvelope[sx4];
5496 if ((sy4<=y5)||(sy5<y5)) {
5497 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
5498 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
5499 if (fShading==kNotShaded) {
5500 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(sy5-1)+1);
5502 for (il=sy5;il<=sy4+1;il++) {
5504 if(il<=sy4) dy1 = il;
5506 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5507 else v =(iv1+iv2+iv4)/3;
5509 ColorModel(iv,ui1,ui2,ui3);
5510 box->SetFillColor(fNewColorIndex);
5511 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(il)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(il-1)+1);
5519 for (sx4=sx2;sx4<=sx3;sx4++) {
5521 sdy4 = sdx3*pom1+sdy3;
5524 sdy4 = sdx2*pom1+sdy2;
5526 y5 = fEnvelope[sx4];
5532 if ((sy4<=y5)||(sy5<y5)) {
5533 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
5534 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
5535 if (fShading==kNotShaded) {
5536 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(sy5-1)+1);
5538 for (il=sy5;il<=sy4+1;il++) {
5540 if(il<=sy4) dy1 = il;
5542 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5543 else v =(iv1+iv2+iv4)/3;
5545 ColorModel(iv,ui1,ui2,ui3);
5546 box->SetFillColor(fNewColorIndex);
5547 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(il)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(il-1)+1);
5556 for (sx4=sx1;sx4<=sx3;sx4++) {
5558 sdy4 = sdx2*pom1+sdy2;
5561 sdy4 = sdx1*pom1+sdy1;
5563 y5 = fEnvelope[sx4];
5569 if ((sy4<=y5)||(sy5<y5)) {
5570 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
5571 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
5572 if (fShading==kNotShaded) {
5573 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(sy5-1)+1);
5575 for (il=sy5;il<=sy4+1;il++) {
5577 if(il<=sy4) dy1 = il;
5579 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5580 else v =(iv1+iv2+iv4)/3;
5582 ColorModel(iv,ui1,ui2,ui3);
5583 box->SetFillColor(fNewColorIndex);
5584 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(il)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(il-1)+1);
5592 for (sx4=sx3;sx4<=sx2;sx4++) {
5594 sdy4 = sdx3*pom1+sdy3;
5597 sdy4 = sdx1*pom1+sdy1;
5599 y5 = fEnvelope[sx4];
5605 if ((sy4<=y5)||(sy5<y5)) {
5606 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
5607 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
5608 if (fShading==kNotShaded) {
5609 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(sy5-1)+1);
5611 for (il=sy5;il<=sy4+1;il++) {
5613 if(il<=sy4) dy1 = il;
5615 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5616 else v =(iv1+iv2+iv4)/3;
5618 ColorModel(iv,ui1,ui2,ui3);
5619 box->SetFillColor(fNewColorIndex);
5620 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(il)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(il-1)+1);
5628 xtaz = (dx3+dx2+dx4)/3;
5629 ytaz = (dy3+dy2+dy4)/3;
5630 ztaz = (z3+z2+z4)/3;
5631 if (fShading==kNotShaded) v=ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
5633 if (fShadow==kShadowsNotPainted) {
5634 if (fShading==kNotShaded) {
5636 iv = fLevels-(Int_t)v;
5639 iv3 = fLevels-(Int_t)v3;
5642 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
5643 if (fShading==kNotShaded) {
5645 iv = fLevels-(Int_t)v;
5646 iv = (Int_t)(iv-fLevels*spriz/2);
5649 iv3 = fLevels-(Int_t)v3;
5652 if (fShading==kNotShaded) {
5653 ColorModel(iv,ui1,ui2,ui3);
5654 box->SetFillColor(fNewColorIndex);
5665 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
5666 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
5667 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
5668 dd = -da*dx1-db*dy1-dc*z1;
5705 if (pom2!=0) sdx1 = pom1/pom2;
5708 sdy1 = pom1-sdx1*pom2;
5711 if (pom2!=0) sdx2 = pom1/pom2;
5714 sdy2 = pom1-sdx2*pom2;
5717 if (pom2!=0) sdx3 = pom1/pom2;
5720 sdy3 = pom1-sdx3*pom2;
5723 for (sx4=sx1;sx4<=sx2;sx4++) {
5725 sdy4 = sdx1*pom1+sdy1;
5728 sdy4 = sdx2*pom1+sdy2;
5730 y5 = fEnvelope[sx4];
5736 if ((sy4<=y5)||(sy5<y5)) {
5737 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
5738 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
5739 if (fShading==kNotShaded) {
5740 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(sy5-1)+1);
5742 for (il=sy5;il<=sy4+1;il++) {
5744 if(il<=sy4) dy1 = il;
5746 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5747 else v =(iv2+iv3+iv4)/3;
5749 ColorModel(iv,ui1,ui2,ui3);
5750 box->SetFillColor(fNewColorIndex);
5751 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(il)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(il-1)+1);
5759 for (sx4=sx2;sx4<=sx3;sx4++) {
5761 sdy4 = sdx3*pom1+sdy3;
5764 sdy4 = sdx2*pom1+sdy2;
5766 y5 = fEnvelope[sx4];
5772 if ((sy4<=y5)||(sy5<y5)) {
5773 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
5774 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
5775 if (fShading==kNotShaded) {
5776 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(sy5-1)+1);
5778 for (il=sy5;il<=sy4+1;il++) {
5780 if(il<=sy4) dy1 = il;
5782 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5783 else v =(iv2+iv3+iv4)/3;
5785 ColorModel(iv,ui1,ui2,ui3);
5786 box->SetFillColor(fNewColorIndex);
5787 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(il)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(il-1)+1);
5796 for (sx4=sx1;sx4<=sx3;sx4++) {
5798 sdy4 = sdx2*pom1+sdy2;
5801 sdy4 = sdx1*pom1+sdy1;
5803 y5 = fEnvelope[sx4];
5809 if ((sy4<=y5)||(sy5<y5)) {
5810 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
5811 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
5812 if (fShading==kNotShaded) {
5813 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(sy5-1)+1);
5815 for (il=sy5;il<=sy4+1;il++) {
5817 if(il<=sy4) dy1 = il;
5819 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5820 else v =(iv2+iv3+iv4)/3;
5822 ColorModel(iv,ui1,ui2,ui3);
5823 box->SetFillColor(fNewColorIndex);
5824 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(il)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(il-1)+1);
5832 for (sx4=sx3;sx4<=sx2;sx4++) {
5834 sdy4 = sdx3*pom1+sdy3;
5837 sdy4 = sdx1*pom1+sdy1;
5839 y5 = fEnvelope[sx4];
5845 if ((sy4<=y5)||(sy5<y5)) {
5846 sy4 = (Int_t)TMath::Min(sy4,(Int_t)y5);
5847 sy5 = (Int_t)TMath::Min(sy5,(Int_t)y5);
5848 if (fShading==kNotShaded) {
5849 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(sy5-1)+1);
5851 for (il=sy5;il<=sy4+1;il++) {
5853 if(il<=sy4) dy1 = il;
5855 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
5856 else v =(iv2+iv3+iv4)/3;
5858 ColorModel(iv,ui1,ui2,ui3);
5859 box->SetFillColor(fNewColorIndex);
5860 box->PaintBox(gPad->PixeltoX(sx4),gPad->PixeltoY(il)+1,gPad->PixeltoX(sx4+1),gPad->PixeltoY(il-1)+1);
5870 case kDisplayModeTriangles:
5871 if (fModeGroup==kModeGroupSimple) {
5872 if ((q1!=q2||smer!=0)&&flag==1) {
5883 i1 = (Int_t)TMath::Min(w1,s1);
5884 i2 = (Int_t)TMath::Min(w1,s2);
5885 i3 = (Int_t)TMath::Min(w1,s3);
5886 i4 = (Int_t)TMath::Min(w1,s4);
5888 i1 = (Int_t)TMath::Max(w1-s1,0);
5889 i2 = (Int_t)TMath::Max(w1-s2,0);
5890 i3 = (Int_t)TMath::Max(w1-s3,0);
5891 i4 = (Int_t)TMath::Max(w1-s4,0);
5894 j1 = (Int_t)TMath::Min(w2,t1);
5895 j2 = (Int_t)TMath::Min(w2,t2);
5896 j3 = (Int_t)TMath::Min(w2,t3);
5897 j4 = (Int_t)TMath::Min(w2,t4);
5899 j1 = (Int_t)TMath::Max(w2-t1,0);
5900 j2 = (Int_t)TMath::Max(w2-t2,0);
5901 j3 = (Int_t)TMath::Max(w2-t3,0);
5902 j4 = (Int_t)TMath::Max(w2-t4,0);
5916 if ((q1!=q2||smer!=0)&&flag==1) {
5917 Envelope(x1,y1,x2,y2);
5923 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
5925 Envelope(x2,y2,x3,y3);
5931 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
5933 Envelope(x2,y2,x4,y4);
5939 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
5941 Envelope(x1,y1,x4,y4);
5947 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
5949 Envelope(x3,y3,x4,y4);
5955 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
5959 if ((q1!=q2||smer!=0)&&flag==1) {
5968 if (fShading==kShaded) {
5970 tr1 = (Int_t)TMath::Max(t1-1,0);
5972 tr2 = (Int_t)TMath::Max(t2-1,0);
5973 sr3 = (Int_t)TMath::Max(s2-1,0);
5975 sr4 = (Int_t)TMath::Max(s3-1,0);
5992 i1 = (Int_t)TMath::Max(w1-s1,0);
5993 i2 = (Int_t)TMath::Max(w1-s2,0);
5994 i3 = (Int_t)TMath::Max(w1-s3,0);
5995 i4 = (Int_t)TMath::Max(w1-s4,0);
5996 if (fShading==kShaded) {
5997 sr1 = (Int_t)TMath::Max(w1-sr1,0);
5998 sr2 = (Int_t)TMath::Max(w1-sr2,0);
5999 sr3 = (Int_t)TMath::Max(w1-sr3,0);
6000 sr4 = (Int_t)TMath::Max(w1-sr4,0);
6001 sr5 = (Int_t)TMath::Max(w1-sr5,0);
6002 sr6 = (Int_t)TMath::Max(w1-sr6,0);
6003 sr7 = (Int_t)TMath::Max(w1-sr7,0);
6004 sr8 = (Int_t)TMath::Max(w1-sr8,0);
6013 j1 = (Int_t)TMath::Max(w2-t1,0);
6014 j2 = (Int_t)TMath::Max(w2-t2,0);
6015 j3 = (Int_t)TMath::Max(w2-t3,0);
6016 j4 = (Int_t)TMath::Max(w2-t4,0);
6017 if (fShading==kShaded) {
6018 tr1 = (Int_t)TMath::Max(w2-tr1,0);
6019 tr2 = (Int_t)TMath::Max(w2-tr2,0);
6020 tr3 = (Int_t)TMath::Max(w2-tr3,0);
6021 tr4 = (Int_t)TMath::Max(w2-tr4,0);
6022 tr5 = (Int_t)TMath::Max(w2-tr5,0);
6023 tr6 = (Int_t)TMath::Max(w2-tr6,0);
6024 tr7 = (Int_t)TMath::Max(w2-tr7,0);
6025 tr8 = (Int_t)TMath::Max(w2-tr8,0);
6052 Envelope(x1,y1,x2,y2);
6053 Envelope(x2,y2,x3,y3);
6054 xtaz = (dx1+dx2+dx4)/3;
6055 ytaz = (dy1+dy2+dy4)/3;
6056 ztaz = (z1+z2+z4)/3;
6057 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx4,dy4,z4);
6058 if (fShading==kShaded) {
6059 if (fShadow==kShadowsNotPainted) {
6060 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
6061 else Transform(sr1,tr1,0);
6065 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
6066 else Transform(sr8,tr8,0);
6070 v = v+ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1);
6071 v = v+ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2);
6072 v = v+ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4);
6074 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
6075 else Transform(sr3,tr3,0);
6079 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
6080 else Transform(sr2,tr2,0);
6084 v = ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3);
6085 v = v+ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3);
6086 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
6087 v = v+ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1);
6089 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
6090 else Transform(sr5,tr5,0);
6094 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
6095 else Transform(sr4,tr4,0);
6099 v = ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
6100 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1);
6101 v = v+ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
6102 v = v+ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3);
6104 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
6105 else Transform(sr7,tr7,0);
6109 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
6110 else Transform(sr6,tr6,0);
6114 v = ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4);
6115 v = v+ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2);
6116 v = v+ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1);
6117 v = v+ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1);
6120 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
6123 if (sr1<0||sr1>w1||tr1<0||tr1>w2) Transform(sr1,tr1,-1);
6124 else Transform(sr1,tr1,0);
6128 if (sr8<0||sr8>w1||tr8<0||tr8>w2) Transform(sr8,tr8,-1);
6129 else Transform(sr8,tr8,0);
6133 da = (dxr1+dx2+dx1)/3;
6134 db = (dyr1+dy2+dy1)/3;
6136 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6137 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
6138 da = (dxr1+dxr2+dx1)/3;
6139 db = (dyr1+dyr2+dy1)/3;
6140 dc = (zr1+zr2+z1)/3;
6141 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6142 v = v+(ColorCalculation(dxr1,dyr1,zr1,dx1,dy1,z1,dxr2,dyr2,zr2)+spriz)/2;
6143 da = (dxr2+dx1+dx4)/3;
6144 db = (dyr2+dy1+dy4)/3;
6146 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6147 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx1,dy1,z1,dx4,dy4,z4)+spriz)/2;
6149 if (sr3<0||sr3>w1||tr3<0||tr3>w2) Transform(sr3,tr3,-1);
6150 else Transform(sr3,tr3,0);
6154 if (sr2<0||sr2>w1||tr2<0||tr2>w2) Transform(sr2,tr2,-1);
6155 else Transform(sr2,tr2,0);
6159 da = (dx1+dx2+dx3)/3;
6160 db = (dy1+dy2+dy3)/3;
6162 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6163 v = (ColorCalculation(dx1,dy1,z1,dx2,dy2,z2,dx3,dy3,z3)+spriz)/2;
6164 da = (dx2+dxr1+dx3)/3;
6165 db = (dy2+dyr1+dy3)/3;
6167 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6168 v = v+(ColorCalculation(dx2,dy2,z2,dxr1,dyr1,zr1,dx3,dy3,z3)+spriz)/2;
6169 da = (dx2+dxr2+dxr1)/3;
6170 db = (dy2+dyr2+dyr1)/3;
6171 dc = (z2+zr2+zr1)/3;
6172 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6173 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
6174 da = (dxr2+dx2+dx1)/3;
6175 db = (dyr2+dy2+dy1)/3;
6177 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6178 v = v+(ColorCalculation(dxr2,dyr2,zr2,dx2,dy2,z2,dx1,dy1,z1)+spriz)/2;
6180 if (sr5<0||sr5>w1||tr5<0||tr5>w2) Transform(sr5,tr5,-1);
6181 else Transform(sr5,tr5,0);
6185 if (sr4<0||sr4>w1||tr4<0||tr4>w2) Transform(sr4,tr4,-1);
6186 else Transform(sr4,tr4,0);
6190 da = (dx2+dx3+dx4)/3;
6191 db = (dy2+dy3+dy4)/3;
6193 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6194 v = (ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
6195 da = (dx4+dx3+dxr1)/3;
6196 db = (dy4+dy3+dyr1)/3;
6198 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6199 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr1,dyr1,zr1)+spriz)/2;
6200 da = (dx3+dxr2+dxr1)/3;
6201 db = (dy3+dyr2+dyr1)/3;
6202 dc = (z3+zr2+zr1)/3;
6203 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6204 v = v+(ColorCalculation(dx3,dy3,z3,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
6205 da = (dx2+dxr2+dx3)/3;
6206 db = (dy2+dyr2+dy3)/3;
6208 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6209 v = v+(ColorCalculation(dx2,dy2,z2,dxr2,dyr2,zr2,dx3,dy3,z3)+spriz)/2;
6211 if (sr7<0||sr7>w1||tr7<0||tr7>w2) Transform(sr7,tr7,-1);
6212 else Transform(sr7,tr7,0);
6216 if (sr6<0||sr6>w1||tr6<0||tr6>w2) Transform(sr6,tr6,-1);
6217 else Transform(sr6,tr6,0);
6221 da = (dx1+dx3+dx4)/3;
6222 db = (dy1+dy3+dy4)/3;
6224 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6225 v = (ColorCalculation(dx1,dy1,z1,dx3,dy3,z3,dx4,dy4,z4)+spriz)/2;
6226 da = (dx4+dx3+dxr2)/3;
6227 db = (dy4+dy3+dyr2)/3;
6229 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6230 v = v+(ColorCalculation(dx4,dy4,z4,dx3,dy3,z3,dxr2,dyr2,zr2)+spriz)/2;
6231 da = (dx4+dxr2+dxr1)/3;
6232 db = (dy4+dyr2+dyr1)/3;
6233 dc = (z4+zr2+zr1)/3;
6234 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6235 v = v+(ColorCalculation(dx4,dy4,z4,dxr2,dyr2,zr2,dxr1,dyr1,zr1)+spriz)/2;
6236 da = (dx1+dx4+dxr1)/3;
6237 db = (dy1+dy4+dyr1)/3;
6239 spriz = ShadowColorCalculation(da,db,dc,shad_noise);
6240 v = v+(ColorCalculation(dx1,dy1,z1,dx4,dy4,z4,dxr1,dyr1,zr1)+spriz)/2;
6245 if (fShadow==kShadowsNotPainted) {
6246 if (fShading==kNotShaded) {
6248 iv = fLevels-(Int_t)v;
6251 iv1 = fLevels-(Int_t)v1;
6253 iv2 = fLevels-(Int_t)v2;
6255 iv4 = fLevels-(Int_t)v4;
6258 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
6259 if (fShading==kNotShaded) {
6261 iv = fLevels-(Int_t)(v+0.5);
6264 iv1 = fLevels-(Int_t)v1;
6266 iv2 = fLevels-(Int_t)v2;
6268 iv4 = fLevels-(Int_t)v4;
6271 if (fShading==kNotShaded) {
6272 ColorModel(iv,ui1,ui2,ui3);
6273 line->SetLineColor(fNewColorIndex);
6284 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
6285 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
6286 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
6287 dd = -da*dx1-db*dy1-dc*z1;
6304 if (pom2!=0) sdx1 = pom1/pom2;
6307 sdy1 = pom1-sdx1*pom2;
6308 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
6310 sdy4 = sdx1*pom1+sdy1;
6312 if (sy4<=fEnvelope[sx4]) {
6313 fEnvelope[sx4] = sy4;
6314 if (fShading==kNotShaded) {
6315 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6319 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
6320 else v = (iv1+iv2+iv4)/3;
6322 ColorModel(iv,ui1,ui2,ui3);
6323 line->SetLineColor(fNewColorIndex);
6324 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6328 sy4 = fEnvelope[sx4];
6329 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
6330 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6331 }
else if (sy5<=fEnvelope[sx5]) {
6334 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
6335 else v = (iv1+iv2+iv4)/3;
6337 ColorModel(iv,ui1,ui2,ui3);
6338 line->SetLineColor(fNewColorIndex);
6339 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6341 sy5 = fEnvelope[sx4];
6359 if (pom2!=0) sdx2 = pom1/pom2;
6362 sdy2 = pom1-sdx2*pom2;
6372 uip = fNewColorIndex;
6373 xtaz = (dx3+dx2+dx4)/3;
6374 ytaz = (dy3+dy2+dy4)/3;
6375 ztaz = (z3+z2+z4)/3;
6376 if (fShading==kNotShaded) v = ColorCalculation(dx2,dy2,z2,dx3,dy3,z3,dx4,dy4,z4);
6378 if (fShadow==kShadowsNotPainted) {
6379 if (fShading==kNotShaded) {
6381 iv = fLevels-(Int_t)v;
6384 iv3 = fLevels-(Int_t)v3;
6387 spriz = ShadowColorCalculation(xtaz,ytaz,ztaz,shad_noise);
6388 if (fShading==kNotShaded) {
6390 iv = fLevels-(Int_t)v;
6391 iv = (Int_t)(iv-fLevels*spriz/2);
6394 iv3 = fLevels-(Int_t)v3;
6397 if (fShading==kNotShaded) {
6398 ColorModel(iv,ui1,ui2,ui3);
6399 line->SetLineColor(fNewColorIndex);
6410 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
6411 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
6412 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
6413 dd = -da*dx1-db*dy1-dc*z1;
6430 if (pom2!=0) sdx1 = pom1/pom2;
6433 sdy1 = pom1-sdx1*pom2;
6434 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
6436 sdy4 = sdx1*pom1+sdy1;
6438 if (sy4<=fEnvelope[sx4]) {
6439 fEnvelope[sx4] = sy4;
6440 if (fShading==kNotShaded) {
6441 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6445 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
6446 else v = (iv1+iv2+iv4)/3;
6448 ColorModel(iv,ui1,ui2,ui3);
6449 line->SetLineColor(fNewColorIndex);
6450 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6454 sy4 = fEnvelope[sx4];
6455 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
6456 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6457 }
else if (sy5<=fEnvelope[sx5]) {
6460 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
6461 else v = (iv1+iv2+iv4)/3;
6463 ColorModel(iv,ui1,ui2,ui3);
6464 line->SetLineColor(fNewColorIndex);
6465 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6467 sy5 = fEnvelope[sx4];
6486 if (pom2!=0) sdx1 = pom1/pom2;
6489 sdy1 = pom1-sdx1*pom2;
6490 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
6492 sdy4 = sdx1*pom1+sdy1;
6494 if (sy4<=fEnvelope[sx4]) {
6495 fEnvelope[sx4] = sy4;
6496 if (fShading==kNotShaded) {
6497 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6501 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
6502 else v = (iv1+iv2+iv4)/3;
6504 ColorModel(iv,ui1,ui2,ui3);
6505 line->SetLineColor(fNewColorIndex);
6506 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6510 sy4 = fEnvelope[sx4];
6511 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
6512 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6513 }
else if (sy5<=fEnvelope[sx5]) {
6516 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
6517 else v = (iv1+iv2+iv4)/3;
6519 ColorModel(iv,ui1,ui2,ui3);
6520 line->SetLineColor(fNewColorIndex);
6521 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6523 sy5 = fEnvelope[sx4];
6527 for (sx4=sx1p,sx5=sx1p,sy5=sy1p;sx4<=sx3p;sx4++) {
6529 sdy4 = sdx2p*pom1+sdy2p;
6531 if (sy4<=fEnvelope[sx4]) {
6532 fEnvelope[sx4] = sy4;
6533 if (fShading==kNotShaded) {
6534 line->SetLineColor(uip);
6535 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6539 if (dcp!=0) v = (-ddp-dap*dx1-dbp*dy1)/dcp;
6540 else v = (iv1+iv2+iv4)/3;
6542 ColorModel(iv,ui1,ui2,ui3);
6543 line->SetLineColor(fNewColorIndex);
6544 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6548 sy4 = fEnvelope[sx4];
6549 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
6550 line->SetLineColor(uip);
6551 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6552 }
else if (sy5<=fEnvelope[sx5]) {
6555 if (dcp!=0) v = (-ddp-dap*dx1-dbp*dy1)/dcp;
6556 else v = (iv1+iv2+iv4)/3;
6558 ColorModel(iv,ui1,ui2,ui3);
6559 line->SetLineColor(fNewColorIndex);
6560 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6562 sy5 = fEnvelope[sx4];
6581 if (pom2!=0) sdx2 = pom1/pom2;
6584 sdy2 = pom1-sdx2*pom2;
6585 for (sx4=sx2,sx5=sx2,sy5=sy2;sx4<=sx3;sx4++) {
6587 sdy4 = sdx2*pom1+sdy2;
6589 if (sy4<=fEnvelope[sx4]) {
6590 fEnvelope[sx4] = sy4;
6591 if (fShading==kNotShaded) {
6592 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6596 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
6597 else v = (iv1+iv2+iv4)/3;
6599 ColorModel(iv,ui1,ui2,ui3);
6600 line->SetLineColor(fNewColorIndex);
6601 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6605 sy4 = fEnvelope[sx4];
6606 if (fShading==kNotShaded&&sy5<=fEnvelope[sx5]) {
6607 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6608 }
else if (sy5<=fEnvelope[sx5]) {
6611 if (dc!=0) v = (-dd-da*dx1-db*dy1)/dc;
6612 else v = (iv1+iv2+iv4)/3;
6614 ColorModel(iv,ui1,ui2,ui3);
6615 line->SetLineColor(fNewColorIndex);
6616 line->PaintLine(gPad->PixeltoX(sx4),gPad->PixeltoY(sy4)+1,gPad->PixeltoX(sx5),gPad->PixeltoY(sy5)+1);
6618 sy5 = fEnvelope[sx4];
6639 if (smer==0) q1 += 1;
6647 }
while ((q1!=qv||(q2!=(qv-1) && q2!=w2)||smer!=0||flag!=1) &&
6648 ((q1!=(qv-1) && q1!=w1)||q2!=qv||smer!=1||flag!=1) &&
6650 if (qv<=w2&&qv<=w1) {
6693 if (q2<=w2)
goto l2;
6695 }
while (q1<=w1&&q2<=w2);
6696 if (fChanmarkEnDis==kChannelMarksDrawn ||
6697 fChanlineEnDis==kChannelGridDrawn) {
6698 line->SetLineWidth(1);
6699 for (i=fBx1;i<=fBx2;i++) fEnvelope[i] = fBy2;
6708 if (x2>=x1) turnj = 1;
6709 if (x3>=x2) turni = 1;
6737 if (smer==0) q1 -= 1;
6741 if (smer==0) q2 += 1;
6765 Envelope(x1,y1,x2,y2);
6766 if (fChanlineEnDis==kChannelGridDrawn) {
6772 line->SetLineColor(fChanlineColor);
6773 line->PaintLine(gPad->PixeltoX(fXs),gPad->PixeltoY(fYs)+1,gPad->PixeltoX(fXe),gPad->PixeltoY(fYe)+1);
6776 if (fChanmarkEnDis==kChannelMarksDrawn) {
6777 if (y1<=fEnvelope[x1]) {
6778 DrawMarker(x1,y1,fChanmarkWidth,fChanmarkHeight,fChanmarkStyle);
6794 if (smer==0) q1 += 1;
6802 }
while ((q1!=qv||(q2!=(qv-1)&&q2!=w2)||smer!=0||flag!=1) &&
6803 ((q1!=(qv-1)&&q1!=w1)||q2!=qv||smer!=1||flag!=1) &&
6805 if (qv<=w2&&qv<=w1) {
6848 if (q2<=w2)
goto lc2;
6850 }
while (q1<=w1&&q2<=w2);
6854 static char chopt[10] =
"";
6855 if (fViewAngle==0) {
6856 axis->PaintAxis(p101x, p101y, p111x, p111y, bmin, bmax, ndivx,
"");
6857 axis->PaintAxis(p011x, p011y, p111x, p111y, bmin, bmax, ndivx,
"");
6859 axis->PaintAxis(p110x, p110y, p111x, p111y, bmin, bmax, ndivx,
"");
6860 ndivx = fH2->GetXaxis()->GetNdivisions();
6861 bmin = fH2->GetXaxis()->GetXmin();
6862 bmax = fH2->GetXaxis()->GetXmax();
6863 xaxis->SetLabelOffset(xaxis->GetLabelOffset()-xaxis->GetTickSize());
6864 chopt[0] = 0; strlcat(chopt,
"SDH-",10);
6866 strlcat(chopt,
"N",10);
6869 xaxis->PaintAxis(p010x, p010y, p110x, p110y, bmin, bmax, ndivx, chopt);
6870 ndivy = fH2->GetYaxis()->GetNdivisions();
6871 bmin = fH2->GetYaxis()->GetXmin();
6872 bmax = fH2->GetYaxis()->GetXmax();
6873 yaxis->SetLabelOffset(yaxis->GetLabelOffset()+yaxis->GetTickSize());
6874 chopt[0] = 0; strlcat(chopt,
"SDH+",10);
6876 strlcat(chopt,
"N",10);
6879 yaxis->PaintAxis(p100x, p100y, p110x, p110y, bmin, bmax, ndivy, chopt);
6880 if(fAlpha+fBeta<90){
6884 zaxis->SetLabelOffset(zaxis->GetLabelOffset()-zaxis->GetTickSize());
6885 if (fZscale==kZScaleLog) {
6887 if (bmin <= 0) bmin=0.001*bmax;
6888 zaxis->PaintAxis(p010x, p010y, p011x, p011y, bmin, bmax, ndivz,
"G+");
6889 }
else if (fZscale==kZScaleSqrt) {
6890 TF1 *f1=
new TF1(
"f1",
"sqrt(x)",bmin,bmax);
6891 TGaxis *a1 =
new TGaxis(p010x, p010y, p011x, p011y,
"f1", ndivz,
"SDH+");
6892 a1->SetLabelOffset(a1->GetLabelOffset()-a1->GetTickSize());
6897 chopt[0] = 0; strlcat(chopt,
"SDH+",10);
6899 strlcat(chopt,
"N",10);
6902 zaxis->PaintAxis(p010x, p010y, p011x, p011y, bmin, bmax, ndivz, chopt);
6905 }
else if (fViewAngle==90) {
6906 axis->PaintAxis(p001x, p001y, p101x, p101y, bmin, bmax, ndivx,
"");
6907 axis->PaintAxis(p111x, p111y, p101x, p101y, bmin, bmax, ndivx,
"");
6909 axis->PaintAxis(p100x, p100y, p101x, p101y, bmin, bmax, ndivx,
"");
6910 ndivx = fH2->GetXaxis()->GetNdivisions();
6911 bmin = fH2->GetXaxis()->GetXmin();
6912 bmax = fH2->GetXaxis()->GetXmax();
6913 xaxis->SetLabelOffset(xaxis->GetLabelOffset()+xaxis->GetTickSize());
6914 chopt[0] = 0; strlcat(chopt,
"SDH+",10);
6916 strlcat(chopt,
"N",10);
6919 xaxis->PaintAxis(p000x, p000y, p100x, p100y, bmin, bmax, ndivx, chopt);
6920 ndivy = fH2->GetYaxis()->GetNdivisions();
6921 bmin = fH2->GetYaxis()->GetXmin();
6922 bmax = fH2->GetYaxis()->GetXmax();
6923 yaxis->SetLabelOffset(yaxis->GetLabelOffset()+yaxis->GetTickSize());
6924 chopt[0] = 0; strlcat(chopt,
"SDH+",10);
6926 strlcat(chopt,
"N",10);
6929 yaxis->PaintAxis(p100x, p100y, p110x, p110y, bmin, bmax, ndivy, chopt);
6930 if(fAlpha+fBeta<90){
6934 zaxis->SetLabelOffset(zaxis->GetLabelOffset()-zaxis->GetTickSize());
6935 if (fZscale==kZScaleLog) {
6937 if (bmin <= 0) bmin=0.001*bmax;
6938 zaxis->PaintAxis(p110x, p110y, p111x, p111y, bmin, bmax, ndivz,
"G+");
6939 }
else if (fZscale==kZScaleSqrt) {
6940 TF1 *f1=
new TF1(
"f1",
"sqrt(x)",bmin,bmax);
6941 TGaxis *a1 =
new TGaxis(p110x, p110y, p111x, p111y,
"f1", ndivz,
"SDH+");
6942 a1->SetLabelOffset(a1->GetLabelOffset()-a1->GetTickSize());
6947 chopt[0] = 0; strlcat(chopt,
"SDH+",10);
6949 strlcat(chopt,
"N",10);
6952 zaxis->PaintAxis(p110x, p110y, p111x, p111y, bmin, bmax, ndivz, chopt);
6955 }
else if (fViewAngle==180) {
6956 axis->PaintAxis(p011x, p011y, p001x, p001y, bmin, bmax, ndivx,
"");
6957 axis->PaintAxis(p101x, p101y, p001x, p001y, bmin, bmax, ndivx,
"");
6959 axis->PaintAxis(p000x, p000y, p001x, p001y, bmin, bmax, ndivx,
"");
6960 ndivx = fH2->GetXaxis()->GetNdivisions();
6961 bmin = fH2->GetXaxis()->GetXmin();
6962 bmax = fH2->GetXaxis()->GetXmax();
6963 xaxis->SetLabelOffset(xaxis->GetLabelOffset()+xaxis->GetTickSize());
6964 chopt[0] = 0; strlcat(chopt,
"SDH+",10);
6966 strlcat(chopt,
"N",10);
6969 xaxis->PaintAxis(p000x, p000y, p100x, p100y, bmin, bmax, ndivx, chopt);
6970 ndivy = fH2->GetYaxis()->GetNdivisions();
6971 bmin = fH2->GetYaxis()->GetXmin();
6972 bmax = fH2->GetYaxis()->GetXmax();
6973 yaxis->SetLabelOffset(yaxis->GetLabelOffset()-yaxis->GetTickSize());
6974 chopt[0] = 0; strlcat(chopt,
"SDH-",10);
6976 strlcat(chopt,
"N",10);
6979 yaxis->PaintAxis(p000x, p000y, p010x, p010y, bmin, bmax, ndivy, chopt);
6980 if(fAlpha+fBeta<90){
6984 zaxis->SetLabelOffset(zaxis->GetLabelOffset()-zaxis->GetTickSize());
6985 if (fZscale==kZScaleLog) {
6987 if (bmin <= 0) bmin=0.001*bmax;
6988 zaxis->PaintAxis(p100x, p100y, p101x, p101y, bmin, bmax, ndivz,
"G+");
6989 }
else if (fZscale==kZScaleSqrt) {
6990 TF1 *f1=
new TF1(
"f1",
"sqrt(x)",bmin,bmax);
6991 TGaxis *a1 =
new TGaxis(p100x, p100y, p101x, p101y,
"f1", ndivz,
"SDH+");
6992 a1->SetLabelOffset(a1->GetLabelOffset()-a1->GetTickSize());
6997 chopt[0] = 0; strlcat(chopt,
"SDH+",10);
6999 strlcat(chopt,
"N",10);
7002 zaxis->PaintAxis(p100x, p100y, p101x, p101y, bmin, bmax, ndivz, chopt);
7005 }
else if (fViewAngle==270) {
7006 axis->PaintAxis(p111x, p111y, p011x, p011y, bmin, bmax, ndivx,
"");
7007 axis->PaintAxis(p001x, p001y, p011x, p011y, bmin, bmax, ndivx,
"");
7009 axis->PaintAxis(p010x, p010y, p011x, p011y, bmin, bmax, ndivx,
"");
7010 ndivx = fH2->GetXaxis()->GetNdivisions();
7011 bmin = fH2->GetXaxis()->GetXmin();
7012 bmax = fH2->GetXaxis()->GetXmax();
7013 xaxis->SetLabelOffset(xaxis->GetLabelOffset()-xaxis->GetTickSize());
7014 chopt[0] = 0; strlcat(chopt,
"SDH-",10);
7016 strlcat(chopt,
"N",10);
7019 xaxis->PaintAxis(p010x, p010y, p110x, p110y, bmin, bmax, ndivx, chopt);
7020 ndivy = fH2->GetYaxis()->GetNdivisions();
7021 bmin = fH2->GetYaxis()->GetXmin();
7022 bmax = fH2->GetYaxis()->GetXmax();
7023 yaxis->SetLabelOffset(yaxis->GetLabelOffset()-yaxis->GetTickSize());
7024 chopt[0] = 0; strlcat(chopt,
"SDH-",10);
7026 strlcat(chopt,
"N",10);
7029 yaxis->PaintAxis(p000x, p000y, p010x, p010y, bmin, bmax, ndivy, chopt);
7030 if(fAlpha+fBeta<90){
7034 zaxis->SetLabelOffset(zaxis->GetLabelOffset()-zaxis->GetTickSize());
7035 if (fZscale==kZScaleLog) {
7037 if (bmin <= 0) bmin=0.001*bmax;
7038 zaxis->PaintAxis(p000x, p000y, p001x, p001y, bmin, bmax, ndivz,
"G+");
7039 }
else if (fZscale==kZScaleSqrt) {
7040 TF1 *f1=
new TF1(
"f1",
"sqrt(x)",bmin,bmax);
7041 TGaxis *a1 =
new TGaxis(p000x, p000y, p001x, p001y,
"f1", ndivz,
"SDH+");
7042 a1->SetLabelOffset(a1->GetLabelOffset()-a1->GetTickSize());
7047 chopt[0] = 0; strlcat(chopt,
"SDH+",10);
7049 strlcat(chopt,
"N",10);
7052 zaxis->PaintAxis(p000x, p000y, p001x, p001y, bmin, bmax, ndivz,
"SDH+");
7070 void TSpectrum2Painter::SetDisplayMode(Int_t modeGroup,Int_t displayMode)
7072 if (modeGroup>=kModeGroupSimple&&modeGroup<=kModeGroupLightHeight) {
7073 if (displayMode>=kDisplayModePoints&&displayMode<=kDisplayModeTriangles) {
7074 fModeGroup = modeGroup;
7075 fDisplayMode = displayMode;
7087 void TSpectrum2Painter::SetPenAttr(Int_t color,Int_t style,Int_t width)
7089 if (color>=0 && style >=kPenStyleSolid && style <= kPenStyleDashDot && width > 0) {
7101 void TSpectrum2Painter::SetNodes(Int_t nodesx,Int_t nodesy)
7103 if (nodesx>1&&nodesy>1) {
7116 void TSpectrum2Painter::SetAngles(Int_t alpha,Int_t beta,Int_t view)
7118 if (alpha>=0&&alpha<=90&&beta>=0&&beta<=90&&alpha+beta<=90) {
7123 if (view>=0&&view<=3) fViewAngle = view*90;
7131 void TSpectrum2Painter::SetZScale(Int_t scale)
7133 if (scale>=kZScaleLinear&&scale<=kZScaleSqrt) {
7149 void TSpectrum2Painter::SetColorAlgorithm(Int_t colorAlgorithm)
7151 if (fModeGroup!=kModeGroupSimple) {
7152 if (colorAlgorithm>=kColorAlgRgbSmooth&&colorAlgorithm<=kColorAlgHvsModulo) fColorAlg = colorAlgorithm;
7161 void TSpectrum2Painter::SetColorIncrements(Double_t r,Double_t g,Double_t b)
7163 if (r>=0&&r<=255&&g>=0&&g<=255&&b>=0&&b<=255) {
7175 void TSpectrum2Painter::SetLightPosition(Int_t x,Int_t y,Int_t z)
7177 if (x>=0&&y>=0&&z>=0) {
7190 void TSpectrum2Painter::SetShading(Int_t shading,Int_t shadow)
7192 if (fModeGroup!=kModeGroupSimple) {
7193 if (shading==kNotShaded||shading==kShaded) fShading = shading;
7194 if (shadow==kShadowsNotPainted||shadow==kShadowsPainted) fShadow = shadow;
7204 void TSpectrum2Painter::SetBezier(Int_t bezier)
7206 if (fDisplayMode==kDisplayModeGrid || fDisplayMode==kDisplayModeLinesX ||
7207 fDisplayMode==kDisplayModeLinesY) {
7208 if (bezier==kBezierInterpol||bezier==kNoBezierInterpol) fBezier = bezier;
7217 void TSpectrum2Painter::SetContourWidth(Int_t width)
7219 if (width>=1) fContWidth = width;
7227 void TSpectrum2Painter::SetLightHeightWeight(Double_t weight)
7229 if (fModeGroup==kModeGroupLightHeight) {
7230 if (weight>=0&&weight<=1) fLHweight = weight;
7243 void TSpectrum2Painter::SetChanMarks(Int_t enable,Int_t color,Int_t width,Int_t height,Int_t style)
7245 if (enable==kChannelMarksNotDrawn||enable==kChannelMarksDrawn) {
7246 if (enable==kChannelMarksDrawn) {
7247 if (style>=kChannelMarksStyleDot&&style<=kChannelMarksStyleTriangle) {
7248 fChanmarkStyle = style;
7249 fChanmarkColor = color;
7251 fChanmarkWidth = width;
7253 else fChanmarkWidth = 4;
7255 fChanmarkHeight = height;
7257 else fChanmarkHeight = 4;
7260 fChanmarkEnDis = enable;
7270 void TSpectrum2Painter::SetChanGrid(Int_t enable,Int_t color)
7272 if (enable==kChannelGridNotDrawn||enable==kChannelGridDrawn) {
7273 if (enable==kChannelGridDrawn) {
7274 fChanlineColor=color;
7276 fChanlineEnDis=enable;
7286 void TSpectrum2Painter::GetDisplayMode(Int_t &modeGroup,Int_t &displayMode)
7288 modeGroup = fModeGroup;
7289 displayMode = fDisplayMode;
7299 void TSpectrum2Painter::GetPenAttr(Int_t &color, Int_t &style, Int_t &width)
7311 void TSpectrum2Painter::GetNodes(Int_t &nodesx,Int_t &nodesy)
7324 void TSpectrum2Painter::GetAngles(Int_t &alpha,Int_t &beta,Int_t &view)
7336 void TSpectrum2Painter::GetZScale(Int_t &scale)
7346 void TSpectrum2Painter::GetColorAlgorithm(Int_t &colorAlgorithm)
7348 colorAlgorithm = fColorAlg;
7356 void TSpectrum2Painter::GetColorIncrements(Double_t &r,Double_t &g,Double_t &b)
7368 void TSpectrum2Painter::GetLightPosition(Int_t &x,Int_t &y,Int_t &z)
7381 void TSpectrum2Painter::GetShading(Int_t &shading,Int_t &shadow)
7392 void TSpectrum2Painter::GetBezier(Int_t &bezier)
7402 void TSpectrum2Painter::GetContourWidth(Int_t &width)
7412 void TSpectrum2Painter::GetLightHeightWeight(Double_t &weight)
7426 void TSpectrum2Painter::GetChanMarks(Int_t &enable,Int_t &color,Int_t &width,Int_t &height,Int_t &style)
7428 style = fChanmarkStyle,width=fChanmarkWidth,height=fChanmarkHeight,color=fChanmarkColor;
7429 enable = fChanmarkEnDis;
7438 void TSpectrum2Painter::GetChanGrid(Int_t &enable,Int_t &color)
7440 color = fChanlineColor;
7441 enable = fChanlineEnDis;
7673 void TSpectrum2Painter::PaintSpectrum(TH2* h2, Option_t *option, Int_t bs)
7675 TString opt = option;
7677 TSpectrum2Painter sp(h2, bs);
7679 if (gPad->GetLogz()) sp.SetZScale(kZScaleLog);
7680 sp.SetPenAttr(h2->GetLineColor(), h2->GetLineStyle(), h2->GetLineWidth());
7683 Int_t i1, i2, i3, i4, i5;
7684 Double_t f1, f2, f3;
7688 while (opt.Tokenize(token, from,
"[ (]")) {
7692 opt.Tokenize(token, from,
","); i1 = token.Atoi();
7694 printf(
"PaintSpectrum: Display modes groups should be in the [0,3] range\n");
7697 opt.Tokenize(token, from,
")"); i2 = token.Atoi();
7698 if (i2<1 || i2>11) {
7699 printf(
"PaintSpectrum: Display modes should be in the [1,11] range\n");
7702 sp.SetDisplayMode(i1, i2);
7705 }
else if (token==
"pa") {
7706 opt.Tokenize(token, from,
","); i1 = token.Atoi();
7707 opt.Tokenize(token, from,
","); i2 = token.Atoi();
7708 opt.Tokenize(token, from,
")"); i3 = token.Atoi();
7709 sp.SetPenAttr(i1, i2, i3);
7712 }
else if (token==
"n") {
7713 opt.Tokenize(token, from,
","); i1 = token.Atoi();
7714 opt.Tokenize(token, from,
")"); i2 = token.Atoi();
7715 sp.SetNodes(i1, i2);
7718 }
else if (token==
"ca") {
7719 opt.Tokenize(token, from,
")"); i1 = token.Atoi();
7721 printf(
"PaintSpectrum: Color Algorithm should be in the [0,9] range\n");
7724 sp.SetColorAlgorithm(i1);
7727 }
else if (token==
"zs") {
7728 opt.Tokenize(token, from,
")"); i1 = token.Atoi();
7730 printf(
"PaintSpectrum: Z-Scale should be in the [0,2] range\n");
7736 }
else if (token==
"ci") {
7737 opt.Tokenize(token, from,
","); f1 = token.Atof();
7738 opt.Tokenize(token, from,
","); f2 = token.Atof();
7739 opt.Tokenize(token, from,
")"); f3 = token.Atof();
7740 sp.SetColorIncrements(f1, f2, f3);
7743 }
else if (token==
"lhw") {
7744 opt.Tokenize(token, from,
")"); f1 = token.Atof();
7745 sp.SetLightHeightWeight(f1);
7748 }
else if (token==
"lp") {
7749 opt.Tokenize(token, from,
","); i1 = token.Atoi();
7750 opt.Tokenize(token, from,
","); i2 = token.Atoi();
7751 opt.Tokenize(token, from,
")"); i3 = token.Atoi();
7752 sp.SetLightPosition(i1, i2, i3);
7755 }
else if (token==
"cw") {
7756 opt.Tokenize(token, from,
")"); i1 = token.Atoi();
7757 sp.SetContourWidth(i1);
7760 }
else if (token==
"b") {
7761 opt.Tokenize(token, from,
")"); i1 = token.Atoi();
7763 printf(
"PaintSpectrum: Bezier should be in the [0,1] range\n");
7769 }
else if (token==
"s") {
7770 opt.Tokenize(token, from,
","); i1 = token.Atoi();
7772 printf(
"PaintSpectrum: Shading should be in the [0,1] range\n");
7775 opt.Tokenize(token, from,
")"); i2 = token.Atoi();
7777 printf(
"PaintSpectrum: Shadow should be in the [0,1] range\n");
7780 sp.SetShading(i1, i2);
7783 }
else if (token==
"cm") {
7784 opt.Tokenize(token, from,
","); i1 = token.Atoi();
7785 opt.Tokenize(token, from,
","); i2 = token.Atoi();
7786 opt.Tokenize(token, from,
","); i3 = token.Atoi();
7787 opt.Tokenize(token, from,
","); i4 = token.Atoi();
7788 opt.Tokenize(token, from,
")"); i5 = token.Atoi();
7789 sp.SetChanMarks(i1, i2, i3, i4, i5);
7792 }
else if (token==
"cg") {
7793 opt.Tokenize(token, from,
","); i1 = token.Atoi();
7794 opt.Tokenize(token, from,
")"); i2 = token.Atoi();
7795 sp.SetChanGrid(i1, i2);
7798 }
else if (token==
"a" || token==
"a=") {
7799 opt.Tokenize(token, from,
","); i1 = token.Atoi();
7800 opt.Tokenize(token, from,
","); i2 = token.Atoi();
7801 opt.Tokenize(token, from,
")"); i3 = token.Atoi();
7802 sp.SetAngles(i1, i2, i3);
7805 }
else if (token==
"bf") {
7808 opt.Tokenize(token, from,
")");
7812 if (!token.IsNull()) {
7813 printf(
"Unknown option \"%s\"\n",token.Data());