internal void RefreshPictureBox(Point3DF LocationCam, Point3DF VzgladCam, List <Object> Wolrd) { List <Object> WorldCam = new List <Object>(); List <Object> WorldHide = new List <Object>(); List <List <Line> > WorldConvertTo2D = new List <List <Line> >(); g.Clear(Color.White); //List<Object> Corworld = ConvertCoordinate.CorectObj(World); for (int i = 0; i < Wolrd.Count; i++) { WorldCam.Add(ConvertCoordinate.ConvertWorldtoCam(VzgladCam, LocationCam, World[i])); } //List<Object> CorworldCam = ConvertCoordinate.CorectObj(WorldCam); List <Line> lines = HideLineCusk.CuskLineHide(WorldCam); List <Line> lines2D = ConvertCoordinate.Camto2D(lines, 5); drawing(lines2D, mash);/* * for (int i = 0; i < Wolrd.Count; i++) * WorldHide.Add(ConvertCoordinate.ObjectHideLine(WorldCam[i], WorldCam)); * for (int i = 0; i < Wolrd.Count; i++) * WorldConvertTo2D.Add(ConvertCoordinate.Camto2D(WorldHide[i], 5)); * for (int i = 0; i < Wolrd.Count; i++) * drawing(WorldConvertTo2D[i], mash);*/ pictureBox1.Image = DrawArea; }
static public List <Line> CuskLineHide(Line line, List <Object> World) { List <double> Lambda = CuskLine(line, World); List <Line> lines = new List <Line>(); for (int i = 0; i < Lambda.Count - 1; i++) { lines.Add(new Line(Line.PointF(line, Lambda[i]), Line.PointF(line, Lambda[i + 1]), line.ColLine, line.OnlyLine, line.Visible)); } for (int i = 0; i < Lambda.Count - 1; i++) { if (lines[i].Visible) { lines[i].Visible = ConvertCoordinate.LineHide(lines[i], World); } } List <Line> linesCor = new List <Line>(); linesCor.Add(lines[0]); for (int i = 1; i < lines.Count; i++) { if (linesCor[linesCor.Count - 1].Visible == lines[i].Visible) { linesCor[linesCor.Count - 1].EndLine = lines[i].EndLine; } else { linesCor.Add(lines[i]); } } return(linesCor); }
private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { List <Object> WorldCam = new List <Object>(); for (int i = 0; i < World.Count; i++) { WorldCam.Add(ConvertCoordinate.ConvertWorldtoCam(VzgladCam, LocationCam, World[i])); } Object SunO = new Object(); SunO.Points.Add(Sun); Object SunOC = ConvertCoordinate.ConvertWorldtoCam(VzgladCam, LocationCam, SunO); TrasirLuch TRrLuch = new TrasirLuch(WorldCam, SunOC.Points[0], ColSun, focus, mash, pictureBox1.Width, pictureBox1.Height); TRrLuch.Luch(e.X, e.Y); }
private void закраситьToolStripMenuItem_Click(object sender, EventArgs e) { List <Object> WorldCam = new List <Object>(); for (int i = 0; i < World.Count; i++) { WorldCam.Add(ConvertCoordinate.ConvertWorldtoCam(VzgladCam, LocationCam, World[i])); } Object SunO = new Object(); SunO.Points.Add(Sun); Object SunOC = ConvertCoordinate.ConvertWorldtoCam(VzgladCam, LocationCam, SunO); TrasirLuch TRrLuch = new TrasirLuch(WorldCam, SunOC.Points[0], ColSun, focus, mash, pictureBox1.Width, pictureBox1.Height); TRrLuch.ImageBDraw(35); pictureBox1.Image = TRrLuch.GetBitmap(); }