예제 #1
0
 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();
 }
예제 #2
0
        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();
        }
예제 #3
0
        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);
        }
예제 #4
0
        /// <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();
        }
예제 #5
0
        /// <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;
        }
예제 #6
0
        /// <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);
             */
        }