示例#1
0
        /// <summary>
        /// constructor of the select planes window
        /// </summary>
        /// <param name="pc">the current reference cloud</param>
        /// <param name="pm">the plane models</param>
        public SelectPlanesWindow(PointCloud pc, List <PlaneModel> pm, DataManager.DataManager dm)
        {
            InitializeComponent();
            _CancelTokenSource = new System.Threading.CancellationTokenSource();
            pointCloud         = pc;
            planeModelList     = new List <PlaneModel>();
            foreach (PlaneModel pl in pm)
            {
                planeModelList.Add(pl);
                if (pl.isFloor)
                {
                    floorPlane = pl;
                }
            }

            refList = new List <PlaneModel>();
            foreach (PlaneModel refpl in planeModelList)
            {
                refList.Add(refpl);
            }

            _DataManager = dm;

            UpdateListView();
        }
示例#2
0
        /// <summary>
        /// program starting point and init of the mainWindow
        /// </summary>
        public MainWindow()
        {
            //startup point
            if (!IsRunAsAdministrator())
            {
                var processInfo = new ProcessStartInfo(Assembly.GetExecutingAssembly().CodeBase);

                // The following properties run the new process as administrator
                processInfo.UseShellExecute = true;
                processInfo.Verb            = "runas";

                // Start the new process
                try
                {
                    Process.Start(processInfo);
                }
                catch (Exception)
                {
                    // The user did not allow the application to run as administrator
                    MessageBox.Show("Sorry, this application must be run as Administrator.");
                }

                // Shut down the current process
                Application.Current.Shutdown();
                return;
            }

            InitializeComponent();
            if (IsRunAsAdministrator())
            {
                writeConsole("[Application] Elevated to admin rights.");
            }

            LogManager.OnLogMessageEvent               += LogManager_OnLogMessageEvent;
            LogManager.OnClientStatusChangeEvent       += UpdateClientConnectionSatus;
            LogManager.OnLogMessageDebugEvent          += LogManager_OnLogMessageDebugEvent;
            LogManager.OnServerStatusChangeEvent       += LogManager_OnAlgorithmStatusChangeEvent;
            LogManager.OnClientKinectStatusChangeEvent += LogManager_OnClientKinectStatusChangeEvent;

            _DataManager = DataManager.DataManager.getInstance();
            _DataManager.OnNewFusionPictureEvent += _DataManager_OnNewFusionPictureEvent;
            _DataManager.OnNewPointPicturesEvent += _DataManager_OnNewPointPicturesEvent;
            _DataManager.OnNewScanResultEvent    += _DataManager_OnNewScanResultEvent;
            _DataManager.initialize();

            lastFusionPictures = new Dictionary <int, WriteableBitmap>();

            this.statusList = new List <KinectStatusPackage>();

            masterSet         = false;
            referenceTableSet = false;
            planesSet         = false;

            UpdateClientConnectionSatus();
        }