public void drawPoint2Ex(Point3D o, int id) { Color c = Colors.HotPink; if (id == 2000) { c = Colors.Silver; } else if (id == 2001) c = Colors.Green; else if (id == 2002) c = Colors.Goldenrod; else if (id == 2003) c = Colors.Purple; else if (id == 2004) c = Colors.Blue; else if (id == 2005) c = Colors.Olive; else if (id == 2006) c = Colors.Indigo; else if (id == 2007) c = Colors.Yellow; else if (id == 2008) c = Colors.Orange; else if (id == 2009) c = Colors.Red; //if(sphereDic.Length!=0) //MyViewport.Children.Remove(sphereDic[id - 2000]); var p1 = new SphereOnEvent(o, 0.05, c, 1, id); try { sphereDic[p1.Id - 2000] = p1; } catch (Exception exception) { MessageBox.Show(exception.Message); } p1.MouseDown += new MouseButtonEventHandler(p1_MouseDown); p1.MouseEnter += new System.Windows.Input.MouseEventHandler(p2_MouseCover); p1.MouseLeave += new System.Windows.Input.MouseEventHandler(p1_MouseLeave); //MyViewport.Children.Insert(0, sphereDic[id - 2000]); Viewport3D3.Children.Insert(0, sphereDic[id - 2000]); //Viewport3D2.Children.Insert(0,p1); }
public void drawPoint1Ex(Point3D o, int id, bool isRed) { Color c = Colors.Green; if (isRed) c = Colors.Red; MyViewport.Children.Remove(p0); p0 = new SphereOnEvent(o, 0.05, c, 1, id); p0.MouseDown += new MouseButtonEventHandler(p0_MouseDown); p0.MouseEnter += new System.Windows.Input.MouseEventHandler(p1_MouseCover); p0.MouseLeave += new System.Windows.Input.MouseEventHandler(p1_MouseLeave); MyViewport.Children.Insert(0, p0); //MyViewport.Children.Insert(0, p0); }
/// <summary> /// Draw Point /// </summary> /// <param name="o"></param> /// <param name="id"></param> /// <author>Shen Yongyuan</author> /// <date>20100123</date> public void drawPoint2(Point3D o, int id) { Color c; double distance = Math.Sqrt(o.X * o.X + o.Y * o.Y + o.Z * o.Z); if (distance < warnValue) { if (id == 2000) c = Colors.Silver; else c = Colors.Green; id = id + 30000; } else if (distance < 0.95) { if (id == 2000) c = Colors.Silver; else c = Colors.Yellow; id = id + 20000; } else { if (id == 2000) c = Colors.Silver; else c = Colors.Red; id = id + 10000; } var p1 = new SphereOnEvent(o, 0.05, c, 1, id); p1.MouseDown += new MouseButtonEventHandler(p1_MouseDown); p1.MouseEnter += new System.Windows.Input.MouseEventHandler(p2_MouseCover); p1.MouseLeave += new System.Windows.Input.MouseEventHandler(p1_MouseLeave); //MyViewport.Children.Insert(0, p1); Viewport3D3.Children.Insert(0, p1); }
/// <summary> /// Draw Point /// </summary> /// <param name="o"></param> /// <param name="id"></param> /// <author>Shen Yongyuan</author> /// <date>20100123</date> public void drawPoint1(Point3D o, int id) { Color c; double distance = Math.Sqrt(o.X * o.X + o.Y * o.Y + o.Z * o.Z); if (distance < warnValue) { c = Colors.Green; id = 10000 + id; } else if (distance < 0.95) { c = Colors.Yellow; id = 20000 + id; } else { c = Colors.Red; id = 30000 + id; } var p0 = new SphereOnEvent(o, 0.05, c, 1, id); p0.MouseDown += new MouseButtonEventHandler(p0_MouseDown); p0.MouseEnter += new System.Windows.Input.MouseEventHandler(p1_MouseCover); p0.MouseLeave += new System.Windows.Input.MouseEventHandler(p1_MouseLeave); //MyViewport.Children.Insert(0, p0); //Viewport3D2.Children.Insert(0,p0); }