public void Load(FrameDescription frame)
        {
            if (renderConfig == null)
            {
                renderConfig = new RayEngineConfiguration();
                Tracer.TraceLine("Render Config created");
            }

            renderConfig.OpenFrame(frame);
        }
 public void Unload()
 {
     renderConfig.Dispose();
     renderConfig = null;
     Tracer.TraceLine("Render Config disposed");
 }
 public EngineConfigurationController()
 {
     renderConfig = new RayEngineConfiguration();
 }
Esempio n. 4
0
        public MainWindow(IRenderConfig cfg)
            : base(cfg.Width, cfg.Height, new OpenTK.Graphics.GraphicsMode(32, 0, 0, 4))
        {
            config = cfg;
            Keyboard.KeyDown += delegate(object sender, KeyboardKeyEventArgs e)
            {
                if (e.Key == Key.Escape)
                {
                    this.Exit();
                }

                if (e.Key == Key.F1)
                {

                    this.config.SaveImage(config.SavePath + this.GetPicFileName() + ".png");
                }

                if (e.Key == Key.F5)
                {
                    this.config.SaveRawImage(config.SavePath + this.GetPicFileName() + ".exr");
                }

                if (e.Key == Key.F10)
                {
                    var eng = config as RayEngineConfiguration;
                    cfg.GetImagePlane().Reset();
                    eng.NextCamera();
                }

                if (e.Key == Key.F11)
                {
                     var eng = config as RayEngineConfiguration;
                    cfg.GetImagePlane().Reset();
                    eng.PrevCamera();
                }

                if (e.Key == Key.F12)
                {
                    cfg.GetImagePlane().Reset();
                }


                switch (e.Key)                
                {
                    case Key.Number1:
                        config.RunCommand(1);
                        break;

                    case Key.Number2:
                        config.RunCommand(2);
                        break;
                    case Key.Number3:
                        config.RunCommand(3);
                        break;
                    case Key.Number4:
                        config.RunCommand(4);
                        break;
                    case Key.Number5:
                        config.RunCommand(5);
                        break;
                    case Key.Number6:
                        config.RunCommand(6);
                        break;
                    case Key.Number7:
                        config.RunCommand(7);
                        break;
                    case Key.Number8:
                        config.RunCommand(8);
                        break;
                    case Key.Number9:
                        config.RunCommand(9);
                        break;
                    case Key.Number0:
                        config.RunCommand(10);
                        break;
                }

                if ((e.Key == Key.AltLeft || e.Key == Key.AltRight) && (e.Key == Key.Enter || e.Key == Key.KeypadEnter))
                    if (this.WindowState == WindowState.Fullscreen)
                        this.WindowState = WindowState.Normal;
                    else
                        this.WindowState = WindowState.Fullscreen;
            };
        }