Ejemplo n.º 1
0
        public void GLContext_MouseDown(object sender, MouseEventArgs e)
        {
            ActiveDragObject = null;
            Timeline timeline = Program.MainTimeline;

            if (timeline.SelectedLayer == null)
            {
                return;
            }
            if (timeline.SelectedKeyframe == null)
            {
                return;
            }

            Point location = RoundMousePos(UnprojectMousePos(e.Location));

            if (timeline.SelectedLayer.Data.GetType() == typeof(StickFigure) || timeline.SelectedLayer.Data.GetType() == typeof(CustomFigure))
            {
                StickFigurePair = StickFigure.FindJointStatePair(((StickFigure)timeline.SelectedLayer.Data).Root, ((StickFigure.State)timeline.SelectedKeyframe.State).Root, location);
            }

            ManipulateResult result = timeline.SelectedLayer.Data.TryManipulate(
                timeline.SelectedKeyframe.State, location, e.Button, ModifierKeys);

            if (result != null)
            {
                ActiveDragObject    = result.Target;
                ActiveDragParams    = result.Params;
                LastDragObject      = result.Target;
                ActiveDragPrevState = timeline.SelectedKeyframe.State.Copy();
            }

            Program.Form_Properties.UpdateStickFigurePanel();
        }
Ejemplo n.º 2
0
        public void GLContext_MouseUp(object sender, MouseEventArgs e)
        {
            Timeline timeline = Program.MainTimeline;

            // Point location = RoundMousePos(UnprojectMousePos(e.Location));

            if (ActiveDragObject != null)
            {
                Program.Form_Main.Do(new ManipulatableUpdateAction(timeline.SelectedLayer, timeline.SelectedFrameset, timeline.SelectedKeyframe,
                                                                   ActiveDragPrevState, timeline.SelectedKeyframe.State));
            }

            ActiveDragObject = null;
        }
Ejemplo n.º 3
0
        public void GLContext_MouseUp(object sender, MouseEventArgs e)
        {
            Timeline timeline = Program.MainTimeline;

            if (ActiveDragObject != null)
            {
                Program.Form_Main.Do(new ManipulatableUpdateAction(timeline.SelectedLayer, timeline.SelectedFrameset, timeline.SelectedKeyframe,
                ActiveDragPrevState, timeline.SelectedKeyframe.State));
            }

            ActiveDragObject = null;
        }
Ejemplo n.º 4
0
        public void GLContext_MouseDown(object sender, MouseEventArgs e)
        {
            ActiveDragObject = null;
            Timeline timeline = Program.MainTimeline;

            if (timeline.SelectedLayer == null)
                return;
            if (timeline.SelectedKeyframe == null)
                return;

            if (timeline.SelectedLayer.Data.GetType() == typeof(StickFigure) || timeline.SelectedLayer.Data.GetType() == typeof(CustomFigure))
                StickFigurePair = StickFigure.FindJointStatePair(((StickFigure)timeline.SelectedLayer.Data).Root, ((StickFigure.State)timeline.SelectedKeyframe.State).Root, e.Location);

            ManipulateResult result = timeline.SelectedLayer.Data.TryManipulate(
                timeline.SelectedKeyframe.State, e.Location, e.Button, ModifierKeys);

            if (result != null)
            {
                ActiveDragObject = result.Target;
                ActiveDragParams = result.Params;
                LastDragObject = result.Target;
                ActiveDragPrevState = timeline.SelectedKeyframe.State.Copy();

                Program.Form_Properties.UpdateStickFigurePanel();
            }
        }
Ejemplo n.º 5
0
 public void ManipulateEnd(IManipulatable target, IManipulatableParams mparams, Point location)
 {
 }
Ejemplo n.º 6
0
        public void ManipulateUpdate(IManipulatable _target, IManipulatableParams mparams, Point location)
        {
            State target = _target as State;

            target.Move(location, (ManipulateParams)mparams);
        }
Ejemplo n.º 7
0
 public void ManipulateStart(IManipulatable _target, IManipulatableParams mparams, Point location)
 {
 }
Ejemplo n.º 8
0
 public void ManipulateUpdate(IManipulatable _target, IManipulatableParams mparams, Point location)
 {
     State target = _target as State;
     target.Move(location, (ManipulateParams)mparams);
 }
Ejemplo n.º 9
0
 public void ManipulateStart(IManipulatable _target, IManipulatableParams mparams, Point location)
 {
 }
Ejemplo n.º 10
0
 public void ManipulateEnd(IManipulatable target, IManipulatableParams mparams, Point location)
 {
 }