Beispiel #1
0
 public virtual void Paint(Pad Pad, double XMin, double XMax, double YMin, double YMax)
 {
     if (Pad.For3D)
     {
         int millisecond = DateTime.Now.Millisecond;
         int num1 = Pad.ClientX(XMin);
         int num2 = (Pad.ClientY(YMax) + Pad.Y1) / 2;
         int num3 = Math.Abs(Pad.ClientX(XMax) - Pad.ClientX(XMin));
         int num4 = Math.Abs(Pad.ClientY(YMax) - Pad.ClientY(YMin));
         int H = num3 < num4 ? num3 : num4;
         int Left = num1 + num3 / 2 - H / 2;
         int Top = num2;
         if (this.fShowMaxZ == 0.0)
             this.ShowUnnormalizedZ();
         Pad.AxisZ3D.Min = 0.0;
         Pad.AxisZ3D.Max = this.fShowMaxZ;
         TView.View(Pad).PaintAxes(Pad, Left, Top, H);
         if (!this.Multicolor3D)
         {
             switch (this.Smoothing)
             {
                 case ESmoothing.Disabled:
                     this.Draw3DChart.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax);
                     this.Draw3DChart.Paint(Pad);
                     break;
                 case ESmoothing.Linear:
                     this.Draw3DChartSmoothedLinear.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax);
                     this.Draw3DChartSmoothedLinear.Paint(Pad);
                     break;
             }
         }
         else
         {
             switch (this.Smoothing)
             {
                 case ESmoothing.Disabled:
                     this.Draw3DChartMulticolor.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette);
                     this.Draw3DChartMulticolor.Paint(Pad);
                     break;
                 case ESmoothing.Linear:
                     this.Draw3DChartMulticolorSmoothedLinear.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette);
                     this.Draw3DChartMulticolorSmoothedLinear.Paint(Pad);
                     break;
             }
         }
         int num5 = DateTime.Now.Millisecond - millisecond;
     }
     else
     {
         int millisecond1 = DateTime.Now.Millisecond;
         int millisecond2 = DateTime.Now.Millisecond;
         int x = Pad.ClientX(this.fXMin);
         int y = Pad.ClientY(this.fYMax);
         int W = Pad.ClientX(this.fXMax) - x;
         int H = Pad.ClientY(this.fYMin) - y;
         int length = this.fPalette.Length;
         int[] numArray = new int[length];
         for (int index = 0; index < length; ++index)
             numArray[index] = this.fPalette[index].ToArgb();
         TPaintingBitmap tpaintingBitmap = new TPaintingBitmap(W, H);
         tpaintingBitmap.Fill(Pad.ForeColor);
         double num1 = (double)W / (double)this.fNBinsX;
         double num2 = (double)H / (double)this.fNBinsY;
         int w = (int)(num1 + 1.0);
         int h = (int)(num2 + 1.0);
         double num3 = (double)(this.fNColors - 1) / (this.fBinMax - this.fBinMin);
         int index1 = 0;
         double num4 = 0.0;
         while (index1 < this.fNBinsX)
         {
             int index2 = 0;
             double num5 = 0.0;
             while (index2 < this.fNBinsY)
             {
                 if (this.fBins[index1, index2] != 0.0)
                 {
                     int index3 = (int)(num3 * (this.fBins[index1, index2] - this.fBinMin));
                     tpaintingBitmap.FillRectangle(numArray[index3], (int)num4, H - (int)num5 - h, w, h);
                 }
                 ++index2;
                 num5 += num2;
             }
             ++index1;
             num4 += num1;
         }
         Bitmap bitmap = tpaintingBitmap.Get();
         Pad.Graphics.DrawImage((Image)bitmap, x, y);
         int millisecond3 = DateTime.Now.Millisecond;
         int num6 = millisecond2 - millisecond1;
         int num7 = millisecond3 - millisecond1;
     }
 }
Beispiel #2
0
        public virtual void Paint(Pad Pad, double XMin, double XMax, double YMin, double YMax)
        {
            if (Pad.For3D)
            {
                int millisecond = DateTime.Now.Millisecond;
                int num1        = Pad.ClientX(XMin);
                int num2        = (Pad.ClientY(YMax) + Pad.Y1) / 2;
                int num3        = Math.Abs(Pad.ClientX(XMax) - Pad.ClientX(XMin));
                int num4        = Math.Abs(Pad.ClientY(YMax) - Pad.ClientY(YMin));
                int H           = num3 < num4 ? num3 : num4;
                int Left        = num1 + num3 / 2 - H / 2;
                int Top         = num2;
                if (this.fShowMaxZ == 0.0)
                {
                    this.ShowUnnormalizedZ();
                }
                Pad.AxisZ3D.Min = 0.0;
                Pad.AxisZ3D.Max = this.fShowMaxZ;
                TView.View(Pad).PaintAxes(Pad, Left, Top, H);
                if (!this.Multicolor3D)
                {
                    switch (this.Smoothing)
                    {
                    case ESmoothing.Disabled:
                        this.Draw3DChart.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax);
                        this.Draw3DChart.Paint(Pad);
                        break;

                    case ESmoothing.Linear:
                        this.Draw3DChartSmoothedLinear.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax);
                        this.Draw3DChartSmoothedLinear.Paint(Pad);
                        break;
                    }
                }
                else
                {
                    switch (this.Smoothing)
                    {
                    case ESmoothing.Disabled:
                        this.Draw3DChartMulticolor.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette);
                        this.Draw3DChartMulticolor.Paint(Pad);
                        break;

                    case ESmoothing.Linear:
                        this.Draw3DChartMulticolorSmoothedLinear.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette);
                        this.Draw3DChartMulticolorSmoothedLinear.Paint(Pad);
                        break;
                    }
                }
                int num5 = DateTime.Now.Millisecond - millisecond;
            }
            else
            {
                int   millisecond1 = DateTime.Now.Millisecond;
                int   millisecond2 = DateTime.Now.Millisecond;
                int   x            = Pad.ClientX(this.fXMin);
                int   y            = Pad.ClientY(this.fYMax);
                int   W            = Pad.ClientX(this.fXMax) - x;
                int   H            = Pad.ClientY(this.fYMin) - y;
                int   length       = this.fPalette.Length;
                int[] numArray     = new int[length];
                for (int index = 0; index < length; ++index)
                {
                    numArray[index] = this.fPalette[index].ToArgb();
                }
                TPaintingBitmap tpaintingBitmap = new TPaintingBitmap(W, H);
                tpaintingBitmap.Fill(Pad.ForeColor);
                double num1   = (double)W / (double)this.fNBinsX;
                double num2   = (double)H / (double)this.fNBinsY;
                int    w      = (int)(num1 + 1.0);
                int    h      = (int)(num2 + 1.0);
                double num3   = (double)(this.fNColors - 1) / (this.fBinMax - this.fBinMin);
                int    index1 = 0;
                double num4   = 0.0;
                while (index1 < this.fNBinsX)
                {
                    int    index2 = 0;
                    double num5   = 0.0;
                    while (index2 < this.fNBinsY)
                    {
                        if (this.fBins[index1, index2] != 0.0)
                        {
                            int index3 = (int)(num3 * (this.fBins[index1, index2] - this.fBinMin));
                            tpaintingBitmap.FillRectangle(numArray[index3], (int)num4, H - (int)num5 - h, w, h);
                        }
                        ++index2;
                        num5 += num2;
                    }
                    ++index1;
                    num4 += num1;
                }
                Bitmap bitmap = tpaintingBitmap.Get();
                Pad.Graphics.DrawImage((Image)bitmap, x, y);
                int millisecond3 = DateTime.Now.Millisecond;
                int num6         = millisecond2 - millisecond1;
                int num7         = millisecond3 - millisecond1;
            }
        }