Exemple #1
0
 private void RemoveAlternativeView()
 {
     this.AlternativeDXElementContainer.Children.Clear();
     _alternativeDXElement   = null;
     _alternativeHangarScene = null;
     this.OnAlternativeHangarSceneChanged();
 }
Exemple #2
0
        public ProjectMV(MainWindowVM mainWindow, DXElement dxElement) : base("Unbenanntes Project")
        {
            isDisposed  = false;
            _mainWindow = mainWindow;
            _dxElement  = dxElement;

            MouseDownCommand         = new RelayCommand(p => handleMouseDown(p as MouseEventArgs));
            MouseMoveCommand         = new RelayCommand(p => handleMouseMove(p as MouseEventArgs), p => canHandleMouseMove(p as MouseEventArgs));
            MouseUpCommand           = new RelayCommand(p => handleMouseUp(p as MouseEventArgs));
            MouseWheelCommand        = new RelayCommand(p => handleMouseWheel(p as MouseWheelEventArgs));
            PreviewMouseWheelCommand = new RelayCommand(p => handlePreviewMouseWheel(p as MouseWheelEventArgs));
            KeyDownCommand           = new RelayCommand(p => handleKeyDown(p as KeyEventArgs));
            KeyUpCommand             = new RelayCommand(p => handleKeyUp(p as KeyEventArgs));

            MouseEnterCommand = new RelayCommand(p => handleMouseEnter(p as MouseEventArgs));
            MouseLeaveCommand = new RelayCommand(p => handleMouseLeave(p as MouseEventArgs));


            //_models = new List<Models.BaseModel>();
            //Elements = new ObservableCollection<Models.BaseModel>();
            Items   = new SelectionManager();
            _camera = new OrthogonalCamera();
            D3D11   = new D3D11EditorVM(this)
            {
                Camera = _camera
            };
            //CurrentTool = new Tools.Rectangle(D3D11, _models, _camera);
            Tools = new ObservableCollection <Tools.BaseTool>();
            Tools.Add(new Tools.Rectangle(D3D11, Items, _camera));
            Tools.Add(new Tools.Selection(Items, _camera));
            SelectedTool = Tools[0];
            // Initialize the GPU Data
            Models.Polygon.Init(D3D11);
            Models.BaseModel.Init(D3D11, dxElement);
        }
 public MainWindowVM(DXElement dxElement) : base("Melio Draw")
 {
     if (IsInDesignMode)
     {
         return;
     }
     Project = ProjectMV.CreateNewProject(this, dxElement);
 }
Exemple #4
0
        public static ProjectMV CreateNewProject(MainWindowVM mainWindow, DXElement dxElement)
        {
            var project = new ProjectMV(mainWindow, dxElement);

            project.Width  = 320.0f;
            project.Height = 240.0f;
            project.Camera.SetProject(project);
            return(project);
        }
Exemple #5
0
 private void InitializeAlternativeView()
 {
     _alternativeDXElement            = new DXElement();
     _alternativeHangarScene          = new HangarScene();
     _alternativeHangarScene.Renderer = new D3D9();
     _alternativeDXElement.Renderer   = _alternativeHangarScene;
     _alternativeDXElement.Visibility = Visibility.Hidden;
     this.InitializeHangarScene(_alternativeHangarScene);
     this.AlternativeDXElementContainer.Children.Add(_alternativeDXElement);
     this.OnAlternativeHangarSceneChanged();
 }
Exemple #6
0
        public DX11NoteView()
        {
            ResetNoteArrays();

            scene.OnAttach += (s, e) => Attach();
            scene.OnRender += (s, e) => Render(e);
            scene.OnDetach += (s, e) => Detach();

            scene.Renderer = new D3D11()
            {
                SingleThreadedRender = false
            };

            Content = new DXElement()
            {
                Renderer = scene
            };

            for (int i = 0; i < blackKeys.Length; i++)
            {
                blackKeys[i] = isBlackNote(i);
            }
            int        b     = 0;
            int        w     = 0;
            List <int> black = new List <int>();
            List <int> white = new List <int>();

            for (int i = 0; i < keynum.Length; i++)
            {
                if (blackKeys[i])
                {
                    keynum[i] = b++;
                    if (i < 256)
                    {
                        black.Add(i);
                    }
                }
                else
                {
                    keynum[i] = w++;
                    if (i < 256)
                    {
                        white.Add(i);
                    }
                }
            }

            blackKeysID = black.ToArray();
            whiteKeysID = white.ToArray();
        }
Exemple #7
0
 public static void Init(D3D11 d3d, DXElement dxElement)
 {
     ShaderManager.Instance.Init(d3d);
     _dxElement = dxElement;
 }