/// <summary>
        /// Vẽ đường thẳng nối liền giữa 2 điểm A và B
        /// </summary>
        /// <param name="n">1: Vẽ nét liền 2: Vẽ nét đứt</param>
        public void DrawLine(Graphics g, int A, int B, int n = 1)
        {
            Point point1 = ToaDo.NguoiDungMayTinh_3D(this.Dinh[A, 0], this.Dinh[A, 1], this.Dinh[A, 2]),
                  point2 = ToaDo.NguoiDungMayTinh_3D(this.Dinh[B, 0], this.Dinh[B, 1], this.Dinh[B, 2]);


            if (n == 2)
            {
                new Line(point1, point2, Color.RoyalBlue).NetDut(g);
            }
            else
            {
                new Line(point1, point2, Color.Navy).Draw(g);
            }


            Point point;

            for (int i = 0; i < 8; i++)
            {
                point = ToaDo.NguoiDungMayTinh_3D(this.Dinh[i, 0], this.Dinh[i, 1], this.Dinh[i, 2]);
                ToaDo.HienThi(point, g, Color.Pink);
                char c = (char)(65 + i);
                g.DrawString(c.ToString(), new Font("Arial", 14), Brushes.Red, point);
            }
        }
        /// <summary>
        /// Vẽ đường thẳng nối liền giữa 2 điểm A và B
        /// </summary>
        /// <param name="n">1: Vẽ nét liền 2: Vẽ nét đứt</param>
        public void DrawLine(Graphics g, int A, int B, int n = 1)
        {
            Point point1 = ToaDo.NguoiDungMayTinh_3D(this.Dinh[A, 0], this.Dinh[A, 1], this.Dinh[A, 2]),
                  point2 = ToaDo.NguoiDungMayTinh_3D(this.Dinh[B, 0], this.Dinh[B, 1], this.Dinh[B, 2]);

            //ToaDo.HienThi(point1, g);
            //ToaDo.HienThi(point2, g);
            Line line = new Line(point1, point2, Color.Black);

            if (n == 2)
            {
                line.NetDut(g);
            }
            else
            {
                line.Draw(g);
            }

            Point point;

            for (int i = 0; i < 8; i++)
            {
                point = ToaDo.NguoiDungMayTinh_3D(this.Dinh[i, 0], this.Dinh[i, 1], this.Dinh[i, 2]);
                ToaDo.HienThi(point, g, Color.Pink);
                char c = (char)(65 + i);
                g.DrawString(c.ToString(), new Font("Verdana", 14), Brushes.Pink, point);
            }
        }
        public void Draw(Graphics g)
        {
            // Vẽ nét đứt
            DrawLine(g, 0, 1, 2);
            DrawLine(g, 3, 0, 2);
            DrawLine(g, 0, 4, 2);
            // Vẽ nét liền
            DrawLine(g, 1, 2);
            DrawLine(g, 2, 3);
            DrawLine(g, 4, 5);
            DrawLine(g, 5, 6);
            DrawLine(g, 6, 7);
            DrawLine(g, 7, 4);
            DrawLine(g, 1, 5);
            DrawLine(g, 2, 6);
            DrawLine(g, 3, 7);

            Point point;

            for (int i = 0; i < 8; i++)
            {
                point = ToaDo.NguoiDungMayTinh_3D(this.Dinh[i, 0], this.Dinh[i, 1], this.Dinh[i, 2]);
                ToaDo.HienThi(point, g, Color.White);
                char c = (char)(65 + i);
                g.DrawString(c.ToString(), new Font("Arial", 14), Brushes.Red, point);
            }
        }
Beispiel #4
0
 public void Drawn4Point(int x, int y, Graphics g)
 {
     ToaDo.HienThi(new Point(point.X + x, point.Y + y), g, color);
     ToaDo.HienThi(new Point(point.X - x, point.Y + y), g, color);
     ToaDo.HienThi(new Point(point.X - x, point.Y - y), g, color);
     ToaDo.HienThi(new Point(point.X + x, point.Y - y), g, color);
 }
Beispiel #5
0
        public void Drawn4Point_3D_With_Color(int x, int y, Graphics g, Color color)
        {
            if (x % 10 != 0)
            {
                ToaDo.HienThi(new Point(point.X - x, point.Y - y), g, color);
                ToaDo.HienThi(new Point(point.X + x, point.Y - y), g, color);
            }

            ToaDo.HienThi(new Point(point.X + x, point.Y + y), g, color);
            ToaDo.HienThi(new Point(point.X - x, point.Y + y), g, color);
        }
Beispiel #6
0
        public void Drawn4Point_3D(int x, int y, Graphics g)
        {
            if (x % 10 != 0)
            {
                ToaDo.HienThi(new Point(point.X - x, point.Y - y), g, Color.RoyalBlue);
                ToaDo.HienThi(new Point(point.X + x, point.Y - y), g, Color.RoyalBlue);
            }

            ToaDo.HienThi(new Point(point.X + x, point.Y + y), g, color);
            ToaDo.HienThi(new Point(point.X - x, point.Y + y), g, color);
        }
Beispiel #7
0
        public void Draw(Graphics g)
        {
            DrawLine(g, 1, 2, 2);
            DrawLine(g, 1, 4, 2);

            Point point = ToaDo.NguoiDungMayTinh_3D(this.TamDay[1, 0], this.TamDay[1, 1], this.TamDay[1, 2]);

            new HinhTron(point, BanKinhDay).Draw_W_Color_Line(g, Color.Navy);

            //O
            ToaDo.HienThi(point, g, Color.Red);
            char c = 'O';

            g.DrawString(c.ToString(), new Font("Arial", 14), Brushes.Red, point);

            point = ToaDo.NguoiDungMayTinh_3D(this.TamDay[1, 0], this.TamDay[1, 1], this.TamDay[1, 2]);
            double d = this.BanKinhDay * (Math.Sqrt(2) / 2);
            int    b = (int)d;

            new HinhElip(point, this.BanKinhDay, b / 2, Color.Navy).NetDut(g);



            //new HinhElip(point, b / 2, this.BanKinhDay, Color.Blue).NetDut(g);
            //new HinhElip(point, b / 2, this.BanKinhDay, Color.Blue).NetDut(g);



            /*
             * Point point = ToaDo.NguoiDungMayTinh_3D(this.TamDay[1, 0], this.TamDay[1, 1], this.TamDay[1, 2]);
             * ToaDo.HienThi(point, g, Color.Red);
             *
             *  point = ToaDo.NguoiDungMayTinh_3D(this.TamDay[4, 0], this.TamDay[4, 1], this.TamDay[4, 2]);
             * ToaDo.HienThi(point, g, Color.Red);
             *
             *
             *
             *
             * DrawElip(g);
             *
             * for (int i = 0; i < 6; i++)
             * {
             *  point = ToaDo.NguoiDungMayTinh_3D(this.TamDay[i, 0], this.TamDay[i, 1], this.TamDay[i, 2]);
             *  ToaDo.HienThi(point, g, Color.White);
             *  char c = (char)(65 + i);
             *  g.DrawString(c.ToString(), new Font("Verdana", 14), Brushes.Blue, point);
             * }
             *
             */
        }
Beispiel #8
0
        public void Draw(Graphics g)
        {
            DrawLine(g, 0, 3);
            DrawLine(g, 2, 5);

            Point point = ToaDo.NguoiDungMayTinh_3D(this.TamDay[1, 0], this.TamDay[1, 1], this.TamDay[1, 2]);

            ToaDo.HienThi(point, g, Color.Black);
            point = ToaDo.NguoiDungMayTinh_3D(this.TamDay[4, 0], this.TamDay[4, 1], this.TamDay[4, 2]);
            ToaDo.HienThi(point, g, Color.Black);

            DrawElip(g);

            for (int i = 0; i < 6; i++)
            {
                point = ToaDo.NguoiDungMayTinh_3D(this.TamDay[i, 0], this.TamDay[i, 1], this.TamDay[i, 2]);
                ToaDo.HienThi(point, g, Color.Pink);
                char c = (char)(65 + i);
                g.DrawString(c.ToString(), new Font("Verdana", 14), Brushes.Pink, point);
            }
        }