public override void UpdatePercent(int percent, ScanData data) { base.UpdatePercent(percent, data); IScene3DViewer viewer = Settings.Get <IScene3DViewer>(); if (viewer != null) { Control ctl = viewer as Control; if (ctl == null || !ctl.InvokeRequired) { viewer.Scene.Clear(); if (data != null) { viewer.Scene.Add(data); } viewer.Invalidate(); } else { ctl.BeginInvoke(new Action(() => { viewer.Scene.Clear(); if (data != null) { viewer.Scene.Add(data); } viewer.Invalidate(); })); } } }
void SetRunButtonState(bool start) { Image img = global::Sardauscan.Properties.Resources.Play; if (!start) { img = global::Sardauscan.Properties.Resources.Stop; } this.DeleteBox.Enabled = start; ListDragTarget.Lock = !start; ListDragSource.Lock = !start; this.RunButton.Image = img; ViewControler controler = Settings.Get <ViewControler>(); if (controler != null) { controler.Lock = !start; } this.Refresh(); if (start) { IScene3DViewer viewer = Settings.Get <IScene3DViewer>(); if (viewer != null) { viewer.Invalidate(); } } }
private void button1_Click(object sender, EventArgs e) { IScene3DViewer viewer = Settings.Get <IScene3DViewer>(); if (viewer != null) { ScanData points = OpenColoreddPointArray(viewer); if (points != null) { //viewer.Scene = Scene3D.MeshFromScan(points, this.object3DView1.Invalidate); ; viewer.Invalidate(); } } }
protected void UpdateViewer(ScanData points) { IScene3DViewer viewer = Settings.Get <IScene3DViewer>(); if (viewer != null) { viewer.Scene.Clear(); if (points != null) { viewer.Scene.Add(points); } viewer.Invalidate(); } }
public ScanData OpenColoreddPointArray(IScene3DViewer viewer) { if (this.OpenPointsDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string path = Path.Combine(Program.UserDataPath, this.OpenPointsDlg.FileName); ScanData points = ScanDataIO.Read(path); if (viewer != null) { viewer.Scene.Clear(); viewer.Scene.Add(points); viewer.Invalidate(); } return(points); } return(null); }
public ScanData OpenColoreddPointArray(IScene3DViewer viewer) { if (this.OpenPointsDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string path = Path.Combine(Program.UserDataPath, this.OpenPointsDlg.FileName); ScanData points = ScanDataIO.Read(path); if (viewer != null) { viewer.Scene.Clear(); viewer.Scene.Add(points); viewer.Invalidate(); } return points; } return null; }