Пример #1
0
        public ToolbarViewModel(Models models)
        {
            m_models = models;

            PlayPauseCommand            = new PlayPauseCommand(models);
            ResetCommand                = new ResetCommand(models);
            SaveScreenShotCommand       = new ScreenShotCommand(models);
            ToggleCameraMovementCommand = new ActionCommand(() =>
                                                            models.Settings.AllowCameraMovement = !models.Settings.AllowCameraMovement);
            EnterFreeFlightMode             = new EnterFreeFlightMode(models);
            OneIterationCommand             = new PerformIterationsCommand(m_models, 1u);
            NIterationsCommand              = new PerformNIterationsCommand(m_models);
            ContinuousSequenceRenderCommand = new RenderSequenceCommand(m_models, -1, true, false);

            m_models.Renderer.PropertyChanged += RendererOnPropertyChanged;
            m_models.Settings.PropertyChanged += SettingsOnPropertyChanged;
        }
Пример #2
0
        public ViewModels(Models models)
        {
            m_models = models;

            // view model initialization
            ConsoleOutput = new ConsoleOutputViewModel(m_models);
            Display       = new DisplayViewModel(m_models);
            Cameras       = new CamerasViewModel(m_models);
            Lights        = new LightsViewModel(m_models);
            Materials     = new MaterialsViewModel(m_models);

            Toolbar   = new ToolbarViewModel(m_models);
            Statusbar = new StatusbarViewModel(m_models);

            Profiler = new ProfilerViewModel(m_models);

            Renderer = new RendererViewModel(m_models, Toolbar.PlayPauseCommand, Toolbar.ResetCommand);
            Scene    = new SceneViewModel(m_models);

            RenderTargetSelection = new RenderTargetSelectionViewModel(m_models, Toolbar.ResetCommand);

            LoadWorld       = new LoadWorldViewModel(m_models);
            AnimationFrames = new AnimationFrameViewModel(m_models);
            Tessellation    = new TessellationViewModel(m_models);

            // command initialization
            AddLightCommand               = new AddLightCommand(m_models);
            LoadSceneCommand              = new LoadSceneCommand(m_models);
            SaveSceneCommand              = new SaveSceneCommand(m_models);
            SelectRendererCommand         = new SelectRendererCommand(m_models);
            OpenSettingsCommand           = new OpenSettingsCommand(m_models);
            DenoiseImageCommand           = new SaveDenoisedScreenshotCommand(m_models);
            RenderAnimatedSequenceCommand = new RenderSequenceCommand(m_models, 0, false, true);

            KeyGestures = new KeyGestureViewModel(models);
        }