Example #1
0
 public void UpdatePreview()
 {
     if (SetToPreview == null)
     {
         Debug.Log("No PointCloudSet given. Preview aborted.");
         return;
     }
     if (_loaders != null && _loaders.Count != 0)
     {
         Debug.Log("Another updating process seems to be in progress. Please wait, recreate this object or restart.");
         return;
     }
     //Delete Preview of old set
     HidePreview();
     //Copy current values to make sure they are consistent
     _setToPreview = SetToPreview;
     _showPoints   = ShowPoints;
     _setTransform = _setToPreview.transform;
     _pointBudget  = PointBudget;
     //Hide old Preview
     HidePreview();
     //Look for loaders for the given set
     PointCloudLoader[] allLoaders = FindObjectsOfType <PointCloudLoader>();
     _loaders = new List <PointCloudLoader>();
     _nodes   = new List <Node>();
     for (int i = 0; i < allLoaders.Length; ++i)
     {
         if (allLoaders[i].enabled && allLoaders[i].setController == _setToPreview)
         {
             _loaders.Add(allLoaders[i]);
         }
     }
     loadingThread = new Thread(LoadBoundingBoxes);
     loadingThread.Start();
 }