Example #1
0
        public ScanLoader(PointCloud gcloud)
        {
            InitializeComponent();

            System.Diagnostics.Debug.WriteLine("* * GLCLOUD SCANLOADER CALLED");

            //wantKinect = false; // nathan changed this

            //hide buttons from form
            gv = new GroupVisualiser(gcloud);

            this.Loaded += new RoutedEventHandler(ScanLoader_Loaded);

            //Threading of data context population to speed up model generation.
            System.Diagnostics.Debug.WriteLine("Loading model");
            this.Dispatcher.Invoke((Action)(() =>
            {
                gv.preprocess(null);
            }));

            //Assigned threaded object result to the data context.
            this.DataContext          = gv;
            gCloud                    = gcloud;
            this.hvpcanvas.MouseDown += new MouseButtonEventHandler(hvpcanvas_MouseDown);
            System.Diagnostics.Debug.WriteLine("Model loaded");

            hitState = 0;
        }
Example #2
0
        public void processCloudList(List <PointCloud> fcloud, LoadingWidget loadingControl)
        {
            preventClose = true;
            wantKinect   = false;
            this.mode    = 0;

            System.Diagnostics.Debug.WriteLine("Number of items in fcloud list: " + fcloud.Count);

            this.gv = new GroupVisualiser(fcloud);
            loadingwidgetcontrol.UpdateProgressBy(2);

            // Run this as separate 'job' on UI thread
            this.Dispatcher.Invoke(
                System.Windows.Threading.DispatcherPriority.Normal,
                (Action)(() => {
                this.gv = new GroupVisualiser(fcloud);
            }));
            loadingwidgetcontrol.UpdateProgressBy(5);

            // Run this as lower priority 'job' (on UI thread),
            // with hope that UI remains a bit responsive
            this.Dispatcher.Invoke(
                System.Windows.Threading.DispatcherPriority.Input,
                (Action)(() => {
                this.gv.preprocess(loadingwidgetcontrol);
            }));
            loadingwidgetcontrol.UpdateProgressBy(5);

            this.hvpcanvas.DataContext = this.gv;
            loadingwidgetcontrol.UpdateProgressBy(1);

            this.hitState = 0;

            // FINALLY, show the controls.
            this.hvpcanvas.Visibility            = Visibility.Visible;
            this.loadingwidgetcontrol.Visibility = Visibility.Collapsed;

            preventClose = false;

            /*
             * Scanloaderready();
             * if (this.mode == (int)OperationModes.CaptureNewCloud)
             * {
             *  this.start_scan.Visibility = Visibility.Visible;
             *  this.cancel_scan.Visibility = Visibility.Visible;
             * }
             * else
             * {
             *  this.start_scan.Visibility = Visibility.Collapsed;
             *  this.cancel_scan.Visibility = Visibility.Collapsed;
             * }
             */
        }
Example #3
0
        public void processCloudList(List<PointCloud> fcloud, LoadingWidget loadingControl)
        {
            preventClose = true;
            wantKinect = false;
            this.mode = 0;

            System.Diagnostics.Debug.WriteLine("Number of items in fcloud list: " + fcloud.Count);

            this.gv = new GroupVisualiser(fcloud);
            loadingwidgetcontrol.UpdateProgressBy(2);

            // Run this as separate 'job' on UI thread
            this.Dispatcher.Invoke(
                System.Windows.Threading.DispatcherPriority.Normal,
                (Action)(() => {
                    this.gv = new GroupVisualiser(fcloud);
                }));
            loadingwidgetcontrol.UpdateProgressBy(5);

            // Run this as lower priority 'job' (on UI thread),
            // with hope that UI remains a bit responsive
            this.Dispatcher.Invoke(
                System.Windows.Threading.DispatcherPriority.Input,
                (Action)(() => {
                    this.gv.preprocess(loadingwidgetcontrol);
                }));
            loadingwidgetcontrol.UpdateProgressBy(5);

            this.hvpcanvas.DataContext = this.gv;
            loadingwidgetcontrol.UpdateProgressBy(1);

            this.hitState = 0;

            // FINALLY, show the controls.
            this.hvpcanvas.Visibility = Visibility.Visible;
            this.loadingwidgetcontrol.Visibility = Visibility.Collapsed;

            preventClose = false;

            /*
             * Scanloaderready();
            if (this.mode == (int)OperationModes.CaptureNewCloud)
            {
                this.start_scan.Visibility = Visibility.Visible;
                this.cancel_scan.Visibility = Visibility.Visible;
            }
            else
            {
                this.start_scan.Visibility = Visibility.Collapsed;
                this.cancel_scan.Visibility = Visibility.Collapsed;
            }
            */
        }
Example #4
0
        public ScanLoader(PointCloud gcloud)
        {
            InitializeComponent();

            System.Diagnostics.Debug.WriteLine("* * GLCLOUD SCANLOADER CALLED");

            //wantKinect = false; // nathan changed this

            //hide buttons from form
            gv = new GroupVisualiser(gcloud);

            this.Loaded += new RoutedEventHandler(ScanLoader_Loaded);

            //Threading of data context population to speed up model generation.
            System.Diagnostics.Debug.WriteLine("Loading model");
            this.Dispatcher.Invoke((Action)(() =>
            {
                gv.preprocess(null);
            }));

            //Assigned threaded object result to the data context.
            this.DataContext = gv;
            gCloud = gcloud;
            this.hvpcanvas.MouseDown += new MouseButtonEventHandler(hvpcanvas_MouseDown);
            System.Diagnostics.Debug.WriteLine("Model loaded");

            hitState = 0;
        }