Exemple #1
0
        public ModelView(MainWindow mainWindow, IScene scene, Coroutines coroutines,
                         MeshViewSettingsViewModel settingsViewModel)
        {
            _scene  = scene;
            _camera = new Camera(scene.RendererCamera, Vector3.Zero, coroutines, scene.CameraLight);

            var border = new Border {
                Background = Brushes.Black
            };

            border.Child = scene.Visual;

            var grid = new Grid();

            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(4, GridUnitType.Star)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Auto)
            });

            grid.Children.Add(border);
            border.SetValue(Grid.RowSpanProperty, 1);

            _settingsViewModel = settingsViewModel;
            _settings          = new MeshViewSettings(_settingsViewModel);
            grid.Children.Add(_settings);
            _settings.SetValue(Grid.RowProperty, 1);

            var input = scene.MouseInput;

            input.MouseWheel += MouseWheel;
            input.MouseMove  += MouseMove;
            input.MouseDown  += MouseDown;
            input.MouseUp    += MouseUp;

            input.MouseDown += DoubleClick;

            mainWindow.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(KeyDown), false);
            Element = grid;
        }
Exemple #2
0
 public MeshViewSettings(MeshViewSettingsViewModel vm)
 {
     InitializeComponent();
     DataContext = vm;
 }