/// <summary> /// Called to stop rendering and at the end of successful rendering /// </summary> protected void StopRendering() { if (aThread == null) { return; } if (buttonRender.InvokeRequired) { StopRenderingCallback ea = new StopRenderingCallback(StopRendering); BeginInvoke(ea); } else { // actually stop the rendering: lock (progress) progress.Continue = false; aThread.Join(); aThread = null; // GUI stuff: SetGUI(true); additionalViews.form?.RenderButtonsEnabled(true); additionalViews.form?.ExportDataButtonsEnabled(true); MT.renderingInProgress = false; MT.sceneRendered = true; if (Master.singleton != null && (Master.singleton.pointCloud == null || Master.singleton.pointCloud.IsCloudEmpty)) { savePointCloudButton.Enabled = false; } else if (rayVisualizer.form != null) { rayVisualizer.form.PointCloudButton.Enabled = true; } additionalViews.form?.NewImageRendered(); // Keep the image but include it to the history. panAndZoom.SetNewImage(panAndZoom.CurrentImage(), true); SetPreviousAndNextImageButtons(); dirty = true; } }
protected void StopRendering() { if (aThread == null) { return; } if (buttonRender.InvokeRequired) { StopRenderingCallback ea = new StopRenderingCallback(StopRendering); BeginInvoke(ea); } else { // actually stop the rendering: lock (progress) progress.Continue = false; aThread.Join(); aThread = null; // GUI stuff: SetGUI(true); } }