/// <summary> /// Resets the object's properties. /// </summary> public void Reset() { // Check if there is a rendering caller. renderingCaller = GetComponent <Rendering.Rendering>(); // Reset the key child components. _cameraSetup = CameraSetup.CreateOrResetCameraSetup(transform); _dataHandler = DataHandler.CreateOrResetDataHandler(transform); // Initialize the processing methods. _processingMethods = ProcessingMethod.CreateOrResetProcessingMethods(transform); for (int iter = 0; iter < _processingMethods.Length; iter++) { _processingMethods[iter].InitializeLinks(); } // Initialize the external tools. _externalHelpers = ExternalHelper.CreateOrResetExternalHelpers(transform); for (int iter = 0; iter < _externalHelpers.Length; iter++) { _externalHelpers[iter].InitializeLinks(); } // Get the method defining the container for the input images. _previewSourceImagesLoader = _processingMethods[0].PMColorTextureArray; // Reads the acquisition information from the source data directory. ReadAcquisitionInformation(); // Destroys all created method components. foreach (MonoBehaviour component in GetComponents <MonoBehaviour>()) { if (component is IMethodGUI) { DestroyImmediate(component); } } }
/// <inheritdoc/> public override void InitializeLinks() { base.InitializeLinks(); // Enable the user to choose whether or not to generate per-view meshes from the created depth texture array. _nestedMethodsToDisplay = new ProcessingMethod[] { PMPerViewMeshesQSTRDTA }; }
/// <summary> /// Processes color and/or depth data. /// </summary> /// <returns></returns> private IEnumerator ProcessDataCoroutine() { // Inform the user that the process has started. GeneralToolkit.ResetCancelableProgressBar(true, true); Debug.Log(GeneralToolkit.FormatScriptMessage(typeof(Processing), "Started processing data.")); processingCanceled = false; // Save the current position, rotation, and scale for later. Vector3 position = transform.position; Quaternion rotation = transform.rotation; Vector3 scale = transform.localScale; // Reset the transform, and wait for the camera models to be updated accordingly. GeneralToolkit.SetTransformValues(transform, false, Vector3.zero, Quaternion.identity, Vector3.one); yield return(null); // Create the processed data directory and initialize the processing information file. dataHandler.CreateProcessingInfoFile(); // Move the processed data directory to the temporary directory. GeneralToolkit.Move(PathType.Directory, dataHandler.processedDataDirectory, GeneralToolkit.tempDirectoryAbsolutePath, false); AssetDatabase.Refresh(); if (!Directory.Exists(GeneralToolkit.tempDirectoryAbsolutePath)) { processingCanceled = true; } // Execute the processing methods. for (int iter = 0; iter < processingMethods.Length; iter++) { ProcessingMethod processingMethod = processingMethods[iter]; if (!processingMethod.IsGUINested() && processingMethod.shouldExecute) { yield return(StartCoroutine(processingMethod.ExecuteAndDisplayLog())); } if (processingCanceled) { break; } } // Unload loaded assets. Resources.UnloadUnusedAssets(); EditorUtility.UnloadUnusedAssetsImmediate(); yield return(null); // Move the processed data directory back to its original position. GeneralToolkit.Move(PathType.Directory, GeneralToolkit.tempDirectoryAbsolutePath, dataHandler.processedDataDirectory, false); AssetDatabase.Refresh(); // Update the processed asset information. dataHandler.UpdateProcessedAssets(); // Inform the user of the end of the process. if (!processingCanceled) { Debug.Log(GeneralToolkit.FormatScriptMessage(typeof(Processing), "Finished processing data.")); } else { Debug.Log(GeneralToolkit.FormatScriptMessage(typeof(Processing), "Processing was canceled.")); } // Perform a check to verify whether data was processed. dataHandler.CheckStatusOfDataProcessingAndBundling(out isDataReadyForBundling, out isDataBundled, out processedDataInfo); // Return the transform's values to their previous ones. GeneralToolkit.SetTransformValues(transform, false, position, rotation, scale); // Reset the progress bar. GeneralToolkit.ResetCancelableProgressBar(false, false); }
/// <inheritdoc/> public override void InitializeLinks() { base.InitializeLinks(); // Enable the user to choose whether or not to generate a depth texture array from the created global mesh, and to choose whether or not to generate texture maps for the global mesh. _nestedMethodsToDisplay = new ProcessingMethod[] { PMDepthTextureArray, PMGlobalTextureMap }; }