Ejemplo n.º 1
0
		public virtual TColor Result(TVec3 r, TVec3 n, TColor Diffuse)
		{
			TColor tcolor = this.Ambient;
			foreach (TLight.TSource tsource in this.ParallelBeams)
			{
				double num1 = n * tsource.o;
				if (num1 >= 0.0)
				{
					double num2 = num1 * num1 / (n * n * tsource.o * tsource.o);
					tcolor += num2 * tsource.c;
				}
			}
			foreach (TLight.TSource tsource in this.NearSources)
			{
				TVec3 tvec3 = tsource.o - r;
				double num1 = n * tvec3;
				double num2 = tvec3 * tvec3;
				if (num1 >= 0.0)
				{
					double num3 = num1 * num1 / (n * n * num2 * num2);
					tcolor += num3 * tsource.c;
				}
			}
			return Diffuse * tcolor;
		}
Ejemplo n.º 2
0
        public virtual TColor Result(TVec3 r, TVec3 n, TColor Diffuse)
        {
            TColor tcolor = this.Ambient;

            foreach (TLight.TSource tsource in this.ParallelBeams)
            {
                double num1 = n * tsource.o;
                if (num1 >= 0.0)
                {
                    double num2 = num1 * num1 / (n * n * tsource.o * tsource.o);
                    tcolor += num2 * tsource.c;
                }
            }
            foreach (TLight.TSource tsource in this.NearSources)
            {
                TVec3  tvec3 = tsource.o - r;
                double num1  = n * tvec3;
                double num2  = tvec3 * tvec3;
                if (num1 >= 0.0)
                {
                    double num3 = num1 * num1 / (n * n * num2 * num2);
                    tcolor += num3 * tsource.c;
                }
            }
            return(Diffuse * tcolor);
        }
Ejemplo n.º 3
0
        public unsafe void Paint(Pad pad)
        {
            TView tview = TView.View(pad);

            this.uq63OYZaax = tview.Left;
            this.FP43FHdtWy = tview.Top;
            this.Jm23JdRAV2 = tview.H;
            this.C843M1JDuK = tview.H;
            this.Sp23PRDLnW = tview.o - new TVec3((double)this.uq63OYZaax, (double)this.FP43FHdtWy, 0.0);
            this.tn83Ged55u = tview.Lx;
            this.PqY3RZfYIU = tview.Ly;
            this.gcU3NtonPe = tview.Lz;
            this.trP3fdnMpS = tview.Light;
            if (this.Look == EChartLook.SurfaceOnly)
            {
                this.hH1321Stt8 = false;
            }
            Bitmap bitmap = new Bitmap(this.Jm23JdRAV2, this.C843M1JDuK, PixelFormat.Format32bppRgb);

            this.qDx3lDiW7U(pad, bitmap);
            Rectangle  rect       = new Rectangle(0, 0, this.Jm23JdRAV2, this.C843M1JDuK);
            BitmapData bitmapdata = bitmap.LockBits(rect, this.hH1321Stt8 ? ImageLockMode.WriteOnly : ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);

            this.Pnx3KTVZoc((int *)bitmapdata.Scan0.ToPointer());
            bitmap.UnlockBits(bitmapdata);
            Color transparentColor = Color.FromArgb((int)byte.MaxValue, 0, 0, 0);

            bitmap.MakeTransparent(transparentColor);
            pad.Graphics.DrawImage((Image)bitmap, this.uq63OYZaax, this.FP43FHdtWy);
        }
Ejemplo n.º 4
0
 public TAxisCalc(TVec3 origin, TVec3 end, double valO, double valE, int nticks)
 {
     this.tticks = new TAxisCalc.TTick[0];
     this.origin = origin;
     this.end    = end;
     this.valO   = valO;
     this.valE   = valE;
     this.nticks = nticks;
     this.mXvbWEhZj();
     this.CKSEVIHa4();
 }
Ejemplo n.º 5
0
		public TAxisCalc(TVec3 origin, TVec3 end, double valO, double valE, int nticks)
		{
			this.tticks = new TAxisCalc.TTick[0];
			this.origin = origin;
			this.end = end;
			this.valO = valO;
			this.valE = valE;
			this.nticks = nticks;
			this.mXvbWEhZj();
			this.CKSEVIHa4();
		}
Ejemplo n.º 6
0
        public static TVec3 operator *(TVec3 v, TMat3x3 m)
        {
            TVec3 v3 = new TVec3();

            for (int i = 0; i < 3; ++i)
            {
                for (int j = 0; j < 3; ++j)
                {
                    v3[j] += v[i] * m[i, j];
                }
            }
            return(v3);
        }
Ejemplo n.º 7
0
        public static TVec3 operator *(TMat3x3 m, TVec3 v)
        {
            TVec3 v3 = new TVec3();

            for (int i = 0; i < 3; ++i)
            {
                for (int j = 0; j < 3; ++j)
                {
                    v3[i] += m[i, j] * v[j];
                }
            }
            return(v3);
        }
Ejemplo n.º 8
0
        public void CalculateAxes(Pad Pad, int Left, int Top, int H)
        {
            this.left       = Left;
            this.top        = Top;
            this.h          = H;
            this.mWHorsKIXa = new TVec3((double)(Left + H / 2), (double)(Top + 3 * H / 4), 0.0);
            if (this.ScaleZ < 1.0)
            {
                this.mWHorsKIXa.y -= (1.0 - this.ScaleZ) * 0.25 * (double)H;
            }
            double num = 0.7 * (double)H;
            double Z   = 0.5 * this.ScaleZ * (double)H;

            this.lx = new TVec3(num, 0.0, 0.0);
            this.ly = new TVec3(0.0, num, 0.0);
            this.lz = new TVec3(0.0, 0.0, Z);
            this.lx = this.E6Oo4awtTa * this.Lx;
            this.ly = this.E6Oo4awtTa * this.Ly;
            this.lz = this.E6Oo4awtTa * this.Lz;
        }
Ejemplo n.º 9
0
		public unsafe void Paint(Pad pad)
		{
			TView tview = TView.View(pad);
			this.uq63OYZaax = tview.Left;
			this.FP43FHdtWy = tview.Top;
			this.Jm23JdRAV2 = tview.H;
			this.C843M1JDuK = tview.H;
			this.Sp23PRDLnW = tview.o - new TVec3((double)this.uq63OYZaax, (double)this.FP43FHdtWy, 0.0);
			this.tn83Ged55u = tview.Lx;
			this.PqY3RZfYIU = tview.Ly;
			this.gcU3NtonPe = tview.Lz;
			this.trP3fdnMpS = tview.Light;
			if (this.Look == EChartLook.SurfaceOnly)
				this.hH1321Stt8 = false;
			Bitmap bitmap = new Bitmap(this.Jm23JdRAV2, this.C843M1JDuK, PixelFormat.Format32bppRgb);
			this.qDx3lDiW7U(pad, bitmap);
			Rectangle rect = new Rectangle(0, 0, this.Jm23JdRAV2, this.C843M1JDuK);
			BitmapData bitmapdata = bitmap.LockBits(rect, this.hH1321Stt8 ? ImageLockMode.WriteOnly : ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);
			this.Pnx3KTVZoc((int*)bitmapdata.Scan0.ToPointer());
			bitmap.UnlockBits(bitmapdata);
			Color transparentColor = Color.FromArgb((int)byte.MaxValue, 0, 0, 0);
			bitmap.MakeTransparent(transparentColor);
			pad.Graphics.DrawImage((Image)bitmap, this.uq63OYZaax, this.FP43FHdtWy);
		}
Ejemplo n.º 10
0
		public void CalculateAxes(Pad Pad, int Left, int Top, int H)
		{
			this.left = Left;
			this.top = Top;
			this.h = H;
			this.mWHorsKIXa = new TVec3((double)(Left + H / 2), (double)(Top + 3 * H / 4), 0.0);
			if (this.ScaleZ < 1.0)
				this.mWHorsKIXa.y -= (1.0 - this.ScaleZ) * 0.25 * (double)H;
			double num = 0.7 * (double)H;
			double Z = 0.5 * this.ScaleZ * (double)H;
			this.lx = new TVec3(num, 0.0, 0.0);
			this.ly = new TVec3(0.0, num, 0.0);
			this.lz = new TVec3(0.0, 0.0, Z);
			this.lx = this.E6Oo4awtTa * this.Lx;
			this.ly = this.E6Oo4awtTa * this.Ly;
			this.lz = this.E6Oo4awtTa * this.Lz;
		}
Ejemplo n.º 11
0
		private TColor E0C3BMxUWS(double obj0, double obj1, double obj2, double obj3, TColor obj4)
		{
			TVec3 n = new TVec3(obj2, 0.0, this.f(obj0 + obj2, obj1) - this.f(obj0, obj1)) ^ new TVec3(0.0, obj3, this.f(obj0, obj1 + obj3) - this.f(obj0, obj1));
			return this.trP3fdnMpS.Result(new TVec3(obj0, obj1, this.f(obj0, obj1)), n, obj4);
		}
Ejemplo n.º 12
0
			public TSource(TVec3 o, TColor c)
			{
				this.o = o;
				this.c = c;
			}
Ejemplo n.º 13
0
		public static TVec3 operator *(TMat3x3 m, TVec3 v)
		{
			TVec3 v3 = new TVec3();
			for (int i = 0; i < 3; ++i)
			{
				for (int j = 0; j < 3; ++j)
					v3[i] += m[i, j] * v[j];
			}
			return v3;
		}
Ejemplo n.º 14
0
 public TVec3(TVec3 v)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = v.z;
 }
Ejemplo n.º 15
0
        public void PaintAxes(Pad Pad, int Left, int Top, int H)
        {
            this.CalculateAxes(Pad, Left, Top, H);
            TVec3[] v = new TVec3[4]
            {
                this.o - 0.5 * this.Lx - 0.5 * this.Ly,
                this.o + 0.5 * this.Lx - 0.5 * this.Ly,
                this.o + 0.5 * this.Lx + 0.5 * this.Ly,
                this.o - 0.5 * this.Lx + 0.5 * this.Ly
            };
            double num1 = -1.0;
            int    num2 = -1;

            for (int index = 0; index < v.Length; ++index)
            {
                if (v[index].y > num1)
                {
                    num1 = v[index].y;
                    num2 = index;
                }
            }
            int index1 = 0;
            int index2 = 0;
            int index3 = 0;

            switch (num2)
            {
            case 0:
                index1 = 1;
                index2 = 2;
                index3 = 3;
                break;

            case 1:
                index1 = 2;
                index2 = 3;
                index3 = 0;
                break;

            case 2:
                index1 = 3;
                index2 = 0;
                index3 = 1;
                break;

            case 3:
                index1 = 0;
                index2 = 1;
                index3 = 2;
                break;
            }
            Point[] points1 = TVec3.PointArray(v);
            Point[] points2 = new Point[4]
            {
                (Point)v[index1],
                (Point)v[index2],
                (Point)(v[index2] + this.Lz),
                (Point)(v[index1] + this.Lz)
            };
            Point[] points3 = new Point[4]
            {
                (Point)v[index2],
                (Point)v[index3],
                (Point)(v[index3] + this.Lz),
                (Point)(v[index2] + this.Lz)
            };
            Graphics graphics = Pad.Graphics;

            graphics.Clip = new Region(new Rectangle(Pad.X1, Pad.Y1, Pad.Width + 1, Pad.Height + 1));
            Pen   pen   = new Pen(Color.Black, 1f);
            Brush brush = (Brush) new SolidBrush(Color.White);

            graphics.FillPolygon(brush, points1);
            graphics.FillPolygon(brush, points2);
            graphics.FillPolygon(brush, points3);
            graphics.DrawPolygon(pen, points1);
            graphics.DrawPolygon(pen, points2);
            graphics.DrawPolygon(pen, points3);
            TView.lF6ovwu8P3(Pad);
            Pad.AxisX3D.Position = EAxisPosition.Bottom;
            Pad.AxisY3D.Position = EAxisPosition.Bottom;
            Pad.AxisZ3D.Position = EAxisPosition.Right;
            this.PaintAxisGridAndTicks(graphics, Pad.AxisX3D, true, v[0], v[0] + this.Ly, this.Lx);
            this.PaintAxisGridAndTicks(graphics, Pad.AxisY3D, true, v[0], v[0] + this.Lx, this.Ly);
            this.PaintAxisGridAndTicks(graphics, Pad.AxisX3D, false, v[index2], v[index2] + this.Lz, this.Lx);
            this.PaintAxisGridAndTicks(graphics, Pad.AxisY3D, false, v[index2], v[index2] + this.Lz, this.Ly);
            this.PaintAxisGridAndTicks(graphics, Pad.AxisZ3D, true, v[index2], v[index2] + this.Lx, this.Lz);
            this.PaintAxisGridAndTicks(graphics, Pad.AxisZ3D, true, v[index2], v[index2] + this.Ly, this.Lz);
        }
Ejemplo n.º 16
0
        public void PaintAxisGridAndTicks(Graphics g, Axis a, bool Marks, TVec3 o, TVec3 o_, TVec3 L)
        {
            a.MinorGridEnabled  = false;
            a.MinorTicksEnabled = false;
            int nTicks = (int)(L.NormInf / 10.0);

            if (nTicks < 3)
            {
                nTicks = 3;
            }
            if (nTicks > 10)
            {
                nTicks = 10;
            }
            TAxisCalc taxisCalc = new TAxisCalc(o, o + L, a.Min, a.Max, nTicks);
            TVec3     tvec3_1   = o_ - o;
            TVec3     tvec3_2   = TVec3.O;
            TVec3     tvec3_3   = -0.04 * tvec3_1;

            if (o_.y > o.y)
            {
                tvec3_2 = tvec3_1;
                tvec3_3 = -tvec3_3;
            }
            TVec3 tvec3_4 = tvec3_2 + 1.04 * tvec3_3;

            if (a.GridEnabled)
            {
                Pen pen = new Pen(a.GridColor, a.GridWidth);
                for (int i = 0; i < taxisCalc.nTicks; ++i)
                {
                    g.DrawLine(pen, (Point)taxisCalc.TickPos(i), (Point)(taxisCalc.TickPos(i) + tvec3_1));
                }
            }
            if (a.Position == EAxisPosition.Right && tvec3_3.x <= 0.0)
            {
                Marks = false;
            }
            if (!Marks)
            {
                return;
            }
            int   num1 = a.Position == EAxisPosition.Bottom ? 0 : 1;
            int   num2 = a.Position == EAxisPosition.Bottom ? taxisCalc.nTicks - 1 : taxisCalc.nTicks;
            float num3 = 0.0f;

            if (a.MajorTicksEnabled)
            {
                Pen pen = new Pen(a.GridColor, a.GridWidth);
                for (int i = num1; i < num2; ++i)
                {
                    g.DrawLine(pen, (Point)(taxisCalc.TickPos(i) + tvec3_2), (Point)(taxisCalc.TickPos(i) + tvec3_2 + tvec3_3));
                }
            }
            if (a.LabelEnabled)
            {
                Font         labelFont  = a.LabelFont;
                float        height     = labelFont.GetHeight(g);
                SolidBrush   solidBrush = new SolidBrush(a.LabelColor);
                StringFormat format     = new StringFormat();
                float        num4;
                if (a.Position == EAxisPosition.Bottom)
                {
                    format.FormatFlags = StringFormatFlags.DirectionVertical;
                    num4 = (float)Math.Abs(taxisCalc.TickPos(1).x - taxisCalc.TickPos(0).x);
                }
                else
                {
                    tvec3_4.y -= 0.5 * (double)a.LabelFont.GetHeight();
                    num4       = (float)Math.Abs(taxisCalc.TickPos(1).y - taxisCalc.TickPos(0).y);
                }
                if (tvec3_3.x < 0.0)
                {
                    tvec3_4.x -= (double)a.LabelFont.GetHeight();
                }
                if ((double)num4 > 0.0)
                {
                    int num5 = (int)((double)height / (double)num4 + 1.0);
                    if (num1 + num5 < num2)
                    {
                        int i = num1;
                        while (i < num2)
                        {
                            if (i + num5 >= num2)
                            {
                                i = num2 - 1;
                            }
                            TVec3  tvec3_5 = taxisCalc.TickPos(i) + tvec3_4;
                            string str     = taxisCalc.TickVal(i).ToString();
                            g.DrawString(str, labelFont, (Brush)solidBrush, (PointF)tvec3_5, format);
                            SizeF sizeF = g.MeasureString(str, labelFont);
                            if ((double)sizeF.Width > (double)num3)
                            {
                                num3 = sizeF.Width;
                            }
                            i += num5;
                        }
                    }
                    else if (num2 > 0)
                    {
                        int    i       = num2 - 1;
                        TVec3  tvec3_5 = taxisCalc.TickPos(i) + tvec3_4;
                        string str     = taxisCalc.TickVal(i).ToString();
                        g.DrawString(str, labelFont, (Brush)solidBrush, (PointF)tvec3_5, format);
                        num3 = g.MeasureString(str, labelFont).Width;
                    }
                }
            }
            if (!a.TitleEnabled)
            {
                return;
            }
            SizeF  sizeF1 = g.MeasureString(a.Title, a.TitleFont);
            PointF point1;
            PointF point2;
            float  angle;

            if (a.Position == EAxisPosition.Bottom)
            {
                if (tvec3_3.x < 0.0)
                {
                    point1    = taxisCalc.TickPos(0).x > taxisCalc.TickPos(1).x ? (PointF)(taxisCalc.TickPos(taxisCalc.nTicks - 1) + tvec3_4) : (PointF)(taxisCalc.TickPos(0) + tvec3_4);
                    point1.Y += num3;
                    point2    = point1;
                    angle     = (float)(Math.Atan2(Math.Abs(L.y), Math.Abs(L.x)) * 180.0 / Math.PI);
                }
                else
                {
                    point1    = taxisCalc.TickPos(0).x > taxisCalc.TickPos(1).x ? (PointF)(taxisCalc.TickPos(0) + tvec3_4) : (PointF)(taxisCalc.TickPos(taxisCalc.nTicks - 1) + tvec3_4);
                    point1.X += a.LabelFont.GetHeight(g);
                    point1.Y += num3;
                    point2    = point1;
                    point2.X -= sizeF1.Width;
                    angle     = (float)(-Math.Atan2(Math.Abs(L.y), Math.Abs(L.x)) * 180.0 / Math.PI);
                }
            }
            else
            {
                point1    = taxisCalc.TickPos(0).z > taxisCalc.TickPos(1).z ? (PointF)(taxisCalc.TickPos(0) + tvec3_4) : (PointF)(taxisCalc.TickPos(taxisCalc.nTicks - 1) + tvec3_4);
                point1.X += num3;
                point2    = point1;
                point2.X -= sizeF1.Width;
                angle     = -90f;
            }
            Matrix matrix = new Matrix();

            matrix.RotateAt(angle, point1, MatrixOrder.Append);
            g.Transform = matrix;
            g.DrawString(a.Title, a.LabelFont, (Brush) new SolidBrush(a.LabelColor), point2);
            matrix.Reset();
            g.Transform = matrix;
        }
Ejemplo n.º 17
0
		public static Point[] PointArray(TVec3[] v)
		{
			Point[] points = new Point[v.Length];
			for (int i = 0; i < points.Length; ++i)
				points[i] = (Point)v[i];
			return points;
		}
Ejemplo n.º 18
0
		public TVec3(TVec3 v)
		{
			this.x = v.x;
			this.y = v.y;
			this.z = v.z;
		}
Ejemplo n.º 19
0
		public void PaintAxisGridAndTicks(Graphics g, Axis a, bool Marks, TVec3 o, TVec3 o_, TVec3 L)
		{
			a.MinorGridEnabled = false;
			a.MinorTicksEnabled = false;
			int nTicks = (int)(L.NormInf / 10.0);
			if (nTicks < 3)
				nTicks = 3;
			if (nTicks > 10)
				nTicks = 10;
			TAxisCalc taxisCalc = new TAxisCalc(o, o + L, a.Min, a.Max, nTicks);
			TVec3 tvec3_1 = o_ - o;
			TVec3 tvec3_2 = TVec3.O;
			TVec3 tvec3_3 = -0.04 * tvec3_1;
			if (o_.y > o.y)
			{
				tvec3_2 = tvec3_1;
				tvec3_3 = -tvec3_3;
			}
			TVec3 tvec3_4 = tvec3_2 + 1.04 * tvec3_3;
			if (a.GridEnabled)
			{
				Pen pen = new Pen(a.GridColor, a.GridWidth);
				for (int i = 0; i < taxisCalc.nTicks; ++i)
					g.DrawLine(pen, (Point)taxisCalc.TickPos(i), (Point)(taxisCalc.TickPos(i) + tvec3_1));
			}
			if (a.Position == EAxisPosition.Right && tvec3_3.x <= 0.0)
				Marks = false;
			if (!Marks)
				return;
			int num1 = a.Position == EAxisPosition.Bottom ? 0 : 1;
			int num2 = a.Position == EAxisPosition.Bottom ? taxisCalc.nTicks - 1 : taxisCalc.nTicks;
			float num3 = 0.0f;
			if (a.MajorTicksEnabled)
			{
				Pen pen = new Pen(a.GridColor, a.GridWidth);
				for (int i = num1; i < num2; ++i)
					g.DrawLine(pen, (Point)(taxisCalc.TickPos(i) + tvec3_2), (Point)(taxisCalc.TickPos(i) + tvec3_2 + tvec3_3));
			}
			if (a.LabelEnabled)
			{
				Font labelFont = a.LabelFont;
				float height = labelFont.GetHeight(g);
				SolidBrush solidBrush = new SolidBrush(a.LabelColor);
				StringFormat format = new StringFormat();
				float num4;
				if (a.Position == EAxisPosition.Bottom)
				{
					format.FormatFlags = StringFormatFlags.DirectionVertical;
					num4 = (float)Math.Abs(taxisCalc.TickPos(1).x - taxisCalc.TickPos(0).x);
				}
				else
				{
					tvec3_4.y -= 0.5 * (double)a.LabelFont.GetHeight();
					num4 = (float)Math.Abs(taxisCalc.TickPos(1).y - taxisCalc.TickPos(0).y);
				}
				if (tvec3_3.x < 0.0)
					tvec3_4.x -= (double)a.LabelFont.GetHeight();
				if ((double)num4 > 0.0)
				{
					int num5 = (int)((double)height / (double)num4 + 1.0);
					if (num1 + num5 < num2)
					{
						int i = num1;
						while (i < num2)
						{
							if (i + num5 >= num2)
								i = num2 - 1;
							TVec3 tvec3_5 = taxisCalc.TickPos(i) + tvec3_4;
							string str = taxisCalc.TickVal(i).ToString();
							g.DrawString(str, labelFont, (Brush)solidBrush, (PointF)tvec3_5, format);
							SizeF sizeF = g.MeasureString(str, labelFont);
							if ((double)sizeF.Width > (double)num3)
								num3 = sizeF.Width;
							i += num5;
						}
					}
					else if (num2 > 0)
					{
						int i = num2 - 1;
						TVec3 tvec3_5 = taxisCalc.TickPos(i) + tvec3_4;
						string str = taxisCalc.TickVal(i).ToString();
						g.DrawString(str, labelFont, (Brush)solidBrush, (PointF)tvec3_5, format);
						num3 = g.MeasureString(str, labelFont).Width;
					}
				}
			}
			if (!a.TitleEnabled)
				return;
			SizeF sizeF1 = g.MeasureString(a.Title, a.TitleFont);
			PointF point1;
			PointF point2;
			float angle;
			if (a.Position == EAxisPosition.Bottom)
			{
				if (tvec3_3.x < 0.0)
				{
					point1 = taxisCalc.TickPos(0).x > taxisCalc.TickPos(1).x ? (PointF)(taxisCalc.TickPos(taxisCalc.nTicks - 1) + tvec3_4) : (PointF)(taxisCalc.TickPos(0) + tvec3_4);
					point1.Y += num3;
					point2 = point1;
					angle = (float)(Math.Atan2(Math.Abs(L.y), Math.Abs(L.x)) * 180.0 / Math.PI);
				}
				else
				{
					point1 = taxisCalc.TickPos(0).x > taxisCalc.TickPos(1).x ? (PointF)(taxisCalc.TickPos(0) + tvec3_4) : (PointF)(taxisCalc.TickPos(taxisCalc.nTicks - 1) + tvec3_4);
					point1.X += a.LabelFont.GetHeight(g);
					point1.Y += num3;
					point2 = point1;
					point2.X -= sizeF1.Width;
					angle = (float)(-Math.Atan2(Math.Abs(L.y), Math.Abs(L.x)) * 180.0 / Math.PI);
				}
			}
			else
			{
				point1 = taxisCalc.TickPos(0).z > taxisCalc.TickPos(1).z ? (PointF)(taxisCalc.TickPos(0) + tvec3_4) : (PointF)(taxisCalc.TickPos(taxisCalc.nTicks - 1) + tvec3_4);
				point1.X += num3;
				point2 = point1;
				point2.X -= sizeF1.Width;
				angle = -90f;
			}
			Matrix matrix = new Matrix();
			matrix.RotateAt(angle, point1, MatrixOrder.Append);
			g.Transform = matrix;
			g.DrawString(a.Title, a.LabelFont, (Brush)new SolidBrush(a.LabelColor), point2);
			matrix.Reset();
			g.Transform = matrix;
		}
Ejemplo n.º 20
0
        private TColor E0C3BMxUWS(double obj0, double obj1, double obj2, double obj3, TColor obj4)
        {
            TVec3 n = new TVec3(obj2, 0.0, this.f(obj0 + obj2, obj1) - this.f(obj0, obj1)) ^ new TVec3(0.0, obj3, this.f(obj0, obj1 + obj3) - this.f(obj0, obj1));

            return(this.trP3fdnMpS.Result(new TVec3(obj0, obj1, this.f(obj0, obj1)), n, obj4));
        }
Ejemplo n.º 21
0
		public void PaintAxes(Pad Pad, int Left, int Top, int H)
		{
			this.CalculateAxes(Pad, Left, Top, H);
			TVec3[] v = new TVec3[4]
			{
				this.o - 0.5 * this.Lx - 0.5 * this.Ly,
				this.o + 0.5 * this.Lx - 0.5 * this.Ly,
				this.o + 0.5 * this.Lx + 0.5 * this.Ly,
				this.o - 0.5 * this.Lx + 0.5 * this.Ly
			};
			double num1 = -1.0;
			int num2 = -1;
			for (int index = 0; index < v.Length; ++index)
			{
				if (v[index].y > num1)
				{
					num1 = v[index].y;
					num2 = index;
				}
			}
			int index1 = 0;
			int index2 = 0;
			int index3 = 0;
			switch (num2)
			{
				case 0:
					index1 = 1;
					index2 = 2;
					index3 = 3;
					break;
				case 1:
					index1 = 2;
					index2 = 3;
					index3 = 0;
					break;
				case 2:
					index1 = 3;
					index2 = 0;
					index3 = 1;
					break;
				case 3:
					index1 = 0;
					index2 = 1;
					index3 = 2;
					break;
			}
			Point[] points1 = TVec3.PointArray(v);
			Point[] points2 = new Point[4]
			{
				(Point)v[index1],
				(Point)v[index2],
				(Point)(v[index2] + this.Lz),
				(Point)(v[index1] + this.Lz)
			};
			Point[] points3 = new Point[4]
			{
				(Point)v[index2],
				(Point)v[index3],
				(Point)(v[index3] + this.Lz),
				(Point)(v[index2] + this.Lz)
			};
			Graphics graphics = Pad.Graphics;
			graphics.Clip = new Region(new Rectangle(Pad.X1, Pad.Y1, Pad.Width + 1, Pad.Height + 1));
			Pen pen = new Pen(Color.Black, 1f);
			Brush brush = (Brush)new SolidBrush(Color.White);
			graphics.FillPolygon(brush, points1);
			graphics.FillPolygon(brush, points2);
			graphics.FillPolygon(brush, points3);
			graphics.DrawPolygon(pen, points1);
			graphics.DrawPolygon(pen, points2);
			graphics.DrawPolygon(pen, points3);
			TView.lF6ovwu8P3(Pad);
			Pad.AxisX3D.Position = EAxisPosition.Bottom;
			Pad.AxisY3D.Position = EAxisPosition.Bottom;
			Pad.AxisZ3D.Position = EAxisPosition.Right;
			this.PaintAxisGridAndTicks(graphics, Pad.AxisX3D, true, v[0], v[0] + this.Ly, this.Lx);
			this.PaintAxisGridAndTicks(graphics, Pad.AxisY3D, true, v[0], v[0] + this.Lx, this.Ly);
			this.PaintAxisGridAndTicks(graphics, Pad.AxisX3D, false, v[index2], v[index2] + this.Lz, this.Lx);
			this.PaintAxisGridAndTicks(graphics, Pad.AxisY3D, false, v[index2], v[index2] + this.Lz, this.Ly);
			this.PaintAxisGridAndTicks(graphics, Pad.AxisZ3D, true, v[index2], v[index2] + this.Lx, this.Lz);
			this.PaintAxisGridAndTicks(graphics, Pad.AxisZ3D, true, v[index2], v[index2] + this.Ly, this.Lz);
		}
Ejemplo n.º 22
0
        private unsafe void Pnx3KTVZoc(int *obj0)
        {
            int[,] numArray = new int[this.Jm23JdRAV2, this.C843M1JDuK];
            if (!this.hH1321Stt8)
            {
                int *numPtr = obj0;
                for (int index1 = 0; index1 < this.C843M1JDuK; ++index1)
                {
                    for (int index2 = 0; index2 < this.Jm23JdRAV2; ++index2)
                    {
                        numArray[index2, index1] = *numPtr++;
                    }
                }
            }
            double normInf1 = this.tn83Ged55u.NormInf;
            double normInf2 = this.PqY3RZfYIU.NormInf;
            TVec3  Origin   = this.Sp23PRDLnW - 0.5 * this.tn83Ged55u - 0.5 * this.PqY3RZfYIU;
            TVec3  tvec3_1  = this.tn83Ged55u / normInf1;
            TVec3  tvec3_2  = this.PqY3RZfYIU / normInf2;
            double num1     = (this.MaxX - this.MinX) / normInf1;
            double num2     = (this.MaxY - this.MinY) / normInf2;
            double num3     = num1;
            double num4     = num2;

            if ((double)(2 * this.nx) >= normInf1 && (double)(2 * this.ny) >= normInf2)
            {
                num3 = (this.MaxX - this.MinX) / (double)this.nx;
                num4 = (this.MaxY - this.MinY) / (double)this.ny;
            }
            double ValO1   = this.MinX + 0.01 * num3;
            double ValO2   = this.MinY + 0.01 * num4;
            TVec3  tvec3_3 = this.tn83Ged55u;
            TVec3  tvec3_4 = this.PqY3RZfYIU;

            if (this.tn83Ged55u.z > 0.0)
            {
                ValO1   = this.MaxX - 0.99 * num3;
                num1    = -num1;
                num3    = -num3;
                Origin += this.tn83Ged55u;
                tvec3_3 = -this.tn83Ged55u;
                tvec3_1 = -tvec3_1;
            }
            if (this.PqY3RZfYIU.z > 0.0)
            {
                ValO2   = this.MaxY - 0.99 * num4;
                num2    = -num2;
                num4    = -num4;
                Origin += this.PqY3RZfYIU;
                tvec3_4 = -this.PqY3RZfYIU;
                tvec3_2 = -tvec3_2;
            }
            int num5 = (int)normInf1;
            int num6 = (int)normInf2;
            int num7 = (int)this.gcU3NtonPe.NormInf;

            bool[] flagArray1 = new bool[num5 + 2];
            bool[] flagArray2 = new bool[num6 + 2];
            bool[] flagArray3 = new bool[num7 + 2];
            if (this.Grid)
            {
                TAxisCalc taxisCalc1 = new TAxisCalc(Origin, Origin + tvec3_3, ValO1, ValO1 + normInf1 * num1, 10);
                TAxisCalc taxisCalc2 = new TAxisCalc(Origin, Origin + tvec3_4, ValO2, ValO2 + normInf2 * num2, 10);
                double    Val1       = ValO1;
                int       index1     = 0;
                while (index1 <= num5)
                {
                    if (taxisCalc1.TickPassed(Val1))
                    {
                        flagArray1[index1] = true;
                    }
                    ++index1;
                    Val1 += num1;
                }
                double Val2   = ValO2;
                int    index2 = 0;
                while (index2 <= num6)
                {
                    if (taxisCalc2.TickPassed(Val2))
                    {
                        flagArray2[index2] = true;
                    }
                    ++index2;
                    Val2 += num2;
                }
            }
            if (this.LevelLines)
            {
                for (int index = 0; index < num7; ++index)
                {
                    flagArray3[index] = (index & 4) != 0;
                }
            }
            switch (this.Look)
            {
            case EChartLook.FromZeroToSurface:
                double x1     = ValO1;
                int    index3 = 0;
                while (index3 <= num5)
                {
                    bool   flag    = flagArray1[index3];
                    TVec3  tvec3_5 = Origin;
                    double y       = ValO2;
                    int    index1  = 0;
                    while (index1 <= num6)
                    {
                        double num8 = this.f(x1, y);
                        if (num8 > 0.0)
                        {
                            int num9  = (int)tvec3_5.y;
                            int num10 = (int)(tvec3_5.y - num8);
                            if (num10 < 0)
                            {
                                num10 = 0;
                            }
                            TColor tcolor1 = this.color0(x1, y);
                            if (this.Grid && (flag || flagArray2[index1]))
                            {
                                tcolor1 = this.Surface.GridDiffuse;
                            }
                            TColor tcolor2 = this.E0C3BMxUWS(x1, y, num3, num4, tcolor1);
                            tcolor2.Clip();
                            int num11  = tcolor2.Get888();
                            int index2 = (int)tvec3_5.x;
                            if (this.LevelLines)
                            {
                                TColor tcolor3 = 0.81 * tcolor2;
                                tcolor3.Clip();
                                int num12 = tcolor3.Get888();
                                for (int index4 = num9; index4 >= num10; --index4)
                                {
                                    numArray[index2, index4] = flagArray3[num9 - index4] ? num12 : num11;
                                }
                            }
                            else
                            {
                                for (int index4 = num9; index4 >= num10; --index4)
                                {
                                    numArray[index2, index4] = num11;
                                }
                            }
                        }
                        ++index1;
                        y       += num2;
                        tvec3_5 += tvec3_2;
                    }
                    ++index3;
                    x1     += num1;
                    Origin += tvec3_1;
                }
                break;

            case EChartLook.SurfaceOnly:
                double x2     = ValO1;
                int    index5 = 0;
                while (index5 < num5)
                {
                    bool   flag    = flagArray1[index5];
                    TVec3  tvec3_5 = Origin;
                    double y       = ValO2;
                    int    index1  = 0;
                    while (index1 < num6)
                    {
                        double num8  = this.f(x2, y);
                        double num9  = this.f(x2 + num1, y);
                        double num10 = this.f(x2, y + num2);
                        double num11 = this.f(x2 + num1, y + num2);
                        double num12 = num8;
                        double num13 = num8;
                        if (num9 < num12)
                        {
                            num12 = num9;
                        }
                        if (num10 < num12)
                        {
                            num12 = num10;
                        }
                        if (num11 < num12)
                        {
                            num12 = num11;
                        }
                        if (num9 > num13)
                        {
                            num13 = num9;
                        }
                        if (num10 > num13)
                        {
                            num13 = num10;
                        }
                        if (num11 > num13)
                        {
                            num13 = num11;
                        }
                        int num14 = (int)tvec3_5.y;
                        int num15 = (int)(tvec3_5.y - num12 + 1.0);
                        int num16 = (int)(tvec3_5.y - num13);
                        if (num15 < this.C843M1JDuK && num15 >= 0 && (num16 < this.C843M1JDuK && num16 >= 0))
                        {
                            TColor tcolor1 = this.color0(x2, y);
                            if (this.Grid && (flag || flagArray2[index1]))
                            {
                                tcolor1 = this.Surface.GridDiffuse;
                            }
                            TColor tcolor2 = this.E0C3BMxUWS(x2, y, num3, num4, tcolor1);
                            tcolor2.Clip();
                            int num17  = tcolor2.Get888();
                            int index2 = (int)tvec3_5.x;
                            if (this.LevelLines)
                            {
                                TColor tcolor3 = 0.81 * tcolor2;
                                tcolor3.Clip();
                                int num18 = tcolor3.Get888();
                                for (int index4 = num15; index4 >= num16; --index4)
                                {
                                    if (num12 > 0.0 || numArray[index2, index4] >= 0 || numArray[index2, index4] == -1)
                                    {
                                        numArray[index2, index4] = (num14 - index4 & 4) != 0 ? num18 : num17;
                                    }
                                }
                            }
                            else
                            {
                                for (int index4 = num15; index4 >= num16; --index4)
                                {
                                    if (num12 > 0.0 || numArray[index2, index4] >= 0 || numArray[index2, index4] == -1)
                                    {
                                        numArray[index2, index4] = num17;
                                    }
                                }
                            }
                        }
                        ++index1;
                        y       += num2;
                        tvec3_5 += tvec3_2;
                    }
                    ++index5;
                    x2     += num1;
                    Origin += tvec3_1;
                }
                break;
            }
            for (int index1 = 0; index1 < this.C843M1JDuK; ++index1)
            {
                for (int index2 = 0; index2 < this.Jm23JdRAV2; ++index2)
                {
                    *obj0++ = numArray[index2, index1];
                }
            }
        }
Ejemplo n.º 23
0
		public static TVec3 operator *(TVec3 v, TMat3x3 m)
		{
			TVec3 v3 = new TVec3();
			for (int i = 0; i < 3; ++i)
			{
				for (int j = 0; j < 3; ++j)
					v3[j] += v[i] * m[i, j];
			}
			return v3;
		}
Ejemplo n.º 24
0
 public TSource(TVec3 o, TColor c)
 {
     this.o = o;
     this.c = c;
 }