private void volumeBtn_Click(object sender, RoutedEventArgs e) { ScanLoader newScanWindow = new ScanLoader((int)ScanLoader.OperationModes.CaptureNewCloud); newScanWindow.Owner = this; newScanWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; newScanWindow.Show(); }
public void LoadPointCloud() { // Show the window first - keep UI FAST speedy is a stupid word. System.Diagnostics.Debug.WriteLine("Showing window"); shutAnyWindows(); windowScanner = new ScanLoader((int)ScanLoader.OperationModes.ShowExistingResults); windowScanner.Owner = this; // Do UI stuff on UI thread this.export1.IsEnabled = false; this.export2.IsEnabled = true; this.removefloor.IsEnabled = true; //define //windowHistory = new HistoryLoader(); //windowHistory.Owner = this; // Background thread to get all the heavy computation off of the UI thread BackgroundWorker B = new BackgroundWorker(); B.DoWork += new DoWorkEventHandler(loadScanThread); // Catch the progress update events B.WorkerReportsProgress = true; B.ProgressChanged += new ProgressChangedEventHandler((obj, args) => { windowScanner.loadingwidgetcontrol.UpdateProgressBy(args.ProgressPercentage); if (args.UserState != null) { if (args.UserState is string) { System.Diagnostics.Debug.WriteLine((string)args.UserState); } else if (args.UserState is Action) { ((Action)args.UserState)(); } } }); B.RunWorkerCompleted += new RunWorkerCompletedEventHandler((obj, args) => { windowScanner.processCloudList(pcdl, windowScanner.loadingwidgetcontrol); }); // GOOO!!! Pass the file name so it can be loaded B.RunWorkerAsync(filename); }
/// <summary> /// performs a simple stitch test (deprecated? robin?) /// </summary> /// <param name="sender">the object</param> /// <param name="e">the routed event</param> private void SimpleStitchTest_Click(object sender, RoutedEventArgs e) { List <PointCloud> pc = pcdl; pcd = new PointCloud(); //instantiate the stitcher stitcher = new BoundingBox(); //jam points into stitcher stitcher.add(pc); stitcher.stitch(); pcd = stitcher.getResult(); windowViewer.Close(); windowScanner = new ScanLoader(pcd); windowScanner.Owner = this; windowScanner.Show(); }
/// <summary> /// displays a new scan loader screen /// </summary> /// <param name="sender">the object</param> /// <param name="e">the routed event</param> private void NewScan_Click(object sender, RoutedEventArgs e) { if (this.noSensor()) { return; } this.shutAnyWindows(); this.resetButtons(); this.kinectInterp.calibrate(); windowScanner = new ScanLoader((int)ScanLoader.OperationModes.CaptureNewCloud); windowScanner.Owner = this; windowScanner.Show(); windowHistory = new HistoryLoader(); windowHistory.Owner = this; windowHistory.history.Visibility = Visibility.Collapsed; }
/// <summary> /// fine tunes the point cloud (just removes floor) /// </summary> /// <param name="sender">the object</param> /// <param name="e">the routed event</param> private void RemoveFeet_Click(object sender, RoutedEventArgs e) { for (int i = 0; i < pcdl.Count; i++) { pcdl[i].deleteFloor(); if ((this.windowPatient.nameText.Text.CompareTo("Greg Corbett")) == 0) { pcdl[i].deleteFloor(); //again } } this.calculate.IsEnabled = true; this.measurement.IsEnabled = true; this.shutAnyWindows(); windowScanner = new ScanLoader((int)ScanLoader.OperationModes.ShowExistingResults); windowScanner.Owner = this; // Do UI stuff on UI thread this.export1.IsEnabled = false; this.export2.IsEnabled = false; this.removefloor.IsEnabled = true; //define windowHistory = new HistoryLoader(); windowHistory.Owner = this; windowHistory.history.Visibility = Visibility.Collapsed; // Background thread to get all the heavy computation off of the UI thread /* * BackgroundWorker B = new BackgroundWorker(); */ //TODO Confirm we don't need this - the point cloud is loaded and stitched already? //B.DoWork += new DoWorkEventHandler(loadScanThread); /* * // Catch the progress update events * B.WorkerReportsProgress = true; * B.ProgressChanged += new ProgressChangedEventHandler((obj, args) => * { * windowScanner.loadingwidgetcontrol.UpdateProgressBy(args.ProgressPercentage); * if (args.UserState != null) * { * if (args.UserState is string) * { * System.Diagnostics.Debug.WriteLine((string)args.UserState); * } * else if (args.UserState is Action) * { * ((Action)args.UserState)(); * } * } * }); * B.RunWorkerCompleted += new RunWorkerCompletedEventHandler((obj, args) => * {*/ windowScanner.processCloudList(pcdl, windowScanner.loadingwidgetcontrol); /* * }); * * * // GOOO!!! Pass the file name so it can be loaded * B.RunWorkerAsync(null); */ }