예제 #1
0
파일: MainForm.cs 프로젝트: Spawek/valeo
        // Set new visualization method
        private void visualizationTypeMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            if (item.Tag is VisualizationType)
            {
                imageProcessor.VisualizationType = (VisualizationType)item.Tag;

                lock (this)
                {
                    if (imageProcessor.VisualizationType == VisualizationType.Model)
                    {
                        if (arForm == null)
                        {
                            arForm = new AugmentedRealityForm( );

                            arForm.FormClosing += new FormClosingEventHandler(arForm_FormClosing);
                            arForm.Show( );
                        }
                    }
                    else
                    {
                        if (arForm != null)
                        {
                            arForm.Close( );
                        }
                    }
                }
            }
        }
예제 #2
0
파일: MainForm.cs 프로젝트: Spawek/valeo
        // On closing the Augmented Reality form
        private void arForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            arForm.FormClosing -= new FormClosingEventHandler(arForm_FormClosing);
            arForm              = null;

            // reset visualization type if form was closed by user
            if (imageProcessor.VisualizationType == VisualizationType.Model)
            {
                imageProcessor.VisualizationType = VisualizationType.Name;
            }
        }