private void toolStripButton4_Click(object sender, EventArgs e) { LightSourceDialog dialog = new LightSourceDialog(); dialog.SetLAngle = ViewObject.GetLAngleSource(); dialog.SourceOn = ViewObject.On; dialog.flag_OnOff = ViewObject.GetSourceStatus(); dialog.InvalidateForm_1 = Invalidate; dialog.SourceOff = ViewObject.Off; dialog.ChangeSetting = ViewObject.ChangeSettings; dialog.InitLightSource(ViewObject.GetSource.GetLen, ViewObject.GetSource.GetCountRay, ViewObject.GetSource.GetColorRay, ViewObject.GetSource.GetLeftAngle); dialog.ShowDialog(); }
private void OnDown(object sender, MouseEventArgs e) { if (MouseButtons.Left == e.Button) { IsDown = ViewObject.IsSelected(new Point(e.X, e.Y)); last_dot.X = e.X; last_dot.Y = e.Y; } else if (MouseButtons.Right == e.Button) { string NameObject = ViewObject.IsVisibleMy(new PointF(e.X, e.Y)); if (NameObject.Contains("Зеркало")) { MirrorSelect dialog = new MirrorSelect(); dialog.NameMirror = NameObject; dialog.InvalidateForm_1 = Invalidate; dialog.Find = ViewObject.FindMirror; dialog.DeleteObject = ViewObject.DeleteObject; dialog.RedactMirror = ViewObject.ChangeMirror; dialog.ShowDialog(); } else if (NameObject.Contains("Призма")) { float [] RGB = new float[3]; PointF [] tmp = ViewObject.FindPrism(NameObject, ref RGB); PrismPreviewDialog dialog = new PrismPreviewDialog(NameObject, tmp, RGB[0], RGB[1], RGB[2]); dialog.InvalidateForm_1 = Invalidate; dialog.Delete = ViewObject.DeleteObject; dialog.RedactPrism = ViewObject.RedactPrism; dialog.ShowDialog(); } else if (ViewObject.IsVisibleMy(new Point(e.X, e.Y)).Contains("Источник")) { LightSourceDialog dialog = new LightSourceDialog(); dialog.SetLAngle = ViewObject.GetLAngleSource(); dialog.SourceOn = ViewObject.On; dialog.flag_OnOff = ViewObject.GetSourceStatus(); dialog.InvalidateForm_1 = Invalidate; dialog.SourceOff = ViewObject.Off; dialog.ChangeSetting = ViewObject.ChangeSettings; dialog.InitLightSource(ViewObject.GetSource.GetLen, ViewObject.GetSource.GetCountRay, ViewObject.GetSource.GetColorRay, ViewObject.GetSource.GetLeftAngle); dialog.ShowDialog(); } } }