protected override void OnContentRendered(EventArgs e) { // Creates the pens PenSilho = new Pen(System.Drawing.Color.Black, 3.0f); PenEdge = new Pen(System.Drawing.Color.Black, 1.0f); PenWire = new Pen(System.Drawing.Color.Black, 1.0f); PenEdge.SetLineCap(LineCap.Round, LineCap.Round, DashCap.Round); PenSilho.SetLineCap(LineCap.Round, LineCap.Round, DashCap.Round); PenWire.SetLineCap(LineCap.Round, LineCap.Round, DashCap.Round); model1.GetGrid().AutoSize = true; model1.GetGrid().Step = 50; model1.Camera.FocalLength = 30; model1.Camera.ProjectionMode = projectionType.Perspective; model1.SetView(viewType.Trimetric); model1.ZoomFit(); model1.Invalidate(); // Imports an Ascii model devDept.Eyeshot.Translators.ReadFile rf = new devDept.Eyeshot.Translators.ReadFile("../../../../../../dataset/Assets/house.eye"); rf.DoWork(); model1.Entities.AddRange(rf.Entities, Color.Gray); // Changes the color/material of the fifth entity rf.Entities[5].Color = System.Drawing.Color.Pink; model1.ZoomFit(); comboBoxPrintMode.SelectedIndex = 0; base.OnContentRendered(e); }
private void PictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { int directionX; int directionY; switch (this.Direction) { case Direction.UpLeft: directionX = -1; directionY = -1; break; case Direction.Left: directionX = -1; directionY = 0; break; case Direction.DownLeft: directionX = -1; directionY = 1; break; case Direction.Down: directionX = 0; directionY = 1; break; case Direction.Right: directionX = 1; directionY = 0; break; case Direction.UpRight: directionX = 1; directionY = -1; break; case Direction.Up: directionX = 0; directionY = -1; break; default: // Direction.DownRight directionX = 1; directionY = 1; break; } System.Drawing.Pen pen = new System.Drawing.Pen(System.Drawing.Color.Black, 3); pen.SetLineCap(System.Drawing.Drawing2D.LineCap.Flat, System.Drawing.Drawing2D.LineCap.ArrowAnchor, System.Drawing.Drawing2D.DashCap.Flat); int center = Convert.ToInt32(PictureBox1.Width / 2); int radius = center - 1; e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; e.Graphics.DrawLine(pen, center, center, center + radius * directionX, center + radius * directionY); }