Example #1
0
        public override uint MouseWheel(MouseEventArgs e, GL_ControlBase control)
        {
            uint var = 0;

            foreach (IEditableObject obj in GetObjects())
            {
                var |= obj.MouseWheel(e, control);
            }

            foreach (AbstractGlDrawable obj in StaticObjects)
            {
                var |= obj.MouseWheel(e, control);
            }

            if ((SelectionTransformAction != NoAction || CurrentAction != null))
            {
                if (WinInput.Keyboard.IsKeyDown(WinInput.Key.LeftCtrl))
                {
                    SelectionTransformAction.UpdateMousePos(e.Location);
                    CurrentAction?.UpdateMousePos(e.Location);
                    var |= REDRAW;
                }
                else
                {
                    SelectionTransformAction.ApplyScrolling(e.Location, e.Delta);
                    CurrentAction?.ApplyScrolling(e.Location, e.Delta);

                    var |= REDRAW | NO_CAMERA_ACTION;

                    var &= ~REPICK;
                }
            }

            return(var);
        }
Example #2
0
        public override uint MouseMove(MouseEventArgs e, Point lastMousePos, GL_ControlBase control)
        {
            uint var = 0;

            foreach (IEditableObject obj in GetObjects())
            {
                var |= obj.MouseMove(e, lastMousePos, control);
            }

            foreach (AbstractGlDrawable obj in StaticObjects)
            {
                var |= obj.MouseMove(e, lastMousePos, control);
            }

            if (SelectionTransformAction != NoAction || CurrentAction != null)
            {
                SelectionTransformAction.UpdateMousePos(e.Location);
                CurrentAction?.UpdateMousePos(e.Location);

                var |= REDRAW | NO_CAMERA_ACTION;

                var &= ~REPICK;
            }
            else
            {
                if (e.Button == MouseButtons.Left && WinInput.Keyboard.IsKeyDown(WinInput.Key.LeftAlt))
                {
                    if (WinInput.Keyboard.IsKeyDown(WinInput.Key.LeftShift))
                    {
                        Hovered?.Deselect(HoveredPart, control);
                    }
                    else
                    {
                        Hovered?.Select(HoveredPart, control);
                    }

                    SelectionChanged?.Invoke(this, new EventArgs());

                    var |= NO_CAMERA_ACTION | FORCE_REENTER;
                }
                var |= REPICK;
            }
            return(var);
        }