Ejemplo n.º 1
0
        /// <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;
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }